ViewStubCompat.java
4.38 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
package android.support.v7.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.support.annotation.RestrictTo;
import android.support.v7.appcompat.R.styleable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import java.lang.ref.WeakReference;
@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public final class ViewStubCompat
extends View
{
private int a = 0;
private int b;
private WeakReference<View> c;
private LayoutInflater d;
private OnInflateListener e;
public ViewStubCompat(Context paramContext, AttributeSet paramAttributeSet)
{
this(paramContext, paramAttributeSet, 0);
}
public ViewStubCompat(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
super(paramContext, paramAttributeSet, paramInt);
paramContext = paramContext.obtainStyledAttributes(paramAttributeSet, R.styleable.ViewStubCompat, paramInt, 0);
this.b = paramContext.getResourceId(R.styleable.ViewStubCompat_android_inflatedId, -1);
this.a = paramContext.getResourceId(R.styleable.ViewStubCompat_android_layout, 0);
setId(paramContext.getResourceId(R.styleable.ViewStubCompat_android_id, -1));
paramContext.recycle();
setVisibility(8);
setWillNotDraw(true);
}
protected final void dispatchDraw(Canvas paramCanvas) {}
public final void draw(Canvas paramCanvas) {}
public final int getInflatedId()
{
return this.b;
}
public final LayoutInflater getLayoutInflater()
{
return this.d;
}
public final int getLayoutResource()
{
return this.a;
}
public final View inflate()
{
Object localObject = getParent();
if ((localObject != null) && ((localObject instanceof ViewGroup)))
{
if (this.a != 0)
{
ViewGroup localViewGroup = (ViewGroup)localObject;
int i;
if (this.d != null)
{
localObject = this.d;
localObject = ((LayoutInflater)localObject).inflate(this.a, localViewGroup, false);
if (this.b != -1) {
((View)localObject).setId(this.b);
}
i = localViewGroup.indexOfChild(this);
localViewGroup.removeViewInLayout(this);
ViewGroup.LayoutParams localLayoutParams = getLayoutParams();
if (localLayoutParams == null) {
break label140;
}
localViewGroup.addView((View)localObject, i, localLayoutParams);
}
for (;;)
{
this.c = new WeakReference(localObject);
if (this.e != null) {
this.e.onInflate(this, (View)localObject);
}
return (View)localObject;
localObject = LayoutInflater.from(getContext());
break;
label140:
localViewGroup.addView((View)localObject, i);
}
}
throw new IllegalArgumentException("ViewStub must have a valid layoutResource");
}
throw new IllegalStateException("ViewStub must have a non-null ViewGroup viewParent");
}
protected final void onMeasure(int paramInt1, int paramInt2)
{
setMeasuredDimension(0, 0);
}
public final void setInflatedId(int paramInt)
{
this.b = paramInt;
}
public final void setLayoutInflater(LayoutInflater paramLayoutInflater)
{
this.d = paramLayoutInflater;
}
public final void setLayoutResource(int paramInt)
{
this.a = paramInt;
}
public final void setOnInflateListener(OnInflateListener paramOnInflateListener)
{
this.e = paramOnInflateListener;
}
public final void setVisibility(int paramInt)
{
if (this.c != null)
{
View localView = (View)this.c.get();
if (localView != null) {
localView.setVisibility(paramInt);
}
}
do
{
return;
throw new IllegalStateException("setVisibility called on un-referenced view");
super.setVisibility(paramInt);
} while ((paramInt != 0) && (paramInt != 4));
inflate();
}
public static abstract interface OnInflateListener
{
public abstract void onInflate(ViewStubCompat paramViewStubCompat, View paramView);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/widget/ViewStubCompat.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/