HomeRecyclerView.smali
.class public Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;
.super Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView$HomeWrapAdapter;
}
.end annotation
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.registers 2
invoke-direct {p0, p1}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView;-><init>(Landroid/content/Context;)V
invoke-direct {p0}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->initHome()V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.registers 3
invoke-direct {p0, p1, p2}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
invoke-direct {p0}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->initHome()V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.registers 4
invoke-direct {p0, p1, p2, p3}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
invoke-direct {p0}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->initHome()V
return-void
.end method
.method static synthetic access$000(Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;)Z
.registers 2
iget-boolean v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->loadingMoreEnabled:Z
return v0
.end method
.method static synthetic access$100(Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;)Z
.registers 2
iget-boolean v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->loadingMoreEnabled:Z
return v0
.end method
.method static synthetic access$200()Ljava/util/List;
.registers 1
sget-object v0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->sHeaderTypes:Ljava/util/List;
return-object v0
.end method
.method static synthetic access$300(Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;I)Z
.registers 3
invoke-virtual {p0, p1}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->isReservedItemViewType(I)Z
move-result v0
return v0
.end method
.method private initHome()V
.registers 3
const/4 v0, 0x0
invoke-virtual {p0, v0, v0}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->setFootViewText(Ljava/lang/String;Ljava/lang/String;)V
new-instance v0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRefreshHeader;
invoke-virtual {p0}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->getContext()Landroid/content/Context;
move-result-object v1
invoke-direct {v0, v1}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRefreshHeader;-><init>(Landroid/content/Context;)V
invoke-virtual {p0, v0}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->setRefreshHeader(Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/BaseRefreshHeader;)V
return-void
.end method
.method private isOnBottom()Z
.registers 3
invoke-virtual {p0}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->getLayoutManager()Landroid/support/v7/widget/RecyclerView$LayoutManager;
move-result-object v0
instance-of v1, v0, Landroid/support/v7/widget/GridLayoutManager;
if-eqz v1, :cond_21
check-cast v0, Landroid/support/v7/widget/GridLayoutManager;
invoke-virtual {v0}, Landroid/support/v7/widget/GridLayoutManager;->findLastCompletelyVisibleItemPosition()I
move-result v0
:goto_e
iget-object v1, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mWrapAdapter:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$WrapAdapter;
invoke-virtual {v1}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$WrapAdapter;->getHeadersCount()I
move-result v1
add-int/2addr v0, v1
add-int/lit8 v0, v0, 0x2
iget-object v1, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mWrapAdapter:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$WrapAdapter;
invoke-virtual {v1}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$WrapAdapter;->getItemCount()I
move-result v1
if-ne v0, v1, :cond_3f
const/4 v0, 0x1
:goto_20
return v0
:cond_21
instance-of v1, v0, Landroid/support/v7/widget/StaggeredGridLayoutManager;
if-eqz v1, :cond_38
move-object v1, v0
check-cast v1, Landroid/support/v7/widget/StaggeredGridLayoutManager;
invoke-virtual {v1}, Landroid/support/v7/widget/StaggeredGridLayoutManager;->getSpanCount()I
move-result v1
new-array v1, v1, [I
check-cast v0, Landroid/support/v7/widget/StaggeredGridLayoutManager;
invoke-virtual {v0, v1}, Landroid/support/v7/widget/StaggeredGridLayoutManager;->findLastCompletelyVisibleItemPositions([I)[I
invoke-virtual {p0, v1}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->findMax([I)I
move-result v0
goto :goto_e
:cond_38
check-cast v0, Landroid/support/v7/widget/LinearLayoutManager;
invoke-virtual {v0}, Landroid/support/v7/widget/LinearLayoutManager;->findLastCompletelyVisibleItemPosition()I
move-result v0
goto :goto_e
:cond_3f
const/4 v0, 0x0
goto :goto_20
.end method
# virtual methods
.method public dispatchTouchEvent(Landroid/view/MotionEvent;)Z
.registers 7
const/4 v0, 0x0
const/high16 v4, 0x40400000 # 3.0f
const/high16 v2, -0x40800000 # -1.0f
iget v1, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mLastY:F
cmpl-float v1, v1, v2
if-nez v1, :cond_11
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F
move-result v1
iput v1, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mLastY:F
:cond_11
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v1
packed-switch v1, :pswitch_data_74
:pswitch_18
iput v2, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mLastY:F
invoke-direct {p0}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->isOnBottom()Z
move-result v0
if-eqz v0, :cond_3b
iget-boolean v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->pullRefreshEnabled:Z
if-eqz v0, :cond_3b
iget-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->appbarState:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/AppBarStateChangeListener$State;
sget-object v1, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/AppBarStateChangeListener$State;->EXPANDED:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/AppBarStateChangeListener$State;
if-ne v0, v1, :cond_3b
iget-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mRefreshHeader:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/BaseRefreshHeader;
invoke-virtual {v0}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/BaseRefreshHeader;->releaseAction()Z
move-result v0
if-eqz v0, :cond_3b
iget-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mLoadingListener:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$LoadingListener;
if-eqz v0, :cond_3b
iget-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mLoadingListener:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$LoadingListener;
invoke-interface {v0}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$LoadingListener;->onRefresh()V
:cond_3b
:goto_3b
invoke-super {p0, p1}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView;->dispatchTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
:goto_3f
return v0
:pswitch_40
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F
move-result v0
iput v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mLastY:F
goto :goto_3b
:pswitch_47
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F
move-result v1
iget v2, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mLastY:F
sub-float/2addr v1, v2
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F
move-result v2
iput v2, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mLastY:F
iget-object v2, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mRefreshHeader:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/BaseRefreshHeader;
invoke-virtual {v2}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/BaseRefreshHeader;->getParent()Landroid/view/ViewParent;
move-result-object v2
if-eqz v2, :cond_3b
iget-boolean v2, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->pullRefreshEnabled:Z
if-eqz v2, :cond_3b
iget-object v2, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->appbarState:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/AppBarStateChangeListener$State;
sget-object v3, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/AppBarStateChangeListener$State;->EXPANDED:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/AppBarStateChangeListener$State;
if-ne v2, v3, :cond_3b
iget-object v2, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mRefreshHeader:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/BaseRefreshHeader;
div-float v3, v1, v4
invoke-virtual {v2, v3}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/BaseRefreshHeader;->onMove(F)V
div-float/2addr v1, v4
neg-float v1, v1
float-to-int v1, v1
invoke-virtual {p0, v0, v1}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->scrollBy(II)V
goto :goto_3f
:pswitch_data_74
.packed-switch 0x0
:pswitch_40
:pswitch_18
:pswitch_47
.end packed-switch
.end method
.method public onScrollStateChanged(I)V
.registers 6
const/4 v3, 0x0
if-nez p1, :cond_48
iget-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mLoadingListener:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$LoadingListener;
if-eqz v0, :cond_48
iget-boolean v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->isLoadingData:Z
if-nez v0, :cond_48
iget-boolean v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->loadingMoreEnabled:Z
if-eqz v0, :cond_48
invoke-virtual {p0}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->getLayoutManager()Landroid/support/v7/widget/RecyclerView$LayoutManager;
move-result-object v1
instance-of v0, v1, Landroid/support/v7/widget/GridLayoutManager;
if-eqz v0, :cond_49
move-object v0, v1
check-cast v0, Landroid/support/v7/widget/GridLayoutManager;
invoke-virtual {v0}, Landroid/support/v7/widget/GridLayoutManager;->findFirstVisibleItemPosition()I
move-result v0
:goto_1e
invoke-virtual {v1}, Landroid/support/v7/widget/RecyclerView$LayoutManager;->getChildCount()I
move-result v1
if-lez v1, :cond_48
if-gtz v0, :cond_48
iget-boolean v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->isNoMore:Z
if-nez v0, :cond_48
iget-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mRefreshHeader:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/BaseRefreshHeader;
invoke-virtual {v0}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/BaseRefreshHeader;->getState()I
move-result v0
const/4 v1, 0x2
if-ge v0, v1, :cond_48
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->isLoadingData:Z
iget-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mFootView:Landroid/view/View;
instance-of v0, v0, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/LoadingMoreFooter;
if-eqz v0, :cond_69
iget-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mFootView:Landroid/view/View;
check-cast v0, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/LoadingMoreFooter;
invoke-virtual {v0, v3}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/LoadingMoreFooter;->setState(I)V
:goto_43
iget-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mLoadingListener:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$LoadingListener;
invoke-interface {v0}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$LoadingListener;->onLoadMore()V
:cond_48
return-void
:cond_49
instance-of v0, v1, Landroid/support/v7/widget/StaggeredGridLayoutManager;
if-eqz v0, :cond_61
move-object v0, v1
check-cast v0, Landroid/support/v7/widget/StaggeredGridLayoutManager;
invoke-virtual {v0}, Landroid/support/v7/widget/StaggeredGridLayoutManager;->getSpanCount()I
move-result v0
new-array v2, v0, [I
move-object v0, v1
check-cast v0, Landroid/support/v7/widget/StaggeredGridLayoutManager;
invoke-virtual {v0, v2}, Landroid/support/v7/widget/StaggeredGridLayoutManager;->findFirstVisibleItemPositions([I)[I
invoke-virtual {p0, v2}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->findMax([I)I
move-result v0
goto :goto_1e
:cond_61
move-object v0, v1
check-cast v0, Landroid/support/v7/widget/LinearLayoutManager;
invoke-virtual {v0}, Landroid/support/v7/widget/LinearLayoutManager;->findFirstVisibleItemPosition()I
move-result v0
goto :goto_1e
:cond_69
iget-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mFootView:Landroid/view/View;
invoke-virtual {v0, v3}, Landroid/view/View;->setVisibility(I)V
goto :goto_43
.end method
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.registers 3
invoke-super {p0, p1}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
return v0
.end method
.method public setAdapter(Landroid/support/v7/widget/RecyclerView$Adapter;)V
.registers 3
new-instance v0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView$HomeWrapAdapter;
invoke-direct {v0, p0, p1}, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView$HomeWrapAdapter;-><init>(Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;Landroid/support/v7/widget/RecyclerView$Adapter;)V
iput-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mWrapAdapter:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$WrapAdapter;
iget-object v0, p0, Lcom/sdk/orion/ui/baselibrary/widget/HomeRecyclerView;->mWrapAdapter:Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView$WrapAdapter;
invoke-super {p0, v0}, Lcom/sdk/orion/ui/baselibrary/widget/xrecyclerview/XRecyclerView;->setAdapter(Landroid/support/v7/widget/RecyclerView$Adapter;)V
return-void
.end method