ActionBarPolicy.java
2.89 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
package android.support.v7.view;
import android.content.Context;
import android.content.pm.ApplicationInfo;
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.ViewConfigurationCompat;
import android.support.v7.appcompat.R.attr;
import android.support.v7.appcompat.R.bool;
import android.support.v7.appcompat.R.dimen;
import android.support.v7.appcompat.R.styleable;
import android.util.DisplayMetrics;
import android.view.ViewConfiguration;
@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public class ActionBarPolicy
{
private Context a;
private ActionBarPolicy(Context paramContext)
{
this.a = paramContext;
}
public static ActionBarPolicy get(Context paramContext)
{
return new ActionBarPolicy(paramContext);
}
public boolean enableHomeButtonByDefault()
{
return this.a.getApplicationInfo().targetSdkVersion < 14;
}
public int getEmbeddedMenuWidthLimit()
{
return this.a.getResources().getDisplayMetrics().widthPixels / 2;
}
public int getMaxActionButtons()
{
Resources localResources = this.a.getResources();
int i = ConfigurationHelper.getScreenWidthDp(localResources);
int j = ConfigurationHelper.getScreenHeightDp(localResources);
if ((ConfigurationHelper.getSmallestScreenWidthDp(localResources) > 600) || (i > 600) || ((i > 960) && (j > 720)) || ((i > 720) && (j > 960))) {
return 5;
}
if ((i >= 500) || ((i > 640) && (j > 480)) || ((i > 480) && (j > 640))) {
return 4;
}
if (i >= 360) {
return 3;
}
return 2;
}
public int getStackedTabMaxWidth()
{
return this.a.getResources().getDimensionPixelSize(R.dimen.abc_action_bar_stacked_tab_max_width);
}
public int getTabContainerHeight()
{
TypedArray localTypedArray = this.a.obtainStyledAttributes(null, R.styleable.ActionBar, R.attr.actionBarStyle, 0);
int j = localTypedArray.getLayoutDimension(R.styleable.ActionBar_height, 0);
Resources localResources = this.a.getResources();
int i = j;
if (!hasEmbeddedTabs()) {
i = Math.min(j, localResources.getDimensionPixelSize(R.dimen.abc_action_bar_stacked_max_height));
}
localTypedArray.recycle();
return i;
}
public boolean hasEmbeddedTabs()
{
return this.a.getResources().getBoolean(R.bool.abc_action_bar_embed_tabs);
}
public boolean showsOverflowMenuButton()
{
if (Build.VERSION.SDK_INT >= 19) {}
while (!ViewConfigurationCompat.hasPermanentMenuKey(ViewConfiguration.get(this.a))) {
return true;
}
return false;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/view/ActionBarPolicy.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/