ProfileImageFragment.smali

.class public Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;
.super Lcom/sandboxol/common/base/app/TemplateFragment;
.source "ProfileImageFragment.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/sandboxol/common/base/app/TemplateFragment<",
        "Lcom/sandboxol/blockymods/view/fragment/profileImage/f;",
        "Lcom/sandboxol/blockymods/databinding/He;",
        ">;"
    }
.end annotation


# instance fields
.field public a:Ljava/lang/String;

.field public b:Ljava/io/File;

.field private c:Lcom/sandboxol/greendao/entity/User;


# direct methods
.method public constructor <init>()V
    .registers 1

    .line 1
    invoke-direct {p0}, Lcom/sandboxol/common/base/app/TemplateFragment;-><init>()V

    return-void
.end method

.method static synthetic a(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)Lcom/sandboxol/greendao/entity/User;
    .registers 1

    .line 1
    iget-object p0, p0, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->c:Lcom/sandboxol/greendao/entity/User;

    return-object p0
.end method

.method static synthetic a(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;Lcom/sandboxol/greendao/entity/User;)Lcom/sandboxol/greendao/entity/User;
    .registers 2

    .line 2
    iput-object p1, p0, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->c:Lcom/sandboxol/greendao/entity/User;

    return-object p1
.end method

.method static synthetic b(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)V
    .registers 1

    .line 1
    invoke-direct {p0}, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->k()V

    return-void
.end method

.method static synthetic c(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)Landroid/content/Context;
    .registers 1

    .line 1
    iget-object p0, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    return-object p0
.end method

.method static synthetic d(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)Landroid/content/Context;
    .registers 1

    .line 1
    iget-object p0, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    return-object p0
.end method

.method static synthetic e(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)Landroid/content/Context;
    .registers 1

    .line 1
    iget-object p0, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    return-object p0
.end method

.method static synthetic f(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)Landroid/content/Context;
    .registers 1

    .line 1
    iget-object p0, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    return-object p0
.end method

.method static synthetic g(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)Landroid/content/Context;
    .registers 1

    .line 1
    iget-object p0, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    return-object p0
.end method

.method static synthetic h(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)Landroid/content/Context;
    .registers 1

    .line 1
    iget-object p0, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    return-object p0
.end method

.method static synthetic i(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)Landroid/content/Context;
    .registers 1

    .line 1
    iget-object p0, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    return-object p0
.end method

.method private k()V
    .registers 4

    .line 1
    new-instance v0, Lcom/sandboxol/blockymods/view/fragment/updateuserinfo/j;

    iget-object v1, p0, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->c:Lcom/sandboxol/greendao/entity/User;

    invoke-direct {v0, v1}, Lcom/sandboxol/blockymods/view/fragment/updateuserinfo/j;-><init>(Lcom/sandboxol/greendao/entity/User;)V

    iget-object v1, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    new-instance v2, Lcom/sandboxol/blockymods/view/fragment/profileImage/h;

    invoke-direct {v2, p0}, Lcom/sandboxol/blockymods/view/fragment/profileImage/h;-><init>(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)V

    invoke-virtual {v0, v1, v2}, Lcom/sandboxol/blockymods/view/fragment/updateuserinfo/j;->loadData(Landroid/content/Context;Lcom/sandboxol/common/base/web/OnResponseListener;)V

    return-void
.end method


# virtual methods
.method protected a(Lcom/sandboxol/blockymods/databinding/He;Lcom/sandboxol/blockymods/view/fragment/profileImage/f;)V
    .registers 3

    .line 3
    invoke-virtual {p1, p2}, Lcom/sandboxol/blockymods/databinding/He;->a(Lcom/sandboxol/blockymods/view/fragment/profileImage/f;)V

    return-void
.end method

.method protected bridge synthetic bindViewModel(Landroidx/databinding/ViewDataBinding;Lcom/sandboxol/common/base/viewmodel/ViewModel;)V
    .registers 3

    .line 1
    check-cast p1, Lcom/sandboxol/blockymods/databinding/He;

    check-cast p2, Lcom/sandboxol/blockymods/view/fragment/profileImage/f;

    invoke-virtual {p0, p1, p2}, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->a(Lcom/sandboxol/blockymods/databinding/He;Lcom/sandboxol/blockymods/view/fragment/profileImage/f;)V

    return-void
.end method

.method public g()Ljava/io/File;
    .registers 2

    .line 2
    iget-object v0, p0, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->b:Ljava/io/File;

    return-object v0
.end method

.method protected getLayoutId()I
    .registers 2

    const v0, 0x7f0d0182

    return v0
.end method

.method protected getViewModel()Lcom/sandboxol/blockymods/view/fragment/profileImage/f;
    .registers 3

    .line 2
    new-instance v0, Lcom/sandboxol/blockymods/view/fragment/profileImage/f;

    iget-object v1, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    invoke-direct {v0, v1, p0}, Lcom/sandboxol/blockymods/view/fragment/profileImage/f;-><init>(Landroid/content/Context;Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)V

    return-object v0
.end method

.method protected bridge synthetic getViewModel()Lcom/sandboxol/common/base/viewmodel/ViewModel;
    .registers 2

    .line 1
    invoke-virtual {p0}, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->getViewModel()Lcom/sandboxol/blockymods/view/fragment/profileImage/f;

    move-result-object v0

    return-object v0
.end method

.method public h()Ljava/lang/String;
    .registers 2

    .line 2
    iget-object v0, p0, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->a:Ljava/lang/String;

    return-object v0
.end method

