SubSkillFragment.smali

.class public Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;
.super Lcom/cmcm/xiaobao/phone/smarthome/base/AbstractLazyLoadFragment;


# static fields
.field private static final TAG:Ljava/lang/String;


# instance fields
.field private mBannerList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/sdk/orion/bean/BannerListBean;",
            ">;"
        }
    .end annotation
.end field

.field private mOtherList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/sdk/orion/bean/SkillListBean;",
            ">;"
        }
    .end annotation
.end field

.field private mSkillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;

.field private mSkillBannerView:Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;

.field private mSkillList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/sdk/orion/bean/SkillListBean;",
            ">;"
        }
    .end annotation
.end field

.field oldBanner:Ljava/lang/String;

.field private oldData:Ljava/lang/String;

.field private skillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/widget/HeaderAndFooterWrapper;


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

    const-class v0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->TAG:Ljava/lang/String;

    return-void
.end method

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

    invoke-direct {p0}, Lcom/cmcm/xiaobao/phone/smarthome/base/AbstractLazyLoadFragment;-><init>()V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mOtherList:Ljava/util/List;

    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->oldBanner:Ljava/lang/String;

    return-void
.end method

.method static synthetic access$000(Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;)Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;
    .registers 2

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;

    return-object v0
.end method

.method static synthetic access$100(Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;)Ljava/lang/String;
    .registers 2

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->oldData:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$102(Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;Ljava/lang/String;)Ljava/lang/String;
    .registers 2

    iput-object p1, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->oldData:Ljava/lang/String;

    return-object p1
.end method

.method static synthetic access$200(Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;)Ljava/util/List;
    .registers 2

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillList:Ljava/util/List;

    return-object v0
.end method

.method static synthetic access$202(Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;Ljava/util/List;)Ljava/util/List;
    .registers 2

    iput-object p1, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillList:Ljava/util/List;

    return-object p1
.end method

.method static synthetic access$302(Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;Ljava/util/List;)Ljava/util/List;
    .registers 2

    iput-object p1, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mBannerList:Ljava/util/List;

    return-object p1
.end method

.method static synthetic access$400()Ljava/lang/String;
    .registers 1

    sget-object v0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->TAG:Ljava/lang/String;

    return-object v0
.end method

