DCSDKInitConfig$Builder.smali

.class public Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;
.super Ljava/lang/Object;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lio/dcloud/feature/sdk/DCSDKInitConfig;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "Builder"
.end annotation


# instance fields
.field isCapsule:Z

.field isDisplayedUnimpTaskList:Z

.field isEnableBackground:Z

.field isNJS:Z

.field private isUniMPFromRecents:Z

.field mCapsuleButtonStyle:Lio/dcloud/feature/sdk/DCUniMPCapsuleButtonStyle;

.field mCustomOAID:Ljava/lang/String;

.field mMenuDefFontColor:Ljava/lang/String;

.field mMenuDefFontSize:Ljava/lang/String;

.field mMenuDefFontWeight:Ljava/lang/String;

.field mSheetItems:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lio/dcloud/feature/sdk/MenuActionSheetItem;",
            ">;"
        }
    .end annotation
.end field


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

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x1

    .line 2
    iput-boolean v0, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isCapsule:Z

    const-string v1, "#000000"

    .line 4
    iput-object v1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mMenuDefFontColor:Ljava/lang/String;

    const-string v1, "22px"

    .line 5
    iput-object v1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mMenuDefFontSize:Ljava/lang/String;

    const-string v1, "normal"

    .line 6
    iput-object v1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mMenuDefFontWeight:Ljava/lang/String;

    const-string v1, ""

    .line 7
    iput-object v1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mCustomOAID:Ljava/lang/String;

    .line 8
    iput-boolean v0, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isEnableBackground:Z

    .line 9
    iput-boolean v0, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isUniMPFromRecents:Z

    .line 10
    iput-boolean v0, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isDisplayedUnimpTaskList:Z

    .line 11
    iput-boolean v0, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isNJS:Z

    return-void
.end method

