FragmentCompat.java
4.54 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
package android.support.v13.app;
import android.annotation.TargetApi;
import android.app.Fragment;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build.VERSION;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.v4.os.BuildCompat;
import java.util.Arrays;
@TargetApi(13)
@RequiresApi(13)
public class FragmentCompat
{
static final b a = new a();
static
{
if (BuildCompat.isAtLeastN())
{
a = new f();
return;
}
if (Build.VERSION.SDK_INT >= 23)
{
a = new e();
return;
}
if (Build.VERSION.SDK_INT >= 15)
{
a = new d();
return;
}
if (Build.VERSION.SDK_INT >= 14)
{
a = new c();
return;
}
}
public static void requestPermissions(@NonNull Fragment paramFragment, @NonNull String[] paramArrayOfString, int paramInt)
{
a.a(paramFragment, paramArrayOfString, paramInt);
}
public static void setMenuVisibility(Fragment paramFragment, boolean paramBoolean)
{
a.a(paramFragment, paramBoolean);
}
public static void setUserVisibleHint(Fragment paramFragment, boolean paramBoolean)
{
a.b(paramFragment, paramBoolean);
}
public static boolean shouldShowRequestPermissionRationale(@NonNull Fragment paramFragment, @NonNull String paramString)
{
return a.a(paramFragment, paramString);
}
public static abstract interface OnRequestPermissionsResultCallback
{
public abstract void onRequestPermissionsResult(int paramInt, @NonNull String[] paramArrayOfString, @NonNull int[] paramArrayOfInt);
}
static class a
implements FragmentCompat.b
{
public void a(Fragment paramFragment, boolean paramBoolean) {}
public void a(final Fragment paramFragment, final String[] paramArrayOfString, final int paramInt)
{
new Handler(Looper.getMainLooper()).post(new Runnable()
{
public final void run()
{
int[] arrayOfInt = new int[paramArrayOfString.length];
Object localObject = paramFragment.getActivity();
if (localObject != null)
{
PackageManager localPackageManager = ((Context)localObject).getPackageManager();
localObject = ((Context)localObject).getPackageName();
int j = paramArrayOfString.length;
int i = 0;
while (i < j)
{
arrayOfInt[i] = localPackageManager.checkPermission(paramArrayOfString[i], (String)localObject);
i += 1;
}
}
Arrays.fill(arrayOfInt, -1);
((FragmentCompat.OnRequestPermissionsResultCallback)paramFragment).onRequestPermissionsResult(paramInt, paramArrayOfString, arrayOfInt);
}
});
}
public boolean a(Fragment paramFragment, String paramString)
{
return false;
}
public void b(Fragment paramFragment, boolean paramBoolean) {}
}
static abstract interface b
{
public abstract void a(Fragment paramFragment, boolean paramBoolean);
public abstract void a(Fragment paramFragment, String[] paramArrayOfString, int paramInt);
public abstract boolean a(Fragment paramFragment, String paramString);
public abstract void b(Fragment paramFragment, boolean paramBoolean);
}
static class c
extends FragmentCompat.a
{
public final void a(Fragment paramFragment, boolean paramBoolean)
{
paramFragment.setMenuVisibility(paramBoolean);
}
}
static class d
extends FragmentCompat.c
{
public void b(Fragment paramFragment, boolean paramBoolean)
{
if (paramFragment.getFragmentManager() != null) {
paramFragment.setUserVisibleHint(paramBoolean);
}
}
}
static class e
extends FragmentCompat.d
{
public final void a(Fragment paramFragment, String[] paramArrayOfString, int paramInt)
{
paramFragment.requestPermissions(paramArrayOfString, paramInt);
}
public final boolean a(Fragment paramFragment, String paramString)
{
return paramFragment.shouldShowRequestPermissionRationale(paramString);
}
}
static final class f
extends FragmentCompat.e
{
public final void b(Fragment paramFragment, boolean paramBoolean)
{
paramFragment.setUserVisibleHint(paramBoolean);
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v13/app/FragmentCompat.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/