FragmentPagerAdapter.java
3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package android.support.v4.app;
import android.os.Parcelable;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
public abstract class FragmentPagerAdapter
extends PagerAdapter
{
private final FragmentManager a;
private FragmentTransaction b = null;
private Fragment c = null;
public FragmentPagerAdapter(FragmentManager paramFragmentManager)
{
this.a = paramFragmentManager;
}
private static String a(int paramInt, long paramLong)
{
return "android:switcher:" + paramInt + ":" + paramLong;
}
public void destroyItem(ViewGroup paramViewGroup, int paramInt, Object paramObject)
{
if (this.b == null) {
this.b = this.a.beginTransaction();
}
this.b.detach((Fragment)paramObject);
}
public void finishUpdate(ViewGroup paramViewGroup)
{
if (this.b != null)
{
this.b.commitNowAllowingStateLoss();
this.b = null;
}
}
public abstract Fragment getItem(int paramInt);
public long getItemId(int paramInt)
{
return paramInt;
}
public Object instantiateItem(ViewGroup paramViewGroup, int paramInt)
{
if (this.b == null) {
this.b = this.a.beginTransaction();
}
long l = getItemId(paramInt);
Object localObject = a(paramViewGroup.getId(), l);
localObject = this.a.findFragmentByTag((String)localObject);
if (localObject != null) {
this.b.attach((Fragment)localObject);
}
for (paramViewGroup = (ViewGroup)localObject;; paramViewGroup = (ViewGroup)localObject)
{
if (paramViewGroup != this.c)
{
paramViewGroup.setMenuVisibility(false);
paramViewGroup.setUserVisibleHint(false);
}
return paramViewGroup;
localObject = getItem(paramInt);
this.b.add(paramViewGroup.getId(), (Fragment)localObject, a(paramViewGroup.getId(), l));
}
}
public boolean isViewFromObject(View paramView, Object paramObject)
{
return ((Fragment)paramObject).getView() == paramView;
}
public void restoreState(Parcelable paramParcelable, ClassLoader paramClassLoader) {}
public Parcelable saveState()
{
return null;
}
public void setPrimaryItem(ViewGroup paramViewGroup, int paramInt, Object paramObject)
{
paramViewGroup = (Fragment)paramObject;
if (paramViewGroup != this.c)
{
if (this.c != null)
{
this.c.setMenuVisibility(false);
this.c.setUserVisibleHint(false);
}
if (paramViewGroup != null)
{
paramViewGroup.setMenuVisibility(true);
paramViewGroup.setUserVisibleHint(true);
}
this.c = paramViewGroup;
}
}
public void startUpdate(ViewGroup paramViewGroup)
{
if (paramViewGroup.getId() == -1) {
throw new IllegalStateException("ViewPager with adapter " + this + " requires a view id");
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/app/FragmentPagerAdapter.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/