.method private initSkillAdapter()V
    .registers 4

    new-instance v0, Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;

    invoke-virtual {p0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->getActivity()Landroid/support/v4/app/FragmentActivity;

    move-result-object v1

    iget-object v2, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mOtherList:Ljava/util/List;

    invoke-direct {v0, v1, v2}, Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;-><init>(Landroid/app/Activity;Ljava/util/List;)V

    iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;

    new-instance v1, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment$2;

    invoke-direct {v1, p0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment$2;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;)V

    invoke-virtual {v0, v1}, Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;->setOnClickListener(Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter$OnClickListener;)V

    return-void
.end method

.method public static newInstance()Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;
    .registers 1

    new-instance v0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;

    invoke-direct {v0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;-><init>()V

    return-object v0
.end method


# virtual methods
.method public addSkillHeaderView()V
    .registers 5

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mBannerList:Ljava/util/List;

    if-eqz v0, :cond_2f

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mBannerList:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_2f

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillBannerView:Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;

    if-nez v0, :cond_2f

    new-instance v0, Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;

    invoke-direct {v0}, Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;-><init>()V

    iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillBannerView:Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->skillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/widget/HeaderAndFooterWrapper;

    iget-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillBannerView:Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;

    iget-object v2, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mActivity:Landroid/app/Activity;

    iget-object v3, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mBannerList:Ljava/util/List;

    invoke-virtual {v1, v2, v3}, Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;->getContentView(Landroid/content/Context;Ljava/util/List;)Landroid/view/View;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/cmcm/xiaobao/phone/smarthome/widget/HeaderAndFooterWrapper;->addHeaderView(Landroid/view/View;)V

    invoke-virtual {p0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->resetGridLayoutManager()V

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->skillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/widget/HeaderAndFooterWrapper;

    invoke-virtual {v0}, Lcom/cmcm/xiaobao/phone/smarthome/widget/HeaderAndFooterWrapper;->notifyDataSetChanged()V

    :goto_2e
    return-void

    :cond_2f
    invoke-virtual {p0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->resetGridLayoutManager()V

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillBannerView:Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;

    iget-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mBannerList:Ljava/util/List;

    invoke-virtual {v0, v1}, Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;->refresh(Ljava/util/List;)V

    goto :goto_2e
.end method

.method public allRefresh()V
    .registers 1

    invoke-virtual {p0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->getSkillList()V

    invoke-virtual {p0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->getSkillBanner()V

    return-void
.end method

.method protected getLayoutId()I
    .registers 2

    sget v0, Lcom/cmcm/xiaobao/phone/smarthome/R$layout;->sh_sdk_fragment_smarthome_device_list_1:I

    return v0
.end method

.method public getSkillBanner()V
    .registers 3

    invoke-static {}, Lcom/sdk/orion/orion/OrionClient;->getInstance()Lcom/sdk/orion/orion/OrionClient;

    move-result-object v0

    new-instance v1, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment$5;

    invoke-direct {v1, p0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment$5;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;)V

    invoke-virtual {v0, v1}, Lcom/sdk/orion/orion/OrionClient;->getBannerList(Lcom/sdk/orion/callback/JsonCallback;)V

    return-void
.end method

.method public getSkillList()V
    .registers 4

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    invoke-static {}, Lcom/sdk/orion/orion/OrionClient;->getInstance()Lcom/sdk/orion/orion/OrionClient;

    move-result-object v1

    new-instance v2, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment$4;

    invoke-direct {v2, p0, v0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment$4;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;Ljava/util/List;)V

    invoke-virtual {v1, v2}, Lcom/sdk/orion/orion/OrionClient;->getSkillList(Lcom/sdk/orion/callback/JsonCallback;)V

    return-void
.end method

.method protected initView()V
    .registers 5

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mContentView:Landroid/view/View;

    sget v1, Lcom/cmcm/xiaobao/phone/smarthome/R$id;->skill_list:I

    invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/support/v7/widget/RecyclerView;

    new-instance v1, Landroid/support/v7/widget/GridLayoutManager;

    iget-object v2, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mActivity:Landroid/app/Activity;

    const/4 v3, 0x2

    invoke-direct {v1, v2, v3}, Landroid/support/v7/widget/GridLayoutManager;-><init>(Landroid/content/Context;I)V

    invoke-virtual {v0, v1}, Landroid/support/v7/widget/RecyclerView;->setLayoutManager(Landroid/support/v7/widget/RecyclerView$LayoutManager;)V

    new-instance v2, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment$1;

    invoke-direct {v2, p0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment$1;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;)V

    invoke-virtual {v1, v2}, Landroid/support/v7/widget/GridLayoutManager;->setSpanSizeLookup(Landroid/support/v7/widget/GridLayoutManager$SpanSizeLookup;)V

    invoke-direct {p0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->initSkillAdapter()V

    new-instance v1, Lcom/cmcm/xiaobao/phone/smarthome/widget/HeaderAndFooterWrapper;

    iget-object v2, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;

    invoke-direct {v1, v2}, Lcom/cmcm/xiaobao/phone/smarthome/widget/HeaderAndFooterWrapper;-><init>(Landroid/support/v7/widget/RecyclerView$Adapter;)V

    iput-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->skillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/widget/HeaderAndFooterWrapper;

    iget-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mActivity:Landroid/app/Activity;

    sget v2, Lcom/cmcm/xiaobao/phone/smarthome/R$layout;->orion_sdk_view_footer:I

    const/4 v3, 0x0

    invoke-static {v1, v2, v3}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    iget-object v2, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->skillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/widget/HeaderAndFooterWrapper;

    invoke-virtual {v2, v1}, Lcom/cmcm/xiaobao/phone/smarthome/widget/HeaderAndFooterWrapper;->addFooterView(Landroid/view/View;)V

    iget-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->skillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/widget/HeaderAndFooterWrapper;

    invoke-virtual {v0, v1}, Landroid/support/v7/widget/RecyclerView;->setAdapter(Landroid/support/v7/widget/RecyclerView$Adapter;)V

    invoke-virtual {p0, v0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->initLoadingHelper(Landroid/view/View;)V

    return-void
.end method

.method protected loadData()V
    .registers 1

    invoke-virtual {p0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->allRefresh()V

    return-void
.end method

.method public notifySkillDataChanged(Ljava/util/List;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/sdk/orion/bean/SkillListBean;",
            ">;)V"
        }
    .end annotation

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;

    invoke-virtual {v0, p1}, Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;->setData(Ljava/util/List;)V

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillAdapter:Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;

    invoke-virtual {v0}, Lcom/cmcm/xiaobao/phone/smarthome/adapter/NewSkillAdapter;->notifyDataSetChanged()V

    return-void
.end method

.method public onDestroy()V
    .registers 2

    invoke-super {p0}, Lcom/cmcm/xiaobao/phone/smarthome/base/AbstractLazyLoadFragment;->onDestroy()V

    invoke-static {}, Lorg/greenrobot/eventbus/c;->a()Lorg/greenrobot/eventbus/c;

    move-result-object v0

    invoke-virtual {v0, p0}, Lorg/greenrobot/eventbus/c;->b(Ljava/lang/Object;)V

    return-void
.end method

.method public onPause()V
    .registers 2

    invoke-super {p0}, Lcom/cmcm/xiaobao/phone/smarthome/base/AbstractLazyLoadFragment;->onPause()V

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillBannerView:Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;

    if-eqz v0, :cond_c

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillBannerView:Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;

    invoke-virtual {v0}, Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;->stopLoop()V

    :cond_c
    return-void
.end method

.method public onResume()V
    .registers 2

    invoke-super {p0}, Lcom/cmcm/xiaobao/phone/smarthome/base/AbstractLazyLoadFragment;->onResume()V

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillBannerView:Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;

    if-eqz v0, :cond_c

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mSkillBannerView:Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;

    invoke-virtual {v0}, Lcom/sdk/orion/ui/baselibrary/widget/banner/SkillBannerView;->startLoop()V

    :cond_c
    return-void
.end method

.method public resetGridLayoutManager()V
    .registers 3

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;->mContentView:Landroid/view/View;

    sget v1, Lcom/cmcm/xiaobao/phone/smarthome/R$id;->skill_list:I

    invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/support/v7/widget/RecyclerView;

    invoke-virtual {v0}, Landroid/support/v7/widget/RecyclerView;->getLayoutManager()Landroid/support/v7/widget/RecyclerView$LayoutManager;

    move-result-object v0

    check-cast v0, Landroid/support/v7/widget/GridLayoutManager;

    new-instance v1, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment$3;

    invoke-direct {v1, p0}, Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment$3;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/SubSkillFragment;)V

    invoke-virtual {v0, v1}, Landroid/support/v7/widget/GridLayoutManager;->setSpanSizeLookup(Landroid/support/v7/widget/GridLayoutManager$SpanSizeLookup;)V

    return-void
.end method