HomeApi.smali

.class public Lcom/sandboxol/center/web/HomeApi;
.super Ljava/lang/Object;
.source "HomeApi.java"


# static fields
.field private static final api:Lcom/sandboxol/center/web/IHomeApi;


# direct methods
.method static constructor <clinit>()V
    .registers 2

    .line 1
    invoke-static {}, Lcom/sandboxol/common/base/app/BaseApplication;->getApp()Lcom/sandboxol/common/base/app/BaseApplication;

    move-result-object v0

    invoke-virtual {v0}, Lcom/sandboxol/common/base/app/BaseApplication;->getMetaDataBaseUrl()Ljava/lang/String;

    move-result-object v0

    const-class v1, Lcom/sandboxol/center/web/IHomeApi;

    invoke-static {v0, v1}, Lcom/sandboxol/common/retrofit/RetrofitFactory;->httpsCreate(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/sandboxol/center/web/IHomeApi;

    sput-object v0, Lcom/sandboxol/center/web/HomeApi;->api:Lcom/sandboxol/center/web/IHomeApi;

    return-void
.end method

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

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

    return-void
.end method

.method static synthetic a(Lcom/sandboxol/common/base/web/OnResponseListener;)V
    .registers 1

    .line 1
    invoke-static {p0}, Lcom/sandboxol/center/web/HomeApi;->getHomeData(Lcom/sandboxol/common/base/web/OnResponseListener;)V

    return-void
.end method

.method public static getHomeData(Lcom/sandboxol/common/base/web/OnResponseListener;)V
    .registers 9
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/sandboxol/common/base/web/OnResponseListener<",
            "Ljava/util/List<",
            "Lcom/sandboxol/greendao/entity/homedata/HomeColumn;",
            ">;>;)V"
        }
    .end annotation

    .line 1
    new-instance v0, Lcom/sandboxol/center/web/X;

    invoke-direct {v0, p0}, Lcom/sandboxol/center/web/X;-><init>(Lcom/sandboxol/common/base/web/OnResponseListener;)V

    invoke-static {p0, v0}, Lcom/sandboxol/common/utils/HttpUtils;->getRetryCommand(Lcom/sandboxol/common/base/web/OnResponseListener;Lrx/functions/Action0;)Lcom/sandboxol/common/command/ReplyCommand;

    move-result-object v0

    .line 2
    sget-object v1, Lcom/sandboxol/center/web/HomeApi;->api:Lcom/sandboxol/center/web/IHomeApi;

    invoke-static {}, Lcom/sandboxol/common/utils/CommonHelper;->getLanguage()Ljava/lang/String;

    move-result-object v2

    invoke-static {}, Lcom/sandboxol/center/utils/Helper;->isBelowKitKat()Z

    move-result v4

    const/4 v6, 0x0

    const/16 v7, 0xa

    const/4 v3, 0x0

    const-string v5, "android"

    invoke-interface/range {v1 .. v7}, Lcom/sandboxol/center/web/IHomeApi;->getHomeData(Ljava/lang/String;IILjava/lang/String;II)Lrx/Observable;

    move-result-object v1

    .line 3
    invoke-static {}, Lrx/schedulers/Schedulers;->io()Lrx/Scheduler;

    move-result-object v2

    invoke-virtual {v1, v2}, Lrx/Observable;->subscribeOn(Lrx/Scheduler;)Lrx/Observable;

    move-result-object v1

    .line 4
    invoke-static {}, Lrx/android/schedulers/AndroidSchedulers;->mainThread()Lrx/Scheduler;

    move-result-object v2

    invoke-virtual {v1, v2}, Lrx/Observable;->observeOn(Lrx/Scheduler;)Lrx/Observable;

    move-result-object v1

    const-wide/16 v2, 0x2

    .line 5
    invoke-virtual {v1, v2, v3}, Lrx/Observable;->retry(J)Lrx/Observable;

    move-result-object v1

    new-instance v2, Lcom/sandboxol/center/web/http/AuthTokenHttpSubscriber;

    invoke-direct {v2, p0, v0}, Lcom/sandboxol/center/web/http/AuthTokenHttpSubscriber;-><init>(Lcom/sandboxol/common/base/web/OnResponseListener;Lcom/sandboxol/common/command/ReplyCommand;)V

    .line 6
    invoke-virtual {v1, v2}, Lrx/Observable;->subscribe(Lrx/Subscriber;)Lrx/Subscription;

    return-void
.end method