.class public Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;
.super Landroid/support/v4/view/PagerAdapter;
.source "AppStoreCycleSlipPagerAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$FixedSpeedScroller;,
        Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$MyHandler;
    }
.end annotation


# instance fields
.field private final a:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/moji/mjappstore/data/AppStoreHeaderData;",
            ">;"
        }
    .end annotation
.end field

.field private final b:Lcom/moji/viewpager/CycleSlipViewPager;

.field private final c:Lcom/moji/emotion/CityIndexControlView;

.field private d:Ljava/util/Timer;

.field private final e:Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$MyHandler;

.field private f:Z

.field private g:I

.field private h:I

.field private i:Z


# direct methods
.method public constructor <init>(Ljava/util/List;Lcom/moji/viewpager/CycleSlipViewPager;Lcom/moji/emotion/CityIndexControlView;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lcom/moji/mjappstore/data/AppStoreHeaderData;",
            ">;",
            "Lcom/moji/viewpager/CycleSlipViewPager;",
            "Lcom/moji/emotion/CityIndexControlView;",
            ")V"
        }
    .end annotation

    .line 49
    invoke-direct {p0}, Landroid/support/v4/view/PagerAdapter;-><init>()V

    const/4 v0, 0x0

    .line 35
    iput-boolean v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->f:Z

    .line 37
    iput v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->h:I

    .line 38
    iput-boolean v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->i:Z

    .line 50
    iput-object p1, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

    .line 51
    iput-object p2, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->b:Lcom/moji/viewpager/CycleSlipViewPager;

    .line 52
    iput-object p3, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->c:Lcom/moji/emotion/CityIndexControlView;

    .line 53
    new-instance p1, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$MyHandler;

    const/4 p2, 0x0

    invoke-direct {p1, p0, p2}, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$MyHandler;-><init>(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$1;)V

    iput-object p1, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->e:Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$MyHandler;

    .line 54
    iget-object p1, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->b:Lcom/moji/viewpager/CycleSlipViewPager;

    if-eqz p1, :cond_0

    .line 55
    invoke-direct {p0}, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->b()V

    :cond_0
    return-void
.end method

.method static synthetic a(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;)Lcom/moji/emotion/CityIndexControlView;
    .locals 0

    .line 27
    iget-object p0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->c:Lcom/moji/emotion/CityIndexControlView;

    return-object p0
.end method

.method static synthetic a(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;Z)Z
    .locals 0

    .line 27
    iput-boolean p1, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->i:Z

    return p1
.end method

.method static synthetic b(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;)I
    .locals 0

    .line 27
    iget p0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->h:I

    return p0
.end method

