AppCompatPopupWindow.java
4.46 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
package android.support.v7.widget;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build.VERSION;
import android.support.annotation.AttrRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StyleRes;
import android.support.v4.widget.PopupWindowCompat;
import android.support.v7.appcompat.R.styleable;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewTreeObserver.OnScrollChangedListener;
import android.widget.PopupWindow;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
class AppCompatPopupWindow
extends PopupWindow
{
private static final boolean a;
private boolean b;
static
{
if (Build.VERSION.SDK_INT < 21) {}
for (boolean bool = true;; bool = false)
{
a = bool;
return;
}
}
public AppCompatPopupWindow(@NonNull Context paramContext, @Nullable AttributeSet paramAttributeSet, @AttrRes int paramInt)
{
super(paramContext, paramAttributeSet, paramInt);
a(paramContext, paramAttributeSet, paramInt, 0);
}
@TargetApi(11)
public AppCompatPopupWindow(@NonNull Context paramContext, @Nullable AttributeSet paramAttributeSet, @AttrRes int paramInt1, @StyleRes int paramInt2)
{
super(paramContext, paramAttributeSet, paramInt1, paramInt2);
a(paramContext, paramAttributeSet, paramInt1, paramInt2);
}
private void a(Context paramContext, AttributeSet paramAttributeSet, int paramInt1, int paramInt2)
{
paramContext = TintTypedArray.obtainStyledAttributes(paramContext, paramAttributeSet, R.styleable.PopupWindow, paramInt1, paramInt2);
boolean bool;
if (paramContext.hasValue(R.styleable.PopupWindow_overlapAnchor))
{
bool = paramContext.getBoolean(R.styleable.PopupWindow_overlapAnchor, false);
if (!a) {
break label153;
}
this.b = bool;
}
for (;;)
{
setBackgroundDrawable(paramContext.getDrawable(R.styleable.PopupWindow_android_popupBackground));
paramInt1 = Build.VERSION.SDK_INT;
if ((paramInt2 != 0) && (paramInt1 < 11) && (paramContext.hasValue(R.styleable.PopupWindow_android_popupAnimationStyle))) {
setAnimationStyle(paramContext.getResourceId(R.styleable.PopupWindow_android_popupAnimationStyle, -1));
}
paramContext.recycle();
if (Build.VERSION.SDK_INT < 14) {}
label153:
try
{
paramContext = PopupWindow.class.getDeclaredField("mAnchor");
paramContext.setAccessible(true);
paramAttributeSet = PopupWindow.class.getDeclaredField("mOnScrollChangedListener");
paramAttributeSet.setAccessible(true);
paramAttributeSet.set(this, new ViewTreeObserver.OnScrollChangedListener()
{
public final void onScrollChanged()
{
try
{
WeakReference localWeakReference = (WeakReference)this.a.get(jdField_this);
if (localWeakReference != null)
{
if (localWeakReference.get() == null) {
return;
}
this.c.onScrollChanged();
return;
}
}
catch (IllegalAccessException localIllegalAccessException) {}
}
});
return;
}
catch (Exception paramContext) {}
PopupWindowCompat.setOverlapAnchor(this, bool);
}
}
public void showAsDropDown(View paramView, int paramInt1, int paramInt2)
{
int i = paramInt2;
if (a)
{
i = paramInt2;
if (this.b) {
i = paramInt2 - paramView.getHeight();
}
}
super.showAsDropDown(paramView, paramInt1, i);
}
@TargetApi(19)
public void showAsDropDown(View paramView, int paramInt1, int paramInt2, int paramInt3)
{
int i = paramInt2;
if (a)
{
i = paramInt2;
if (this.b) {
i = paramInt2 - paramView.getHeight();
}
}
super.showAsDropDown(paramView, paramInt1, i, paramInt3);
}
public void update(View paramView, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
if ((a) && (this.b)) {
paramInt2 -= paramView.getHeight();
}
for (;;)
{
super.update(paramView, paramInt1, paramInt2, paramInt3, paramInt4);
return;
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/widget/AppCompatPopupWindow.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/