.method protected i()V
    .registers 3

    .line 2
    invoke-static {}, Lcom/sandboxol/center/utils/IconCrop;->newInstance()Lcom/sandboxol/center/utils/IconCrop;

    move-result-object v0

    iget-object v1, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    invoke-virtual {v0, v1, p0}, Lcom/sandboxol/center/utils/IconCrop;->checkPermissionAndVisitGallery(Landroid/content/Context;Lcom/sandboxol/common/base/app/BaseFragment;)V

    return-void
.end method

.method j()V
    .registers 5

    .line 1
    iget-object v0, p0, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->a:Ljava/lang/String;

    if-eqz v0, :cond_1b

    iget-object v0, p0, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->b:Ljava/io/File;

    if-nez v0, :cond_9

    goto :goto_1b

    .line 2
    :cond_9
    iget-object v0, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    invoke-virtual {p0}, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->g()Ljava/io/File;

    move-result-object v1

    invoke-virtual {p0}, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->h()Ljava/lang/String;

    move-result-object v2

    new-instance v3, Lcom/sandboxol/blockymods/view/fragment/profileImage/g;

    invoke-direct {v3, p0}, Lcom/sandboxol/blockymods/view/fragment/profileImage/g;-><init>(Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;)V

    invoke-static {v0, v1, v2, v3}, Lcom/sandboxol/center/utils/IconUploadHelper;->uploadIcon(Landroid/content/Context;Ljava/io/File;Ljava/lang/String;Lcom/sandboxol/common/base/web/OnResponseListener;)V

    :cond_1b
    :goto_1b
    return-void
.end method

.method public onActivityResult(IILandroid/content/Intent;)V
    .registers 6

    .line 1
    invoke-super {p0, p1, p2, p3}, Landroidx/fragment/app/Fragment;->onActivityResult(IILandroid/content/Intent;)V

    const/4 v0, 0x1

    if-ne p1, v0, :cond_30

    if-nez p3, :cond_9

    return-void

    .line 2
    :cond_9
    invoke-virtual {p3}, Landroid/content/Intent;->getData()Landroid/net/Uri;

    move-result-object p1

    if-nez p1, :cond_10

    return-void

    .line 3
    :cond_10
    sget p2, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 p3, 0x18

    if-lt p2, p3, :cond_1e

    .line 4
    invoke-static {}, Lcom/sandboxol/center/utils/IconCrop;->newInstance()Lcom/sandboxol/center/utils/IconCrop;

    move-result-object p2

    invoke-virtual {p2, p1, p0}, Lcom/sandboxol/center/utils/IconCrop;->cutIcon(Landroid/net/Uri;Lcom/sandboxol/common/base/app/BaseFragment;)V

    goto :goto_61

    .line 5
    :cond_1e
    invoke-static {}, Lcom/sandboxol/center/utils/IconCrop;->newInstance()Lcom/sandboxol/center/utils/IconCrop;

    move-result-object p2

    iget-object p3, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    invoke-virtual {p2, p3, p1}, Lcom/sandboxol/center/utils/IconCrop;->getRealPathFromURI(Landroid/content/Context;Landroid/net/Uri;)Landroid/net/Uri;

    move-result-object p1

    .line 6
    invoke-static {}, Lcom/sandboxol/center/utils/IconCrop;->newInstance()Lcom/sandboxol/center/utils/IconCrop;

    move-result-object p2

    invoke-virtual {p2, p1, p0}, Lcom/sandboxol/center/utils/IconCrop;->cutIcon(Landroid/net/Uri;Lcom/sandboxol/common/base/app/BaseFragment;)V

    goto :goto_61

    :cond_30
    const/16 v1, 0x45

    if-ne p1, v1, :cond_61

    const/4 p1, -0x1

    if-ne p2, p1, :cond_61

    if-eqz p3, :cond_61

    .line 7
    invoke-static {}, Lcom/sandboxol/center/utils/IconCrop;->newInstance()Lcom/sandboxol/center/utils/IconCrop;

    move-result-object p1

    iget-object p2, p0, Lcom/sandboxol/common/base/app/BaseFragment;->context:Landroid/content/Context;

    new-array p3, v0, [Landroid/widget/ImageView;

    const/4 v0, 0x0

    iget-object v1, p0, Lcom/sandboxol/common/base/app/BaseFragment;->binding:Landroidx/databinding/ViewDataBinding;

    check-cast v1, Lcom/sandboxol/blockymods/databinding/He;

    iget-object v1, v1, Lcom/sandboxol/blockymods/databinding/He;->a:Lcom/sandboxol/center/view/widget/AvatarLayout;

    iget-object v1, v1, Lcom/sandboxol/center/view/widget/AvatarLayout;->binding:Lcom/sandboxol/center/databinding/LayoutAvatarBinding;

    iget-object v1, v1, Lcom/sandboxol/center/databinding/LayoutAvatarBinding;->ivHead:Lcom/sandboxol/common/widget/RoundImageView;

    aput-object v1, p3, v0

    invoke-virtual {p1, p2, p3}, Lcom/sandboxol/center/utils/IconCrop;->cutIconResult(Landroid/content/Context;[Landroid/widget/ImageView;)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->a:Ljava/lang/String;

    .line 8
    invoke-static {}, Lcom/sandboxol/center/utils/IconCrop;->newInstance()Lcom/sandboxol/center/utils/IconCrop;

    move-result-object p1

    invoke-virtual {p1}, Lcom/sandboxol/center/utils/IconCrop;->cutIconReturnFile()Ljava/io/File;

    move-result-object p1

    iput-object p1, p0, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->b:Ljava/io/File;

    .line 9
    invoke-virtual {p0}, Lcom/sandboxol/blockymods/view/fragment/profileImage/ProfileImageFragment;->j()V

    :cond_61
    :goto_61
    return-void
.end method