BottomSheetDialog.java
6.02 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
package android.support.design.widget;
import android.content.Context;
import android.content.DialogInterface.OnCancelListener;
import android.content.res.TypedArray;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.StyleRes;
import android.support.design.R.id;
import android.support.design.R.layout;
import android.support.v4.view.AccessibilityDelegateCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat;
import android.support.v7.app.AppCompatDialog;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.widget.FrameLayout;
public class BottomSheetDialog
extends AppCompatDialog
{
boolean a = true;
boolean b = true;
boolean c;
private BottomSheetBehavior<FrameLayout> d;
private BottomSheetBehavior.BottomSheetCallback e = new BottomSheetBehavior.BottomSheetCallback()
{
public final void onSlide(@NonNull View paramAnonymousView, float paramAnonymousFloat) {}
public final void onStateChanged(@NonNull View paramAnonymousView, int paramAnonymousInt)
{
if (paramAnonymousInt == 5) {
BottomSheetDialog.this.cancel();
}
}
};
public BottomSheetDialog(@NonNull Context paramContext)
{
this(paramContext, 0);
}
public BottomSheetDialog(@NonNull Context paramContext, @StyleRes int paramInt) {}
protected BottomSheetDialog(@NonNull Context paramContext, boolean paramBoolean, DialogInterface.OnCancelListener paramOnCancelListener)
{
super(paramContext, paramBoolean, paramOnCancelListener);
supportRequestWindowFeature(1);
this.a = paramBoolean;
}
private View a(int paramInt, View paramView, ViewGroup.LayoutParams paramLayoutParams)
{
CoordinatorLayout localCoordinatorLayout = (CoordinatorLayout)View.inflate(getContext(), R.layout.design_bottom_sheet_dialog, null);
View localView = paramView;
if (paramInt != 0)
{
localView = paramView;
if (paramView == null) {
localView = getLayoutInflater().inflate(paramInt, localCoordinatorLayout, false);
}
}
paramView = (FrameLayout)localCoordinatorLayout.findViewById(R.id.design_bottom_sheet);
this.d = BottomSheetBehavior.from(paramView);
this.d.setBottomSheetCallback(this.e);
this.d.setHideable(this.a);
if (paramLayoutParams == null) {
paramView.addView(localView);
}
for (;;)
{
localCoordinatorLayout.findViewById(R.id.touch_outside).setOnClickListener(new View.OnClickListener()
{
public final void onClick(View paramAnonymousView)
{
if ((BottomSheetDialog.this.a) && (BottomSheetDialog.this.isShowing()))
{
paramAnonymousView = BottomSheetDialog.this;
if (!paramAnonymousView.c)
{
if (Build.VERSION.SDK_INT >= 11) {
break label65;
}
paramAnonymousView.b = true;
}
}
for (;;)
{
paramAnonymousView.c = true;
if (paramAnonymousView.b) {
BottomSheetDialog.this.cancel();
}
return;
label65:
TypedArray localTypedArray = paramAnonymousView.getContext().obtainStyledAttributes(new int[] { 16843611 });
paramAnonymousView.b = localTypedArray.getBoolean(0, true);
localTypedArray.recycle();
}
}
});
ViewCompat.setAccessibilityDelegate(paramView, new AccessibilityDelegateCompat()
{
public final void onInitializeAccessibilityNodeInfo(View paramAnonymousView, AccessibilityNodeInfoCompat paramAnonymousAccessibilityNodeInfoCompat)
{
super.onInitializeAccessibilityNodeInfo(paramAnonymousView, paramAnonymousAccessibilityNodeInfoCompat);
if (BottomSheetDialog.this.a)
{
paramAnonymousAccessibilityNodeInfoCompat.addAction(1048576);
paramAnonymousAccessibilityNodeInfoCompat.setDismissable(true);
return;
}
paramAnonymousAccessibilityNodeInfoCompat.setDismissable(false);
}
public final boolean performAccessibilityAction(View paramAnonymousView, int paramAnonymousInt, Bundle paramAnonymousBundle)
{
if ((paramAnonymousInt == 1048576) && (BottomSheetDialog.this.a))
{
BottomSheetDialog.this.cancel();
return true;
}
return super.performAccessibilityAction(paramAnonymousView, paramAnonymousInt, paramAnonymousBundle);
}
});
return localCoordinatorLayout;
paramView.addView(localView, paramLayoutParams);
}
}
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
getWindow().setLayout(-1, -1);
}
public void setCancelable(boolean paramBoolean)
{
super.setCancelable(paramBoolean);
if (this.a != paramBoolean)
{
this.a = paramBoolean;
if (this.d != null) {
this.d.setHideable(paramBoolean);
}
}
}
public void setCanceledOnTouchOutside(boolean paramBoolean)
{
super.setCanceledOnTouchOutside(paramBoolean);
if ((paramBoolean) && (!this.a)) {
this.a = true;
}
this.b = paramBoolean;
this.c = true;
}
public void setContentView(@LayoutRes int paramInt)
{
super.setContentView(a(paramInt, null, null));
}
public void setContentView(View paramView)
{
super.setContentView(a(0, paramView, null));
}
public void setContentView(View paramView, ViewGroup.LayoutParams paramLayoutParams)
{
super.setContentView(a(0, paramView, paramLayoutParams));
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/design/widget/BottomSheetDialog.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/