1760 lines
47 KiB
Smali
1760 lines
47 KiB
Smali
.class public Lcom/lytefast/flexinput/fragment/CameraFragment;
|
|
.super Lcom/lytefast/flexinput/fragment/PermissionsFragment;
|
|
.source "CameraFragment.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/lytefast/flexinput/fragment/CameraFragment$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final synthetic $$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
.field public static final Companion:Lcom/lytefast/flexinput/fragment/CameraFragment$Companion;
|
|
|
|
.field public static final FACING_STATE_CYCLE_LIST:[I
|
|
|
|
.field public static final FLASH_STATE_CYCLE_LIST:[I
|
|
|
|
.field public static final PREF_FLASH_STATE:Ljava/lang/String; = "FLASH_STATE"
|
|
|
|
.field public static final REQUEST_IMAGE_CAPTURE:I = 0x11d7
|
|
|
|
.field public static final REQUIRED_PERMISSIONS:[Ljava/lang/String;
|
|
|
|
.field public static final TAG:Ljava/lang/String;
|
|
|
|
|
|
# instance fields
|
|
.field public cameraContainer:Landroid/view/View;
|
|
|
|
.field public final cameraErrorListener:Lcom/camerakit/CameraKitView$ErrorListener;
|
|
|
|
.field public cameraFacingBtn:Landroid/widget/ImageView;
|
|
|
|
.field public final cameraListener:Lcom/lytefast/flexinput/fragment/CameraFragment$cameraListener$1;
|
|
|
|
.field public cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
.field public flexInputCoordinator:Lcom/lytefast/flexinput/FlexInputCoordinator;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/lytefast/flexinput/FlexInputCoordinator<",
|
|
"Ljava/lang/Object;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public handler:Landroid/os/Handler;
|
|
|
|
.field public final isSingleCamera$delegate:Lkotlin/Lazy;
|
|
|
|
.field public onFlashChanged:Lkotlin/jvm/functions/Function2;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lkotlin/jvm/functions/Function2<",
|
|
"-",
|
|
"Landroid/view/View;",
|
|
"-",
|
|
"Ljava/lang/Integer;",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public permissionsContainer:Landroid/widget/FrameLayout;
|
|
|
|
.field public photoFile:Ljava/io/File;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 5
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [Lkotlin/reflect/KProperty;
|
|
|
|
new-instance v1, Ly/u/b/u;
|
|
|
|
const-class v2, Lcom/lytefast/flexinput/fragment/CameraFragment;
|
|
|
|
invoke-static {v2}, Ly/u/b/x;->getOrCreateKotlinClass(Ljava/lang/Class;)Ly/y/b;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "isSingleCamera"
|
|
|
|
const-string v4, "isSingleCamera()Z"
|
|
|
|
invoke-direct {v1, v2, v3, v4}, Ly/u/b/u;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sget-object v2, Ly/u/b/x;->a:Ly/u/b/y;
|
|
|
|
invoke-virtual {v2, v1}, Ly/u/b/y;->property1(Ly/u/b/t;)Ly/y/d;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
sput-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
new-instance v0, Lcom/lytefast/flexinput/fragment/CameraFragment$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/lytefast/flexinput/fragment/CameraFragment$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment;->Companion:Lcom/lytefast/flexinput/fragment/CameraFragment$Companion;
|
|
|
|
const-string v0, "android.permission.WRITE_EXTERNAL_STORAGE"
|
|
|
|
const-string v1, "android.permission.READ_EXTERNAL_STORAGE"
|
|
|
|
const-string v2, "android.permission.CAMERA"
|
|
|
|
filled-new-array {v0, v1, v2}, [Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment;->REQUIRED_PERMISSIONS:[Ljava/lang/String;
|
|
|
|
const/4 v0, 0x3
|
|
|
|
new-array v0, v0, [I
|
|
|
|
fill-array-data v0, :array_0
|
|
|
|
sput-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment;->FLASH_STATE_CYCLE_LIST:[I
|
|
|
|
const/4 v0, 0x2
|
|
|
|
new-array v0, v0, [I
|
|
|
|
fill-array-data v0, :array_1
|
|
|
|
sput-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment;->FACING_STATE_CYCLE_LIST:[I
|
|
|
|
const-class v0, Lcom/lytefast/flexinput/fragment/CameraFragment;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment;->TAG:Ljava/lang/String;
|
|
|
|
return-void
|
|
|
|
nop
|
|
|
|
:array_0
|
|
.array-data 4
|
|
0x2
|
|
0x1
|
|
0x0
|
|
.end array-data
|
|
|
|
:array_1
|
|
.array-data 4
|
|
0x0
|
|
0x1
|
|
.end array-data
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Lcom/lytefast/flexinput/fragment/PermissionsFragment;-><init>()V
|
|
|
|
sget-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment$e;->d:Lcom/lytefast/flexinput/fragment/CameraFragment$e;
|
|
|
|
iput-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->onFlashChanged:Lkotlin/jvm/functions/Function2;
|
|
|
|
new-instance v0, Lcom/lytefast/flexinput/fragment/CameraFragment$d;
|
|
|
|
invoke-direct {v0, p0}, Lcom/lytefast/flexinput/fragment/CameraFragment$d;-><init>(Lcom/lytefast/flexinput/fragment/CameraFragment;)V
|
|
|
|
invoke-static {v0}, Lf/n/a/j/a;->lazy(Lkotlin/jvm/functions/Function0;)Lkotlin/Lazy;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->isSingleCamera$delegate:Lkotlin/Lazy;
|
|
|
|
sget-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment$b;->a:Lcom/lytefast/flexinput/fragment/CameraFragment$b;
|
|
|
|
iput-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraErrorListener:Lcom/camerakit/CameraKitView$ErrorListener;
|
|
|
|
new-instance v0, Lcom/lytefast/flexinput/fragment/CameraFragment$cameraListener$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/lytefast/flexinput/fragment/CameraFragment$cameraListener$1;-><init>(Lcom/lytefast/flexinput/fragment/CameraFragment;)V
|
|
|
|
iput-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraListener:Lcom/lytefast/flexinput/fragment/CameraFragment$cameraListener$1;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$getFlexInputCoordinator$p(Lcom/lytefast/flexinput/fragment/CameraFragment;)Lcom/lytefast/flexinput/FlexInputCoordinator;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->flexInputCoordinator:Lcom/lytefast/flexinput/FlexInputCoordinator;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getTAG$cp()Ljava/lang/String;
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment;->TAG:Ljava/lang/String;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$onCameraFacingClick(Lcom/lytefast/flexinput/fragment/CameraFragment;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/lytefast/flexinput/fragment/CameraFragment;->onCameraFacingClick()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$onCameraFlashClick(Lcom/lytefast/flexinput/fragment/CameraFragment;Landroid/widget/ImageView;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/lytefast/flexinput/fragment/CameraFragment;->onCameraFlashClick(Landroid/widget/ImageView;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$onFacingChanged(Lcom/lytefast/flexinput/fragment/CameraFragment;I)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/lytefast/flexinput/fragment/CameraFragment;->onFacingChanged(I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$onLaunchCameraClick(Lcom/lytefast/flexinput/fragment/CameraFragment;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/lytefast/flexinput/fragment/CameraFragment;->onLaunchCameraClick()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$onTakePhotoClick(Lcom/lytefast/flexinput/fragment/CameraFragment;Lcom/camerakit/CameraKitView;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/lytefast/flexinput/fragment/CameraFragment;->onTakePhotoClick(Lcom/camerakit/CameraKitView;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$setFlexInputCoordinator$p(Lcom/lytefast/flexinput/fragment/CameraFragment;Lcom/lytefast/flexinput/FlexInputCoordinator;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->flexInputCoordinator:Lcom/lytefast/flexinput/FlexInputCoordinator;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getFlashState()I
|
|
.locals 3
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->requireContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "FLASH_STATE"
|
|
|
|
const/4 v2, 0x2
|
|
|
|
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private final isSingleCamera()Z
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->isSingleCamera$delegate:Lkotlin/Lazy;
|
|
|
|
sget-object v1, Lcom/lytefast/flexinput/fragment/CameraFragment;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aget-object v1, v1, v2
|
|
|
|
invoke-interface {v0}, Lkotlin/Lazy;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/lang/Boolean;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private final onCameraFacingClick()V
|
|
.locals 8
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
invoke-virtual {v0}, Lcom/camerakit/CameraKitView;->getFacing()I
|
|
|
|
move-result v0
|
|
|
|
sget-object v2, Lcom/lytefast/flexinput/fragment/CameraFragment;->FACING_STATE_CYCLE_LIST:[I
|
|
|
|
invoke-static {v2}, Lf/n/a/j/a;->getIndices([I)Lkotlin/ranges/IntRange;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_0
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x1
|
|
|
|
const/4 v5, 0x0
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
move-object v6, v3
|
|
|
|
check-cast v6, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v6}, Ljava/lang/Number;->intValue()I
|
|
|
|
move-result v6
|
|
|
|
sget-object v7, Lcom/lytefast/flexinput/fragment/CameraFragment;->FACING_STATE_CYCLE_LIST:[I
|
|
|
|
aget v6, v7, v6
|
|
|
|
if-ne v0, v6, :cond_1
|
|
|
|
const/4 v6, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v6, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v6, :cond_0
|
|
|
|
move-object v1, v3
|
|
|
|
:cond_2
|
|
check-cast v1, Ljava/lang/Integer;
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v5
|
|
|
|
:cond_3
|
|
add-int/2addr v5, v4
|
|
|
|
sget-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment;->FACING_STATE_CYCLE_LIST:[I
|
|
|
|
array-length v1, v0
|
|
|
|
rem-int/2addr v5, v1
|
|
|
|
aget v0, v0, v5
|
|
|
|
invoke-direct {p0, v0}, Lcom/lytefast/flexinput/fragment/CameraFragment;->setFacing(I)V
|
|
|
|
return-void
|
|
|
|
:cond_4
|
|
const-string v0, "cameraView"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method private final onCameraFlashClick(Landroid/widget/ImageView;)V
|
|
.locals 12
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
invoke-virtual {v0}, Lcom/camerakit/CameraKitView;->getFlash()I
|
|
|
|
move-result v0
|
|
|
|
sget-object v2, Lcom/lytefast/flexinput/fragment/CameraFragment;->FLASH_STATE_CYCLE_LIST:[I
|
|
|
|
invoke-static {v2}, Lf/n/a/j/a;->getIndices([I)Lkotlin/ranges/IntRange;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_0
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x1
|
|
|
|
const/4 v5, 0x0
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
move-object v6, v3
|
|
|
|
check-cast v6, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v6}, Ljava/lang/Number;->intValue()I
|
|
|
|
move-result v6
|
|
|
|
sget-object v7, Lcom/lytefast/flexinput/fragment/CameraFragment;->FLASH_STATE_CYCLE_LIST:[I
|
|
|
|
aget v6, v7, v6
|
|
|
|
if-ne v0, v6, :cond_1
|
|
|
|
const/4 v6, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v6, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v6, :cond_0
|
|
|
|
move-object v1, v3
|
|
|
|
:cond_2
|
|
check-cast v1, Ljava/lang/Integer;
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v5
|
|
|
|
:cond_3
|
|
add-int/2addr v5, v4
|
|
|
|
sget-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment;->FLASH_STATE_CYCLE_LIST:[I
|
|
|
|
array-length v1, v0
|
|
|
|
rem-int/2addr v5, v1
|
|
|
|
aget v8, v0, v5
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x4
|
|
|
|
const/4 v11, 0x0
|
|
|
|
move-object v6, p0
|
|
|
|
move-object v7, p1
|
|
|
|
invoke-static/range {v6 .. v11}, Lcom/lytefast/flexinput/fragment/CameraFragment;->setFlash$default(Lcom/lytefast/flexinput/fragment/CameraFragment;Landroid/widget/ImageView;IZILjava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
:cond_4
|
|
const-string p1, "cameraView"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method private final onFacingChanged(I)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
sget p1, Lcom/lytefast/flexinput/R$d;->ic_camera_front_white_24dp:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget p1, Lcom/lytefast/flexinput/R$d;->ic_camera_rear_white_24dp:I
|
|
|
|
:goto_0
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraFacingBtn:Landroid/widget/ImageView;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setImageResource(I)V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "cameraFacingBtn"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private final onLaunchCameraClick()V
|
|
.locals 5
|
|
|
|
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string v1, "context ?: return"
|
|
|
|
invoke-static {v0, v1}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iget-object v1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->flexInputCoordinator:Lcom/lytefast/flexinput/FlexInputCoordinator;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-interface {v1}, Lcom/lytefast/flexinput/FlexInputCoordinator;->getFileManager()Lcom/lytefast/flexinput/managers/FileManager;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-interface {v1}, Lcom/lytefast/flexinput/managers/FileManager;->a()Ljava/io/File;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v1, v0, v2}, Lcom/lytefast/flexinput/managers/FileManager;->a(Landroid/content/Context;Ljava/io/File;)Landroid/net/Uri;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v3, Landroid/content/Intent;
|
|
|
|
const-string v4, "android.media.action.IMAGE_CAPTURE"
|
|
|
|
invoke-direct {v3, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string v4, "output"
|
|
|
|
invoke-virtual {v3, v4, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
|
|
|
|
move-result-object v3
|
|
|
|
const/4 v4, 0x2
|
|
|
|
invoke-virtual {v3, v4}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v4, "Intent(MediaStore.ACTION\u2026ANT_WRITE_URI_PERMISSION)"
|
|
|
|
invoke-static {v3, v4}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v3, v4}, Landroid/content/Intent;->resolveActivity(Landroid/content/pm/PackageManager;)Landroid/content/ComponentName;
|
|
|
|
move-result-object v4
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
iput-object v2, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->photoFile:Ljava/io/File;
|
|
|
|
sget-object v2, Lcom/lytefast/flexinput/fragment/CameraFragment;->Companion:Lcom/lytefast/flexinput/fragment/CameraFragment$Companion;
|
|
|
|
invoke-virtual {v2, v0, v3, v1}, Lcom/lytefast/flexinput/fragment/CameraFragment$Companion;->a(Landroid/content/Context;Landroid/content/Intent;Landroid/net/Uri;)V
|
|
|
|
const/16 v0, 0x11d7
|
|
|
|
invoke-virtual {p0, v3, v0}, Landroidx/fragment/app/Fragment;->startActivityForResult(Landroid/content/Intent;I)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private final onTakePhotoClick(Lcom/camerakit/CameraKitView;)V
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
.end annotation
|
|
|
|
new-instance v0, Lcom/lytefast/flexinput/fragment/CameraFragment$f;
|
|
|
|
invoke-direct {v0, p0}, Lcom/lytefast/flexinput/fragment/CameraFragment$f;-><init>(Lcom/lytefast/flexinput/fragment/CameraFragment;)V
|
|
|
|
invoke-virtual {p1, v0}, Lcom/camerakit/CameraKitView;->a(Lcom/camerakit/CameraKitView$g;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final setFacing(I)V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {v0}, Lcom/camerakit/CameraKitView;->getFacing()I
|
|
|
|
move-result v1
|
|
|
|
if-eq v1, p1, :cond_0
|
|
|
|
invoke-virtual {v0, p1}, Lcom/camerakit/CameraKitView;->setFacing(I)V
|
|
|
|
invoke-virtual {v0}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
sget v1, Lcom/lytefast/flexinput/R$g;->camera_switched:I
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Landroid/widget/Toast;->show()V
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1}, Lcom/lytefast/flexinput/fragment/CameraFragment;->onFacingChanged(I)V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "cameraView"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private final setFlash(Landroid/widget/ImageView;IZ)V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const-string v2, "cameraView"
|
|
|
|
if-eqz v0, :cond_7
|
|
|
|
invoke-virtual {v0}, Lcom/camerakit/CameraKitView;->getFlash()I
|
|
|
|
move-result v0
|
|
|
|
if-ne v0, p2, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p2}, Lcom/lytefast/flexinput/fragment/CameraFragment;->setFlashState(I)V
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
invoke-virtual {v0, p2}, Lcom/camerakit/CameraKitView;->setFlash(I)V
|
|
|
|
iget-object p2, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
if-eqz p2, :cond_4
|
|
|
|
invoke-virtual {p2}, Lcom/camerakit/CameraKitView;->getFlash()I
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-eq p2, v0, :cond_1
|
|
|
|
sget p2, Lcom/lytefast/flexinput/R$d;->ic_flash_auto_24dp:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
sget p2, Lcom/lytefast/flexinput/R$d;->ic_flash_on_24dp:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
sget p2, Lcom/lytefast/flexinput/R$d;->ic_flash_off_24dp:I
|
|
|
|
:goto_0
|
|
invoke-virtual {p1, p2}, Landroid/widget/ImageView;->setImageResource(I)V
|
|
|
|
if-eqz p3, :cond_6
|
|
|
|
iget-object p2, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->onFlashChanged:Lkotlin/jvm/functions/Function2;
|
|
|
|
iget-object p3, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
if-eqz p3, :cond_3
|
|
|
|
invoke-virtual {p3}, Lcom/camerakit/CameraKitView;->getFlash()I
|
|
|
|
move-result p3
|
|
|
|
invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-interface {p2, p1, p3}, Lkotlin/jvm/functions/Function2;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
invoke-static {v2}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
throw v1
|
|
|
|
:cond_4
|
|
:try_start_1
|
|
invoke-static {v2}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
|
|
|
|
throw v1
|
|
|
|
:cond_5
|
|
:try_start_2
|
|
invoke-static {v2}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
:try_end_2
|
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
|
|
|
|
throw v1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
const-string p2, "Camera error on set flash"
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/lytefast/flexinput/fragment/CameraFragment;->onCameraError(Ljava/lang/Exception;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
sget p2, Lcom/lytefast/flexinput/R$g;->camera_unknown_error:I
|
|
|
|
const/4 p3, 0x0
|
|
|
|
invoke-static {p1, p2, p3}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroid/widget/Toast;->show()V
|
|
|
|
:cond_6
|
|
:goto_1
|
|
return-void
|
|
|
|
:cond_7
|
|
invoke-static {v2}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public static synthetic setFlash$default(Lcom/lytefast/flexinput/fragment/CameraFragment;Landroid/widget/ImageView;IZILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
if-nez p5, :cond_1
|
|
|
|
and-int/lit8 p4, p4, 0x4
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
const/4 p3, 0x1
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/lytefast/flexinput/fragment/CameraFragment;->setFlash(Landroid/widget/ImageView;IZ)V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
new-instance p0, Ljava/lang/UnsupportedOperationException;
|
|
|
|
const-string p1, "Super calls with default arguments not supported in this target, function: setFlash"
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private final setFlashState(I)V
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->requireContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "FLASH_STATE"
|
|
|
|
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getCameraContainer()Landroid/view/View;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraContainer:Landroid/view/View;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const-string v0, "cameraContainer"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final getCameraFacingBtn()Landroid/widget/ImageView;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraFacingBtn:Landroid/widget/ImageView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const-string v0, "cameraFacingBtn"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final getCameraView()Lcom/camerakit/CameraKitView;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const-string v0, "cameraView"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final getOnFlashChanged()Lkotlin/jvm/functions/Function2;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lkotlin/jvm/functions/Function2<",
|
|
"Landroid/view/View;",
|
|
"Ljava/lang/Integer;",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->onFlashChanged:Lkotlin/jvm/functions/Function2;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getPermissionsContainer()Landroid/widget/FrameLayout;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->permissionsContainer:Landroid/widget/FrameLayout;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const-string v0, "permissionsContainer"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public initPermissionsView(Landroid/widget/FrameLayout;)V
|
|
.locals 3
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p1}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object v0
|
|
|
|
sget v1, Lcom/lytefast/flexinput/R$f;->view_camera_permissions:I
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v0, v1, p1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
sget v0, Lcom/lytefast/flexinput/R$e;->permissions_req_btn:I
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
new-instance v0, Lcom/lytefast/flexinput/fragment/CameraFragment$c;
|
|
|
|
invoke-direct {v0, p0}, Lcom/lytefast/flexinput/fragment/CameraFragment$c;-><init>(Lcom/lytefast/flexinput/fragment/CameraFragment;)V
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "permissionsContainer"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public onActivityResult(IILandroid/content/Intent;)V
|
|
.locals 1
|
|
|
|
invoke-super {p0, p1, p2, p3}, Landroidx/fragment/app/Fragment;->onActivityResult(IILandroid/content/Intent;)V
|
|
|
|
const/16 p3, 0x11d7
|
|
|
|
if-eq p3, p1, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->photoFile:Ljava/io/File;
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
const/4 p3, -0x1
|
|
|
|
if-eq p2, p3, :cond_1
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p2
|
|
|
|
sget p3, Lcom/lytefast/flexinput/R$g;->camera_intent_result_error:I
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {p2, p3, v0}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Landroid/widget/Toast;->show()V
|
|
|
|
invoke-virtual {p1}, Ljava/io/File;->delete()Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
sget-object p3, Lcom/lytefast/flexinput/fragment/CameraFragment;->Companion:Lcom/lytefast/flexinput/fragment/CameraFragment$Companion;
|
|
|
|
invoke-virtual {p3, p2, p1}, Lcom/lytefast/flexinput/fragment/CameraFragment$Companion;->a(Landroid/content/Context;Ljava/io/File;)V
|
|
|
|
:cond_2
|
|
iget-object p2, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->flexInputCoordinator:Lcom/lytefast/flexinput/FlexInputCoordinator;
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
invoke-static {p1}, Lf/b/a/e/a;->a(Ljava/io/File;)Lcom/lytefast/flexinput/model/Attachment;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p2, p1}, Lcom/lytefast/flexinput/FlexInputCoordinator;->a(Lcom/lytefast/flexinput/model/Attachment;)V
|
|
|
|
:cond_3
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public onCameraError(Ljava/lang/Exception;Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
sget-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment;->TAG:Ljava/lang/String;
|
|
|
|
invoke-static {v0, p2, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "message"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "e"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public onCreate(Landroid/os/Bundle;)V
|
|
.locals 0
|
|
|
|
invoke-super {p0, p1}, Landroidx/fragment/app/Fragment;->onCreate(Landroid/os/Bundle;)V
|
|
|
|
const/4 p1, 0x1
|
|
|
|
invoke-virtual {p0, p1}, Landroidx/fragment/app/Fragment;->setRetainInstance(Z)V
|
|
|
|
new-instance p1, Landroid/os/Handler;
|
|
|
|
invoke-direct {p1}, Landroid/os/Handler;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->handler:Landroid/os/Handler;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onCreateView(Landroid/view/LayoutInflater;Landroid/view/ViewGroup;Landroid/os/Bundle;)Landroid/view/View;
|
|
.locals 2
|
|
|
|
const/4 p3, 0x0
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->getParentFragment()Landroidx/fragment/app/Fragment;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->getParentFragment()Landroidx/fragment/app/Fragment;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object v0, p3
|
|
|
|
:goto_0
|
|
instance-of v1, v0, Lcom/lytefast/flexinput/FlexInputCoordinator;
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move-object p3, v0
|
|
|
|
:goto_1
|
|
check-cast p3, Lcom/lytefast/flexinput/FlexInputCoordinator;
|
|
|
|
iput-object p3, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->flexInputCoordinator:Lcom/lytefast/flexinput/FlexInputCoordinator;
|
|
|
|
sget p3, Lcom/lytefast/flexinput/R$f;->fragment_camera:I
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-virtual {p1, p3, p2, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_2
|
|
const-string p1, "inflater"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw p3
|
|
.end method
|
|
|
|
.method public onPause()V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->handler:Landroid/os/Handler;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacksAndMessages(Ljava/lang/Object;)V
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lcom/camerakit/CameraKitView;->b()V
|
|
|
|
invoke-super {p0}, Landroidx/fragment/app/Fragment;->onPause()V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string v0, "cameraView"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:cond_1
|
|
const-string v0, "handler"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public onResume()V
|
|
.locals 7
|
|
|
|
invoke-super {p0}, Landroidx/fragment/app/Fragment;->onResume()V
|
|
|
|
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->requireContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "requireContext()"
|
|
|
|
invoke-static {v0, v1}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "android.hardware.camera.any"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/pm/PackageManager;->hasSystemFeature(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
const-string v1, "permissionsContainer"
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const-string v3, "cameraContainer"
|
|
|
|
const/16 v4, 0x8
|
|
|
|
const/4 v5, 0x0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
sget-object v0, Lcom/lytefast/flexinput/fragment/CameraFragment;->REQUIRED_PERMISSIONS:[Ljava/lang/String;
|
|
|
|
array-length v6, v0
|
|
|
|
invoke-static {v0, v6}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [Ljava/lang/String;
|
|
|
|
invoke-virtual {p0, v0}, Lcom/lytefast/flexinput/fragment/PermissionsFragment;->hasPermissions([Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraContainer:Landroid/view/View;
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
invoke-virtual {v0, v2}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->permissionsContainer:Landroid/widget/FrameLayout;
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-virtual {v0, v4}, Landroid/widget/FrameLayout;->setVisibility(I)V
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {v0}, Lcom/camerakit/CameraKitView;->c()V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string v0, "cameraView"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v5
|
|
|
|
:cond_2
|
|
invoke-static {v1}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v5
|
|
|
|
:cond_3
|
|
invoke-static {v3}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v5
|
|
|
|
:cond_4
|
|
:goto_0
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraContainer:Landroid/view/View;
|
|
|
|
if-eqz v0, :cond_7
|
|
|
|
invoke-virtual {v0, v4}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->permissionsContainer:Landroid/widget/FrameLayout;
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
invoke-virtual {v0, v2}, Landroid/widget/FrameLayout;->setVisibility(I)V
|
|
|
|
invoke-virtual {v0}, Landroid/widget/FrameLayout;->getChildCount()I
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_5
|
|
|
|
invoke-virtual {p0, v0}, Lcom/lytefast/flexinput/fragment/CameraFragment;->initPermissionsView(Landroid/widget/FrameLayout;)V
|
|
|
|
:cond_5
|
|
return-void
|
|
|
|
:cond_6
|
|
invoke-static {v1}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v5
|
|
|
|
:cond_7
|
|
invoke-static {v3}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v5
|
|
.end method
|
|
|
|
.method public onStart()V
|
|
.locals 1
|
|
|
|
invoke-super {p0}, Landroidx/fragment/app/Fragment;->onStart()V
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lcom/camerakit/CameraKitView;->d()V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string v0, "cameraView"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public onStop()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lcom/camerakit/CameraKitView;->e()V
|
|
|
|
invoke-super {p0}, Landroidx/fragment/app/Fragment;->onStop()V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string v0, "cameraView"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public onViewCreated(Landroid/view/View;Landroid/os/Bundle;)V
|
|
.locals 5
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
invoke-super {p0, p1, p2}, Landroidx/fragment/app/Fragment;->onViewCreated(Landroid/view/View;Landroid/os/Bundle;)V
|
|
|
|
sget p2, Lcom/lytefast/flexinput/R$e;->permissions_container:I
|
|
|
|
invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v1, "findViewById(R.id.permissions_container)"
|
|
|
|
invoke-static {p2, v1}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p2, Landroid/widget/FrameLayout;
|
|
|
|
iput-object p2, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->permissionsContainer:Landroid/widget/FrameLayout;
|
|
|
|
sget p2, Lcom/lytefast/flexinput/R$e;->camera_container:I
|
|
|
|
invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v1, "findViewById(R.id.camera_container)"
|
|
|
|
invoke-static {p2, v1}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object p2, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraContainer:Landroid/view/View;
|
|
|
|
sget p2, Lcom/lytefast/flexinput/R$e;->camera_view:I
|
|
|
|
invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v1, "findViewById(R.id.camera_view)"
|
|
|
|
invoke-static {p2, v1}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p2, Lcom/camerakit/CameraKitView;
|
|
|
|
iput-object p2, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
iget-object p2, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
const-string v1, "cameraView"
|
|
|
|
if-eqz p2, :cond_5
|
|
|
|
iget-object v2, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraErrorListener:Lcom/camerakit/CameraKitView$ErrorListener;
|
|
|
|
invoke-virtual {p2, v2}, Lcom/camerakit/CameraKitView;->setErrorListener(Lcom/camerakit/CameraKitView$ErrorListener;)V
|
|
|
|
iget-object p2, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
if-eqz p2, :cond_4
|
|
|
|
iget-object v1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraListener:Lcom/lytefast/flexinput/fragment/CameraFragment$cameraListener$1;
|
|
|
|
invoke-virtual {p2, v1}, Lcom/camerakit/CameraKitView;->setCameraListener(Lcom/camerakit/CameraKitView$d;)V
|
|
|
|
sget p2, Lcom/lytefast/flexinput/R$e;->take_photo_btn:I
|
|
|
|
invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Landroid/widget/ImageView;
|
|
|
|
new-instance v1, Lcom/lytefast/flexinput/fragment/CameraFragment$a;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-direct {v1, v2, p0}, Lcom/lytefast/flexinput/fragment/CameraFragment$a;-><init>(ILjava/lang/Object;)V
|
|
|
|
invoke-virtual {p2, v1}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
const-string v1, "takePhotoBtn"
|
|
|
|
invoke-static {p2, v1}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p2, v0}, Landroid/widget/ImageView;->setImageTintList(Landroid/content/res/ColorStateList;)V
|
|
|
|
sget p2, Lcom/lytefast/flexinput/R$e;->launch_camera_btn:I
|
|
|
|
invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Landroid/widget/ImageView;
|
|
|
|
new-instance v1, Lcom/lytefast/flexinput/fragment/CameraFragment$a;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-direct {v1, v3, p0}, Lcom/lytefast/flexinput/fragment/CameraFragment$a;-><init>(ILjava/lang/Object;)V
|
|
|
|
invoke-virtual {p2, v1}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
const-string v1, "launchCameraBtn"
|
|
|
|
invoke-static {p2, v1}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v1, -0x1
|
|
|
|
invoke-static {v1}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {p2, v3}, Landroid/widget/ImageView;->setImageTintList(Landroid/content/res/ColorStateList;)V
|
|
|
|
sget p2, Lcom/lytefast/flexinput/R$e;->camera_flash_btn:I
|
|
|
|
invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Landroid/widget/ImageView;
|
|
|
|
new-instance v3, Lcom/lytefast/flexinput/fragment/CameraFragment$a;
|
|
|
|
const/4 v4, 0x2
|
|
|
|
invoke-direct {v3, v4, p0}, Lcom/lytefast/flexinput/fragment/CameraFragment$a;-><init>(ILjava/lang/Object;)V
|
|
|
|
invoke-virtual {p2, v3}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
const-string v3, "flashBtn"
|
|
|
|
invoke-static {p2, v3}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v1}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {p2, v3}, Landroid/widget/ImageView;->setImageTintList(Landroid/content/res/ColorStateList;)V
|
|
|
|
invoke-direct {p0}, Lcom/lytefast/flexinput/fragment/CameraFragment;->getFlashState()I
|
|
|
|
move-result v3
|
|
|
|
invoke-direct {p0, p2, v3, v2}, Lcom/lytefast/flexinput/fragment/CameraFragment;->setFlash(Landroid/widget/ImageView;IZ)V
|
|
|
|
sget p2, Lcom/lytefast/flexinput/R$e;->camera_facing_btn:I
|
|
|
|
invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "findViewById(R.id.camera_facing_btn)"
|
|
|
|
invoke-static {p1, p2}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Landroid/widget/ImageView;
|
|
|
|
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraFacingBtn:Landroid/widget/ImageView;
|
|
|
|
iget-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraFacingBtn:Landroid/widget/ImageView;
|
|
|
|
const-string p2, "cameraFacingBtn"
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
new-instance v2, Lcom/lytefast/flexinput/fragment/CameraFragment$a;
|
|
|
|
const/4 v3, 0x3
|
|
|
|
invoke-direct {v2, v3, p0}, Lcom/lytefast/flexinput/fragment/CameraFragment$a;-><init>(ILjava/lang/Object;)V
|
|
|
|
invoke-virtual {p1, v2}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
iget-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraFacingBtn:Landroid/widget/ImageView;
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-static {v1}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p1, v1}, Landroid/widget/ImageView;->setImageTintList(Landroid/content/res/ColorStateList;)V
|
|
|
|
invoke-direct {p0}, Lcom/lytefast/flexinput/fragment/CameraFragment;->isSingleCamera()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
iget-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraFacingBtn:Landroid/widget/ImageView;
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/16 p2, 0x8
|
|
|
|
invoke-virtual {p1, p2}, Landroid/widget/ImageView;->setVisibility(I)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-static {p2}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_2
|
|
invoke-static {p2}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_3
|
|
invoke-static {p2}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_4
|
|
invoke-static {v1}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_5
|
|
invoke-static {v1}, Ly/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_6
|
|
const-string p1, "view"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public requestPermissionClick()V
|
|
.locals 3
|
|
|
|
new-instance v0, Lcom/lytefast/flexinput/fragment/CameraFragment$g;
|
|
|
|
invoke-direct {v0, p0}, Lcom/lytefast/flexinput/fragment/CameraFragment$g;-><init>(Lcom/lytefast/flexinput/fragment/CameraFragment;)V
|
|
|
|
sget-object v1, Lcom/lytefast/flexinput/fragment/CameraFragment;->REQUIRED_PERMISSIONS:[Ljava/lang/String;
|
|
|
|
array-length v2, v1
|
|
|
|
invoke-static {v1, v2}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, [Ljava/lang/String;
|
|
|
|
invoke-virtual {p0, v0, v1}, Lcom/lytefast/flexinput/fragment/PermissionsFragment;->requestPermissions(Lcom/lytefast/flexinput/fragment/PermissionsFragment$PermissionsResultCallback;[Ljava/lang/String;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final setCameraContainer(Landroid/view/View;)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraContainer:Landroid/view/View;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "<set-?>"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final setCameraFacingBtn(Landroid/widget/ImageView;)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraFacingBtn:Landroid/widget/ImageView;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "<set-?>"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final setCameraView(Lcom/camerakit/CameraKitView;)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->cameraView:Lcom/camerakit/CameraKitView;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "<set-?>"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final setOnFlashChanged(Lkotlin/jvm/functions/Function2;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lkotlin/jvm/functions/Function2<",
|
|
"-",
|
|
"Landroid/view/View;",
|
|
"-",
|
|
"Ljava/lang/Integer;",
|
|
"Lkotlin/Unit;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->onFlashChanged:Lkotlin/jvm/functions/Function2;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "<set-?>"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final setPermissionsContainer(Landroid/widget/FrameLayout;)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/CameraFragment;->permissionsContainer:Landroid/widget/FrameLayout;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "<set-?>"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|