.method private getDefaultMenuButton()Ljava/lang/String;
    .registers 9

    .line 1
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    const-string v1, "show"

    .line 3
    :try_start_7
    iget-boolean v2, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isCapsule:Z

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    .line 4
    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1}, Lorg/json/JSONObject;-><init>()V

    .line 5
    new-instance v2, Lorg/json/JSONArray;

    invoke-direct {v2}, Lorg/json/JSONArray;-><init>()V

    .line 6
    iget-object v3, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mSheetItems:Ljava/util/List;

    if-eqz v3, :cond_4e

    invoke-interface {v3}, Ljava/util/List;->size()I

    move-result v3

    if-lez v3, :cond_4e

    .line 7
    iget-object v3, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mSheetItems:Ljava/util/List;

    invoke-interface {v3}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_26
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_49

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lio/dcloud/feature/sdk/MenuActionSheetItem;

    .line 8
    new-instance v5, Lorg/json/JSONObject;

    invoke-direct {v5}, Lorg/json/JSONObject;-><init>()V
    :try_end_37
    .catch Lorg/json/JSONException; {:try_start_7 .. :try_end_37} :catch_92

    const-string v6, "title"

    .line 9
    :try_start_39
    iget-object v7, v4, Lio/dcloud/feature/sdk/MenuActionSheetItem;->a:Ljava/lang/String;

    invoke-virtual {v5, v6, v7}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_3e
    .catch Lorg/json/JSONException; {:try_start_39 .. :try_end_3e} :catch_92

    const-string v6, "id"

    .line 10
    :try_start_40
    iget-object v4, v4, Lio/dcloud/feature/sdk/MenuActionSheetItem;->b:Ljava/lang/String;

    invoke-virtual {v5, v6, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 11
    invoke-virtual {v2, v5}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    goto :goto_26

    :cond_49
    const-string v3, "buttons"

    .line 13
    invoke-virtual {v1, v3, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_4e
    .catch Lorg/json/JSONException; {:try_start_40 .. :try_end_4e} :catch_92

    :cond_4e
    const-string v2, "textColor"

    .line 15
    :try_start_50
    iget-object v3, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mMenuDefFontColor:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_55
    .catch Lorg/json/JSONException; {:try_start_50 .. :try_end_55} :catch_92

    const-string v2, "fontSize"

    .line 16
    :try_start_57
    iget-object v3, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mMenuDefFontSize:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_5c
    .catch Lorg/json/JSONException; {:try_start_57 .. :try_end_5c} :catch_92

    const-string v2, "fontWeight"

    .line 17
    :try_start_5e
    iget-object v3, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mMenuDefFontWeight:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v2, "menu"

    .line 18
    invoke-virtual {v0, v2, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_68
    .catch Lorg/json/JSONException; {:try_start_5e .. :try_end_68} :catch_92

    const-string v1, "enableBackground"

    .line 19
    :try_start_6a
    iget-boolean v2, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isEnableBackground:Z

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;
    :try_end_6f
    .catch Lorg/json/JSONException; {:try_start_6a .. :try_end_6f} :catch_92

    const-string v1, "isUniMPFromRecents"

    .line 20
    :try_start_71
    iget-boolean v2, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isUniMPFromRecents:Z

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;
    :try_end_76
    .catch Lorg/json/JSONException; {:try_start_71 .. :try_end_76} :catch_92

    const-string v1, "isNJS"

    .line 21
    :try_start_78
    iget-boolean v2, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isNJS:Z

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;
    :try_end_7d
    .catch Lorg/json/JSONException; {:try_start_78 .. :try_end_7d} :catch_92

    const-string v1, "mCustomOAID"

    .line 22
    :try_start_7f
    iget-object v2, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mCustomOAID:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 23
    iget-object v1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mCapsuleButtonStyle:Lio/dcloud/feature/sdk/DCUniMPCapsuleButtonStyle;
    :try_end_86
    .catch Lorg/json/JSONException; {:try_start_7f .. :try_end_86} :catch_92

    if-eqz v1, :cond_96

    const-string v2, "capsuleButtonStyle"

    .line 24
    :try_start_8a
    invoke-virtual {v1}, Lio/dcloud/feature/sdk/DCUniMPCapsuleButtonStyle;->getCapsuleButtonStyle()Lorg/json/JSONObject;

    move-result-object v1

    invoke-virtual {v0, v2, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_91
    .catch Lorg/json/JSONException; {:try_start_8a .. :try_end_91} :catch_92

    goto :goto_96

    :catch_92
    move-exception v1

    .line 27
    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    .line 29
    :cond_96
    :goto_96
    invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method


# virtual methods
.method public build()Lio/dcloud/feature/sdk/DCSDKInitConfig;
    .registers 3

    .line 1
    new-instance v0, Lio/dcloud/feature/sdk/DCSDKInitConfig;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lio/dcloud/feature/sdk/DCSDKInitConfig;-><init>(Lio/dcloud/feature/sdk/DCSDKInitConfig$a;)V

    .line 2
    iget-boolean v1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isCapsule:Z

    # setter for: Lio/dcloud/feature/sdk/DCSDKInitConfig;->isCapsule:Z
    invoke-static {v0, v1}, Lio/dcloud/feature/sdk/DCSDKInitConfig;->access$102(Lio/dcloud/feature/sdk/DCSDKInitConfig;Z)Z

    .line 3
    iget-boolean v1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isEnableBackground:Z

    # setter for: Lio/dcloud/feature/sdk/DCSDKInitConfig;->isEnableBackground:Z
    invoke-static {v0, v1}, Lio/dcloud/feature/sdk/DCSDKInitConfig;->access$202(Lio/dcloud/feature/sdk/DCSDKInitConfig;Z)Z

    .line 4
    iget-boolean v1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isUniMPFromRecents:Z

    # setter for: Lio/dcloud/feature/sdk/DCSDKInitConfig;->isUniMPFromRecents:Z
    invoke-static {v0, v1}, Lio/dcloud/feature/sdk/DCSDKInitConfig;->access$302(Lio/dcloud/feature/sdk/DCSDKInitConfig;Z)Z

    .line 5
    iget-object v1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mCustomOAID:Ljava/lang/String;

    # setter for: Lio/dcloud/feature/sdk/DCSDKInitConfig;->customOAID:Ljava/lang/String;
    invoke-static {v0, v1}, Lio/dcloud/feature/sdk/DCSDKInitConfig;->access$402(Lio/dcloud/feature/sdk/DCSDKInitConfig;Ljava/lang/String;)Ljava/lang/String;

    .line 6
    invoke-direct {p0}, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->getDefaultMenuButton()Ljava/lang/String;

    move-result-object v1

    # setter for: Lio/dcloud/feature/sdk/DCSDKInitConfig;->mDefaultMenuButton:Ljava/lang/String;
    invoke-static {v0, v1}, Lio/dcloud/feature/sdk/DCSDKInitConfig;->access$502(Lio/dcloud/feature/sdk/DCSDKInitConfig;Ljava/lang/String;)Ljava/lang/String;

    .line 7
    iget-boolean v1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isDisplayedUnimpTaskList:Z

    # setter for: Lio/dcloud/feature/sdk/DCSDKInitConfig;->isDisplayedUnimpTaskList:Z
    invoke-static {v0, v1}, Lio/dcloud/feature/sdk/DCSDKInitConfig;->access$602(Lio/dcloud/feature/sdk/DCSDKInitConfig;Z)Z

    .line 8
    iget-boolean v1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isNJS:Z

    # setter for: Lio/dcloud/feature/sdk/DCSDKInitConfig;->isNJS:Z
    invoke-static {v0, v1}, Lio/dcloud/feature/sdk/DCSDKInitConfig;->access$702(Lio/dcloud/feature/sdk/DCSDKInitConfig;Z)Z

    return-object v0
.end method

.method public setCapsule(Z)Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;
    .registers 2

    .line 1
    iput-boolean p1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isCapsule:Z

    return-object p0
.end method

.method public setCapsuleButtonStyle(Lio/dcloud/feature/sdk/DCUniMPCapsuleButtonStyle;)Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;
    .registers 2

    .line 1
    iput-object p1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mCapsuleButtonStyle:Lio/dcloud/feature/sdk/DCUniMPCapsuleButtonStyle;

    return-object p0
.end method

.method public setCustomOAID(Ljava/lang/String;)Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;
    .registers 2

    .line 1
    iput-object p1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mCustomOAID:Ljava/lang/String;

    return-object p0
.end method

.method public setEnableBackground(Z)Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;
    .registers 2

    .line 1
    iput-boolean p1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isEnableBackground:Z

    return-object p0
.end method

.method public setMenuActionSheetItems(Ljava/util/List;)Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lio/dcloud/feature/sdk/MenuActionSheetItem;",
            ">;)",
            "Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;"
        }
    .end annotation

    .line 1
    iput-object p1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mSheetItems:Ljava/util/List;

    return-object p0
.end method

.method public setMenuDefFontColor(Ljava/lang/String;)Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;
    .registers 2

    .line 1
    iput-object p1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mMenuDefFontColor:Ljava/lang/String;

    return-object p0
.end method

.method public setMenuDefFontSize(Ljava/lang/String;)Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;
    .registers 2

    .line 1
    iput-object p1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mMenuDefFontSize:Ljava/lang/String;

    return-object p0
.end method

.method public setMenuDefFontWeight(Ljava/lang/String;)Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;
    .registers 2

    .line 1
    iput-object p1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->mMenuDefFontWeight:Ljava/lang/String;

    return-object p0
.end method

.method public setNJS(Z)Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;
    .registers 2

    .line 1
    iput-boolean p1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isNJS:Z

    return-object p0
.end method

.method public setUniMPFromRecents(Z)Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;
    .registers 2
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .line 1
    iput-boolean p1, p0, Lio/dcloud/feature/sdk/DCSDKInitConfig$Builder;->isUniMPFromRecents:Z

    return-object p0
.end method