.method private b()V
    .locals 5

    .line 60
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->b:Lcom/moji/viewpager/CycleSlipViewPager;

    new-instance v1, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$1;

    invoke-direct {v1, p0}, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$1;-><init>(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;)V

    invoke-virtual {v0, v1}, Lcom/moji/viewpager/CycleSlipViewPager;->setOnPageChangeListener(Landroid/support/v4/view/ViewPager$OnPageChangeListener;)V

    .line 89
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->b:Lcom/moji/viewpager/CycleSlipViewPager;

    new-instance v1, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$2;

    invoke-direct {v1, p0}, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$2;-><init>(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;)V

    invoke-virtual {v0, v1}, Lcom/moji/viewpager/CycleSlipViewPager;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

    .line 110
    :try_start_0
    const-class v0, Landroid/support/v4/view/ViewPager;

    const-string v1, "mScroller"

    invoke-virtual {v0, v1}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;

    move-result-object v0

    const/4 v1, 0x1

    .line 111
    invoke-virtual {v0, v1}, Ljava/lang/reflect/Field;->setAccessible(Z)V

    .line 112
    new-instance v1, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$FixedSpeedScroller;

    iget-object v2, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->b:Lcom/moji/viewpager/CycleSlipViewPager;

    invoke-virtual {v2}, Lcom/moji/viewpager/CycleSlipViewPager;->getContext()Landroid/content/Context;

    move-result-object v2

    new-instance v3, Landroid/view/animation/DecelerateInterpolator;

    const/high16 v4, 0x40000000    # 2.0f

    invoke-direct {v3, v4}, Landroid/view/animation/DecelerateInterpolator;-><init>(F)V

    invoke-direct {v1, p0, v2, v3}, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$FixedSpeedScroller;-><init>(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;Landroid/content/Context;Landroid/view/animation/Interpolator;)V

    .line 113
    iget-object v2, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->b:Lcom/moji/viewpager/CycleSlipViewPager;

    invoke-virtual {v0, v2, v1}, Ljava/lang/reflect/Field;->set(Ljava/lang/Object;Ljava/lang/Object;)V
    :try_end_0
    .catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_0} :catch_2
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    const-string v1, "CycleSlipPagerAdapter"

    .line 119
    invoke-static {v1, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_0

    :catch_1
    move-exception v0

    const-string v1, "CycleSlipPagerAdapter"

    .line 117
    invoke-static {v1, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_0

    :catch_2
    move-exception v0

    const-string v1, "CycleSlipPagerAdapter"

    .line 115
    invoke-static {v1, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    :goto_0
    return-void
.end method

.method static synthetic b(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;Z)Z
    .locals 0

    .line 27
    iput-boolean p1, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->f:Z

    return p1
.end method

.method static synthetic c(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;)Ljava/util/List;
    .locals 0

    .line 27
    iget-object p0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

    return-object p0
.end method

.method static synthetic d(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;)Z
    .locals 0

    .line 27
    iget-boolean p0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->i:Z

    return p0
.end method

.method static synthetic e(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;)Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$MyHandler;
    .locals 0

    .line 27
    iget-object p0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->e:Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$MyHandler;

    return-object p0
.end method

.method static synthetic f(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;)Lcom/moji/viewpager/CycleSlipViewPager;
    .locals 0

    .line 27
    iget-object p0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->b:Lcom/moji/viewpager/CycleSlipViewPager;

    return-object p0
.end method

.method static synthetic g(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;)Z
    .locals 0

    .line 27
    iget-boolean p0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->f:Z

    return p0
.end method


# virtual methods
.method public a()V
    .locals 1

    .line 185
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->d:Ljava/util/Timer;

    if-eqz v0, :cond_0

    .line 186
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->d:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    const/4 v0, 0x0

    .line 187
    iput-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->d:Ljava/util/Timer;

    :cond_0
    return-void
.end method

.method public a(I)V
    .locals 7

    .line 171
    iput p1, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->g:I

    .line 172
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->d:Ljava/util/Timer;

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

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

    move-result v0

    const/4 v1, 0x1

    if-le v0, v1, :cond_0

    .line 173
    new-instance v0, Ljava/util/Timer;

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

    iput-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->d:Ljava/util/Timer;

    .line 174
    iget-object v1, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->d:Ljava/util/Timer;

    new-instance v2, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$3;

    invoke-direct {v2, p0}, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter$3;-><init>(Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;)V

    int-to-long v5, p1

    move-wide v3, v5

    invoke-virtual/range {v1 .. v6}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;JJ)V

    :cond_0
    return-void
.end method

.method public destroyItem(Landroid/view/ViewGroup;ILjava/lang/Object;)V
    .locals 0

    .line 141
    iget-object p2, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

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

    move-result p2

    if-nez p2, :cond_0

    .line 142
    invoke-virtual {p1}, Landroid/view/ViewGroup;->removeAllViews()V

    :cond_0
    return-void
.end method

.method public getCount()I
    .locals 2

    .line 130
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

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

    move-result v0

    const/4 v1, 0x1

    if-le v0, v1, :cond_0

    const v0, 0x7fffffff

    goto :goto_0

    :cond_0
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

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

    move-result v0

    :goto_0
    return v0
.end method

.method public getItemPosition(Ljava/lang/Object;)I
    .locals 0

    const/4 p1, -0x2

    return p1
.end method

.method public instantiateItem(Landroid/view/ViewGroup;I)Ljava/lang/Object;
    .locals 4

    .line 148
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

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

    move-result v0

    const/4 v1, 0x0

    const/4 v2, 0x1

    if-le v0, v2, :cond_1

    .line 149
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

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

    move-result v0

    rem-int v0, p2, v0

    .line 150
    iget-object v2, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

    invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/moji/mjappstore/data/AppStoreHeaderData;

    iget-object v2, v2, Lcom/moji/mjappstore/data/AppStoreHeaderData;->headerObject:Ljava/lang/Object;

    check-cast v2, Landroid/view/View;

    .line 151
    invoke-virtual {v2}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v3

    if-eqz v3, :cond_0

    .line 152
    invoke-virtual {v2}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v3

    check-cast v3, Landroid/support/v4/view/ViewPager;

    invoke-virtual {v3, v2}, Landroid/support/v4/view/ViewPager;->removeView(Landroid/view/View;)V

    .line 155
    :cond_0
    iget-object v2, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

    invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/mjappstore/data/AppStoreHeaderData;

    iget-object v0, v0, Lcom/moji/mjappstore/data/AppStoreHeaderData;->headerObject:Ljava/lang/Object;

    check-cast v0, Landroid/view/View;

    invoke-virtual {p1, v0, v1}, Landroid/view/ViewGroup;->addView(Landroid/view/View;I)V

    .line 157
    iget-object p1, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

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

    move-result v0

    rem-int/2addr p2, v0

    invoke-interface {p1, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/moji/mjappstore/data/AppStoreHeaderData;

    iget-object p1, p1, Lcom/moji/mjappstore/data/AppStoreHeaderData;->headerObject:Ljava/lang/Object;

    return-object p1

    .line 159
    :cond_1
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

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

    move-result v0

    if-lez v0, :cond_2

    if-ltz p2, :cond_2

    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

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

    move-result v0

    if-ge p2, v0, :cond_2

    .line 160
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

    invoke-interface {v0, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/mjappstore/data/AppStoreHeaderData;

    iget-object v0, v0, Lcom/moji/mjappstore/data/AppStoreHeaderData;->headerObject:Ljava/lang/Object;

    check-cast v0, Landroid/view/View;

    if-eqz v0, :cond_2

    .line 161
    invoke-virtual {v0}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v2

    if-eqz v2, :cond_2

    .line 162
    invoke-virtual {v0}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v2

    check-cast v2, Landroid/support/v4/view/ViewPager;

    invoke-virtual {v2, v0}, Landroid/support/v4/view/ViewPager;->removeView(Landroid/view/View;)V

    .line 165
    :cond_2
    iget-object v0, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

    invoke-interface {v0, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/mjappstore/data/AppStoreHeaderData;

    iget-object v0, v0, Lcom/moji/mjappstore/data/AppStoreHeaderData;->headerObject:Ljava/lang/Object;

    check-cast v0, Landroid/view/View;

    invoke-virtual {p1, v0, v1}, Landroid/view/ViewGroup;->addView(Landroid/view/View;I)V

    .line 166
    iget-object p1, p0, Lcom/moji/mjappstore/adapter/AppStoreCycleSlipPagerAdapter;->a:Ljava/util/List;

    invoke-interface {p1, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/moji/mjappstore/data/AppStoreHeaderData;

    iget-object p1, p1, Lcom/moji/mjappstore/data/AppStoreHeaderData;->headerObject:Ljava/lang/Object;

    return-object p1
.end method

.method public isViewFromObject(Landroid/view/View;Ljava/lang/Object;)Z
    .locals 0

    if-ne p1, p2, :cond_0

    const/4 p1, 0x1

    goto :goto_0

    :cond_0
    const/4 p1, 0x0

    :goto_0
    return p1
.end method
