86 lines
2.3 KiB
Java
86 lines
2.3 KiB
Java
|
package j;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.content.res.Configuration;
|
||
|
import android.content.res.Resources;
|
||
|
import android.content.res.TypedArray;
|
||
|
import android.os.Build;
|
||
|
import android.view.ViewConfiguration;
|
||
|
import e.b;
|
||
|
import e.d;
|
||
|
import e.j;
|
||
|
/* compiled from: ActionBarPolicy.java */
|
||
|
/* loaded from: classes.dex */
|
||
|
public class a {
|
||
|
|
||
|
/* renamed from: a reason: collision with root package name */
|
||
|
private Context f14463a;
|
||
|
|
||
|
private a(Context context) {
|
||
|
this.f14463a = context;
|
||
|
}
|
||
|
|
||
|
public static a b(Context context) {
|
||
|
return new a(context);
|
||
|
}
|
||
|
|
||
|
public boolean a() {
|
||
|
return this.f14463a.getApplicationInfo().targetSdkVersion < 14;
|
||
|
}
|
||
|
|
||
|
public int c() {
|
||
|
return this.f14463a.getResources().getDisplayMetrics().widthPixels / 2;
|
||
|
}
|
||
|
|
||
|
public int d() {
|
||
|
Configuration configuration = this.f14463a.getResources().getConfiguration();
|
||
|
int i10 = configuration.screenWidthDp;
|
||
|
int i11 = configuration.screenHeightDp;
|
||
|
if (configuration.smallestScreenWidthDp > 600 || i10 > 600) {
|
||
|
return 5;
|
||
|
}
|
||
|
if (i10 > 960 && i11 > 720) {
|
||
|
return 5;
|
||
|
}
|
||
|
if (i10 > 720 && i11 > 960) {
|
||
|
return 5;
|
||
|
}
|
||
|
if (i10 >= 500) {
|
||
|
return 4;
|
||
|
}
|
||
|
if (i10 > 640 && i11 > 480) {
|
||
|
return 4;
|
||
|
}
|
||
|
if (i10 <= 480 || i11 <= 640) {
|
||
|
return i10 >= 360 ? 3 : 2;
|
||
|
}
|
||
|
return 4;
|
||
|
}
|
||
|
|
||
|
public int e() {
|
||
|
return this.f14463a.getResources().getDimensionPixelSize(d.f10234b);
|
||
|
}
|
||
|
|
||
|
public int f() {
|
||
|
TypedArray obtainStyledAttributes = this.f14463a.obtainStyledAttributes(null, j.f10338a, e.a.f10200c, 0);
|
||
|
int layoutDimension = obtainStyledAttributes.getLayoutDimension(j.f10381j, 0);
|
||
|
Resources resources = this.f14463a.getResources();
|
||
|
if (!g()) {
|
||
|
layoutDimension = Math.min(layoutDimension, resources.getDimensionPixelSize(d.f10233a));
|
||
|
}
|
||
|
obtainStyledAttributes.recycle();
|
||
|
return layoutDimension;
|
||
|
}
|
||
|
|
||
|
public boolean g() {
|
||
|
return this.f14463a.getResources().getBoolean(b.f10224a);
|
||
|
}
|
||
|
|
||
|
public boolean h() {
|
||
|
if (Build.VERSION.SDK_INT >= 19) {
|
||
|
return true;
|
||
|
}
|
||
|
return !ViewConfiguration.get(this.f14463a).hasPermanentMenuKey();
|
||
|
}
|
||
|
}
|