ButtonBarLayout.java
4.98 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
package android.support.v7.widget;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.os.Build.VERSION;
import android.support.annotation.RestrictTo;
import android.support.v4.content.res.ConfigurationHelper;
import android.support.v4.view.ViewCompat;
import android.support.v7.appcompat.R.id;
import android.support.v7.appcompat.R.styleable;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.View.MeasureSpec;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public class ButtonBarLayout
extends LinearLayout
{
private boolean a;
private int b = -1;
public ButtonBarLayout(Context paramContext, AttributeSet paramAttributeSet)
{
super(paramContext, paramAttributeSet);
if (ConfigurationHelper.getScreenHeightDp(getResources()) >= 320) {}
for (boolean bool = true;; bool = false)
{
paramContext = paramContext.obtainStyledAttributes(paramAttributeSet, R.styleable.ButtonBarLayout);
this.a = paramContext.getBoolean(R.styleable.ButtonBarLayout_allowStacking, bool);
paramContext.recycle();
return;
}
}
private int a(int paramInt)
{
int i = getChildCount();
while (paramInt < i)
{
if (getChildAt(paramInt).getVisibility() == 0) {
return paramInt;
}
paramInt += 1;
}
return -1;
}
private boolean a()
{
return getOrientation() == 1;
}
private void setStacked(boolean paramBoolean)
{
label17:
View localView;
if (paramBoolean)
{
i = 1;
setOrientation(i);
if (!paramBoolean) {
break label78;
}
i = 5;
setGravity(i);
localView = findViewById(R.id.spacer);
if (localView != null) {
if (!paramBoolean) {
break label84;
}
}
}
label78:
label84:
for (int i = 8;; i = 4)
{
localView.setVisibility(i);
i = getChildCount() - 2;
while (i >= 0)
{
bringChildToFront(getChildAt(i));
i -= 1;
}
i = 0;
break;
i = 80;
break label17;
}
}
protected void onMeasure(int paramInt1, int paramInt2)
{
int m = View.MeasureSpec.getSize(paramInt1);
if (this.a)
{
if ((m > this.b) && (a())) {
setStacked(false);
}
this.b = m;
}
int i;
int j;
int k;
if ((!a()) && (View.MeasureSpec.getMode(paramInt1) == 1073741824))
{
i = View.MeasureSpec.makeMeasureSpec(m, Integer.MIN_VALUE);
j = 1;
super.onMeasure(i, paramInt2);
k = j;
if (this.a)
{
k = j;
if (!a())
{
if (Build.VERSION.SDK_INT < 11) {
break label280;
}
if ((ViewCompat.getMeasuredWidthAndState(this) & 0xFF000000) != 16777216) {
break label275;
}
i = 1;
label117:
k = j;
if (i != 0)
{
setStacked(true);
k = 1;
}
}
}
if (k != 0) {
super.onMeasure(paramInt1, paramInt2);
}
paramInt1 = a(0);
if (paramInt1 < 0) {
break label354;
}
View localView = getChildAt(paramInt1);
LinearLayout.LayoutParams localLayoutParams = (LinearLayout.LayoutParams)localView.getLayoutParams();
paramInt2 = getPaddingTop();
i = localView.getMeasuredHeight();
j = localLayoutParams.topMargin;
paramInt2 = localLayoutParams.bottomMargin + (i + paramInt2 + j) + 0;
if (!a()) {
break label344;
}
i = a(paramInt1 + 1);
paramInt1 = paramInt2;
if (i >= 0) {
paramInt1 = (int)(paramInt2 + (getChildAt(i).getPaddingTop() + 16.0F * getResources().getDisplayMetrics().density));
}
}
for (;;)
{
if (ViewCompat.getMinimumHeight(this) != paramInt1) {
setMinimumHeight(paramInt1);
}
return;
i = paramInt1;
j = 0;
break;
label275:
i = 0;
break label117;
label280:
int n = getChildCount();
i = 0;
k = 0;
while (i < n)
{
k += getChildAt(i).getMeasuredWidth();
i += 1;
}
if (getPaddingLeft() + k + getPaddingRight() > m)
{
i = 1;
break label117;
}
i = 0;
break label117;
label344:
paramInt1 = paramInt2 + getPaddingBottom();
continue;
label354:
paramInt1 = 0;
}
}
public void setAllowStacking(boolean paramBoolean)
{
if (this.a != paramBoolean)
{
this.a = paramBoolean;
if ((!this.a) && (getOrientation() == 1)) {
setStacked(false);
}
requestLayout();
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/widget/ButtonBarLayout.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/