Initial commit
This commit is contained in:
17
sources/androidx/core/R$attr.java
Normal file
17
sources/androidx/core/R$attr.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package androidx.core;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$attr {
|
||||
public static final int alpha = 2130968616;
|
||||
public static final int font = 2130968827;
|
||||
public static final int fontProviderAuthority = 2130968829;
|
||||
public static final int fontProviderCerts = 2130968830;
|
||||
public static final int fontProviderFetchStrategy = 2130968831;
|
||||
public static final int fontProviderFetchTimeout = 2130968832;
|
||||
public static final int fontProviderPackage = 2130968833;
|
||||
public static final int fontProviderQuery = 2130968834;
|
||||
public static final int fontStyle = 2130968835;
|
||||
public static final int fontVariationSettings = 2130968836;
|
||||
public static final int fontWeight = 2130968837;
|
||||
public static final int ttcIndex = 2130969208;
|
||||
}
|
||||
33
sources/androidx/core/R$id.java
Normal file
33
sources/androidx/core/R$id.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package androidx.core;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$id {
|
||||
public static final int action_container = 2131296279;
|
||||
public static final int action_divider = 2131296281;
|
||||
public static final int action_image = 2131296282;
|
||||
public static final int action_text = 2131296288;
|
||||
public static final int actions = 2131296289;
|
||||
public static final int async = 2131296326;
|
||||
public static final int blocking = 2131296343;
|
||||
public static final int chronometer = 2131296452;
|
||||
public static final int forever = 2131296644;
|
||||
public static final int icon = 2131296701;
|
||||
public static final int icon_group = 2131296702;
|
||||
public static final int info = 2131296971;
|
||||
public static final int italic = 2131296980;
|
||||
public static final int line1 = 2131297087;
|
||||
public static final int line3 = 2131297088;
|
||||
public static final int normal = 2131297194;
|
||||
public static final int notification_background = 2131297195;
|
||||
public static final int notification_main_column = 2131297196;
|
||||
public static final int notification_main_column_container = 2131297197;
|
||||
public static final int right_icon = 2131297308;
|
||||
public static final int right_side = 2131297309;
|
||||
public static final int tag_transition_group = 2131297528;
|
||||
public static final int tag_unhandled_key_event_manager = 2131297529;
|
||||
public static final int tag_unhandled_key_listeners = 2131297530;
|
||||
public static final int text = 2131297537;
|
||||
public static final int text2 = 2131297538;
|
||||
public static final int time = 2131297551;
|
||||
public static final int title = 2131297555;
|
||||
}
|
||||
45
sources/androidx/core/R$styleable.java
Normal file
45
sources/androidx/core/R$styleable.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package androidx.core;
|
||||
|
||||
import android.R;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$styleable {
|
||||
public static final int ColorStateListItem_alpha = 2;
|
||||
public static final int ColorStateListItem_android_alpha = 1;
|
||||
public static final int ColorStateListItem_android_color = 0;
|
||||
public static final int FontFamilyFont_android_font = 0;
|
||||
public static final int FontFamilyFont_android_fontStyle = 2;
|
||||
public static final int FontFamilyFont_android_fontVariationSettings = 4;
|
||||
public static final int FontFamilyFont_android_fontWeight = 1;
|
||||
public static final int FontFamilyFont_android_ttcIndex = 3;
|
||||
public static final int FontFamilyFont_font = 5;
|
||||
public static final int FontFamilyFont_fontStyle = 6;
|
||||
public static final int FontFamilyFont_fontVariationSettings = 7;
|
||||
public static final int FontFamilyFont_fontWeight = 8;
|
||||
public static final int FontFamilyFont_ttcIndex = 9;
|
||||
public static final int FontFamily_fontProviderAuthority = 0;
|
||||
public static final int FontFamily_fontProviderCerts = 1;
|
||||
public static final int FontFamily_fontProviderFetchStrategy = 2;
|
||||
public static final int FontFamily_fontProviderFetchTimeout = 3;
|
||||
public static final int FontFamily_fontProviderPackage = 4;
|
||||
public static final int FontFamily_fontProviderQuery = 5;
|
||||
public static final int GradientColorItem_android_color = 0;
|
||||
public static final int GradientColorItem_android_offset = 1;
|
||||
public static final int GradientColor_android_centerColor = 7;
|
||||
public static final int GradientColor_android_centerX = 3;
|
||||
public static final int GradientColor_android_centerY = 4;
|
||||
public static final int GradientColor_android_endColor = 1;
|
||||
public static final int GradientColor_android_endX = 10;
|
||||
public static final int GradientColor_android_endY = 11;
|
||||
public static final int GradientColor_android_gradientRadius = 5;
|
||||
public static final int GradientColor_android_startColor = 0;
|
||||
public static final int GradientColor_android_startX = 8;
|
||||
public static final int GradientColor_android_startY = 9;
|
||||
public static final int GradientColor_android_tileMode = 6;
|
||||
public static final int GradientColor_android_type = 2;
|
||||
public static final int[] ColorStateListItem = {R.attr.color, R.attr.alpha, com.ubt.jimu.R.attr.alpha};
|
||||
public static final int[] FontFamily = {com.ubt.jimu.R.attr.fontProviderAuthority, com.ubt.jimu.R.attr.fontProviderCerts, com.ubt.jimu.R.attr.fontProviderFetchStrategy, com.ubt.jimu.R.attr.fontProviderFetchTimeout, com.ubt.jimu.R.attr.fontProviderPackage, com.ubt.jimu.R.attr.fontProviderQuery};
|
||||
public static final int[] FontFamilyFont = {R.attr.font, R.attr.fontWeight, R.attr.fontStyle, R.attr.ttcIndex, R.attr.fontVariationSettings, com.ubt.jimu.R.attr.font, com.ubt.jimu.R.attr.fontStyle, com.ubt.jimu.R.attr.fontVariationSettings, com.ubt.jimu.R.attr.fontWeight, com.ubt.jimu.R.attr.ttcIndex};
|
||||
public static final int[] GradientColor = {R.attr.startColor, R.attr.endColor, R.attr.type, R.attr.centerX, R.attr.centerY, R.attr.gradientRadius, R.attr.tileMode, R.attr.centerColor, R.attr.startX, R.attr.startY, R.attr.endX, R.attr.endY};
|
||||
public static final int[] GradientColorItem = {R.attr.color, R.attr.offset};
|
||||
}
|
||||
177
sources/androidx/core/app/ActivityCompat.java
Normal file
177
sources/androidx/core/app/ActivityCompat.java
Normal file
@@ -0,0 +1,177 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.SharedElementCallback;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.RectF;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Parcelable;
|
||||
import android.view.View;
|
||||
import androidx.core.app.SharedElementCallback;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActivityCompat extends ContextCompat {
|
||||
private static PermissionCompatDelegate c;
|
||||
|
||||
public interface OnRequestPermissionsResultCallback {
|
||||
void onRequestPermissionsResult(int i, String[] strArr, int[] iArr);
|
||||
}
|
||||
|
||||
public interface PermissionCompatDelegate {
|
||||
boolean a(Activity activity, int i, int i2, Intent intent);
|
||||
|
||||
boolean a(Activity activity, String[] strArr, int i);
|
||||
}
|
||||
|
||||
public interface RequestPermissionsRequestCodeValidator {
|
||||
void validateRequestPermissionsRequestCode(int i);
|
||||
}
|
||||
|
||||
private static class SharedElementCallback21Impl extends android.app.SharedElementCallback {
|
||||
private final SharedElementCallback a;
|
||||
|
||||
SharedElementCallback21Impl(SharedElementCallback sharedElementCallback) {
|
||||
this.a = sharedElementCallback;
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public Parcelable onCaptureSharedElementSnapshot(View view, Matrix matrix, RectF rectF) {
|
||||
return this.a.a(view, matrix, rectF);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public View onCreateSnapshotView(Context context, Parcelable parcelable) {
|
||||
return this.a.a(context, parcelable);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public void onMapSharedElements(List<String> list, Map<String, View> map) {
|
||||
this.a.a(list, map);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public void onRejectSharedElements(List<View> list) {
|
||||
this.a.a(list);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public void onSharedElementEnd(List<String> list, List<View> list2, List<View> list3) {
|
||||
this.a.a(list, list2, list3);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public void onSharedElementStart(List<String> list, List<View> list2, List<View> list3) {
|
||||
this.a.b(list, list2, list3);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public void onSharedElementsArrived(List<String> list, List<View> list2, SharedElementCallback.OnSharedElementsReadyListener onSharedElementsReadyListener) {
|
||||
this.a.a(list, list2, new SharedElementCallback.OnSharedElementsReadyListener(this, onSharedElementsReadyListener) { // from class: androidx.core.app.ActivityCompat.SharedElementCallback21Impl.1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static PermissionCompatDelegate a() {
|
||||
return c;
|
||||
}
|
||||
|
||||
public static void b(Activity activity) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
activity.finishAfterTransition();
|
||||
} else {
|
||||
activity.finish();
|
||||
}
|
||||
}
|
||||
|
||||
public static void c(Activity activity) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
activity.postponeEnterTransition();
|
||||
}
|
||||
}
|
||||
|
||||
public static void d(Activity activity) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
activity.startPostponedEnterTransition();
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(Activity activity, Intent intent, int i, Bundle bundle) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
activity.startActivityForResult(intent, i, bundle);
|
||||
} else {
|
||||
activity.startActivityForResult(intent, i);
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(Activity activity, SharedElementCallback sharedElementCallback) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
activity.setExitSharedElementCallback(sharedElementCallback != null ? new SharedElementCallback21Impl(sharedElementCallback) : null);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(Activity activity, IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
activity.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4, bundle);
|
||||
} else {
|
||||
activity.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(Activity activity) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
activity.finishAffinity();
|
||||
} else {
|
||||
activity.finish();
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(Activity activity, SharedElementCallback sharedElementCallback) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
activity.setEnterSharedElementCallback(sharedElementCallback != null ? new SharedElementCallback21Impl(sharedElementCallback) : null);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static void a(final Activity activity, final String[] strArr, final int i) {
|
||||
PermissionCompatDelegate permissionCompatDelegate = c;
|
||||
if (permissionCompatDelegate == null || !permissionCompatDelegate.a(activity, strArr, i)) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
if (activity instanceof RequestPermissionsRequestCodeValidator) {
|
||||
((RequestPermissionsRequestCodeValidator) activity).validateRequestPermissionsRequestCode(i);
|
||||
}
|
||||
activity.requestPermissions(strArr, i);
|
||||
} else if (activity instanceof OnRequestPermissionsResultCallback) {
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: androidx.core.app.ActivityCompat.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
int[] iArr = new int[strArr.length];
|
||||
PackageManager packageManager = activity.getPackageManager();
|
||||
String packageName = activity.getPackageName();
|
||||
int length = strArr.length;
|
||||
for (int i2 = 0; i2 < length; i2++) {
|
||||
iArr[i2] = packageManager.checkPermission(strArr[i2], packageName);
|
||||
}
|
||||
((OnRequestPermissionsResultCallback) activity).onRequestPermissionsResult(i, strArr, iArr);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean a(Activity activity, String str) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return activity.shouldShowRequestPermissionRationale(str);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
33
sources/androidx/core/app/ActivityOptionsCompat.java
Normal file
33
sources/androidx/core/app/ActivityOptionsCompat.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityOptions;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import androidx.core.util.Pair;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActivityOptionsCompat {
|
||||
|
||||
private static class ActivityOptionsCompatImpl extends ActivityOptionsCompat {
|
||||
ActivityOptionsCompatImpl(ActivityOptions activityOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
protected ActivityOptionsCompat() {
|
||||
}
|
||||
|
||||
public static ActivityOptionsCompat a(Activity activity, Pair<View, String>... pairArr) {
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
return new ActivityOptionsCompat();
|
||||
}
|
||||
android.util.Pair[] pairArr2 = null;
|
||||
if (pairArr != null) {
|
||||
pairArr2 = new android.util.Pair[pairArr.length];
|
||||
for (int i = 0; i < pairArr.length; i++) {
|
||||
pairArr2[i] = android.util.Pair.create(pairArr[i].a, pairArr[i].b);
|
||||
}
|
||||
}
|
||||
return new ActivityOptionsCompatImpl(ActivityOptions.makeSceneTransitionAnimation(activity, pairArr2));
|
||||
}
|
||||
}
|
||||
22
sources/androidx/core/app/AppOpsManagerCompat.java
Normal file
22
sources/androidx/core/app/AppOpsManagerCompat.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.AppOpsManager;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AppOpsManagerCompat {
|
||||
public static String a(String str) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return AppOpsManager.permissionToOp(str);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int a(Context context, String str, String str2) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return ((AppOpsManager) context.getSystemService(AppOpsManager.class)).noteProxyOpNoThrow(str, str2);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
73
sources/androidx/core/app/BundleCompat.java
Normal file
73
sources/androidx/core/app/BundleCompat.java
Normal file
@@ -0,0 +1,73 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class BundleCompat {
|
||||
public static IBinder a(Bundle bundle, String str) {
|
||||
return Build.VERSION.SDK_INT >= 18 ? bundle.getBinder(str) : BundleCompatBaseImpl.a(bundle, str);
|
||||
}
|
||||
|
||||
public static void a(Bundle bundle, String str, IBinder iBinder) {
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
bundle.putBinder(str, iBinder);
|
||||
} else {
|
||||
BundleCompatBaseImpl.a(bundle, str, iBinder);
|
||||
}
|
||||
}
|
||||
|
||||
static class BundleCompatBaseImpl {
|
||||
private static Method a;
|
||||
private static boolean b;
|
||||
private static Method c;
|
||||
private static boolean d;
|
||||
|
||||
public static IBinder a(Bundle bundle, String str) {
|
||||
if (!b) {
|
||||
try {
|
||||
a = Bundle.class.getMethod("getIBinder", String.class);
|
||||
a.setAccessible(true);
|
||||
} catch (NoSuchMethodException e) {
|
||||
Log.i("BundleCompatBaseImpl", "Failed to retrieve getIBinder method", e);
|
||||
}
|
||||
b = true;
|
||||
}
|
||||
Method method = a;
|
||||
if (method != null) {
|
||||
try {
|
||||
return (IBinder) method.invoke(bundle, str);
|
||||
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e2) {
|
||||
Log.i("BundleCompatBaseImpl", "Failed to invoke getIBinder via reflection", e2);
|
||||
a = null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void a(Bundle bundle, String str, IBinder iBinder) {
|
||||
if (!d) {
|
||||
try {
|
||||
c = Bundle.class.getMethod("putIBinder", String.class, IBinder.class);
|
||||
c.setAccessible(true);
|
||||
} catch (NoSuchMethodException e) {
|
||||
Log.i("BundleCompatBaseImpl", "Failed to retrieve putIBinder method", e);
|
||||
}
|
||||
d = true;
|
||||
}
|
||||
Method method = c;
|
||||
if (method != null) {
|
||||
try {
|
||||
method.invoke(bundle, str, iBinder);
|
||||
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e2) {
|
||||
Log.i("BundleCompatBaseImpl", "Failed to invoke putIBinder via reflection", e2);
|
||||
c = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
70
sources/androidx/core/app/ComponentActivity.java
Normal file
70
sources/androidx/core/app/ComponentActivity.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
import androidx.core.view.KeyEventDispatcher;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.LifecycleRegistry;
|
||||
import androidx.lifecycle.ReportFragment;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ComponentActivity extends Activity implements LifecycleOwner, KeyEventDispatcher.Component {
|
||||
private SimpleArrayMap<Class<? extends ExtraData>, ExtraData> mExtraDataMap = new SimpleArrayMap<>();
|
||||
private LifecycleRegistry mLifecycleRegistry = new LifecycleRegistry(this);
|
||||
|
||||
public static class ExtraData {
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
|
||||
View decorView = getWindow().getDecorView();
|
||||
if (decorView == null || !KeyEventDispatcher.a(decorView, keyEvent)) {
|
||||
return KeyEventDispatcher.a(this, decorView, this, keyEvent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public boolean dispatchKeyShortcutEvent(KeyEvent keyEvent) {
|
||||
View decorView = getWindow().getDecorView();
|
||||
if (decorView == null || !KeyEventDispatcher.a(decorView, keyEvent)) {
|
||||
return super.dispatchKeyShortcutEvent(keyEvent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public <T extends ExtraData> T getExtraData(Class<T> cls) {
|
||||
return (T) this.mExtraDataMap.get(cls);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleOwner
|
||||
public Lifecycle getLifecycle() {
|
||||
return this.mLifecycleRegistry;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
ReportFragment.a(this);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onSaveInstanceState(Bundle bundle) {
|
||||
this.mLifecycleRegistry.a(Lifecycle.State.CREATED);
|
||||
super.onSaveInstanceState(bundle);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public void putExtraData(ExtraData extraData) {
|
||||
this.mExtraDataMap.put(extraData.getClass(), extraData);
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.KeyEventDispatcher.Component
|
||||
public boolean superDispatchKeyEvent(KeyEvent keyEvent) {
|
||||
return super.dispatchKeyEvent(keyEvent);
|
||||
}
|
||||
}
|
||||
47
sources/androidx/core/app/CoreComponentFactory.java
Normal file
47
sources/androidx/core/app/CoreComponentFactory.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AppComponentFactory;
|
||||
import android.app.Application;
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ContentProvider;
|
||||
import android.content.Intent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CoreComponentFactory extends AppComponentFactory {
|
||||
|
||||
public interface CompatWrapped {
|
||||
Object a();
|
||||
}
|
||||
|
||||
static <T> T a(T t) {
|
||||
T t2;
|
||||
return (!(t instanceof CompatWrapped) || (t2 = (T) ((CompatWrapped) t).a()) == null) ? t : t2;
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public Activity instantiateActivity(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (Activity) a(super.instantiateActivity(classLoader, str, intent));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public Application instantiateApplication(ClassLoader classLoader, String str) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (Application) a(super.instantiateApplication(classLoader, str));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public ContentProvider instantiateProvider(ClassLoader classLoader, String str) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (ContentProvider) a(super.instantiateProvider(classLoader, str));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public BroadcastReceiver instantiateReceiver(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (BroadcastReceiver) a(super.instantiateReceiver(classLoader, str, intent));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public Service instantiateService(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (Service) a(super.instantiateService(classLoader, str, intent));
|
||||
}
|
||||
}
|
||||
378
sources/androidx/core/app/JobIntentService.java
Normal file
378
sources/androidx/core/app/JobIntentService.java
Normal file
@@ -0,0 +1,378 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Service;
|
||||
import android.app.job.JobInfo;
|
||||
import android.app.job.JobParameters;
|
||||
import android.app.job.JobServiceEngine;
|
||||
import android.app.job.JobWorkItem;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.PowerManager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class JobIntentService extends Service {
|
||||
static final HashMap<ComponentName, WorkEnqueuer> g = new HashMap<>();
|
||||
CompatJobEngine a;
|
||||
WorkEnqueuer b;
|
||||
CommandProcessor c;
|
||||
boolean d = false;
|
||||
boolean e = false;
|
||||
final ArrayList<CompatWorkItem> f;
|
||||
|
||||
interface CompatJobEngine {
|
||||
IBinder a();
|
||||
|
||||
GenericWorkItem b();
|
||||
}
|
||||
|
||||
static final class CompatWorkEnqueuer extends WorkEnqueuer {
|
||||
private final PowerManager.WakeLock d;
|
||||
private final PowerManager.WakeLock e;
|
||||
boolean f;
|
||||
boolean g;
|
||||
|
||||
CompatWorkEnqueuer(Context context, ComponentName componentName) {
|
||||
super(context, componentName);
|
||||
context.getApplicationContext();
|
||||
PowerManager powerManager = (PowerManager) context.getSystemService("power");
|
||||
this.d = powerManager.newWakeLock(1, componentName.getClassName() + ":launch");
|
||||
this.d.setReferenceCounted(false);
|
||||
this.e = powerManager.newWakeLock(1, componentName.getClassName() + ":run");
|
||||
this.e.setReferenceCounted(false);
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.WorkEnqueuer
|
||||
public void a() {
|
||||
synchronized (this) {
|
||||
if (this.g) {
|
||||
if (this.f) {
|
||||
this.d.acquire(60000L);
|
||||
}
|
||||
this.g = false;
|
||||
this.e.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.WorkEnqueuer
|
||||
public void b() {
|
||||
synchronized (this) {
|
||||
if (!this.g) {
|
||||
this.g = true;
|
||||
this.e.acquire(600000L);
|
||||
this.d.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.WorkEnqueuer
|
||||
public void c() {
|
||||
synchronized (this) {
|
||||
this.f = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final class CompatWorkItem implements GenericWorkItem {
|
||||
final Intent a;
|
||||
final int b;
|
||||
|
||||
CompatWorkItem(Intent intent, int i) {
|
||||
this.a = intent;
|
||||
this.b = i;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.GenericWorkItem
|
||||
public void a() {
|
||||
JobIntentService.this.stopSelf(this.b);
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.GenericWorkItem
|
||||
public Intent getIntent() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
interface GenericWorkItem {
|
||||
void a();
|
||||
|
||||
Intent getIntent();
|
||||
}
|
||||
|
||||
static final class JobServiceEngineImpl extends JobServiceEngine implements CompatJobEngine {
|
||||
final JobIntentService a;
|
||||
final Object b;
|
||||
JobParameters c;
|
||||
|
||||
final class WrapperWorkItem implements GenericWorkItem {
|
||||
final JobWorkItem a;
|
||||
|
||||
WrapperWorkItem(JobWorkItem jobWorkItem) {
|
||||
this.a = jobWorkItem;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.GenericWorkItem
|
||||
public void a() {
|
||||
synchronized (JobServiceEngineImpl.this.b) {
|
||||
if (JobServiceEngineImpl.this.c != null) {
|
||||
JobServiceEngineImpl.this.c.completeWork(this.a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.GenericWorkItem
|
||||
public Intent getIntent() {
|
||||
return this.a.getIntent();
|
||||
}
|
||||
}
|
||||
|
||||
JobServiceEngineImpl(JobIntentService jobIntentService) {
|
||||
super(jobIntentService);
|
||||
this.b = new Object();
|
||||
this.a = jobIntentService;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.CompatJobEngine
|
||||
public IBinder a() {
|
||||
return getBinder();
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.CompatJobEngine
|
||||
public GenericWorkItem b() {
|
||||
synchronized (this.b) {
|
||||
if (this.c == null) {
|
||||
return null;
|
||||
}
|
||||
JobWorkItem dequeueWork = this.c.dequeueWork();
|
||||
if (dequeueWork == null) {
|
||||
return null;
|
||||
}
|
||||
dequeueWork.getIntent().setExtrasClassLoader(this.a.getClassLoader());
|
||||
return new WrapperWorkItem(dequeueWork);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.job.JobServiceEngine
|
||||
public boolean onStartJob(JobParameters jobParameters) {
|
||||
this.c = jobParameters;
|
||||
this.a.a(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.app.job.JobServiceEngine
|
||||
public boolean onStopJob(JobParameters jobParameters) {
|
||||
boolean b = this.a.b();
|
||||
synchronized (this.b) {
|
||||
this.c = null;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
static final class JobWorkEnqueuer extends WorkEnqueuer {
|
||||
JobWorkEnqueuer(Context context, ComponentName componentName, int i) {
|
||||
super(context, componentName);
|
||||
a(i);
|
||||
new JobInfo.Builder(i, this.a).setOverrideDeadline(0L).build();
|
||||
}
|
||||
}
|
||||
|
||||
static abstract class WorkEnqueuer {
|
||||
final ComponentName a;
|
||||
boolean b;
|
||||
int c;
|
||||
|
||||
WorkEnqueuer(Context context, ComponentName componentName) {
|
||||
this.a = componentName;
|
||||
}
|
||||
|
||||
public void a() {
|
||||
}
|
||||
|
||||
void a(int i) {
|
||||
if (!this.b) {
|
||||
this.b = true;
|
||||
this.c = i;
|
||||
} else {
|
||||
if (this.c == i) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Given job ID " + i + " is different than previous " + this.c);
|
||||
}
|
||||
}
|
||||
|
||||
public void b() {
|
||||
}
|
||||
|
||||
public void c() {
|
||||
}
|
||||
}
|
||||
|
||||
public JobIntentService() {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.f = null;
|
||||
} else {
|
||||
this.f = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
static WorkEnqueuer a(Context context, ComponentName componentName, boolean z, int i) {
|
||||
WorkEnqueuer compatWorkEnqueuer;
|
||||
WorkEnqueuer workEnqueuer = g.get(componentName);
|
||||
if (workEnqueuer != null) {
|
||||
return workEnqueuer;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < 26) {
|
||||
compatWorkEnqueuer = new CompatWorkEnqueuer(context, componentName);
|
||||
} else {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException("Can't be here without a job id");
|
||||
}
|
||||
compatWorkEnqueuer = new JobWorkEnqueuer(context, componentName, i);
|
||||
}
|
||||
WorkEnqueuer workEnqueuer2 = compatWorkEnqueuer;
|
||||
g.put(componentName, workEnqueuer2);
|
||||
return workEnqueuer2;
|
||||
}
|
||||
|
||||
protected abstract void a(Intent intent);
|
||||
|
||||
boolean b() {
|
||||
CommandProcessor commandProcessor = this.c;
|
||||
if (commandProcessor != null) {
|
||||
commandProcessor.cancel(this.d);
|
||||
}
|
||||
return c();
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void d() {
|
||||
ArrayList<CompatWorkItem> arrayList = this.f;
|
||||
if (arrayList != null) {
|
||||
synchronized (arrayList) {
|
||||
this.c = null;
|
||||
if (this.f != null && this.f.size() > 0) {
|
||||
a(false);
|
||||
} else if (!this.e) {
|
||||
this.b.a();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public IBinder onBind(Intent intent) {
|
||||
CompatJobEngine compatJobEngine = this.a;
|
||||
if (compatJobEngine != null) {
|
||||
return compatJobEngine.a();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.a = new JobServiceEngineImpl(this);
|
||||
this.b = null;
|
||||
} else {
|
||||
this.a = null;
|
||||
this.b = a(this, new ComponentName(this, (Class<?>) JobIntentService.class), false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
ArrayList<CompatWorkItem> arrayList = this.f;
|
||||
if (arrayList != null) {
|
||||
synchronized (arrayList) {
|
||||
this.e = true;
|
||||
this.b.a();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public int onStartCommand(Intent intent, int i, int i2) {
|
||||
if (this.f == null) {
|
||||
return 2;
|
||||
}
|
||||
this.b.c();
|
||||
synchronized (this.f) {
|
||||
ArrayList<CompatWorkItem> arrayList = this.f;
|
||||
if (intent == null) {
|
||||
intent = new Intent();
|
||||
}
|
||||
arrayList.add(new CompatWorkItem(intent, i2));
|
||||
a(true);
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
final class CommandProcessor extends AsyncTask<Void, Void, Void> {
|
||||
CommandProcessor() {
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // android.os.AsyncTask
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public Void doInBackground(Void... voidArr) {
|
||||
while (true) {
|
||||
GenericWorkItem a = JobIntentService.this.a();
|
||||
if (a == null) {
|
||||
return null;
|
||||
}
|
||||
JobIntentService.this.a(a.getIntent());
|
||||
a.a();
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // android.os.AsyncTask
|
||||
/* renamed from: b, reason: merged with bridge method [inline-methods] */
|
||||
public void onPostExecute(Void r1) {
|
||||
JobIntentService.this.d();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // android.os.AsyncTask
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onCancelled(Void r1) {
|
||||
JobIntentService.this.d();
|
||||
}
|
||||
}
|
||||
|
||||
void a(boolean z) {
|
||||
if (this.c == null) {
|
||||
this.c = new CommandProcessor();
|
||||
WorkEnqueuer workEnqueuer = this.b;
|
||||
if (workEnqueuer != null && z) {
|
||||
workEnqueuer.b();
|
||||
}
|
||||
this.c.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
|
||||
}
|
||||
}
|
||||
|
||||
GenericWorkItem a() {
|
||||
CompatJobEngine compatJobEngine = this.a;
|
||||
if (compatJobEngine != null) {
|
||||
return compatJobEngine.b();
|
||||
}
|
||||
synchronized (this.f) {
|
||||
if (this.f.size() <= 0) {
|
||||
return null;
|
||||
}
|
||||
return this.f.remove(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
89
sources/androidx/core/app/NavUtils.java
Normal file
89
sources/androidx/core/app/NavUtils.java
Normal file
@@ -0,0 +1,89 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class NavUtils {
|
||||
public static void a(Activity activity, Intent intent) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
activity.navigateUpTo(intent);
|
||||
return;
|
||||
}
|
||||
intent.addFlags(67108864);
|
||||
activity.startActivity(intent);
|
||||
activity.finish();
|
||||
}
|
||||
|
||||
public static boolean b(Activity activity, Intent intent) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return activity.shouldUpRecreateTask(intent);
|
||||
}
|
||||
String action = activity.getIntent().getAction();
|
||||
return (action == null || action.equals("android.intent.action.MAIN")) ? false : true;
|
||||
}
|
||||
|
||||
public static String b(Activity activity) {
|
||||
try {
|
||||
return b(activity, activity.getComponentName());
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Intent a(Activity activity) {
|
||||
Intent parentActivityIntent;
|
||||
if (Build.VERSION.SDK_INT >= 16 && (parentActivityIntent = activity.getParentActivityIntent()) != null) {
|
||||
return parentActivityIntent;
|
||||
}
|
||||
String b = b(activity);
|
||||
if (b == null) {
|
||||
return null;
|
||||
}
|
||||
ComponentName componentName = new ComponentName(activity, b);
|
||||
try {
|
||||
if (b(activity, componentName) == null) {
|
||||
return Intent.makeMainActivity(componentName);
|
||||
}
|
||||
return new Intent().setComponent(componentName);
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
Log.e("NavUtils", "getParentActivityIntent: bad parentActivityName '" + b + "' in manifest");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String b(Context context, ComponentName componentName) throws PackageManager.NameNotFoundException {
|
||||
String string;
|
||||
String str;
|
||||
ActivityInfo activityInfo = context.getPackageManager().getActivityInfo(componentName, PeripheralType.SERVO);
|
||||
if (Build.VERSION.SDK_INT >= 16 && (str = activityInfo.parentActivityName) != null) {
|
||||
return str;
|
||||
}
|
||||
if (activityInfo.metaData == null || (string = activityInfo.metaData.getString("android.support.PARENT_ACTIVITY")) == null) {
|
||||
return null;
|
||||
}
|
||||
if (string.charAt(0) != '.') {
|
||||
return string;
|
||||
}
|
||||
return context.getPackageName() + string;
|
||||
}
|
||||
|
||||
public static Intent a(Context context, ComponentName componentName) throws PackageManager.NameNotFoundException {
|
||||
String b = b(context, componentName);
|
||||
if (b == null) {
|
||||
return null;
|
||||
}
|
||||
ComponentName componentName2 = new ComponentName(componentName.getPackageName(), b);
|
||||
if (b(context, componentName2) == null) {
|
||||
return Intent.makeMainActivity(componentName2);
|
||||
}
|
||||
return new Intent().setComponent(componentName2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Notification;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface NotificationBuilderWithBuilderAccessor {
|
||||
Notification.Builder a();
|
||||
}
|
||||
303
sources/androidx/core/app/NotificationCompat.java
Normal file
303
sources/androidx/core/app/NotificationCompat.java
Normal file
@@ -0,0 +1,303 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.widget.RemoteViews;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class NotificationCompat {
|
||||
|
||||
public static class Action {
|
||||
final Bundle a;
|
||||
private final RemoteInput[] b;
|
||||
private final RemoteInput[] c;
|
||||
private boolean d;
|
||||
boolean e;
|
||||
private final int f;
|
||||
public int g;
|
||||
public CharSequence h;
|
||||
public PendingIntent i;
|
||||
|
||||
public Action(int i, CharSequence charSequence, PendingIntent pendingIntent) {
|
||||
this(i, charSequence, pendingIntent, new Bundle(), null, null, true, 0, true);
|
||||
}
|
||||
|
||||
public PendingIntent a() {
|
||||
return this.i;
|
||||
}
|
||||
|
||||
public boolean b() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public RemoteInput[] c() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public Bundle d() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public int e() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
public RemoteInput[] f() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public int g() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
public boolean h() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public CharSequence i() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
Action(int i, CharSequence charSequence, PendingIntent pendingIntent, Bundle bundle, RemoteInput[] remoteInputArr, RemoteInput[] remoteInputArr2, boolean z, int i2, boolean z2) {
|
||||
this.e = true;
|
||||
this.g = i;
|
||||
this.h = Builder.d(charSequence);
|
||||
this.i = pendingIntent;
|
||||
this.a = bundle == null ? new Bundle() : bundle;
|
||||
this.b = remoteInputArr;
|
||||
this.c = remoteInputArr2;
|
||||
this.d = z;
|
||||
this.f = i2;
|
||||
this.e = z2;
|
||||
}
|
||||
}
|
||||
|
||||
public static class BigTextStyle extends Style {
|
||||
private CharSequence e;
|
||||
|
||||
public BigTextStyle a(CharSequence charSequence) {
|
||||
this.e = Builder.d(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.NotificationCompat.Style
|
||||
public void a(NotificationBuilderWithBuilderAccessor notificationBuilderWithBuilderAccessor) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
Notification.BigTextStyle bigText = new Notification.BigTextStyle(notificationBuilderWithBuilderAccessor.a()).setBigContentTitle(this.b).bigText(this.e);
|
||||
if (this.d) {
|
||||
bigText.setSummaryText(this.c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
String A;
|
||||
Bundle B;
|
||||
int C;
|
||||
int D;
|
||||
Notification E;
|
||||
RemoteViews F;
|
||||
RemoteViews G;
|
||||
RemoteViews H;
|
||||
String I;
|
||||
int J;
|
||||
String K;
|
||||
long L;
|
||||
int M;
|
||||
Notification N;
|
||||
|
||||
@Deprecated
|
||||
public ArrayList<String> O;
|
||||
public Context a;
|
||||
public ArrayList<Action> b;
|
||||
ArrayList<Action> c;
|
||||
CharSequence d;
|
||||
CharSequence e;
|
||||
PendingIntent f;
|
||||
PendingIntent g;
|
||||
RemoteViews h;
|
||||
Bitmap i;
|
||||
CharSequence j;
|
||||
int k;
|
||||
int l;
|
||||
boolean m;
|
||||
boolean n;
|
||||
Style o;
|
||||
CharSequence p;
|
||||
CharSequence[] q;
|
||||
int r;
|
||||
int s;
|
||||
boolean t;
|
||||
String u;
|
||||
boolean v;
|
||||
String w;
|
||||
boolean x;
|
||||
boolean y;
|
||||
boolean z;
|
||||
|
||||
public Builder(Context context, String str) {
|
||||
this.b = new ArrayList<>();
|
||||
this.c = new ArrayList<>();
|
||||
this.m = true;
|
||||
this.x = false;
|
||||
this.C = 0;
|
||||
this.D = 0;
|
||||
this.J = 0;
|
||||
this.M = 0;
|
||||
this.N = new Notification();
|
||||
this.a = context;
|
||||
this.I = str;
|
||||
this.N.when = System.currentTimeMillis();
|
||||
this.N.audioStreamType = -1;
|
||||
this.l = 0;
|
||||
this.O = new ArrayList<>();
|
||||
}
|
||||
|
||||
protected static CharSequence d(CharSequence charSequence) {
|
||||
return (charSequence != null && charSequence.length() > 5120) ? charSequence.subSequence(0, 5120) : charSequence;
|
||||
}
|
||||
|
||||
public Builder a(long j) {
|
||||
this.N.when = j;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder b(int i) {
|
||||
this.N.icon = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder c(CharSequence charSequence) {
|
||||
this.N.tickerText = d(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(CharSequence charSequence) {
|
||||
this.e = d(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder b(CharSequence charSequence) {
|
||||
this.d = d(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(PendingIntent pendingIntent) {
|
||||
this.f = pendingIntent;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder b(boolean z) {
|
||||
this.x = z;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(boolean z) {
|
||||
a(16, z);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Bundle b() {
|
||||
if (this.B == null) {
|
||||
this.B = new Bundle();
|
||||
}
|
||||
return this.B;
|
||||
}
|
||||
|
||||
private void a(int i, boolean z) {
|
||||
if (z) {
|
||||
Notification notification = this.N;
|
||||
notification.flags = i | notification.flags;
|
||||
} else {
|
||||
Notification notification2 = this.N;
|
||||
notification2.flags = (~i) & notification2.flags;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder a(int i) {
|
||||
this.l = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(int i, CharSequence charSequence, PendingIntent pendingIntent) {
|
||||
this.b.add(new Action(i, charSequence, pendingIntent));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(Style style) {
|
||||
if (this.o != style) {
|
||||
this.o = style;
|
||||
Style style2 = this.o;
|
||||
if (style2 != null) {
|
||||
style2.a(this);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(String str) {
|
||||
this.I = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Notification a() {
|
||||
return new NotificationCompatBuilder(this).b();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Builder(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class Style {
|
||||
protected Builder a;
|
||||
CharSequence b;
|
||||
CharSequence c;
|
||||
boolean d = false;
|
||||
|
||||
public void a(Bundle bundle) {
|
||||
}
|
||||
|
||||
public abstract void a(NotificationBuilderWithBuilderAccessor notificationBuilderWithBuilderAccessor);
|
||||
|
||||
public void a(Builder builder) {
|
||||
if (this.a != builder) {
|
||||
this.a = builder;
|
||||
Builder builder2 = this.a;
|
||||
if (builder2 != null) {
|
||||
builder2.a(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public RemoteViews b(NotificationBuilderWithBuilderAccessor notificationBuilderWithBuilderAccessor) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public RemoteViews c(NotificationBuilderWithBuilderAccessor notificationBuilderWithBuilderAccessor) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public RemoteViews d(NotificationBuilderWithBuilderAccessor notificationBuilderWithBuilderAccessor) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Bundle a(Notification notification) {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 19) {
|
||||
return notification.extras;
|
||||
}
|
||||
if (i >= 16) {
|
||||
return NotificationCompatJellybean.a(notification);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
306
sources/androidx/core/app/NotificationCompatBuilder.java
Normal file
306
sources/androidx/core/app/NotificationCompatBuilder.java
Normal file
@@ -0,0 +1,306 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.SparseArray;
|
||||
import android.widget.RemoteViews;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import com.ijm.dataencryption.de.DataDecryptTool;
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class NotificationCompatBuilder implements NotificationBuilderWithBuilderAccessor {
|
||||
private final Notification.Builder a;
|
||||
private final NotificationCompat.Builder b;
|
||||
private RemoteViews c;
|
||||
private RemoteViews d;
|
||||
private final List<Bundle> e = new ArrayList();
|
||||
private final Bundle f = new Bundle();
|
||||
private int g;
|
||||
private RemoteViews h;
|
||||
|
||||
NotificationCompatBuilder(NotificationCompat.Builder builder) {
|
||||
ArrayList<String> arrayList;
|
||||
this.b = builder;
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.a = new Notification.Builder(builder.a, builder.I);
|
||||
} else {
|
||||
this.a = new Notification.Builder(builder.a);
|
||||
}
|
||||
Notification notification = builder.N;
|
||||
this.a.setWhen(notification.when).setSmallIcon(notification.icon, notification.iconLevel).setContent(notification.contentView).setTicker(notification.tickerText, builder.h).setVibrate(notification.vibrate).setLights(notification.ledARGB, notification.ledOnMS, notification.ledOffMS).setOngoing((notification.flags & 2) != 0).setOnlyAlertOnce((notification.flags & 8) != 0).setAutoCancel((notification.flags & 16) != 0).setDefaults(notification.defaults).setContentTitle(builder.d).setContentText(builder.e).setContentInfo(builder.j).setContentIntent(builder.f).setDeleteIntent(notification.deleteIntent).setFullScreenIntent(builder.g, (notification.flags & PeripheralType.SERVO) != 0).setLargeIcon(builder.i).setNumber(builder.k).setProgress(builder.r, builder.s, builder.t);
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
this.a.setSound(notification.sound, notification.audioStreamType);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
this.a.setSubText(builder.p).setUsesChronometer(builder.n).setPriority(builder.l);
|
||||
Iterator<NotificationCompat.Action> it = builder.b.iterator();
|
||||
while (it.hasNext()) {
|
||||
a(it.next());
|
||||
}
|
||||
Bundle bundle = builder.B;
|
||||
if (bundle != null) {
|
||||
this.f.putAll(bundle);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < 20) {
|
||||
if (builder.x) {
|
||||
this.f.putBoolean("android.support.localOnly", true);
|
||||
}
|
||||
String str = builder.u;
|
||||
if (str != null) {
|
||||
this.f.putString("android.support.groupKey", str);
|
||||
if (builder.v) {
|
||||
this.f.putBoolean("android.support.isGroupSummary", true);
|
||||
} else {
|
||||
this.f.putBoolean("android.support.useSideChannel", true);
|
||||
}
|
||||
}
|
||||
String str2 = builder.w;
|
||||
if (str2 != null) {
|
||||
this.f.putString("android.support.sortKey", str2);
|
||||
}
|
||||
}
|
||||
this.c = builder.F;
|
||||
this.d = builder.G;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
this.a.setShowWhen(builder.m);
|
||||
if (Build.VERSION.SDK_INT < 21 && (arrayList = builder.O) != null && !arrayList.isEmpty()) {
|
||||
Bundle bundle2 = this.f;
|
||||
ArrayList<String> arrayList2 = builder.O;
|
||||
bundle2.putStringArray("android.people", (String[]) arrayList2.toArray(new String[arrayList2.size()]));
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 20) {
|
||||
this.a.setLocalOnly(builder.x).setGroup(builder.u).setGroupSummary(builder.v).setSortKey(builder.w);
|
||||
this.g = builder.M;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
this.a.setCategory(builder.A).setColor(builder.C).setVisibility(builder.D).setPublicVersion(builder.E).setSound(notification.sound, notification.audioAttributes);
|
||||
Iterator<String> it2 = builder.O.iterator();
|
||||
while (it2.hasNext()) {
|
||||
this.a.addPerson(it2.next());
|
||||
}
|
||||
this.h = builder.H;
|
||||
if (builder.c.size() > 0) {
|
||||
Bundle bundle3 = builder.b().getBundle("android.car.EXTENSIONS");
|
||||
bundle3 = bundle3 == null ? new Bundle() : bundle3;
|
||||
Bundle bundle4 = new Bundle();
|
||||
for (int i = 0; i < builder.c.size(); i++) {
|
||||
bundle4.putBundle(Integer.toString(i), NotificationCompatJellybean.a(builder.c.get(i)));
|
||||
}
|
||||
bundle3.putBundle("invisible_actions", bundle4);
|
||||
builder.b().putBundle("android.car.EXTENSIONS", bundle3);
|
||||
this.f.putBundle("android.car.EXTENSIONS", bundle3);
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
this.a.setExtras(builder.B).setRemoteInputHistory(builder.q);
|
||||
RemoteViews remoteViews = builder.F;
|
||||
if (remoteViews != null) {
|
||||
this.a.setCustomContentView(remoteViews);
|
||||
}
|
||||
RemoteViews remoteViews2 = builder.G;
|
||||
if (remoteViews2 != null) {
|
||||
this.a.setCustomBigContentView(remoteViews2);
|
||||
}
|
||||
RemoteViews remoteViews3 = builder.H;
|
||||
if (remoteViews3 != null) {
|
||||
this.a.setCustomHeadsUpContentView(remoteViews3);
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.a.setBadgeIconType(builder.J).setShortcutId(builder.K).setTimeoutAfter(builder.L).setGroupAlertBehavior(builder.M);
|
||||
if (builder.z) {
|
||||
this.a.setColorized(builder.y);
|
||||
}
|
||||
if (TextUtils.isEmpty(builder.I)) {
|
||||
return;
|
||||
}
|
||||
this.a.setSound(null).setDefaults(0).setLights(0, 0, 0).setVibrate(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.NotificationBuilderWithBuilderAccessor
|
||||
public Notification.Builder a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public Notification b() {
|
||||
Bundle a;
|
||||
RemoteViews d;
|
||||
RemoteViews b;
|
||||
NotificationCompat.Style style = this.b.o;
|
||||
if (style != null) {
|
||||
style.a(this);
|
||||
}
|
||||
RemoteViews c = style != null ? style.c(this) : null;
|
||||
Notification c2 = c();
|
||||
if (c != null) {
|
||||
c2.contentView = c;
|
||||
} else {
|
||||
RemoteViews remoteViews = this.b.F;
|
||||
if (remoteViews != null) {
|
||||
c2.contentView = remoteViews;
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 16 && style != null && (b = style.b(this)) != null) {
|
||||
c2.bigContentView = b;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 21 && style != null && (d = this.b.o.d(this)) != null) {
|
||||
c2.headsUpContentView = d;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 16 && style != null && (a = NotificationCompat.a(c2)) != null) {
|
||||
style.a(a);
|
||||
}
|
||||
return c2;
|
||||
}
|
||||
|
||||
protected Notification c() {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 26) {
|
||||
return this.a.build();
|
||||
}
|
||||
if (i >= 24) {
|
||||
Notification build = this.a.build();
|
||||
if (this.g != 0) {
|
||||
if (build.getGroup() != null && (build.flags & DataDecryptTool.DECRYPT_DB_FILE) != 0 && this.g == 2) {
|
||||
a(build);
|
||||
}
|
||||
if (build.getGroup() != null && (build.flags & DataDecryptTool.DECRYPT_DB_FILE) == 0 && this.g == 1) {
|
||||
a(build);
|
||||
}
|
||||
}
|
||||
return build;
|
||||
}
|
||||
if (i >= 21) {
|
||||
this.a.setExtras(this.f);
|
||||
Notification build2 = this.a.build();
|
||||
RemoteViews remoteViews = this.c;
|
||||
if (remoteViews != null) {
|
||||
build2.contentView = remoteViews;
|
||||
}
|
||||
RemoteViews remoteViews2 = this.d;
|
||||
if (remoteViews2 != null) {
|
||||
build2.bigContentView = remoteViews2;
|
||||
}
|
||||
RemoteViews remoteViews3 = this.h;
|
||||
if (remoteViews3 != null) {
|
||||
build2.headsUpContentView = remoteViews3;
|
||||
}
|
||||
if (this.g != 0) {
|
||||
if (build2.getGroup() != null && (build2.flags & DataDecryptTool.DECRYPT_DB_FILE) != 0 && this.g == 2) {
|
||||
a(build2);
|
||||
}
|
||||
if (build2.getGroup() != null && (build2.flags & DataDecryptTool.DECRYPT_DB_FILE) == 0 && this.g == 1) {
|
||||
a(build2);
|
||||
}
|
||||
}
|
||||
return build2;
|
||||
}
|
||||
if (i >= 20) {
|
||||
this.a.setExtras(this.f);
|
||||
Notification build3 = this.a.build();
|
||||
RemoteViews remoteViews4 = this.c;
|
||||
if (remoteViews4 != null) {
|
||||
build3.contentView = remoteViews4;
|
||||
}
|
||||
RemoteViews remoteViews5 = this.d;
|
||||
if (remoteViews5 != null) {
|
||||
build3.bigContentView = remoteViews5;
|
||||
}
|
||||
if (this.g != 0) {
|
||||
if (build3.getGroup() != null && (build3.flags & DataDecryptTool.DECRYPT_DB_FILE) != 0 && this.g == 2) {
|
||||
a(build3);
|
||||
}
|
||||
if (build3.getGroup() != null && (build3.flags & DataDecryptTool.DECRYPT_DB_FILE) == 0 && this.g == 1) {
|
||||
a(build3);
|
||||
}
|
||||
}
|
||||
return build3;
|
||||
}
|
||||
if (i >= 19) {
|
||||
SparseArray<Bundle> a = NotificationCompatJellybean.a(this.e);
|
||||
if (a != null) {
|
||||
this.f.putSparseParcelableArray("android.support.actionExtras", a);
|
||||
}
|
||||
this.a.setExtras(this.f);
|
||||
Notification build4 = this.a.build();
|
||||
RemoteViews remoteViews6 = this.c;
|
||||
if (remoteViews6 != null) {
|
||||
build4.contentView = remoteViews6;
|
||||
}
|
||||
RemoteViews remoteViews7 = this.d;
|
||||
if (remoteViews7 != null) {
|
||||
build4.bigContentView = remoteViews7;
|
||||
}
|
||||
return build4;
|
||||
}
|
||||
if (i < 16) {
|
||||
return this.a.getNotification();
|
||||
}
|
||||
Notification build5 = this.a.build();
|
||||
Bundle a2 = NotificationCompat.a(build5);
|
||||
Bundle bundle = new Bundle(this.f);
|
||||
for (String str : this.f.keySet()) {
|
||||
if (a2.containsKey(str)) {
|
||||
bundle.remove(str);
|
||||
}
|
||||
}
|
||||
a2.putAll(bundle);
|
||||
SparseArray<Bundle> a3 = NotificationCompatJellybean.a(this.e);
|
||||
if (a3 != null) {
|
||||
NotificationCompat.a(build5).putSparseParcelableArray("android.support.actionExtras", a3);
|
||||
}
|
||||
RemoteViews remoteViews8 = this.c;
|
||||
if (remoteViews8 != null) {
|
||||
build5.contentView = remoteViews8;
|
||||
}
|
||||
RemoteViews remoteViews9 = this.d;
|
||||
if (remoteViews9 != null) {
|
||||
build5.bigContentView = remoteViews9;
|
||||
}
|
||||
return build5;
|
||||
}
|
||||
|
||||
private void a(NotificationCompat.Action action) {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i < 20) {
|
||||
if (i >= 16) {
|
||||
this.e.add(NotificationCompatJellybean.a(this.a, action));
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
Notification.Action.Builder builder = new Notification.Action.Builder(action.e(), action.i(), action.a());
|
||||
if (action.f() != null) {
|
||||
for (android.app.RemoteInput remoteInput : RemoteInput.a(action.f())) {
|
||||
builder.addRemoteInput(remoteInput);
|
||||
}
|
||||
}
|
||||
Bundle bundle = action.d() != null ? new Bundle(action.d()) : new Bundle();
|
||||
bundle.putBoolean("android.support.allowGeneratedReplies", action.b());
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
builder.setAllowGeneratedReplies(action.b());
|
||||
}
|
||||
bundle.putInt("android.support.action.semanticAction", action.g());
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
builder.setSemanticAction(action.g());
|
||||
}
|
||||
bundle.putBoolean("android.support.action.showsUserInterface", action.h());
|
||||
builder.addExtras(bundle);
|
||||
this.a.addAction(builder.build());
|
||||
}
|
||||
|
||||
private void a(Notification notification) {
|
||||
notification.sound = null;
|
||||
notification.vibrate = null;
|
||||
notification.defaults &= -2;
|
||||
notification.defaults &= -3;
|
||||
}
|
||||
}
|
||||
115
sources/androidx/core/app/NotificationCompatJellybean.java
Normal file
115
sources/androidx/core/app/NotificationCompatJellybean.java
Normal file
@@ -0,0 +1,115 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class NotificationCompatJellybean {
|
||||
private static final Object a = new Object();
|
||||
private static Field b;
|
||||
private static boolean c;
|
||||
|
||||
public static SparseArray<Bundle> a(List<Bundle> list) {
|
||||
int size = list.size();
|
||||
SparseArray<Bundle> sparseArray = null;
|
||||
for (int i = 0; i < size; i++) {
|
||||
Bundle bundle = list.get(i);
|
||||
if (bundle != null) {
|
||||
if (sparseArray == null) {
|
||||
sparseArray = new SparseArray<>();
|
||||
}
|
||||
sparseArray.put(i, bundle);
|
||||
}
|
||||
}
|
||||
return sparseArray;
|
||||
}
|
||||
|
||||
public static Bundle a(Notification notification) {
|
||||
synchronized (a) {
|
||||
if (c) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
if (b == null) {
|
||||
Field declaredField = Notification.class.getDeclaredField("extras");
|
||||
if (!Bundle.class.isAssignableFrom(declaredField.getType())) {
|
||||
Log.e("NotificationCompat", "Notification.extras field is not of type Bundle");
|
||||
c = true;
|
||||
return null;
|
||||
}
|
||||
declaredField.setAccessible(true);
|
||||
b = declaredField;
|
||||
}
|
||||
Bundle bundle = (Bundle) b.get(notification);
|
||||
if (bundle == null) {
|
||||
bundle = new Bundle();
|
||||
b.set(notification, bundle);
|
||||
}
|
||||
return bundle;
|
||||
} catch (IllegalAccessException e) {
|
||||
Log.e("NotificationCompat", "Unable to access notification extras", e);
|
||||
c = true;
|
||||
return null;
|
||||
} catch (NoSuchFieldException e2) {
|
||||
Log.e("NotificationCompat", "Unable to access notification extras", e2);
|
||||
c = true;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Bundle a(Notification.Builder builder, NotificationCompat.Action action) {
|
||||
builder.addAction(action.e(), action.i(), action.a());
|
||||
Bundle bundle = new Bundle(action.d());
|
||||
if (action.f() != null) {
|
||||
bundle.putParcelableArray("android.support.remoteInputs", a(action.f()));
|
||||
}
|
||||
if (action.c() != null) {
|
||||
bundle.putParcelableArray("android.support.dataRemoteInputs", a(action.c()));
|
||||
}
|
||||
bundle.putBoolean("android.support.allowGeneratedReplies", action.b());
|
||||
return bundle;
|
||||
}
|
||||
|
||||
static Bundle a(NotificationCompat.Action action) {
|
||||
Bundle bundle;
|
||||
Bundle bundle2 = new Bundle();
|
||||
bundle2.putInt("icon", action.e());
|
||||
bundle2.putCharSequence("title", action.i());
|
||||
bundle2.putParcelable("actionIntent", action.a());
|
||||
if (action.d() != null) {
|
||||
bundle = new Bundle(action.d());
|
||||
} else {
|
||||
bundle = new Bundle();
|
||||
}
|
||||
bundle.putBoolean("android.support.allowGeneratedReplies", action.b());
|
||||
bundle2.putBundle("extras", bundle);
|
||||
bundle2.putParcelableArray("remoteInputs", a(action.f()));
|
||||
bundle2.putBoolean("showsUserInterface", action.h());
|
||||
bundle2.putInt("semanticAction", action.g());
|
||||
return bundle2;
|
||||
}
|
||||
|
||||
private static Bundle a(RemoteInput remoteInput) {
|
||||
new Bundle();
|
||||
remoteInput.a();
|
||||
throw null;
|
||||
}
|
||||
|
||||
private static Bundle[] a(RemoteInput[] remoteInputArr) {
|
||||
if (remoteInputArr == null) {
|
||||
return null;
|
||||
}
|
||||
Bundle[] bundleArr = new Bundle[remoteInputArr.length];
|
||||
if (remoteInputArr.length <= 0) {
|
||||
return bundleArr;
|
||||
}
|
||||
a(remoteInputArr[0]);
|
||||
throw null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.support.v4.app.INotificationSideChannel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class NotificationCompatSideChannelService extends Service {
|
||||
void a(int i, String str) {
|
||||
for (String str2 : getPackageManager().getPackagesForUid(i)) {
|
||||
if (str2.equals(str)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new SecurityException("NotificationSideChannelService: Uid " + i + " is not authorized for package " + str);
|
||||
}
|
||||
|
||||
public abstract void a(String str);
|
||||
|
||||
public abstract void a(String str, int i, String str2);
|
||||
|
||||
public abstract void a(String str, int i, String str2, Notification notification);
|
||||
|
||||
@Override // android.app.Service
|
||||
public IBinder onBind(Intent intent) {
|
||||
if (!intent.getAction().equals("android.support.BIND_NOTIFICATION_SIDE_CHANNEL") || Build.VERSION.SDK_INT > 19) {
|
||||
return null;
|
||||
}
|
||||
return new NotificationSideChannelStub();
|
||||
}
|
||||
|
||||
private class NotificationSideChannelStub extends INotificationSideChannel.Stub {
|
||||
NotificationSideChannelStub() {
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void a(String str, int i, String str2, Notification notification) throws RemoteException {
|
||||
NotificationCompatSideChannelService.this.a(Binder.getCallingUid(), str);
|
||||
long clearCallingIdentity = Binder.clearCallingIdentity();
|
||||
try {
|
||||
NotificationCompatSideChannelService.this.a(str, i, str2, notification);
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(clearCallingIdentity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void a(String str, int i, String str2) throws RemoteException {
|
||||
NotificationCompatSideChannelService.this.a(Binder.getCallingUid(), str);
|
||||
long clearCallingIdentity = Binder.clearCallingIdentity();
|
||||
try {
|
||||
NotificationCompatSideChannelService.this.a(str, i, str2);
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(clearCallingIdentity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void a(String str) {
|
||||
NotificationCompatSideChannelService.this.a(Binder.getCallingUid(), str);
|
||||
long clearCallingIdentity = Binder.clearCallingIdentity();
|
||||
try {
|
||||
NotificationCompatSideChannelService.this.a(str);
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(clearCallingIdentity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
25
sources/androidx/core/app/RemoteInput.java
Normal file
25
sources/androidx/core/app/RemoteInput.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package androidx.core.app;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class RemoteInput {
|
||||
static android.app.RemoteInput[] a(RemoteInput[] remoteInputArr) {
|
||||
if (remoteInputArr == null) {
|
||||
return null;
|
||||
}
|
||||
android.app.RemoteInput[] remoteInputArr2 = new android.app.RemoteInput[remoteInputArr.length];
|
||||
if (remoteInputArr.length <= 0) {
|
||||
return remoteInputArr2;
|
||||
}
|
||||
a(remoteInputArr[0]);
|
||||
throw null;
|
||||
}
|
||||
|
||||
public String a() {
|
||||
throw null;
|
||||
}
|
||||
|
||||
static android.app.RemoteInput a(RemoteInput remoteInput) {
|
||||
remoteInput.a();
|
||||
throw null;
|
||||
}
|
||||
}
|
||||
30
sources/androidx/core/app/SharedElementCallback.java
Normal file
30
sources/androidx/core/app/SharedElementCallback.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.RectF;
|
||||
import android.os.Parcelable;
|
||||
import android.view.View;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class SharedElementCallback {
|
||||
|
||||
public interface OnSharedElementsReadyListener {
|
||||
}
|
||||
|
||||
public abstract Parcelable a(View view, Matrix matrix, RectF rectF);
|
||||
|
||||
public abstract View a(Context context, Parcelable parcelable);
|
||||
|
||||
public abstract void a(List<View> list);
|
||||
|
||||
public abstract void a(List<String> list, List<View> list2, OnSharedElementsReadyListener onSharedElementsReadyListener);
|
||||
|
||||
public abstract void a(List<String> list, List<View> list2, List<View> list3);
|
||||
|
||||
public abstract void a(List<String> list, Map<String, View> map);
|
||||
|
||||
public abstract void b(List<String> list, List<View> list2, List<View> list3);
|
||||
}
|
||||
93
sources/androidx/core/app/TaskStackBuilder.java
Normal file
93
sources/androidx/core/app/TaskStackBuilder.java
Normal file
@@ -0,0 +1,93 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class TaskStackBuilder implements Iterable<Intent> {
|
||||
private final ArrayList<Intent> a = new ArrayList<>();
|
||||
private final Context b;
|
||||
|
||||
public interface SupportParentable {
|
||||
Intent getSupportParentActivityIntent();
|
||||
}
|
||||
|
||||
private TaskStackBuilder(Context context) {
|
||||
this.b = context;
|
||||
}
|
||||
|
||||
public static TaskStackBuilder a(Context context) {
|
||||
return new TaskStackBuilder(context);
|
||||
}
|
||||
|
||||
@Override // java.lang.Iterable
|
||||
@Deprecated
|
||||
public Iterator<Intent> iterator() {
|
||||
return this.a.iterator();
|
||||
}
|
||||
|
||||
public TaskStackBuilder a(Intent intent) {
|
||||
this.a.add(intent);
|
||||
return this;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public TaskStackBuilder a(Activity activity) {
|
||||
Intent supportParentActivityIntent = activity instanceof SupportParentable ? ((SupportParentable) activity).getSupportParentActivityIntent() : null;
|
||||
if (supportParentActivityIntent == null) {
|
||||
supportParentActivityIntent = NavUtils.a(activity);
|
||||
}
|
||||
if (supportParentActivityIntent != null) {
|
||||
ComponentName component = supportParentActivityIntent.getComponent();
|
||||
if (component == null) {
|
||||
component = supportParentActivityIntent.resolveActivity(this.b.getPackageManager());
|
||||
}
|
||||
a(component);
|
||||
a(supportParentActivityIntent);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public TaskStackBuilder a(ComponentName componentName) {
|
||||
int size = this.a.size();
|
||||
try {
|
||||
Intent a = NavUtils.a(this.b, componentName);
|
||||
while (a != null) {
|
||||
this.a.add(size, a);
|
||||
a = NavUtils.a(this.b, a.getComponent());
|
||||
}
|
||||
return this;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.e("TaskStackBuilder", "Bad ComponentName while traversing activity parent metadata");
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void a() {
|
||||
a((Bundle) null);
|
||||
}
|
||||
|
||||
public void a(Bundle bundle) {
|
||||
if (!this.a.isEmpty()) {
|
||||
ArrayList<Intent> arrayList = this.a;
|
||||
Intent[] intentArr = (Intent[]) arrayList.toArray(new Intent[arrayList.size()]);
|
||||
intentArr[0] = new Intent(intentArr[0]).addFlags(268484608);
|
||||
if (ContextCompat.a(this.b, intentArr, bundle)) {
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent(intentArr[intentArr.length - 1]);
|
||||
intent.addFlags(268435456);
|
||||
this.b.startActivity(intent);
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException("No intents added to TaskStackBuilder; cannot startActivities");
|
||||
}
|
||||
}
|
||||
118
sources/androidx/core/content/ContextCompat.java
Normal file
118
sources/androidx/core/content/ContextCompat.java
Normal file
@@ -0,0 +1,118 @@
|
||||
package androidx.core.content;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Process;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import java.io.File;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ContextCompat {
|
||||
private static final Object a = new Object();
|
||||
private static TypedValue b;
|
||||
|
||||
public static boolean a(Context context, Intent[] intentArr, Bundle bundle) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
context.startActivities(intentArr, bundle);
|
||||
return true;
|
||||
}
|
||||
context.startActivities(intentArr);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static File[] b(Context context, String str) {
|
||||
return Build.VERSION.SDK_INT >= 19 ? context.getExternalFilesDirs(str) : new File[]{context.getExternalFilesDir(str)};
|
||||
}
|
||||
|
||||
public static Drawable c(Context context, int i) {
|
||||
int i2;
|
||||
int i3 = Build.VERSION.SDK_INT;
|
||||
if (i3 >= 21) {
|
||||
return context.getDrawable(i);
|
||||
}
|
||||
if (i3 >= 16) {
|
||||
return context.getResources().getDrawable(i);
|
||||
}
|
||||
synchronized (a) {
|
||||
if (b == null) {
|
||||
b = new TypedValue();
|
||||
}
|
||||
context.getResources().getValue(i, b, true);
|
||||
i2 = b.resourceId;
|
||||
}
|
||||
return context.getResources().getDrawable(i2);
|
||||
}
|
||||
|
||||
public static void a(Context context, Intent intent, Bundle bundle) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
context.startActivity(intent, bundle);
|
||||
} else {
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
public static ColorStateList b(Context context, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return context.getColorStateList(i);
|
||||
}
|
||||
return context.getResources().getColorStateList(i);
|
||||
}
|
||||
|
||||
public static File[] a(Context context) {
|
||||
return Build.VERSION.SDK_INT >= 19 ? context.getExternalCacheDirs() : new File[]{context.getExternalCacheDir()};
|
||||
}
|
||||
|
||||
public static File b(Context context) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return context.getNoBackupFilesDir();
|
||||
}
|
||||
return a(new File(context.getApplicationInfo().dataDir, "no_backup"));
|
||||
}
|
||||
|
||||
public static int a(Context context, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return context.getColor(i);
|
||||
}
|
||||
return context.getResources().getColor(i);
|
||||
}
|
||||
|
||||
public static boolean c(Context context) {
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
return context.isDeviceProtectedStorage();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int a(Context context, String str) {
|
||||
if (str != null) {
|
||||
return context.checkPermission(str, Process.myPid(), Process.myUid());
|
||||
}
|
||||
throw new IllegalArgumentException("permission is null");
|
||||
}
|
||||
|
||||
private static synchronized File a(File file) {
|
||||
synchronized (ContextCompat.class) {
|
||||
if (file.exists() || file.mkdirs()) {
|
||||
return file;
|
||||
}
|
||||
if (file.exists()) {
|
||||
return file;
|
||||
}
|
||||
Log.w("ContextCompat", "Unable to create files subdir " + file.getPath());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(Context context, Intent intent) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
context.startForegroundService(intent);
|
||||
} else {
|
||||
context.startService(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
301
sources/androidx/core/content/FileProvider.java
Normal file
301
sources/androidx/core/content/FileProvider.java
Normal file
@@ -0,0 +1,301 @@
|
||||
package androidx.core.content;
|
||||
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ProviderInfo;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.database.Cursor;
|
||||
import android.database.MatrixCursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.text.TextUtils;
|
||||
import android.webkit.MimeTypeMap;
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FileProvider extends ContentProvider {
|
||||
private static final String ATTR_NAME = "name";
|
||||
private static final String ATTR_PATH = "path";
|
||||
private static final String META_DATA_FILE_PROVIDER_PATHS = "android.support.FILE_PROVIDER_PATHS";
|
||||
private static final String TAG_CACHE_PATH = "cache-path";
|
||||
private static final String TAG_EXTERNAL = "external-path";
|
||||
private static final String TAG_EXTERNAL_CACHE = "external-cache-path";
|
||||
private static final String TAG_EXTERNAL_FILES = "external-files-path";
|
||||
private static final String TAG_EXTERNAL_MEDIA = "external-media-path";
|
||||
private static final String TAG_FILES_PATH = "files-path";
|
||||
private static final String TAG_ROOT_PATH = "root-path";
|
||||
private PathStrategy mStrategy;
|
||||
private static final String[] COLUMNS = {"_display_name", "_size"};
|
||||
private static final File DEVICE_ROOT = new File("/");
|
||||
private static HashMap<String, PathStrategy> sCache = new HashMap<>();
|
||||
|
||||
interface PathStrategy {
|
||||
Uri a(File file);
|
||||
|
||||
File a(Uri uri);
|
||||
}
|
||||
|
||||
private static File buildPath(File file, String... strArr) {
|
||||
for (String str : strArr) {
|
||||
if (str != null) {
|
||||
file = new File(file, str);
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
private static String[] copyOf(String[] strArr, int i) {
|
||||
String[] strArr2 = new String[i];
|
||||
System.arraycopy(strArr, 0, strArr2, 0, i);
|
||||
return strArr2;
|
||||
}
|
||||
|
||||
private static PathStrategy getPathStrategy(Context context, String str) {
|
||||
PathStrategy pathStrategy;
|
||||
synchronized (sCache) {
|
||||
pathStrategy = sCache.get(str);
|
||||
if (pathStrategy == null) {
|
||||
try {
|
||||
pathStrategy = parsePathStrategy(context, str);
|
||||
sCache.put(str, pathStrategy);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException("Failed to parse android.support.FILE_PROVIDER_PATHS meta-data", e);
|
||||
} catch (XmlPullParserException e2) {
|
||||
throw new IllegalArgumentException("Failed to parse android.support.FILE_PROVIDER_PATHS meta-data", e2);
|
||||
}
|
||||
}
|
||||
}
|
||||
return pathStrategy;
|
||||
}
|
||||
|
||||
public static Uri getUriForFile(Context context, String str, File file) {
|
||||
return getPathStrategy(context, str).a(file);
|
||||
}
|
||||
|
||||
private static int modeToMode(String str) {
|
||||
if ("r".equals(str)) {
|
||||
return 268435456;
|
||||
}
|
||||
if ("w".equals(str) || "wt".equals(str)) {
|
||||
return 738197504;
|
||||
}
|
||||
if ("wa".equals(str)) {
|
||||
return 704643072;
|
||||
}
|
||||
if ("rw".equals(str)) {
|
||||
return 939524096;
|
||||
}
|
||||
if ("rwt".equals(str)) {
|
||||
return 1006632960;
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid mode: " + str);
|
||||
}
|
||||
|
||||
private static PathStrategy parsePathStrategy(Context context, String str) throws IOException, XmlPullParserException {
|
||||
SimplePathStrategy simplePathStrategy = new SimplePathStrategy(str);
|
||||
XmlResourceParser loadXmlMetaData = context.getPackageManager().resolveContentProvider(str, PeripheralType.SERVO).loadXmlMetaData(context.getPackageManager(), META_DATA_FILE_PROVIDER_PATHS);
|
||||
if (loadXmlMetaData == null) {
|
||||
throw new IllegalArgumentException("Missing android.support.FILE_PROVIDER_PATHS meta-data");
|
||||
}
|
||||
while (true) {
|
||||
int next = loadXmlMetaData.next();
|
||||
if (next == 1) {
|
||||
return simplePathStrategy;
|
||||
}
|
||||
if (next == 2) {
|
||||
String name = loadXmlMetaData.getName();
|
||||
File file = null;
|
||||
String attributeValue = loadXmlMetaData.getAttributeValue(null, "name");
|
||||
String attributeValue2 = loadXmlMetaData.getAttributeValue(null, "path");
|
||||
if (TAG_ROOT_PATH.equals(name)) {
|
||||
file = DEVICE_ROOT;
|
||||
} else if (TAG_FILES_PATH.equals(name)) {
|
||||
file = context.getFilesDir();
|
||||
} else if (TAG_CACHE_PATH.equals(name)) {
|
||||
file = context.getCacheDir();
|
||||
} else if (TAG_EXTERNAL.equals(name)) {
|
||||
file = Environment.getExternalStorageDirectory();
|
||||
} else if (TAG_EXTERNAL_FILES.equals(name)) {
|
||||
File[] b = ContextCompat.b(context, (String) null);
|
||||
if (b.length > 0) {
|
||||
file = b[0];
|
||||
}
|
||||
} else if (TAG_EXTERNAL_CACHE.equals(name)) {
|
||||
File[] a = ContextCompat.a(context);
|
||||
if (a.length > 0) {
|
||||
file = a[0];
|
||||
}
|
||||
} else if (Build.VERSION.SDK_INT >= 21 && TAG_EXTERNAL_MEDIA.equals(name)) {
|
||||
File[] externalMediaDirs = context.getExternalMediaDirs();
|
||||
if (externalMediaDirs.length > 0) {
|
||||
file = externalMediaDirs[0];
|
||||
}
|
||||
}
|
||||
if (file != null) {
|
||||
simplePathStrategy.a(attributeValue, buildPath(file, attributeValue2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public void attachInfo(Context context, ProviderInfo providerInfo) {
|
||||
super.attachInfo(context, providerInfo);
|
||||
if (providerInfo.exported) {
|
||||
throw new SecurityException("Provider must not be exported");
|
||||
}
|
||||
if (!providerInfo.grantUriPermissions) {
|
||||
throw new SecurityException("Provider must grant uri permissions");
|
||||
}
|
||||
this.mStrategy = getPathStrategy(context, providerInfo.authority);
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public int delete(Uri uri, String str, String[] strArr) {
|
||||
return this.mStrategy.a(uri).delete() ? 1 : 0;
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public String getType(Uri uri) {
|
||||
File a = this.mStrategy.a(uri);
|
||||
int lastIndexOf = a.getName().lastIndexOf(46);
|
||||
if (lastIndexOf < 0) {
|
||||
return "application/octet-stream";
|
||||
}
|
||||
String mimeTypeFromExtension = MimeTypeMap.getSingleton().getMimeTypeFromExtension(a.getName().substring(lastIndexOf + 1));
|
||||
return mimeTypeFromExtension != null ? mimeTypeFromExtension : "application/octet-stream";
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public Uri insert(Uri uri, ContentValues contentValues) {
|
||||
throw new UnsupportedOperationException("No external inserts");
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public boolean onCreate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public ParcelFileDescriptor openFile(Uri uri, String str) throws FileNotFoundException {
|
||||
return ParcelFileDescriptor.open(this.mStrategy.a(uri), modeToMode(str));
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public Cursor query(Uri uri, String[] strArr, String str, String[] strArr2, String str2) {
|
||||
int i;
|
||||
File a = this.mStrategy.a(uri);
|
||||
if (strArr == null) {
|
||||
strArr = COLUMNS;
|
||||
}
|
||||
String[] strArr3 = new String[strArr.length];
|
||||
Object[] objArr = new Object[strArr.length];
|
||||
int i2 = 0;
|
||||
for (String str3 : strArr) {
|
||||
if ("_display_name".equals(str3)) {
|
||||
strArr3[i2] = "_display_name";
|
||||
i = i2 + 1;
|
||||
objArr[i2] = a.getName();
|
||||
} else if ("_size".equals(str3)) {
|
||||
strArr3[i2] = "_size";
|
||||
i = i2 + 1;
|
||||
objArr[i2] = Long.valueOf(a.length());
|
||||
}
|
||||
i2 = i;
|
||||
}
|
||||
String[] copyOf = copyOf(strArr3, i2);
|
||||
Object[] copyOf2 = copyOf(objArr, i2);
|
||||
MatrixCursor matrixCursor = new MatrixCursor(copyOf, 1);
|
||||
matrixCursor.addRow(copyOf2);
|
||||
return matrixCursor;
|
||||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
public int update(Uri uri, ContentValues contentValues, String str, String[] strArr) {
|
||||
throw new UnsupportedOperationException("No external updates");
|
||||
}
|
||||
|
||||
private static Object[] copyOf(Object[] objArr, int i) {
|
||||
Object[] objArr2 = new Object[i];
|
||||
System.arraycopy(objArr, 0, objArr2, 0, i);
|
||||
return objArr2;
|
||||
}
|
||||
|
||||
static class SimplePathStrategy implements PathStrategy {
|
||||
private final String a;
|
||||
private final HashMap<String, File> b = new HashMap<>();
|
||||
|
||||
SimplePathStrategy(String str) {
|
||||
this.a = str;
|
||||
}
|
||||
|
||||
void a(String str, File file) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
throw new IllegalArgumentException("Name must not be empty");
|
||||
}
|
||||
try {
|
||||
this.b.put(str, file.getCanonicalFile());
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException("Failed to resolve canonical path for " + file, e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.content.FileProvider.PathStrategy
|
||||
public Uri a(File file) {
|
||||
String substring;
|
||||
try {
|
||||
String canonicalPath = file.getCanonicalPath();
|
||||
Map.Entry<String, File> entry = null;
|
||||
for (Map.Entry<String, File> entry2 : this.b.entrySet()) {
|
||||
String path = entry2.getValue().getPath();
|
||||
if (canonicalPath.startsWith(path) && (entry == null || path.length() > entry.getValue().getPath().length())) {
|
||||
entry = entry2;
|
||||
}
|
||||
}
|
||||
if (entry != null) {
|
||||
String path2 = entry.getValue().getPath();
|
||||
if (path2.endsWith("/")) {
|
||||
substring = canonicalPath.substring(path2.length());
|
||||
} else {
|
||||
substring = canonicalPath.substring(path2.length() + 1);
|
||||
}
|
||||
return new Uri.Builder().scheme("content").authority(this.a).encodedPath(Uri.encode(entry.getKey()) + '/' + Uri.encode(substring, "/")).build();
|
||||
}
|
||||
throw new IllegalArgumentException("Failed to find configured root that contains " + canonicalPath);
|
||||
} catch (IOException unused) {
|
||||
throw new IllegalArgumentException("Failed to resolve canonical path for " + file);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.content.FileProvider.PathStrategy
|
||||
public File a(Uri uri) {
|
||||
String encodedPath = uri.getEncodedPath();
|
||||
int indexOf = encodedPath.indexOf(47, 1);
|
||||
String decode = Uri.decode(encodedPath.substring(1, indexOf));
|
||||
String decode2 = Uri.decode(encodedPath.substring(indexOf + 1));
|
||||
File file = this.b.get(decode);
|
||||
if (file != null) {
|
||||
File file2 = new File(file, decode2);
|
||||
try {
|
||||
File canonicalFile = file2.getCanonicalFile();
|
||||
if (canonicalFile.getPath().startsWith(file.getPath())) {
|
||||
return canonicalFile;
|
||||
}
|
||||
throw new SecurityException("Resolved path jumped beyond configured root");
|
||||
} catch (IOException unused) {
|
||||
throw new IllegalArgumentException("Failed to resolve canonical path for " + file2);
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unable to find configured root for " + uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
30
sources/androidx/core/content/PermissionChecker.java
Normal file
30
sources/androidx/core/content/PermissionChecker.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package androidx.core.content;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Process;
|
||||
import androidx.core.app.AppOpsManagerCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class PermissionChecker {
|
||||
public static int a(Context context, String str, int i, int i2, String str2) {
|
||||
if (context.checkPermission(str, i, i2) == -1) {
|
||||
return -1;
|
||||
}
|
||||
String a = AppOpsManagerCompat.a(str);
|
||||
if (a == null) {
|
||||
return 0;
|
||||
}
|
||||
if (str2 == null) {
|
||||
String[] packagesForUid = context.getPackageManager().getPackagesForUid(i2);
|
||||
if (packagesForUid == null || packagesForUid.length <= 0) {
|
||||
return -1;
|
||||
}
|
||||
str2 = packagesForUid[0];
|
||||
}
|
||||
return AppOpsManagerCompat.a(context, a, str2) != 0 ? -2 : 0;
|
||||
}
|
||||
|
||||
public static int a(Context context, String str) {
|
||||
return a(context, str, Process.myPid(), Process.myUid(), context.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package androidx.core.content.res;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.StateSet;
|
||||
import android.util.Xml;
|
||||
import androidx.core.R$attr;
|
||||
import androidx.core.R$styleable;
|
||||
import java.io.IOException;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ColorStateListInflaterCompat {
|
||||
public static ColorStateList a(Resources resources, XmlPullParser xmlPullParser, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
int next;
|
||||
AttributeSet asAttributeSet = Xml.asAttributeSet(xmlPullParser);
|
||||
do {
|
||||
next = xmlPullParser.next();
|
||||
if (next == 2) {
|
||||
break;
|
||||
}
|
||||
} while (next != 1);
|
||||
if (next == 2) {
|
||||
return a(resources, xmlPullParser, asAttributeSet, theme);
|
||||
}
|
||||
throw new XmlPullParserException("No start tag found");
|
||||
}
|
||||
|
||||
private static ColorStateList b(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
int depth;
|
||||
int i = 1;
|
||||
int depth2 = xmlPullParser.getDepth() + 1;
|
||||
int[][] iArr = new int[20][];
|
||||
int[] iArr2 = new int[iArr.length];
|
||||
int i2 = 0;
|
||||
while (true) {
|
||||
int next = xmlPullParser.next();
|
||||
if (next == i || ((depth = xmlPullParser.getDepth()) < depth2 && next == 3)) {
|
||||
break;
|
||||
}
|
||||
if (next == 2 && depth <= depth2 && xmlPullParser.getName().equals("item")) {
|
||||
TypedArray a = a(resources, theme, attributeSet, R$styleable.ColorStateListItem);
|
||||
int color = a.getColor(R$styleable.ColorStateListItem_android_color, -65281);
|
||||
float f = 1.0f;
|
||||
if (a.hasValue(R$styleable.ColorStateListItem_android_alpha)) {
|
||||
f = a.getFloat(R$styleable.ColorStateListItem_android_alpha, 1.0f);
|
||||
} else if (a.hasValue(R$styleable.ColorStateListItem_alpha)) {
|
||||
f = a.getFloat(R$styleable.ColorStateListItem_alpha, 1.0f);
|
||||
}
|
||||
a.recycle();
|
||||
int attributeCount = attributeSet.getAttributeCount();
|
||||
int[] iArr3 = new int[attributeCount];
|
||||
int i3 = 0;
|
||||
for (int i4 = 0; i4 < attributeCount; i4++) {
|
||||
int attributeNameResource = attributeSet.getAttributeNameResource(i4);
|
||||
if (attributeNameResource != 16843173 && attributeNameResource != 16843551 && attributeNameResource != R$attr.alpha) {
|
||||
int i5 = i3 + 1;
|
||||
if (!attributeSet.getAttributeBooleanValue(i4, false)) {
|
||||
attributeNameResource = -attributeNameResource;
|
||||
}
|
||||
iArr3[i3] = attributeNameResource;
|
||||
i3 = i5;
|
||||
}
|
||||
}
|
||||
int[] trimStateSet = StateSet.trimStateSet(iArr3, i3);
|
||||
int a2 = a(color, f);
|
||||
if (i2 != 0) {
|
||||
int length = trimStateSet.length;
|
||||
}
|
||||
iArr2 = GrowingArrayUtils.a(iArr2, i2, a2);
|
||||
iArr = (int[][]) GrowingArrayUtils.a(iArr, i2, trimStateSet);
|
||||
i2++;
|
||||
}
|
||||
i = 1;
|
||||
}
|
||||
int[] iArr4 = new int[i2];
|
||||
int[][] iArr5 = new int[i2][];
|
||||
System.arraycopy(iArr2, 0, iArr4, 0, i2);
|
||||
System.arraycopy(iArr, 0, iArr5, 0, i2);
|
||||
return new ColorStateList(iArr5, iArr4);
|
||||
}
|
||||
|
||||
public static ColorStateList a(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
String name = xmlPullParser.getName();
|
||||
if (name.equals("selector")) {
|
||||
return b(resources, xmlPullParser, attributeSet, theme);
|
||||
}
|
||||
throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": invalid color state list tag " + name);
|
||||
}
|
||||
|
||||
private static TypedArray a(Resources resources, Resources.Theme theme, AttributeSet attributeSet, int[] iArr) {
|
||||
if (theme == null) {
|
||||
return resources.obtainAttributes(attributeSet, iArr);
|
||||
}
|
||||
return theme.obtainStyledAttributes(attributeSet, iArr, 0, 0);
|
||||
}
|
||||
|
||||
private static int a(int i, float f) {
|
||||
return (i & 16777215) | (Math.round(Color.alpha(i) * f) << 24);
|
||||
}
|
||||
}
|
||||
114
sources/androidx/core/content/res/ComplexColorCompat.java
Normal file
114
sources/androidx/core/content/res/ComplexColorCompat.java
Normal file
@@ -0,0 +1,114 @@
|
||||
package androidx.core.content.res;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.graphics.Shader;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.Xml;
|
||||
import java.io.IOException;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ComplexColorCompat {
|
||||
private final Shader a;
|
||||
private final ColorStateList b;
|
||||
private int c;
|
||||
|
||||
private ComplexColorCompat(Shader shader, ColorStateList colorStateList, int i) {
|
||||
this.a = shader;
|
||||
this.b = colorStateList;
|
||||
this.c = i;
|
||||
}
|
||||
|
||||
static ComplexColorCompat a(Shader shader) {
|
||||
return new ComplexColorCompat(shader, null, 0);
|
||||
}
|
||||
|
||||
static ComplexColorCompat b(int i) {
|
||||
return new ComplexColorCompat(null, null, i);
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
return this.a != null;
|
||||
}
|
||||
|
||||
public boolean d() {
|
||||
ColorStateList colorStateList;
|
||||
return this.a == null && (colorStateList = this.b) != null && colorStateList.isStateful();
|
||||
}
|
||||
|
||||
public boolean e() {
|
||||
return c() || this.c != 0;
|
||||
}
|
||||
|
||||
static ComplexColorCompat a(ColorStateList colorStateList) {
|
||||
return new ComplexColorCompat(null, colorStateList, colorStateList.getDefaultColor());
|
||||
}
|
||||
|
||||
public Shader b() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public static ComplexColorCompat b(Resources resources, int i, Resources.Theme theme) {
|
||||
try {
|
||||
return a(resources, i, theme);
|
||||
} catch (Exception e) {
|
||||
Log.e("ComplexColorCompat", "Failed to inflate ComplexColor.", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.c = i;
|
||||
}
|
||||
|
||||
public boolean a(int[] iArr) {
|
||||
if (d()) {
|
||||
ColorStateList colorStateList = this.b;
|
||||
int colorForState = colorStateList.getColorForState(iArr, colorStateList.getDefaultColor());
|
||||
if (colorForState != this.c) {
|
||||
this.c = colorForState;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static ComplexColorCompat a(Resources resources, int i, Resources.Theme theme) throws IOException, XmlPullParserException {
|
||||
int next;
|
||||
XmlResourceParser xml = resources.getXml(i);
|
||||
AttributeSet asAttributeSet = Xml.asAttributeSet(xml);
|
||||
do {
|
||||
next = xml.next();
|
||||
if (next == 2) {
|
||||
break;
|
||||
}
|
||||
} while (next != 1);
|
||||
if (next == 2) {
|
||||
String name = xml.getName();
|
||||
char c = 65535;
|
||||
int hashCode = name.hashCode();
|
||||
if (hashCode != 89650992) {
|
||||
if (hashCode == 1191572447 && name.equals("selector")) {
|
||||
c = 0;
|
||||
}
|
||||
} else if (name.equals("gradient")) {
|
||||
c = 1;
|
||||
}
|
||||
if (c == 0) {
|
||||
return a(ColorStateListInflaterCompat.a(resources, xml, asAttributeSet, theme));
|
||||
}
|
||||
if (c == 1) {
|
||||
return a(GradientColorInflaterCompat.a(resources, xml, asAttributeSet, theme));
|
||||
}
|
||||
throw new XmlPullParserException(xml.getPositionDescription() + ": unsupported complex color tag " + name);
|
||||
}
|
||||
throw new XmlPullParserException("No start tag found");
|
||||
}
|
||||
}
|
||||
228
sources/androidx/core/content/res/FontResourcesParserCompat.java
Normal file
228
sources/androidx/core/content/res/FontResourcesParserCompat.java
Normal file
@@ -0,0 +1,228 @@
|
||||
package androidx.core.content.res;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Build;
|
||||
import android.util.Base64;
|
||||
import android.util.TypedValue;
|
||||
import android.util.Xml;
|
||||
import androidx.core.R$styleable;
|
||||
import androidx.core.provider.FontRequest;
|
||||
import com.ubt.jimu.base.mvp.SingleClickListener;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FontResourcesParserCompat {
|
||||
|
||||
public interface FamilyResourceEntry {
|
||||
}
|
||||
|
||||
public static final class FontFamilyFilesResourceEntry implements FamilyResourceEntry {
|
||||
private final FontFileResourceEntry[] a;
|
||||
|
||||
public FontFamilyFilesResourceEntry(FontFileResourceEntry[] fontFileResourceEntryArr) {
|
||||
this.a = fontFileResourceEntryArr;
|
||||
}
|
||||
|
||||
public FontFileResourceEntry[] a() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class FontFileResourceEntry {
|
||||
private final String a;
|
||||
private int b;
|
||||
private boolean c;
|
||||
private String d;
|
||||
private int e;
|
||||
private int f;
|
||||
|
||||
public FontFileResourceEntry(String str, int i, boolean z, String str2, int i2, int i3) {
|
||||
this.a = str;
|
||||
this.b = i;
|
||||
this.c = z;
|
||||
this.d = str2;
|
||||
this.e = i2;
|
||||
this.f = i3;
|
||||
}
|
||||
|
||||
public String a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public int b() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
public int c() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public String d() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public int e() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public boolean f() {
|
||||
return this.c;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class ProviderResourceEntry implements FamilyResourceEntry {
|
||||
private final FontRequest a;
|
||||
private final int b;
|
||||
private final int c;
|
||||
|
||||
public ProviderResourceEntry(FontRequest fontRequest, int i, int i2) {
|
||||
this.a = fontRequest;
|
||||
this.c = i;
|
||||
this.b = i2;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public FontRequest b() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public int c() {
|
||||
return this.b;
|
||||
}
|
||||
}
|
||||
|
||||
public static FamilyResourceEntry a(XmlPullParser xmlPullParser, Resources resources) throws XmlPullParserException, IOException {
|
||||
int next;
|
||||
do {
|
||||
next = xmlPullParser.next();
|
||||
if (next == 2) {
|
||||
break;
|
||||
}
|
||||
} while (next != 1);
|
||||
if (next == 2) {
|
||||
return b(xmlPullParser, resources);
|
||||
}
|
||||
throw new XmlPullParserException("No start tag found");
|
||||
}
|
||||
|
||||
private static FamilyResourceEntry b(XmlPullParser xmlPullParser, Resources resources) throws XmlPullParserException, IOException {
|
||||
xmlPullParser.require(2, null, "font-family");
|
||||
if (xmlPullParser.getName().equals("font-family")) {
|
||||
return c(xmlPullParser, resources);
|
||||
}
|
||||
a(xmlPullParser);
|
||||
return null;
|
||||
}
|
||||
|
||||
private static FamilyResourceEntry c(XmlPullParser xmlPullParser, Resources resources) throws XmlPullParserException, IOException {
|
||||
TypedArray obtainAttributes = resources.obtainAttributes(Xml.asAttributeSet(xmlPullParser), R$styleable.FontFamily);
|
||||
String string = obtainAttributes.getString(R$styleable.FontFamily_fontProviderAuthority);
|
||||
String string2 = obtainAttributes.getString(R$styleable.FontFamily_fontProviderPackage);
|
||||
String string3 = obtainAttributes.getString(R$styleable.FontFamily_fontProviderQuery);
|
||||
int resourceId = obtainAttributes.getResourceId(R$styleable.FontFamily_fontProviderCerts, 0);
|
||||
int integer = obtainAttributes.getInteger(R$styleable.FontFamily_fontProviderFetchStrategy, 1);
|
||||
int integer2 = obtainAttributes.getInteger(R$styleable.FontFamily_fontProviderFetchTimeout, SingleClickListener.FAST_CLICK_DELAY_TIME);
|
||||
obtainAttributes.recycle();
|
||||
if (string != null && string2 != null && string3 != null) {
|
||||
while (xmlPullParser.next() != 3) {
|
||||
a(xmlPullParser);
|
||||
}
|
||||
return new ProviderResourceEntry(new FontRequest(string, string2, string3, a(resources, resourceId)), integer, integer2);
|
||||
}
|
||||
ArrayList arrayList = new ArrayList();
|
||||
while (xmlPullParser.next() != 3) {
|
||||
if (xmlPullParser.getEventType() == 2) {
|
||||
if (xmlPullParser.getName().equals("font")) {
|
||||
arrayList.add(d(xmlPullParser, resources));
|
||||
} else {
|
||||
a(xmlPullParser);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (arrayList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return new FontFamilyFilesResourceEntry((FontFileResourceEntry[]) arrayList.toArray(new FontFileResourceEntry[arrayList.size()]));
|
||||
}
|
||||
|
||||
private static FontFileResourceEntry d(XmlPullParser xmlPullParser, Resources resources) throws XmlPullParserException, IOException {
|
||||
TypedArray obtainAttributes = resources.obtainAttributes(Xml.asAttributeSet(xmlPullParser), R$styleable.FontFamilyFont);
|
||||
int i = obtainAttributes.getInt(obtainAttributes.hasValue(R$styleable.FontFamilyFont_fontWeight) ? R$styleable.FontFamilyFont_fontWeight : R$styleable.FontFamilyFont_android_fontWeight, 400);
|
||||
boolean z = 1 == obtainAttributes.getInt(obtainAttributes.hasValue(R$styleable.FontFamilyFont_fontStyle) ? R$styleable.FontFamilyFont_fontStyle : R$styleable.FontFamilyFont_android_fontStyle, 0);
|
||||
int i2 = obtainAttributes.hasValue(R$styleable.FontFamilyFont_ttcIndex) ? R$styleable.FontFamilyFont_ttcIndex : R$styleable.FontFamilyFont_android_ttcIndex;
|
||||
String string = obtainAttributes.getString(obtainAttributes.hasValue(R$styleable.FontFamilyFont_fontVariationSettings) ? R$styleable.FontFamilyFont_fontVariationSettings : R$styleable.FontFamilyFont_android_fontVariationSettings);
|
||||
int i3 = obtainAttributes.getInt(i2, 0);
|
||||
int i4 = obtainAttributes.hasValue(R$styleable.FontFamilyFont_font) ? R$styleable.FontFamilyFont_font : R$styleable.FontFamilyFont_android_font;
|
||||
int resourceId = obtainAttributes.getResourceId(i4, 0);
|
||||
String string2 = obtainAttributes.getString(i4);
|
||||
obtainAttributes.recycle();
|
||||
while (xmlPullParser.next() != 3) {
|
||||
a(xmlPullParser);
|
||||
}
|
||||
return new FontFileResourceEntry(string2, i, z, string, i3, resourceId);
|
||||
}
|
||||
|
||||
private static int a(TypedArray typedArray, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return typedArray.getType(i);
|
||||
}
|
||||
TypedValue typedValue = new TypedValue();
|
||||
typedArray.getValue(i, typedValue);
|
||||
return typedValue.type;
|
||||
}
|
||||
|
||||
public static List<List<byte[]>> a(Resources resources, int i) {
|
||||
if (i == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
TypedArray obtainTypedArray = resources.obtainTypedArray(i);
|
||||
try {
|
||||
if (obtainTypedArray.length() == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (a(obtainTypedArray, 0) == 1) {
|
||||
for (int i2 = 0; i2 < obtainTypedArray.length(); i2++) {
|
||||
int resourceId = obtainTypedArray.getResourceId(i2, 0);
|
||||
if (resourceId != 0) {
|
||||
arrayList.add(a(resources.getStringArray(resourceId)));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
arrayList.add(a(resources.getStringArray(i)));
|
||||
}
|
||||
return arrayList;
|
||||
} finally {
|
||||
obtainTypedArray.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
private static List<byte[]> a(String[] strArr) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (String str : strArr) {
|
||||
arrayList.add(Base64.decode(str, 0));
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
private static void a(XmlPullParser xmlPullParser) throws XmlPullParserException, IOException {
|
||||
int i = 1;
|
||||
while (i > 0) {
|
||||
int next = xmlPullParser.next();
|
||||
if (next == 2) {
|
||||
i++;
|
||||
} else if (next == 3) {
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package androidx.core.content.res;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.LinearGradient;
|
||||
import android.graphics.RadialGradient;
|
||||
import android.graphics.Shader;
|
||||
import android.graphics.SweepGradient;
|
||||
import android.util.AttributeSet;
|
||||
import androidx.core.R$styleable;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class GradientColorInflaterCompat {
|
||||
static Shader a(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws IOException, XmlPullParserException {
|
||||
String name = xmlPullParser.getName();
|
||||
if (!name.equals("gradient")) {
|
||||
throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": invalid gradient color tag " + name);
|
||||
}
|
||||
TypedArray a = TypedArrayUtils.a(resources, theme, attributeSet, R$styleable.GradientColor);
|
||||
float a2 = TypedArrayUtils.a(a, xmlPullParser, "startX", R$styleable.GradientColor_android_startX, 0.0f);
|
||||
float a3 = TypedArrayUtils.a(a, xmlPullParser, "startY", R$styleable.GradientColor_android_startY, 0.0f);
|
||||
float a4 = TypedArrayUtils.a(a, xmlPullParser, "endX", R$styleable.GradientColor_android_endX, 0.0f);
|
||||
float a5 = TypedArrayUtils.a(a, xmlPullParser, "endY", R$styleable.GradientColor_android_endY, 0.0f);
|
||||
float a6 = TypedArrayUtils.a(a, xmlPullParser, "centerX", R$styleable.GradientColor_android_centerX, 0.0f);
|
||||
float a7 = TypedArrayUtils.a(a, xmlPullParser, "centerY", R$styleable.GradientColor_android_centerY, 0.0f);
|
||||
int b = TypedArrayUtils.b(a, xmlPullParser, "type", R$styleable.GradientColor_android_type, 0);
|
||||
int a8 = TypedArrayUtils.a(a, xmlPullParser, "startColor", R$styleable.GradientColor_android_startColor, 0);
|
||||
boolean a9 = TypedArrayUtils.a(xmlPullParser, "centerColor");
|
||||
int a10 = TypedArrayUtils.a(a, xmlPullParser, "centerColor", R$styleable.GradientColor_android_centerColor, 0);
|
||||
int a11 = TypedArrayUtils.a(a, xmlPullParser, "endColor", R$styleable.GradientColor_android_endColor, 0);
|
||||
int b2 = TypedArrayUtils.b(a, xmlPullParser, "tileMode", R$styleable.GradientColor_android_tileMode, 0);
|
||||
float a12 = TypedArrayUtils.a(a, xmlPullParser, "gradientRadius", R$styleable.GradientColor_android_gradientRadius, 0.0f);
|
||||
a.recycle();
|
||||
ColorStops a13 = a(b(resources, xmlPullParser, attributeSet, theme), a8, a11, a9, a10);
|
||||
if (b != 1) {
|
||||
return b != 2 ? new LinearGradient(a2, a3, a4, a5, a13.a, a13.b, a(b2)) : new SweepGradient(a6, a7, a13.a, a13.b);
|
||||
}
|
||||
if (a12 > 0.0f) {
|
||||
return new RadialGradient(a6, a7, a12, a13.a, a13.b, a(b2));
|
||||
}
|
||||
throw new XmlPullParserException("<gradient> tag requires 'gradientRadius' attribute with radial type");
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:31:0x0089, code lost:
|
||||
|
||||
throw new org.xmlpull.v1.XmlPullParserException(r9.getPositionDescription() + ": <item> tag requires a 'color' attribute and a 'offset' attribute!");
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private static androidx.core.content.res.GradientColorInflaterCompat.ColorStops b(android.content.res.Resources r8, org.xmlpull.v1.XmlPullParser r9, android.util.AttributeSet r10, android.content.res.Resources.Theme r11) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {
|
||||
/*
|
||||
int r0 = r9.getDepth()
|
||||
r1 = 1
|
||||
int r0 = r0 + r1
|
||||
java.util.ArrayList r2 = new java.util.ArrayList
|
||||
r3 = 20
|
||||
r2.<init>(r3)
|
||||
java.util.ArrayList r4 = new java.util.ArrayList
|
||||
r4.<init>(r3)
|
||||
L12:
|
||||
int r3 = r9.next()
|
||||
if (r3 == r1) goto L8a
|
||||
int r5 = r9.getDepth()
|
||||
if (r5 >= r0) goto L21
|
||||
r6 = 3
|
||||
if (r3 == r6) goto L8a
|
||||
L21:
|
||||
r6 = 2
|
||||
if (r3 == r6) goto L25
|
||||
goto L12
|
||||
L25:
|
||||
if (r5 > r0) goto L12
|
||||
java.lang.String r3 = r9.getName()
|
||||
java.lang.String r5 = "item"
|
||||
boolean r3 = r3.equals(r5)
|
||||
if (r3 != 0) goto L34
|
||||
goto L12
|
||||
L34:
|
||||
int[] r3 = androidx.core.R$styleable.GradientColorItem
|
||||
android.content.res.TypedArray r3 = androidx.core.content.res.TypedArrayUtils.a(r8, r11, r10, r3)
|
||||
int r5 = androidx.core.R$styleable.GradientColorItem_android_color
|
||||
boolean r5 = r3.hasValue(r5)
|
||||
int r6 = androidx.core.R$styleable.GradientColorItem_android_offset
|
||||
boolean r6 = r3.hasValue(r6)
|
||||
if (r5 == 0) goto L6a
|
||||
if (r6 == 0) goto L6a
|
||||
int r5 = androidx.core.R$styleable.GradientColorItem_android_color
|
||||
r6 = 0
|
||||
int r5 = r3.getColor(r5, r6)
|
||||
int r6 = androidx.core.R$styleable.GradientColorItem_android_offset
|
||||
r7 = 0
|
||||
float r6 = r3.getFloat(r6, r7)
|
||||
r3.recycle()
|
||||
java.lang.Integer r3 = java.lang.Integer.valueOf(r5)
|
||||
r4.add(r3)
|
||||
java.lang.Float r3 = java.lang.Float.valueOf(r6)
|
||||
r2.add(r3)
|
||||
goto L12
|
||||
L6a:
|
||||
org.xmlpull.v1.XmlPullParserException r8 = new org.xmlpull.v1.XmlPullParserException
|
||||
java.lang.StringBuilder r10 = new java.lang.StringBuilder
|
||||
r10.<init>()
|
||||
java.lang.String r9 = r9.getPositionDescription()
|
||||
r10.append(r9)
|
||||
java.lang.String r9 = ": <item> tag requires a 'color' attribute and a 'offset' "
|
||||
r10.append(r9)
|
||||
java.lang.String r9 = "attribute!"
|
||||
r10.append(r9)
|
||||
java.lang.String r9 = r10.toString()
|
||||
r8.<init>(r9)
|
||||
throw r8
|
||||
L8a:
|
||||
int r8 = r4.size()
|
||||
if (r8 <= 0) goto L96
|
||||
androidx.core.content.res.GradientColorInflaterCompat$ColorStops r8 = new androidx.core.content.res.GradientColorInflaterCompat$ColorStops
|
||||
r8.<init>(r4, r2)
|
||||
return r8
|
||||
L96:
|
||||
r8 = 0
|
||||
return r8
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.core.content.res.GradientColorInflaterCompat.b(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources$Theme):androidx.core.content.res.GradientColorInflaterCompat$ColorStops");
|
||||
}
|
||||
|
||||
static final class ColorStops {
|
||||
final int[] a;
|
||||
final float[] b;
|
||||
|
||||
ColorStops(List<Integer> list, List<Float> list2) {
|
||||
int size = list.size();
|
||||
this.a = new int[size];
|
||||
this.b = new float[size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.a[i] = list.get(i).intValue();
|
||||
this.b[i] = list2.get(i).floatValue();
|
||||
}
|
||||
}
|
||||
|
||||
ColorStops(int i, int i2) {
|
||||
this.a = new int[]{i, i2};
|
||||
this.b = new float[]{0.0f, 1.0f};
|
||||
}
|
||||
|
||||
ColorStops(int i, int i2, int i3) {
|
||||
this.a = new int[]{i, i2, i3};
|
||||
this.b = new float[]{0.0f, 0.5f, 1.0f};
|
||||
}
|
||||
}
|
||||
|
||||
private static ColorStops a(ColorStops colorStops, int i, int i2, boolean z, int i3) {
|
||||
if (colorStops != null) {
|
||||
return colorStops;
|
||||
}
|
||||
if (z) {
|
||||
return new ColorStops(i, i3, i2);
|
||||
}
|
||||
return new ColorStops(i, i2);
|
||||
}
|
||||
|
||||
private static Shader.TileMode a(int i) {
|
||||
if (i == 1) {
|
||||
return Shader.TileMode.REPEAT;
|
||||
}
|
||||
if (i != 2) {
|
||||
return Shader.TileMode.CLAMP;
|
||||
}
|
||||
return Shader.TileMode.MIRROR;
|
||||
}
|
||||
}
|
||||
35
sources/androidx/core/content/res/GrowingArrayUtils.java
Normal file
35
sources/androidx/core/content/res/GrowingArrayUtils.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package androidx.core.content.res;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class GrowingArrayUtils {
|
||||
public static int a(int i) {
|
||||
if (i <= 4) {
|
||||
return 8;
|
||||
}
|
||||
return i * 2;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r0v4, types: [java.lang.Object, java.lang.Object[]] */
|
||||
public static <T> T[] a(T[] tArr, int i, T t) {
|
||||
if (i + 1 > tArr.length) {
|
||||
?? r0 = (Object[]) Array.newInstance(tArr.getClass().getComponentType(), a(i));
|
||||
System.arraycopy(tArr, 0, r0, 0, i);
|
||||
tArr = r0;
|
||||
}
|
||||
tArr[i] = t;
|
||||
return tArr;
|
||||
}
|
||||
|
||||
public static int[] a(int[] iArr, int i, int i2) {
|
||||
if (i + 1 > iArr.length) {
|
||||
int[] iArr2 = new int[a(i)];
|
||||
System.arraycopy(iArr, 0, iArr2, 0, i);
|
||||
iArr = iArr2;
|
||||
}
|
||||
iArr[i] = i2;
|
||||
return iArr;
|
||||
}
|
||||
}
|
||||
178
sources/androidx/core/content/res/ResourcesCompat.java
Normal file
178
sources/androidx/core/content/res/ResourcesCompat.java
Normal file
@@ -0,0 +1,178 @@
|
||||
package androidx.core.content.res;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.TypedValue;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ResourcesCompat {
|
||||
public static Drawable a(Resources resources, int i, Resources.Theme theme) throws Resources.NotFoundException {
|
||||
return Build.VERSION.SDK_INT >= 21 ? resources.getDrawable(i, theme) : resources.getDrawable(i);
|
||||
}
|
||||
|
||||
public static abstract class FontCallback {
|
||||
public abstract void a(int i);
|
||||
|
||||
public abstract void a(Typeface typeface);
|
||||
|
||||
public final void a(final Typeface typeface, Handler handler) {
|
||||
if (handler == null) {
|
||||
handler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
handler.post(new Runnable() { // from class: androidx.core.content.res.ResourcesCompat.FontCallback.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
FontCallback.this.a(typeface);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public final void a(final int i, Handler handler) {
|
||||
if (handler == null) {
|
||||
handler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
handler.post(new Runnable() { // from class: androidx.core.content.res.ResourcesCompat.FontCallback.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
FontCallback.this.a(i);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static Typeface a(Context context, int i, TypedValue typedValue, int i2, FontCallback fontCallback) throws Resources.NotFoundException {
|
||||
if (context.isRestricted()) {
|
||||
return null;
|
||||
}
|
||||
return a(context, i, typedValue, i2, fontCallback, null, true);
|
||||
}
|
||||
|
||||
private static Typeface a(Context context, int i, TypedValue typedValue, int i2, FontCallback fontCallback, Handler handler, boolean z) {
|
||||
Resources resources = context.getResources();
|
||||
resources.getValue(i, typedValue, true);
|
||||
Typeface a = a(context, resources, typedValue, i, i2, fontCallback, handler, z);
|
||||
if (a != null || fontCallback != null) {
|
||||
return a;
|
||||
}
|
||||
throw new Resources.NotFoundException("Font resource ID #0x" + Integer.toHexString(i) + " could not be retrieved.");
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:34:0x00a3 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private static android.graphics.Typeface a(android.content.Context r15, android.content.res.Resources r16, android.util.TypedValue r17, int r18, int r19, androidx.core.content.res.ResourcesCompat.FontCallback r20, android.os.Handler r21, boolean r22) {
|
||||
/*
|
||||
r0 = r16
|
||||
r1 = r17
|
||||
r4 = r18
|
||||
r5 = r19
|
||||
r9 = r20
|
||||
r10 = r21
|
||||
java.lang.String r11 = "ResourcesCompat"
|
||||
java.lang.CharSequence r2 = r1.string
|
||||
if (r2 == 0) goto La7
|
||||
java.lang.String r12 = r2.toString()
|
||||
java.lang.String r1 = "res/"
|
||||
boolean r1 = r12.startsWith(r1)
|
||||
r13 = 0
|
||||
r14 = -3
|
||||
if (r1 != 0) goto L26
|
||||
if (r9 == 0) goto L25
|
||||
r9.a(r14, r10)
|
||||
L25:
|
||||
return r13
|
||||
L26:
|
||||
android.graphics.Typeface r1 = androidx.core.graphics.TypefaceCompat.b(r0, r4, r5)
|
||||
if (r1 == 0) goto L32
|
||||
if (r9 == 0) goto L31
|
||||
r9.a(r1, r10)
|
||||
L31:
|
||||
return r1
|
||||
L32:
|
||||
java.lang.String r1 = r12.toLowerCase() // Catch: java.io.IOException -> L76 org.xmlpull.v1.XmlPullParserException -> L8c
|
||||
java.lang.String r2 = ".xml"
|
||||
boolean r1 = r1.endsWith(r2) // Catch: java.io.IOException -> L76 org.xmlpull.v1.XmlPullParserException -> L8c
|
||||
if (r1 == 0) goto L65
|
||||
android.content.res.XmlResourceParser r1 = r0.getXml(r4) // Catch: java.io.IOException -> L76 org.xmlpull.v1.XmlPullParserException -> L8c
|
||||
androidx.core.content.res.FontResourcesParserCompat$FamilyResourceEntry r2 = androidx.core.content.res.FontResourcesParserCompat.a(r1, r0) // Catch: java.io.IOException -> L76 org.xmlpull.v1.XmlPullParserException -> L8c
|
||||
if (r2 != 0) goto L53
|
||||
java.lang.String r0 = "Failed to find font-family tag"
|
||||
android.util.Log.e(r11, r0) // Catch: java.io.IOException -> L76 org.xmlpull.v1.XmlPullParserException -> L8c
|
||||
if (r9 == 0) goto L52
|
||||
r9.a(r14, r10) // Catch: java.io.IOException -> L76 org.xmlpull.v1.XmlPullParserException -> L8c
|
||||
L52:
|
||||
return r13
|
||||
L53:
|
||||
r1 = r15
|
||||
r3 = r16
|
||||
r4 = r18
|
||||
r5 = r19
|
||||
r6 = r20
|
||||
r7 = r21
|
||||
r8 = r22
|
||||
android.graphics.Typeface r0 = androidx.core.graphics.TypefaceCompat.a(r1, r2, r3, r4, r5, r6, r7, r8) // Catch: java.io.IOException -> L76 org.xmlpull.v1.XmlPullParserException -> L8c
|
||||
return r0
|
||||
L65:
|
||||
r1 = r15
|
||||
android.graphics.Typeface r0 = androidx.core.graphics.TypefaceCompat.a(r15, r0, r4, r12, r5) // Catch: java.io.IOException -> L76 org.xmlpull.v1.XmlPullParserException -> L8c
|
||||
if (r9 == 0) goto L75
|
||||
if (r0 == 0) goto L72
|
||||
r9.a(r0, r10) // Catch: java.io.IOException -> L76 org.xmlpull.v1.XmlPullParserException -> L8c
|
||||
goto L75
|
||||
L72:
|
||||
r9.a(r14, r10) // Catch: java.io.IOException -> L76 org.xmlpull.v1.XmlPullParserException -> L8c
|
||||
L75:
|
||||
return r0
|
||||
L76:
|
||||
r0 = move-exception
|
||||
java.lang.StringBuilder r1 = new java.lang.StringBuilder
|
||||
r1.<init>()
|
||||
java.lang.String r2 = "Failed to read xml resource "
|
||||
r1.append(r2)
|
||||
r1.append(r12)
|
||||
java.lang.String r1 = r1.toString()
|
||||
android.util.Log.e(r11, r1, r0)
|
||||
goto La1
|
||||
L8c:
|
||||
r0 = move-exception
|
||||
java.lang.StringBuilder r1 = new java.lang.StringBuilder
|
||||
r1.<init>()
|
||||
java.lang.String r2 = "Failed to parse xml resource "
|
||||
r1.append(r2)
|
||||
r1.append(r12)
|
||||
java.lang.String r1 = r1.toString()
|
||||
android.util.Log.e(r11, r1, r0)
|
||||
La1:
|
||||
if (r9 == 0) goto La6
|
||||
r9.a(r14, r10)
|
||||
La6:
|
||||
return r13
|
||||
La7:
|
||||
android.content.res.Resources$NotFoundException r2 = new android.content.res.Resources$NotFoundException
|
||||
java.lang.StringBuilder r3 = new java.lang.StringBuilder
|
||||
r3.<init>()
|
||||
java.lang.String r5 = "Resource \""
|
||||
r3.append(r5)
|
||||
java.lang.String r0 = r0.getResourceName(r4)
|
||||
r3.append(r0)
|
||||
java.lang.String r0 = "\" ("
|
||||
r3.append(r0)
|
||||
java.lang.String r0 = java.lang.Integer.toHexString(r18)
|
||||
r3.append(r0)
|
||||
java.lang.String r0 = ") is not a Font: "
|
||||
r3.append(r0)
|
||||
r3.append(r1)
|
||||
java.lang.String r0 = r3.toString()
|
||||
r2.<init>(r0)
|
||||
throw r2
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.core.content.res.ResourcesCompat.a(android.content.Context, android.content.res.Resources, android.util.TypedValue, int, int, androidx.core.content.res.ResourcesCompat$FontCallback, android.os.Handler, boolean):android.graphics.Typeface");
|
||||
}
|
||||
}
|
||||
71
sources/androidx/core/content/res/TypedArrayUtils.java
Normal file
71
sources/androidx/core/content/res/TypedArrayUtils.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package androidx.core.content.res;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class TypedArrayUtils {
|
||||
public static boolean a(XmlPullParser xmlPullParser, String str) {
|
||||
return xmlPullParser.getAttributeValue("http://schemas.android.com/apk/res/android", str) != null;
|
||||
}
|
||||
|
||||
public static int b(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
|
||||
return !a(xmlPullParser, str) ? i2 : typedArray.getInt(i, i2);
|
||||
}
|
||||
|
||||
public static int c(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
|
||||
return !a(xmlPullParser, str) ? i2 : typedArray.getResourceId(i, i2);
|
||||
}
|
||||
|
||||
public static float a(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, float f) {
|
||||
return !a(xmlPullParser, str) ? f : typedArray.getFloat(i, f);
|
||||
}
|
||||
|
||||
public static TypedValue b(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i) {
|
||||
if (a(xmlPullParser, str)) {
|
||||
return typedArray.peekValue(i);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean a(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, boolean z) {
|
||||
return !a(xmlPullParser, str) ? z : typedArray.getBoolean(i, z);
|
||||
}
|
||||
|
||||
public static int a(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
|
||||
return !a(xmlPullParser, str) ? i2 : typedArray.getColor(i, i2);
|
||||
}
|
||||
|
||||
public static ComplexColorCompat a(TypedArray typedArray, XmlPullParser xmlPullParser, Resources.Theme theme, String str, int i, int i2) {
|
||||
if (a(xmlPullParser, str)) {
|
||||
TypedValue typedValue = new TypedValue();
|
||||
typedArray.getValue(i, typedValue);
|
||||
int i3 = typedValue.type;
|
||||
if (i3 >= 28 && i3 <= 31) {
|
||||
return ComplexColorCompat.b(typedValue.data);
|
||||
}
|
||||
ComplexColorCompat b = ComplexColorCompat.b(typedArray.getResources(), typedArray.getResourceId(i, 0), theme);
|
||||
if (b != null) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return ComplexColorCompat.b(i2);
|
||||
}
|
||||
|
||||
public static String a(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i) {
|
||||
if (a(xmlPullParser, str)) {
|
||||
return typedArray.getString(i);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static TypedArray a(Resources resources, Resources.Theme theme, AttributeSet attributeSet, int[] iArr) {
|
||||
if (theme == null) {
|
||||
return resources.obtainAttributes(attributeSet, iArr);
|
||||
}
|
||||
return theme.obtainStyledAttributes(attributeSet, iArr, 0, 0);
|
||||
}
|
||||
}
|
||||
35
sources/androidx/core/graphics/ColorUtils.java
Normal file
35
sources/androidx/core/graphics/ColorUtils.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package androidx.core.graphics;
|
||||
|
||||
import android.graphics.Color;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ColorUtils {
|
||||
static {
|
||||
new ThreadLocal();
|
||||
}
|
||||
|
||||
private static int a(int i, int i2) {
|
||||
return 255 - (((255 - i2) * (255 - i)) / 255);
|
||||
}
|
||||
|
||||
public static int b(int i, int i2) {
|
||||
int alpha = Color.alpha(i2);
|
||||
int alpha2 = Color.alpha(i);
|
||||
int a = a(alpha2, alpha);
|
||||
return Color.argb(a, a(Color.red(i), alpha2, Color.red(i2), alpha, a), a(Color.green(i), alpha2, Color.green(i2), alpha, a), a(Color.blue(i), alpha2, Color.blue(i2), alpha, a));
|
||||
}
|
||||
|
||||
public static int c(int i, int i2) {
|
||||
if (i2 < 0 || i2 > 255) {
|
||||
throw new IllegalArgumentException("alpha must be between 0 and 255.");
|
||||
}
|
||||
return (i & 16777215) | (i2 << 24);
|
||||
}
|
||||
|
||||
private static int a(int i, int i2, int i3, int i4, int i5) {
|
||||
if (i5 == 0) {
|
||||
return 0;
|
||||
}
|
||||
return (((i * 255) * i2) + ((i3 * i4) * (255 - i2))) / (i5 * 255);
|
||||
}
|
||||
}
|
||||
636
sources/androidx/core/graphics/PathParser.java
Normal file
636
sources/androidx/core/graphics/PathParser.java
Normal file
@@ -0,0 +1,636 @@
|
||||
package androidx.core.graphics;
|
||||
|
||||
import android.graphics.Path;
|
||||
import android.util.Log;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PathParser {
|
||||
|
||||
private static class ExtractFloatResult {
|
||||
int a;
|
||||
boolean b;
|
||||
|
||||
ExtractFloatResult() {
|
||||
}
|
||||
}
|
||||
|
||||
static float[] a(float[] fArr, int i, int i2) {
|
||||
if (i > i2) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
int length = fArr.length;
|
||||
if (i < 0 || i > length) {
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
}
|
||||
int i3 = i2 - i;
|
||||
int min = Math.min(i3, length - i);
|
||||
float[] fArr2 = new float[i3];
|
||||
System.arraycopy(fArr, i, fArr2, 0, min);
|
||||
return fArr2;
|
||||
}
|
||||
|
||||
public static Path b(String str) {
|
||||
Path path = new Path();
|
||||
PathDataNode[] a = a(str);
|
||||
if (a == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
PathDataNode.a(a, path);
|
||||
return path;
|
||||
} catch (RuntimeException e) {
|
||||
throw new RuntimeException("Error in parsing " + str, e);
|
||||
}
|
||||
}
|
||||
|
||||
private static float[] c(String str) {
|
||||
if (str.charAt(0) == 'z' || str.charAt(0) == 'Z') {
|
||||
return new float[0];
|
||||
}
|
||||
try {
|
||||
float[] fArr = new float[str.length()];
|
||||
ExtractFloatResult extractFloatResult = new ExtractFloatResult();
|
||||
int length = str.length();
|
||||
int i = 1;
|
||||
int i2 = 0;
|
||||
while (i < length) {
|
||||
a(str, i, extractFloatResult);
|
||||
int i3 = extractFloatResult.a;
|
||||
if (i < i3) {
|
||||
fArr[i2] = Float.parseFloat(str.substring(i, i3));
|
||||
i2++;
|
||||
}
|
||||
i = extractFloatResult.b ? i3 : i3 + 1;
|
||||
}
|
||||
return a(fArr, 0, i2);
|
||||
} catch (NumberFormatException e) {
|
||||
throw new RuntimeException("error in parsing \"" + str + "\"", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static class PathDataNode {
|
||||
public char a;
|
||||
public float[] b;
|
||||
|
||||
PathDataNode(char c, float[] fArr) {
|
||||
this.a = c;
|
||||
this.b = fArr;
|
||||
}
|
||||
|
||||
public static void a(PathDataNode[] pathDataNodeArr, Path path) {
|
||||
float[] fArr = new float[6];
|
||||
char c = 'm';
|
||||
for (int i = 0; i < pathDataNodeArr.length; i++) {
|
||||
a(path, fArr, c, pathDataNodeArr[i].a, pathDataNodeArr[i].b);
|
||||
c = pathDataNodeArr[i].a;
|
||||
}
|
||||
}
|
||||
|
||||
PathDataNode(PathDataNode pathDataNode) {
|
||||
this.a = pathDataNode.a;
|
||||
float[] fArr = pathDataNode.b;
|
||||
this.b = PathParser.a(fArr, 0, fArr.length);
|
||||
}
|
||||
|
||||
public void a(PathDataNode pathDataNode, PathDataNode pathDataNode2, float f) {
|
||||
int i = 0;
|
||||
while (true) {
|
||||
float[] fArr = pathDataNode.b;
|
||||
if (i >= fArr.length) {
|
||||
return;
|
||||
}
|
||||
this.b[i] = (fArr[i] * (1.0f - f)) + (pathDataNode2.b[i] * f);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
|
||||
private static void a(Path path, float[] fArr, char c, char c2, float[] fArr2) {
|
||||
int i;
|
||||
int i2;
|
||||
float f;
|
||||
float f2;
|
||||
float f3;
|
||||
float f4;
|
||||
float f5;
|
||||
float f6;
|
||||
float f7;
|
||||
float f8;
|
||||
char c3 = c2;
|
||||
float f9 = fArr[0];
|
||||
float f10 = fArr[1];
|
||||
float f11 = fArr[2];
|
||||
float f12 = fArr[3];
|
||||
float f13 = fArr[4];
|
||||
float f14 = fArr[5];
|
||||
switch (c3) {
|
||||
case 'A':
|
||||
case 'a':
|
||||
i = 7;
|
||||
break;
|
||||
case 'C':
|
||||
case 'c':
|
||||
i = 6;
|
||||
break;
|
||||
case 'H':
|
||||
case 'V':
|
||||
case 'h':
|
||||
case 'v':
|
||||
i = 1;
|
||||
break;
|
||||
case 'L':
|
||||
case 'M':
|
||||
case 'T':
|
||||
case 'l':
|
||||
case 'm':
|
||||
case 't':
|
||||
default:
|
||||
i = 2;
|
||||
break;
|
||||
case 'Q':
|
||||
case 'S':
|
||||
case 'q':
|
||||
case 's':
|
||||
i = 4;
|
||||
break;
|
||||
case 'Z':
|
||||
case 'z':
|
||||
path.close();
|
||||
path.moveTo(f13, f14);
|
||||
f9 = f13;
|
||||
f11 = f9;
|
||||
f10 = f14;
|
||||
f12 = f10;
|
||||
i = 2;
|
||||
break;
|
||||
}
|
||||
float f15 = f9;
|
||||
float f16 = f10;
|
||||
float f17 = f13;
|
||||
float f18 = f14;
|
||||
int i3 = 0;
|
||||
char c4 = c;
|
||||
while (i3 < fArr2.length) {
|
||||
if (c3 != 'A') {
|
||||
if (c3 == 'C') {
|
||||
i2 = i3;
|
||||
int i4 = i2 + 2;
|
||||
int i5 = i2 + 3;
|
||||
int i6 = i2 + 4;
|
||||
int i7 = i2 + 5;
|
||||
path.cubicTo(fArr2[i2 + 0], fArr2[i2 + 1], fArr2[i4], fArr2[i5], fArr2[i6], fArr2[i7]);
|
||||
f15 = fArr2[i6];
|
||||
float f19 = fArr2[i7];
|
||||
float f20 = fArr2[i4];
|
||||
float f21 = fArr2[i5];
|
||||
f16 = f19;
|
||||
f12 = f21;
|
||||
f11 = f20;
|
||||
} else if (c3 == 'H') {
|
||||
i2 = i3;
|
||||
int i8 = i2 + 0;
|
||||
path.lineTo(fArr2[i8], f16);
|
||||
f15 = fArr2[i8];
|
||||
} else if (c3 == 'Q') {
|
||||
i2 = i3;
|
||||
int i9 = i2 + 0;
|
||||
int i10 = i2 + 1;
|
||||
int i11 = i2 + 2;
|
||||
int i12 = i2 + 3;
|
||||
path.quadTo(fArr2[i9], fArr2[i10], fArr2[i11], fArr2[i12]);
|
||||
float f22 = fArr2[i9];
|
||||
float f23 = fArr2[i10];
|
||||
f15 = fArr2[i11];
|
||||
f16 = fArr2[i12];
|
||||
f11 = f22;
|
||||
f12 = f23;
|
||||
} else if (c3 == 'V') {
|
||||
i2 = i3;
|
||||
int i13 = i2 + 0;
|
||||
path.lineTo(f15, fArr2[i13]);
|
||||
f16 = fArr2[i13];
|
||||
} else if (c3 != 'a') {
|
||||
if (c3 != 'c') {
|
||||
if (c3 == 'h') {
|
||||
int i14 = i3 + 0;
|
||||
path.rLineTo(fArr2[i14], 0.0f);
|
||||
f15 += fArr2[i14];
|
||||
} else if (c3 != 'q') {
|
||||
if (c3 == 'v') {
|
||||
int i15 = i3 + 0;
|
||||
path.rLineTo(0.0f, fArr2[i15]);
|
||||
f4 = fArr2[i15];
|
||||
} else if (c3 == 'L') {
|
||||
int i16 = i3 + 0;
|
||||
int i17 = i3 + 1;
|
||||
path.lineTo(fArr2[i16], fArr2[i17]);
|
||||
f15 = fArr2[i16];
|
||||
f16 = fArr2[i17];
|
||||
} else if (c3 == 'M') {
|
||||
int i18 = i3 + 0;
|
||||
f15 = fArr2[i18];
|
||||
int i19 = i3 + 1;
|
||||
f16 = fArr2[i19];
|
||||
if (i3 > 0) {
|
||||
path.lineTo(fArr2[i18], fArr2[i19]);
|
||||
} else {
|
||||
path.moveTo(fArr2[i18], fArr2[i19]);
|
||||
f18 = f16;
|
||||
f17 = f15;
|
||||
}
|
||||
} else if (c3 == 'S') {
|
||||
if (c4 == 'c' || c4 == 's' || c4 == 'C' || c4 == 'S') {
|
||||
f15 = (f15 * 2.0f) - f11;
|
||||
f16 = (f16 * 2.0f) - f12;
|
||||
}
|
||||
float f24 = f16;
|
||||
int i20 = i3 + 0;
|
||||
int i21 = i3 + 1;
|
||||
int i22 = i3 + 2;
|
||||
int i23 = i3 + 3;
|
||||
path.cubicTo(f15, f24, fArr2[i20], fArr2[i21], fArr2[i22], fArr2[i23]);
|
||||
f = fArr2[i20];
|
||||
f2 = fArr2[i21];
|
||||
f15 = fArr2[i22];
|
||||
f16 = fArr2[i23];
|
||||
f11 = f;
|
||||
f12 = f2;
|
||||
} else if (c3 == 'T') {
|
||||
if (c4 == 'q' || c4 == 't' || c4 == 'Q' || c4 == 'T') {
|
||||
f15 = (f15 * 2.0f) - f11;
|
||||
f16 = (f16 * 2.0f) - f12;
|
||||
}
|
||||
int i24 = i3 + 0;
|
||||
int i25 = i3 + 1;
|
||||
path.quadTo(f15, f16, fArr2[i24], fArr2[i25]);
|
||||
float f25 = fArr2[i24];
|
||||
float f26 = fArr2[i25];
|
||||
f12 = f16;
|
||||
f11 = f15;
|
||||
i2 = i3;
|
||||
f15 = f25;
|
||||
f16 = f26;
|
||||
} else if (c3 == 'l') {
|
||||
int i26 = i3 + 0;
|
||||
int i27 = i3 + 1;
|
||||
path.rLineTo(fArr2[i26], fArr2[i27]);
|
||||
f15 += fArr2[i26];
|
||||
f4 = fArr2[i27];
|
||||
} else if (c3 == 'm') {
|
||||
int i28 = i3 + 0;
|
||||
f15 += fArr2[i28];
|
||||
int i29 = i3 + 1;
|
||||
f16 += fArr2[i29];
|
||||
if (i3 > 0) {
|
||||
path.rLineTo(fArr2[i28], fArr2[i29]);
|
||||
} else {
|
||||
path.rMoveTo(fArr2[i28], fArr2[i29]);
|
||||
f18 = f16;
|
||||
f17 = f15;
|
||||
}
|
||||
} else if (c3 == 's') {
|
||||
if (c4 == 'c' || c4 == 's' || c4 == 'C' || c4 == 'S') {
|
||||
float f27 = f15 - f11;
|
||||
f5 = f16 - f12;
|
||||
f6 = f27;
|
||||
} else {
|
||||
f6 = 0.0f;
|
||||
f5 = 0.0f;
|
||||
}
|
||||
int i30 = i3 + 0;
|
||||
int i31 = i3 + 1;
|
||||
int i32 = i3 + 2;
|
||||
int i33 = i3 + 3;
|
||||
path.rCubicTo(f6, f5, fArr2[i30], fArr2[i31], fArr2[i32], fArr2[i33]);
|
||||
f = fArr2[i30] + f15;
|
||||
f2 = fArr2[i31] + f16;
|
||||
f15 += fArr2[i32];
|
||||
f3 = fArr2[i33];
|
||||
} else if (c3 == 't') {
|
||||
if (c4 == 'q' || c4 == 't' || c4 == 'Q' || c4 == 'T') {
|
||||
f7 = f15 - f11;
|
||||
f8 = f16 - f12;
|
||||
} else {
|
||||
f8 = 0.0f;
|
||||
f7 = 0.0f;
|
||||
}
|
||||
int i34 = i3 + 0;
|
||||
int i35 = i3 + 1;
|
||||
path.rQuadTo(f7, f8, fArr2[i34], fArr2[i35]);
|
||||
float f28 = f7 + f15;
|
||||
float f29 = f8 + f16;
|
||||
f15 += fArr2[i34];
|
||||
f16 += fArr2[i35];
|
||||
f12 = f29;
|
||||
f11 = f28;
|
||||
}
|
||||
f16 += f4;
|
||||
} else {
|
||||
int i36 = i3 + 0;
|
||||
int i37 = i3 + 1;
|
||||
int i38 = i3 + 2;
|
||||
int i39 = i3 + 3;
|
||||
path.rQuadTo(fArr2[i36], fArr2[i37], fArr2[i38], fArr2[i39]);
|
||||
f = fArr2[i36] + f15;
|
||||
f2 = fArr2[i37] + f16;
|
||||
f15 += fArr2[i38];
|
||||
f3 = fArr2[i39];
|
||||
}
|
||||
i2 = i3;
|
||||
} else {
|
||||
int i40 = i3 + 2;
|
||||
int i41 = i3 + 3;
|
||||
int i42 = i3 + 4;
|
||||
int i43 = i3 + 5;
|
||||
path.rCubicTo(fArr2[i3 + 0], fArr2[i3 + 1], fArr2[i40], fArr2[i41], fArr2[i42], fArr2[i43]);
|
||||
f = fArr2[i40] + f15;
|
||||
f2 = fArr2[i41] + f16;
|
||||
f15 += fArr2[i42];
|
||||
f3 = fArr2[i43];
|
||||
}
|
||||
f16 += f3;
|
||||
f11 = f;
|
||||
f12 = f2;
|
||||
i2 = i3;
|
||||
} else {
|
||||
int i44 = i3 + 5;
|
||||
float f30 = fArr2[i44] + f15;
|
||||
int i45 = i3 + 6;
|
||||
float f31 = fArr2[i45] + f16;
|
||||
float f32 = fArr2[i3 + 0];
|
||||
float f33 = fArr2[i3 + 1];
|
||||
float f34 = fArr2[i3 + 2];
|
||||
float f35 = f15;
|
||||
boolean z = fArr2[i3 + 3] != 0.0f;
|
||||
i2 = i3;
|
||||
a(path, f15, f16, f30, f31, f32, f33, f34, z, fArr2[i3 + 4] != 0.0f);
|
||||
f15 = f35 + fArr2[i44];
|
||||
f16 += fArr2[i45];
|
||||
}
|
||||
i3 = i2 + i;
|
||||
c4 = c2;
|
||||
c3 = c4;
|
||||
} else {
|
||||
i2 = i3;
|
||||
int i46 = i2 + 5;
|
||||
int i47 = i2 + 6;
|
||||
a(path, f15, f16, fArr2[i46], fArr2[i47], fArr2[i2 + 0], fArr2[i2 + 1], fArr2[i2 + 2], fArr2[i2 + 3] != 0.0f, fArr2[i2 + 4] != 0.0f);
|
||||
f15 = fArr2[i46];
|
||||
f16 = fArr2[i47];
|
||||
}
|
||||
f12 = f16;
|
||||
f11 = f15;
|
||||
i3 = i2 + i;
|
||||
c4 = c2;
|
||||
c3 = c4;
|
||||
}
|
||||
fArr[0] = f15;
|
||||
fArr[1] = f16;
|
||||
fArr[2] = f11;
|
||||
fArr[3] = f12;
|
||||
fArr[4] = f17;
|
||||
fArr[5] = f18;
|
||||
}
|
||||
|
||||
private static void a(Path path, float f, float f2, float f3, float f4, float f5, float f6, float f7, boolean z, boolean z2) {
|
||||
double d;
|
||||
double d2;
|
||||
double radians = Math.toRadians(f7);
|
||||
double cos = Math.cos(radians);
|
||||
double sin = Math.sin(radians);
|
||||
double d3 = f;
|
||||
double d4 = d3 * cos;
|
||||
double d5 = f2;
|
||||
double d6 = f5;
|
||||
double d7 = (d4 + (d5 * sin)) / d6;
|
||||
double d8 = ((-f) * sin) + (d5 * cos);
|
||||
double d9 = f6;
|
||||
double d10 = d8 / d9;
|
||||
double d11 = f4;
|
||||
double d12 = ((f3 * cos) + (d11 * sin)) / d6;
|
||||
double d13 = (((-f3) * sin) + (d11 * cos)) / d9;
|
||||
double d14 = d7 - d12;
|
||||
double d15 = d10 - d13;
|
||||
double d16 = (d7 + d12) / 2.0d;
|
||||
double d17 = (d10 + d13) / 2.0d;
|
||||
double d18 = (d14 * d14) + (d15 * d15);
|
||||
if (d18 == 0.0d) {
|
||||
Log.w("PathParser", " Points are coincident");
|
||||
return;
|
||||
}
|
||||
double d19 = (1.0d / d18) - 0.25d;
|
||||
if (d19 < 0.0d) {
|
||||
Log.w("PathParser", "Points are too far apart " + d18);
|
||||
float sqrt = (float) (Math.sqrt(d18) / 1.99999d);
|
||||
a(path, f, f2, f3, f4, f5 * sqrt, f6 * sqrt, f7, z, z2);
|
||||
return;
|
||||
}
|
||||
double sqrt2 = Math.sqrt(d19);
|
||||
double d20 = d14 * sqrt2;
|
||||
double d21 = sqrt2 * d15;
|
||||
if (z == z2) {
|
||||
d = d16 - d21;
|
||||
d2 = d17 + d20;
|
||||
} else {
|
||||
d = d16 + d21;
|
||||
d2 = d17 - d20;
|
||||
}
|
||||
double atan2 = Math.atan2(d10 - d2, d7 - d);
|
||||
double atan22 = Math.atan2(d13 - d2, d12 - d) - atan2;
|
||||
if (z2 != (atan22 >= 0.0d)) {
|
||||
atan22 = atan22 > 0.0d ? atan22 - 6.283185307179586d : atan22 + 6.283185307179586d;
|
||||
}
|
||||
double d22 = d * d6;
|
||||
double d23 = d2 * d9;
|
||||
a(path, (d22 * cos) - (d23 * sin), (d22 * sin) + (d23 * cos), d6, d9, d3, d5, radians, atan2, atan22);
|
||||
}
|
||||
|
||||
private static void a(Path path, double d, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9) {
|
||||
double d10 = d3;
|
||||
int ceil = (int) Math.ceil(Math.abs((d9 * 4.0d) / 3.141592653589793d));
|
||||
double cos = Math.cos(d7);
|
||||
double sin = Math.sin(d7);
|
||||
double cos2 = Math.cos(d8);
|
||||
double sin2 = Math.sin(d8);
|
||||
double d11 = -d10;
|
||||
double d12 = d11 * cos;
|
||||
double d13 = d4 * sin;
|
||||
double d14 = (d12 * sin2) - (d13 * cos2);
|
||||
double d15 = d11 * sin;
|
||||
double d16 = d4 * cos;
|
||||
double d17 = (sin2 * d15) + (cos2 * d16);
|
||||
double d18 = d9 / ceil;
|
||||
double d19 = d5;
|
||||
double d20 = d6;
|
||||
double d21 = d17;
|
||||
double d22 = d14;
|
||||
int i = 0;
|
||||
double d23 = d8;
|
||||
while (i < ceil) {
|
||||
double d24 = d23 + d18;
|
||||
double sin3 = Math.sin(d24);
|
||||
double cos3 = Math.cos(d24);
|
||||
double d25 = (d + ((d10 * cos) * cos3)) - (d13 * sin3);
|
||||
double d26 = d2 + (d10 * sin * cos3) + (d16 * sin3);
|
||||
double d27 = (d12 * sin3) - (d13 * cos3);
|
||||
double d28 = (sin3 * d15) + (cos3 * d16);
|
||||
double d29 = d24 - d23;
|
||||
double tan = Math.tan(d29 / 2.0d);
|
||||
double sin4 = (Math.sin(d29) * (Math.sqrt(((tan * 3.0d) * tan) + 4.0d) - 1.0d)) / 3.0d;
|
||||
path.rLineTo(0.0f, 0.0f);
|
||||
path.cubicTo((float) (d19 + (d22 * sin4)), (float) (d20 + (d21 * sin4)), (float) (d25 - (sin4 * d27)), (float) (d26 - (sin4 * d28)), (float) d25, (float) d26);
|
||||
i++;
|
||||
d18 = d18;
|
||||
ceil = ceil;
|
||||
sin = sin;
|
||||
d20 = d26;
|
||||
d15 = d15;
|
||||
d23 = d24;
|
||||
d21 = d28;
|
||||
d22 = d27;
|
||||
cos = cos;
|
||||
d10 = d3;
|
||||
d19 = d25;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(PathDataNode[] pathDataNodeArr, PathDataNode[] pathDataNodeArr2) {
|
||||
for (int i = 0; i < pathDataNodeArr2.length; i++) {
|
||||
pathDataNodeArr[i].a = pathDataNodeArr2[i].a;
|
||||
for (int i2 = 0; i2 < pathDataNodeArr2[i].b.length; i2++) {
|
||||
pathDataNodeArr[i].b[i2] = pathDataNodeArr2[i].b[i2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static PathDataNode[] a(String str) {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
ArrayList arrayList = new ArrayList();
|
||||
int i = 1;
|
||||
int i2 = 0;
|
||||
while (i < str.length()) {
|
||||
int a = a(str, i);
|
||||
String trim = str.substring(i2, a).trim();
|
||||
if (trim.length() > 0) {
|
||||
a((ArrayList<PathDataNode>) arrayList, trim.charAt(0), c(trim));
|
||||
}
|
||||
i2 = a;
|
||||
i = a + 1;
|
||||
}
|
||||
if (i - i2 == 1 && i2 < str.length()) {
|
||||
a((ArrayList<PathDataNode>) arrayList, str.charAt(i2), new float[0]);
|
||||
}
|
||||
return (PathDataNode[]) arrayList.toArray(new PathDataNode[arrayList.size()]);
|
||||
}
|
||||
|
||||
public static PathDataNode[] a(PathDataNode[] pathDataNodeArr) {
|
||||
if (pathDataNodeArr == null) {
|
||||
return null;
|
||||
}
|
||||
PathDataNode[] pathDataNodeArr2 = new PathDataNode[pathDataNodeArr.length];
|
||||
for (int i = 0; i < pathDataNodeArr.length; i++) {
|
||||
pathDataNodeArr2[i] = new PathDataNode(pathDataNodeArr[i]);
|
||||
}
|
||||
return pathDataNodeArr2;
|
||||
}
|
||||
|
||||
public static boolean a(PathDataNode[] pathDataNodeArr, PathDataNode[] pathDataNodeArr2) {
|
||||
if (pathDataNodeArr == null || pathDataNodeArr2 == null || pathDataNodeArr.length != pathDataNodeArr2.length) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < pathDataNodeArr.length; i++) {
|
||||
if (pathDataNodeArr[i].a != pathDataNodeArr2[i].a || pathDataNodeArr[i].b.length != pathDataNodeArr2[i].b.length) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static int a(String str, int i) {
|
||||
while (i < str.length()) {
|
||||
char charAt = str.charAt(i);
|
||||
if (((charAt - 'A') * (charAt - 'Z') <= 0 || (charAt - 'a') * (charAt - 'z') <= 0) && charAt != 'e' && charAt != 'E') {
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
private static void a(ArrayList<PathDataNode> arrayList, char c, float[] fArr) {
|
||||
arrayList.add(new PathDataNode(c, fArr));
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
|
||||
/* JADX WARN: Removed duplicated region for block: B:14:0x003a A[LOOP:0: B:2:0x0007->B:14:0x003a, LOOP_END] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:15:0x003d A[SYNTHETIC] */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private static void a(java.lang.String r8, int r9, androidx.core.graphics.PathParser.ExtractFloatResult r10) {
|
||||
/*
|
||||
r0 = 0
|
||||
r10.b = r0
|
||||
r1 = r9
|
||||
r2 = 0
|
||||
r3 = 0
|
||||
r4 = 0
|
||||
L7:
|
||||
int r5 = r8.length()
|
||||
if (r1 >= r5) goto L3d
|
||||
char r5 = r8.charAt(r1)
|
||||
r6 = 32
|
||||
r7 = 1
|
||||
if (r5 == r6) goto L35
|
||||
r6 = 69
|
||||
if (r5 == r6) goto L33
|
||||
r6 = 101(0x65, float:1.42E-43)
|
||||
if (r5 == r6) goto L33
|
||||
switch(r5) {
|
||||
case 44: goto L35;
|
||||
case 45: goto L2a;
|
||||
case 46: goto L22;
|
||||
default: goto L21;
|
||||
}
|
||||
L21:
|
||||
goto L31
|
||||
L22:
|
||||
if (r3 != 0) goto L27
|
||||
r2 = 0
|
||||
r3 = 1
|
||||
goto L37
|
||||
L27:
|
||||
r10.b = r7
|
||||
goto L35
|
||||
L2a:
|
||||
if (r1 == r9) goto L31
|
||||
if (r2 != 0) goto L31
|
||||
r10.b = r7
|
||||
goto L35
|
||||
L31:
|
||||
r2 = 0
|
||||
goto L37
|
||||
L33:
|
||||
r2 = 1
|
||||
goto L37
|
||||
L35:
|
||||
r2 = 0
|
||||
r4 = 1
|
||||
L37:
|
||||
if (r4 == 0) goto L3a
|
||||
goto L3d
|
||||
L3a:
|
||||
int r1 = r1 + 1
|
||||
goto L7
|
||||
L3d:
|
||||
r10.a = r1
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.core.graphics.PathParser.a(java.lang.String, int, androidx.core.graphics.PathParser$ExtractFloatResult):void");
|
||||
}
|
||||
}
|
||||
79
sources/androidx/core/graphics/TypefaceCompat.java
Normal file
79
sources/androidx/core/graphics/TypefaceCompat.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package androidx.core.graphics;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.os.CancellationSignal;
|
||||
import android.os.Handler;
|
||||
import androidx.collection.LruCache;
|
||||
import androidx.core.content.res.FontResourcesParserCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.core.provider.FontsContractCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class TypefaceCompat {
|
||||
private static final TypefaceCompatBaseImpl a;
|
||||
private static final LruCache<String, Typeface> b;
|
||||
|
||||
static {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 28) {
|
||||
a = new TypefaceCompatApi28Impl();
|
||||
} else if (i >= 26) {
|
||||
a = new TypefaceCompatApi26Impl();
|
||||
} else if (i >= 24 && TypefaceCompatApi24Impl.a()) {
|
||||
a = new TypefaceCompatApi24Impl();
|
||||
} else if (Build.VERSION.SDK_INT >= 21) {
|
||||
a = new TypefaceCompatApi21Impl();
|
||||
} else {
|
||||
a = new TypefaceCompatBaseImpl();
|
||||
}
|
||||
b = new LruCache<>(16);
|
||||
}
|
||||
|
||||
private static String a(Resources resources, int i, int i2) {
|
||||
return resources.getResourcePackageName(i) + "-" + i + "-" + i2;
|
||||
}
|
||||
|
||||
public static Typeface b(Resources resources, int i, int i2) {
|
||||
return b.b(a(resources, i, i2));
|
||||
}
|
||||
|
||||
public static Typeface a(Context context, FontResourcesParserCompat.FamilyResourceEntry familyResourceEntry, Resources resources, int i, int i2, ResourcesCompat.FontCallback fontCallback, Handler handler, boolean z) {
|
||||
Typeface a2;
|
||||
if (familyResourceEntry instanceof FontResourcesParserCompat.ProviderResourceEntry) {
|
||||
FontResourcesParserCompat.ProviderResourceEntry providerResourceEntry = (FontResourcesParserCompat.ProviderResourceEntry) familyResourceEntry;
|
||||
boolean z2 = false;
|
||||
if (!z ? fontCallback == null : providerResourceEntry.a() == 0) {
|
||||
z2 = true;
|
||||
}
|
||||
a2 = FontsContractCompat.a(context, providerResourceEntry.b(), fontCallback, handler, z2, z ? providerResourceEntry.c() : -1, i2);
|
||||
} else {
|
||||
a2 = a.a(context, (FontResourcesParserCompat.FontFamilyFilesResourceEntry) familyResourceEntry, resources, i2);
|
||||
if (fontCallback != null) {
|
||||
if (a2 != null) {
|
||||
fontCallback.a(a2, handler);
|
||||
} else {
|
||||
fontCallback.a(-3, handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (a2 != null) {
|
||||
b.a(a(resources, i, i2), a2);
|
||||
}
|
||||
return a2;
|
||||
}
|
||||
|
||||
public static Typeface a(Context context, Resources resources, int i, String str, int i2) {
|
||||
Typeface a2 = a.a(context, resources, i, str, i2);
|
||||
if (a2 != null) {
|
||||
b.a(a(resources, i, i2), a2);
|
||||
}
|
||||
return a2;
|
||||
}
|
||||
|
||||
public static Typeface a(Context context, CancellationSignal cancellationSignal, FontsContractCompat.FontInfo[] fontInfoArr, int i) {
|
||||
return a.a(context, cancellationSignal, fontInfoArr, i);
|
||||
}
|
||||
}
|
||||
64
sources/androidx/core/graphics/TypefaceCompatApi21Impl.java
Normal file
64
sources/androidx/core/graphics/TypefaceCompatApi21Impl.java
Normal file
@@ -0,0 +1,64 @@
|
||||
package androidx.core.graphics;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.CancellationSignal;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.system.ErrnoException;
|
||||
import android.system.Os;
|
||||
import android.system.OsConstants;
|
||||
import androidx.core.provider.FontsContractCompat;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class TypefaceCompatApi21Impl extends TypefaceCompatBaseImpl {
|
||||
TypefaceCompatApi21Impl() {
|
||||
}
|
||||
|
||||
private File a(ParcelFileDescriptor parcelFileDescriptor) {
|
||||
try {
|
||||
String readlink = Os.readlink("/proc/self/fd/" + parcelFileDescriptor.getFd());
|
||||
if (OsConstants.S_ISREG(Os.stat(readlink).st_mode)) {
|
||||
return new File(readlink);
|
||||
}
|
||||
} catch (ErrnoException unused) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl
|
||||
public Typeface a(Context context, CancellationSignal cancellationSignal, FontsContractCompat.FontInfo[] fontInfoArr, int i) {
|
||||
if (fontInfoArr.length < 1) {
|
||||
return null;
|
||||
}
|
||||
FontsContractCompat.FontInfo a = a(fontInfoArr, i);
|
||||
try {
|
||||
ParcelFileDescriptor openFileDescriptor = context.getContentResolver().openFileDescriptor(a.c(), "r", cancellationSignal);
|
||||
try {
|
||||
File a2 = a(openFileDescriptor);
|
||||
if (a2 != null && a2.canRead()) {
|
||||
Typeface createFromFile = Typeface.createFromFile(a2);
|
||||
if (openFileDescriptor != null) {
|
||||
openFileDescriptor.close();
|
||||
}
|
||||
return createFromFile;
|
||||
}
|
||||
FileInputStream fileInputStream = new FileInputStream(openFileDescriptor.getFileDescriptor());
|
||||
try {
|
||||
Typeface a3 = super.a(context, fileInputStream);
|
||||
fileInputStream.close();
|
||||
if (openFileDescriptor != null) {
|
||||
openFileDescriptor.close();
|
||||
}
|
||||
return a3;
|
||||
} finally {
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
} catch (IOException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
114
sources/androidx/core/graphics/TypefaceCompatApi24Impl.java
Normal file
114
sources/androidx/core/graphics/TypefaceCompatApi24Impl.java
Normal file
@@ -0,0 +1,114 @@
|
||||
package androidx.core.graphics;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Typeface;
|
||||
import android.net.Uri;
|
||||
import android.os.CancellationSignal;
|
||||
import android.util.Log;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
import androidx.core.content.res.FontResourcesParserCompat;
|
||||
import androidx.core.provider.FontsContractCompat;
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class TypefaceCompatApi24Impl extends TypefaceCompatBaseImpl {
|
||||
private static final Class a;
|
||||
private static final Constructor b;
|
||||
private static final Method c;
|
||||
private static final Method d;
|
||||
|
||||
static {
|
||||
Class<?> cls;
|
||||
Method method;
|
||||
Method method2;
|
||||
Constructor<?> constructor = null;
|
||||
try {
|
||||
cls = Class.forName("android.graphics.FontFamily");
|
||||
Constructor<?> constructor2 = cls.getConstructor(new Class[0]);
|
||||
method2 = cls.getMethod("addFontWeightStyle", ByteBuffer.class, Integer.TYPE, List.class, Integer.TYPE, Boolean.TYPE);
|
||||
method = Typeface.class.getMethod("createFromFamiliesWithDefault", Array.newInstance(cls, 1).getClass());
|
||||
constructor = constructor2;
|
||||
} catch (ClassNotFoundException | NoSuchMethodException e) {
|
||||
Log.e("TypefaceCompatApi24Impl", e.getClass().getName(), e);
|
||||
cls = null;
|
||||
method = null;
|
||||
method2 = null;
|
||||
}
|
||||
b = constructor;
|
||||
a = cls;
|
||||
c = method2;
|
||||
d = method;
|
||||
}
|
||||
|
||||
TypefaceCompatApi24Impl() {
|
||||
}
|
||||
|
||||
public static boolean a() {
|
||||
if (c == null) {
|
||||
Log.w("TypefaceCompatApi24Impl", "Unable to collect necessary private methods.Fallback to legacy implementation.");
|
||||
}
|
||||
return c != null;
|
||||
}
|
||||
|
||||
private static Object b() {
|
||||
try {
|
||||
return b.newInstance(new Object[0]);
|
||||
} catch (IllegalAccessException | InstantiationException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean a(Object obj, ByteBuffer byteBuffer, int i, int i2, boolean z) {
|
||||
try {
|
||||
return ((Boolean) c.invoke(obj, byteBuffer, Integer.valueOf(i), null, Integer.valueOf(i2), Boolean.valueOf(z))).booleanValue();
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static Typeface a(Object obj) {
|
||||
try {
|
||||
Object newInstance = Array.newInstance((Class<?>) a, 1);
|
||||
Array.set(newInstance, 0, obj);
|
||||
return (Typeface) d.invoke(null, newInstance);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl
|
||||
public Typeface a(Context context, CancellationSignal cancellationSignal, FontsContractCompat.FontInfo[] fontInfoArr, int i) {
|
||||
Object b2 = b();
|
||||
SimpleArrayMap simpleArrayMap = new SimpleArrayMap();
|
||||
for (FontsContractCompat.FontInfo fontInfo : fontInfoArr) {
|
||||
Uri c2 = fontInfo.c();
|
||||
ByteBuffer byteBuffer = (ByteBuffer) simpleArrayMap.get(c2);
|
||||
if (byteBuffer == null) {
|
||||
byteBuffer = TypefaceCompatUtil.a(context, cancellationSignal, c2);
|
||||
simpleArrayMap.put(c2, byteBuffer);
|
||||
}
|
||||
if (!a(b2, byteBuffer, fontInfo.b(), fontInfo.d(), fontInfo.e())) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return Typeface.create(a(b2), i);
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl
|
||||
public Typeface a(Context context, FontResourcesParserCompat.FontFamilyFilesResourceEntry fontFamilyFilesResourceEntry, Resources resources, int i) {
|
||||
Object b2 = b();
|
||||
for (FontResourcesParserCompat.FontFileResourceEntry fontFileResourceEntry : fontFamilyFilesResourceEntry.a()) {
|
||||
ByteBuffer a2 = TypefaceCompatUtil.a(context, resources, fontFileResourceEntry.b());
|
||||
if (a2 == null || !a(b2, a2, fontFileResourceEntry.c(), fontFileResourceEntry.e(), fontFileResourceEntry.f())) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return a(b2);
|
||||
}
|
||||
}
|
||||
241
sources/androidx/core/graphics/TypefaceCompatApi26Impl.java
Normal file
241
sources/androidx/core/graphics/TypefaceCompatApi26Impl.java
Normal file
@@ -0,0 +1,241 @@
|
||||
package androidx.core.graphics;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.AssetManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.fonts.FontVariationAxis;
|
||||
import android.net.Uri;
|
||||
import android.os.CancellationSignal;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Log;
|
||||
import androidx.core.content.res.FontResourcesParserCompat;
|
||||
import androidx.core.provider.FontsContractCompat;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class TypefaceCompatApi26Impl extends TypefaceCompatApi21Impl {
|
||||
protected final Class a;
|
||||
protected final Constructor b;
|
||||
protected final Method c;
|
||||
protected final Method d;
|
||||
protected final Method e;
|
||||
protected final Method f;
|
||||
protected final Method g;
|
||||
|
||||
public TypefaceCompatApi26Impl() {
|
||||
Method method;
|
||||
Constructor constructor;
|
||||
Method method2;
|
||||
Method method3;
|
||||
Method method4;
|
||||
Method method5;
|
||||
Class cls = null;
|
||||
try {
|
||||
Class a = a();
|
||||
constructor = e(a);
|
||||
method2 = b(a);
|
||||
method3 = c(a);
|
||||
method4 = f(a);
|
||||
method5 = a(a);
|
||||
method = d(a);
|
||||
cls = a;
|
||||
} catch (ClassNotFoundException | NoSuchMethodException e) {
|
||||
Log.e("TypefaceCompatApi26Impl", "Unable to collect necessary methods for class " + e.getClass().getName(), e);
|
||||
method = null;
|
||||
constructor = null;
|
||||
method2 = null;
|
||||
method3 = null;
|
||||
method4 = null;
|
||||
method5 = null;
|
||||
}
|
||||
this.a = cls;
|
||||
this.b = constructor;
|
||||
this.c = method2;
|
||||
this.d = method3;
|
||||
this.e = method4;
|
||||
this.f = method5;
|
||||
this.g = method;
|
||||
}
|
||||
|
||||
private boolean a(Context context, Object obj, String str, int i, int i2, int i3, FontVariationAxis[] fontVariationAxisArr) {
|
||||
try {
|
||||
return ((Boolean) this.c.invoke(obj, context.getAssets(), str, 0, false, Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3), fontVariationAxisArr)).booleanValue();
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean b() {
|
||||
if (this.c == null) {
|
||||
Log.w("TypefaceCompatApi26Impl", "Unable to collect necessary private methods. Fallback to legacy implementation.");
|
||||
}
|
||||
return this.c != null;
|
||||
}
|
||||
|
||||
private Object c() {
|
||||
try {
|
||||
return this.b.newInstance(new Object[0]);
|
||||
} catch (IllegalAccessException | InstantiationException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected Method d(Class cls) throws NoSuchMethodException {
|
||||
Class cls2 = Integer.TYPE;
|
||||
Method declaredMethod = Typeface.class.getDeclaredMethod("createFromFamiliesWithDefault", Array.newInstance((Class<?>) cls, 1).getClass(), cls2, cls2);
|
||||
declaredMethod.setAccessible(true);
|
||||
return declaredMethod;
|
||||
}
|
||||
|
||||
protected Constructor e(Class cls) throws NoSuchMethodException {
|
||||
return cls.getConstructor(new Class[0]);
|
||||
}
|
||||
|
||||
protected Method f(Class cls) throws NoSuchMethodException {
|
||||
return cls.getMethod("freeze", new Class[0]);
|
||||
}
|
||||
|
||||
private boolean c(Object obj) {
|
||||
try {
|
||||
return ((Boolean) this.e.invoke(obj, new Object[0])).booleanValue();
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void b(Object obj) {
|
||||
try {
|
||||
this.f.invoke(obj, new Object[0]);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected Method b(Class cls) throws NoSuchMethodException {
|
||||
Class<?> cls2 = Integer.TYPE;
|
||||
return cls.getMethod("addFontFromAssetManager", AssetManager.class, String.class, Integer.TYPE, Boolean.TYPE, cls2, cls2, cls2, FontVariationAxis[].class);
|
||||
}
|
||||
|
||||
protected Method c(Class cls) throws NoSuchMethodException {
|
||||
Class<?> cls2 = Integer.TYPE;
|
||||
return cls.getMethod("addFontFromBuffer", ByteBuffer.class, cls2, FontVariationAxis[].class, cls2, cls2);
|
||||
}
|
||||
|
||||
private boolean a(Object obj, ByteBuffer byteBuffer, int i, int i2, int i3) {
|
||||
try {
|
||||
return ((Boolean) this.d.invoke(obj, byteBuffer, Integer.valueOf(i), null, Integer.valueOf(i2), Integer.valueOf(i3))).booleanValue();
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected Typeface a(Object obj) {
|
||||
try {
|
||||
Object newInstance = Array.newInstance((Class<?>) this.a, 1);
|
||||
Array.set(newInstance, 0, obj);
|
||||
return (Typeface) this.g.invoke(null, newInstance, -1, -1);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl
|
||||
public Typeface a(Context context, FontResourcesParserCompat.FontFamilyFilesResourceEntry fontFamilyFilesResourceEntry, Resources resources, int i) {
|
||||
if (!b()) {
|
||||
return super.a(context, fontFamilyFilesResourceEntry, resources, i);
|
||||
}
|
||||
Object c = c();
|
||||
for (FontResourcesParserCompat.FontFileResourceEntry fontFileResourceEntry : fontFamilyFilesResourceEntry.a()) {
|
||||
if (!a(context, c, fontFileResourceEntry.a(), fontFileResourceEntry.c(), fontFileResourceEntry.e(), fontFileResourceEntry.f() ? 1 : 0, FontVariationAxis.fromFontVariationSettings(fontFileResourceEntry.d()))) {
|
||||
b(c);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (c(c)) {
|
||||
return a(c);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.TypefaceCompatApi21Impl, androidx.core.graphics.TypefaceCompatBaseImpl
|
||||
public Typeface a(Context context, CancellationSignal cancellationSignal, FontsContractCompat.FontInfo[] fontInfoArr, int i) {
|
||||
if (fontInfoArr.length < 1) {
|
||||
return null;
|
||||
}
|
||||
if (!b()) {
|
||||
FontsContractCompat.FontInfo a = a(fontInfoArr, i);
|
||||
try {
|
||||
ParcelFileDescriptor openFileDescriptor = context.getContentResolver().openFileDescriptor(a.c(), "r", cancellationSignal);
|
||||
if (openFileDescriptor == null) {
|
||||
if (openFileDescriptor != null) {
|
||||
openFileDescriptor.close();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
Typeface build = new Typeface.Builder(openFileDescriptor.getFileDescriptor()).setWeight(a.d()).setItalic(a.e()).build();
|
||||
if (openFileDescriptor != null) {
|
||||
openFileDescriptor.close();
|
||||
}
|
||||
return build;
|
||||
} finally {
|
||||
}
|
||||
} catch (IOException unused) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
Map<Uri, ByteBuffer> a2 = FontsContractCompat.a(context, fontInfoArr, cancellationSignal);
|
||||
Object c = c();
|
||||
boolean z = false;
|
||||
for (FontsContractCompat.FontInfo fontInfo : fontInfoArr) {
|
||||
ByteBuffer byteBuffer = a2.get(fontInfo.c());
|
||||
if (byteBuffer != null) {
|
||||
if (!a(c, byteBuffer, fontInfo.b(), fontInfo.d(), fontInfo.e() ? 1 : 0)) {
|
||||
b(c);
|
||||
return null;
|
||||
}
|
||||
z = true;
|
||||
}
|
||||
}
|
||||
if (!z) {
|
||||
b(c);
|
||||
return null;
|
||||
}
|
||||
if (c(c)) {
|
||||
return Typeface.create(a(c), i);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl
|
||||
public Typeface a(Context context, Resources resources, int i, String str, int i2) {
|
||||
if (!b()) {
|
||||
return super.a(context, resources, i, str, i2);
|
||||
}
|
||||
Object c = c();
|
||||
if (!a(context, c, str, 0, -1, -1, null)) {
|
||||
b(c);
|
||||
return null;
|
||||
}
|
||||
if (c(c)) {
|
||||
return a(c);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected Class a() throws ClassNotFoundException {
|
||||
return Class.forName("android.graphics.FontFamily");
|
||||
}
|
||||
|
||||
protected Method a(Class cls) throws NoSuchMethodException {
|
||||
return cls.getMethod("abortCreation", new Class[0]);
|
||||
}
|
||||
}
|
||||
28
sources/androidx/core/graphics/TypefaceCompatApi28Impl.java
Normal file
28
sources/androidx/core/graphics/TypefaceCompatApi28Impl.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package androidx.core.graphics;
|
||||
|
||||
import android.graphics.Typeface;
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class TypefaceCompatApi28Impl extends TypefaceCompatApi26Impl {
|
||||
@Override // androidx.core.graphics.TypefaceCompatApi26Impl
|
||||
protected Typeface a(Object obj) {
|
||||
try {
|
||||
Object newInstance = Array.newInstance((Class<?>) this.a, 1);
|
||||
Array.set(newInstance, 0, obj);
|
||||
return (Typeface) this.g.invoke(null, newInstance, "sans-serif", -1, -1);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.TypefaceCompatApi26Impl
|
||||
protected Method d(Class cls) throws NoSuchMethodException {
|
||||
Class cls2 = Integer.TYPE;
|
||||
Method declaredMethod = Typeface.class.getDeclaredMethod("createFromFamiliesWithDefault", Array.newInstance((Class<?>) cls, 1).getClass(), String.class, cls2, cls2);
|
||||
declaredMethod.setAccessible(true);
|
||||
return declaredMethod;
|
||||
}
|
||||
}
|
||||
138
sources/androidx/core/graphics/TypefaceCompatBaseImpl.java
Normal file
138
sources/androidx/core/graphics/TypefaceCompatBaseImpl.java
Normal file
@@ -0,0 +1,138 @@
|
||||
package androidx.core.graphics;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.CancellationSignal;
|
||||
import androidx.core.content.res.FontResourcesParserCompat;
|
||||
import androidx.core.provider.FontsContractCompat;
|
||||
import com.baidu.cloud.media.player.IMediaPlayer;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class TypefaceCompatBaseImpl {
|
||||
|
||||
private interface StyleExtractor<T> {
|
||||
int a(T t);
|
||||
|
||||
boolean b(T t);
|
||||
}
|
||||
|
||||
TypefaceCompatBaseImpl() {
|
||||
}
|
||||
|
||||
private static <T> T a(T[] tArr, int i, StyleExtractor<T> styleExtractor) {
|
||||
int i2 = (i & 1) == 0 ? 400 : IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING;
|
||||
boolean z = (i & 2) != 0;
|
||||
T t = null;
|
||||
int i3 = Integer.MAX_VALUE;
|
||||
for (T t2 : tArr) {
|
||||
int abs = (Math.abs(styleExtractor.a(t2) - i2) * 2) + (styleExtractor.b(t2) == z ? 0 : 1);
|
||||
if (t == null || i3 > abs) {
|
||||
t = t2;
|
||||
i3 = abs;
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
protected FontsContractCompat.FontInfo a(FontsContractCompat.FontInfo[] fontInfoArr, int i) {
|
||||
return (FontsContractCompat.FontInfo) a(fontInfoArr, i, new StyleExtractor<FontsContractCompat.FontInfo>(this) { // from class: androidx.core.graphics.TypefaceCompatBaseImpl.1
|
||||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl.StyleExtractor
|
||||
public int a(FontsContractCompat.FontInfo fontInfo) {
|
||||
return fontInfo.d();
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl.StyleExtractor
|
||||
public boolean b(FontsContractCompat.FontInfo fontInfo) {
|
||||
return fontInfo.e();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected Typeface a(Context context, InputStream inputStream) {
|
||||
File a = TypefaceCompatUtil.a(context);
|
||||
if (a == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
if (TypefaceCompatUtil.a(a, inputStream)) {
|
||||
return Typeface.createFromFile(a.getPath());
|
||||
}
|
||||
return null;
|
||||
} catch (RuntimeException unused) {
|
||||
return null;
|
||||
} finally {
|
||||
a.delete();
|
||||
}
|
||||
}
|
||||
|
||||
public Typeface a(Context context, CancellationSignal cancellationSignal, FontsContractCompat.FontInfo[] fontInfoArr, int i) {
|
||||
InputStream inputStream;
|
||||
InputStream inputStream2 = null;
|
||||
if (fontInfoArr.length < 1) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
inputStream = context.getContentResolver().openInputStream(a(fontInfoArr, i).c());
|
||||
try {
|
||||
Typeface a = a(context, inputStream);
|
||||
TypefaceCompatUtil.a(inputStream);
|
||||
return a;
|
||||
} catch (IOException unused) {
|
||||
TypefaceCompatUtil.a(inputStream);
|
||||
return null;
|
||||
} catch (Throwable th) {
|
||||
th = th;
|
||||
inputStream2 = inputStream;
|
||||
TypefaceCompatUtil.a(inputStream2);
|
||||
throw th;
|
||||
}
|
||||
} catch (IOException unused2) {
|
||||
inputStream = null;
|
||||
} catch (Throwable th2) {
|
||||
th = th2;
|
||||
}
|
||||
}
|
||||
|
||||
private FontResourcesParserCompat.FontFileResourceEntry a(FontResourcesParserCompat.FontFamilyFilesResourceEntry fontFamilyFilesResourceEntry, int i) {
|
||||
return (FontResourcesParserCompat.FontFileResourceEntry) a(fontFamilyFilesResourceEntry.a(), i, new StyleExtractor<FontResourcesParserCompat.FontFileResourceEntry>(this) { // from class: androidx.core.graphics.TypefaceCompatBaseImpl.2
|
||||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl.StyleExtractor
|
||||
public int a(FontResourcesParserCompat.FontFileResourceEntry fontFileResourceEntry) {
|
||||
return fontFileResourceEntry.e();
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl.StyleExtractor
|
||||
public boolean b(FontResourcesParserCompat.FontFileResourceEntry fontFileResourceEntry) {
|
||||
return fontFileResourceEntry.f();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public Typeface a(Context context, FontResourcesParserCompat.FontFamilyFilesResourceEntry fontFamilyFilesResourceEntry, Resources resources, int i) {
|
||||
FontResourcesParserCompat.FontFileResourceEntry a = a(fontFamilyFilesResourceEntry, i);
|
||||
if (a == null) {
|
||||
return null;
|
||||
}
|
||||
return TypefaceCompat.a(context, resources, a.b(), a.a(), i);
|
||||
}
|
||||
|
||||
public Typeface a(Context context, Resources resources, int i, String str, int i2) {
|
||||
File a = TypefaceCompatUtil.a(context);
|
||||
if (a == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
if (TypefaceCompatUtil.a(a, resources, i)) {
|
||||
return Typeface.createFromFile(a.getPath());
|
||||
}
|
||||
return null;
|
||||
} catch (RuntimeException unused) {
|
||||
return null;
|
||||
} finally {
|
||||
a.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
160
sources/androidx/core/graphics/TypefaceCompatUtil.java
Normal file
160
sources/androidx/core/graphics/TypefaceCompatUtil.java
Normal file
@@ -0,0 +1,160 @@
|
||||
package androidx.core.graphics;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.os.CancellationSignal;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.os.Process;
|
||||
import android.os.StrictMode;
|
||||
import android.util.Log;
|
||||
import com.ijm.dataencryption.de.DataDecryptTool;
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.MappedByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class TypefaceCompatUtil {
|
||||
public static File a(Context context) {
|
||||
String str = ".font" + Process.myPid() + "-" + Process.myTid() + "-";
|
||||
for (int i = 0; i < 100; i++) {
|
||||
File file = new File(context.getCacheDir(), str + i);
|
||||
if (file.createNewFile()) {
|
||||
return file;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static ByteBuffer a(File file) {
|
||||
try {
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
try {
|
||||
FileChannel channel = fileInputStream.getChannel();
|
||||
MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_ONLY, 0L, channel.size());
|
||||
fileInputStream.close();
|
||||
return map;
|
||||
} finally {
|
||||
}
|
||||
} catch (IOException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static ByteBuffer a(Context context, CancellationSignal cancellationSignal, Uri uri) {
|
||||
try {
|
||||
ParcelFileDescriptor openFileDescriptor = context.getContentResolver().openFileDescriptor(uri, "r", cancellationSignal);
|
||||
if (openFileDescriptor == null) {
|
||||
if (openFileDescriptor != null) {
|
||||
openFileDescriptor.close();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
FileInputStream fileInputStream = new FileInputStream(openFileDescriptor.getFileDescriptor());
|
||||
try {
|
||||
FileChannel channel = fileInputStream.getChannel();
|
||||
MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_ONLY, 0L, channel.size());
|
||||
fileInputStream.close();
|
||||
if (openFileDescriptor != null) {
|
||||
openFileDescriptor.close();
|
||||
}
|
||||
return map;
|
||||
} finally {
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
} catch (IOException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static ByteBuffer a(Context context, Resources resources, int i) {
|
||||
File a = a(context);
|
||||
if (a == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
if (a(a, resources, i)) {
|
||||
return a(a);
|
||||
}
|
||||
return null;
|
||||
} finally {
|
||||
a.delete();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean a(File file, InputStream inputStream) {
|
||||
StrictMode.ThreadPolicy allowThreadDiskWrites = StrictMode.allowThreadDiskWrites();
|
||||
FileOutputStream fileOutputStream = null;
|
||||
try {
|
||||
try {
|
||||
FileOutputStream fileOutputStream2 = new FileOutputStream(file, false);
|
||||
try {
|
||||
byte[] bArr = new byte[DataDecryptTool.DECRYPT_SP_FILE];
|
||||
while (true) {
|
||||
int read = inputStream.read(bArr);
|
||||
if (read != -1) {
|
||||
fileOutputStream2.write(bArr, 0, read);
|
||||
} else {
|
||||
a(fileOutputStream2);
|
||||
StrictMode.setThreadPolicy(allowThreadDiskWrites);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e = e;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
Log.e("TypefaceCompatUtil", "Error copying resource contents to temp file: " + e.getMessage());
|
||||
a(fileOutputStream);
|
||||
StrictMode.setThreadPolicy(allowThreadDiskWrites);
|
||||
return false;
|
||||
} catch (Throwable th) {
|
||||
th = th;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
a(fileOutputStream);
|
||||
StrictMode.setThreadPolicy(allowThreadDiskWrites);
|
||||
throw th;
|
||||
}
|
||||
} catch (Throwable th2) {
|
||||
th = th2;
|
||||
}
|
||||
} catch (IOException e2) {
|
||||
e = e2;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean a(File file, Resources resources, int i) {
|
||||
InputStream inputStream;
|
||||
try {
|
||||
inputStream = resources.openRawResource(i);
|
||||
} catch (Throwable th) {
|
||||
th = th;
|
||||
inputStream = null;
|
||||
}
|
||||
try {
|
||||
boolean a = a(file, inputStream);
|
||||
a(inputStream);
|
||||
return a;
|
||||
} catch (Throwable th2) {
|
||||
th = th2;
|
||||
a(inputStream);
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(Closeable closeable) {
|
||||
if (closeable != null) {
|
||||
try {
|
||||
closeable.close();
|
||||
} catch (IOException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
211
sources/androidx/core/graphics/drawable/DrawableCompat.java
Normal file
211
sources/androidx/core/graphics/drawable/DrawableCompat.java
Normal file
@@ -0,0 +1,211 @@
|
||||
package androidx.core.graphics.drawable;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.DrawableContainer;
|
||||
import android.graphics.drawable.InsetDrawable;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class DrawableCompat {
|
||||
private static Method a;
|
||||
private static boolean b;
|
||||
private static Method c;
|
||||
private static boolean d;
|
||||
|
||||
public static void a(Drawable drawable, boolean z) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
drawable.setAutoMirrored(z);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static void b(Drawable drawable, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
drawable.setTint(i);
|
||||
} else if (drawable instanceof TintAwareDrawable) {
|
||||
((TintAwareDrawable) drawable).setTint(i);
|
||||
}
|
||||
}
|
||||
|
||||
public static int c(Drawable drawable) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
return drawable.getAlpha();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static ColorFilter d(Drawable drawable) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return drawable.getColorFilter();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int e(Drawable drawable) {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 23) {
|
||||
return drawable.getLayoutDirection();
|
||||
}
|
||||
if (i >= 17) {
|
||||
if (!d) {
|
||||
try {
|
||||
c = Drawable.class.getDeclaredMethod("getLayoutDirection", new Class[0]);
|
||||
c.setAccessible(true);
|
||||
} catch (NoSuchMethodException e) {
|
||||
Log.i("DrawableCompat", "Failed to retrieve getLayoutDirection() method", e);
|
||||
}
|
||||
d = true;
|
||||
}
|
||||
Method method = c;
|
||||
if (method != null) {
|
||||
try {
|
||||
return ((Integer) method.invoke(drawable, new Object[0])).intValue();
|
||||
} catch (Exception e2) {
|
||||
Log.i("DrawableCompat", "Failed to invoke getLayoutDirection() via reflection", e2);
|
||||
c = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static boolean f(Drawable drawable) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
return drawable.isAutoMirrored();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void g(Drawable drawable) {
|
||||
drawable.jumpToCurrentState();
|
||||
}
|
||||
|
||||
public static Drawable h(Drawable drawable) {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
return i >= 23 ? drawable : i >= 21 ? !(drawable instanceof TintAwareDrawable) ? new WrappedDrawableApi21(drawable) : drawable : !(drawable instanceof TintAwareDrawable) ? new WrappedDrawableApi14(drawable) : drawable;
|
||||
}
|
||||
|
||||
public static void a(Drawable drawable, float f, float f2) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
drawable.setHotspot(f, f2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(Drawable drawable, int i, int i2, int i3, int i4) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
drawable.setHotspotBounds(i, i2, i3, i4);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static void b(Drawable drawable) {
|
||||
DrawableContainer.DrawableContainerState drawableContainerState;
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 23) {
|
||||
drawable.clearColorFilter();
|
||||
return;
|
||||
}
|
||||
if (i >= 21) {
|
||||
drawable.clearColorFilter();
|
||||
if (drawable instanceof InsetDrawable) {
|
||||
b(((InsetDrawable) drawable).getDrawable());
|
||||
return;
|
||||
}
|
||||
if (drawable instanceof WrappedDrawable) {
|
||||
b(((WrappedDrawable) drawable).a());
|
||||
return;
|
||||
}
|
||||
if (!(drawable instanceof DrawableContainer) || (drawableContainerState = (DrawableContainer.DrawableContainerState) ((DrawableContainer) drawable).getConstantState()) == null) {
|
||||
return;
|
||||
}
|
||||
int childCount = drawableContainerState.getChildCount();
|
||||
for (int i2 = 0; i2 < childCount; i2++) {
|
||||
Drawable child = drawableContainerState.getChild(i2);
|
||||
if (child != null) {
|
||||
b(child);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
drawable.clearColorFilter();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static void a(Drawable drawable, ColorStateList colorStateList) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
drawable.setTintList(colorStateList);
|
||||
} else if (drawable instanceof TintAwareDrawable) {
|
||||
((TintAwareDrawable) drawable).setTintList(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static void a(Drawable drawable, PorterDuff.Mode mode) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
drawable.setTintMode(mode);
|
||||
} else if (drawable instanceof TintAwareDrawable) {
|
||||
((TintAwareDrawable) drawable).setTintMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(Drawable drawable, Resources.Theme theme) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
drawable.applyTheme(theme);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean a(Drawable drawable) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return drawable.canApplyTheme();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void a(Drawable drawable, Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
drawable.inflate(resources, xmlPullParser, attributeSet, theme);
|
||||
} else {
|
||||
drawable.inflate(resources, xmlPullParser, attributeSet);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean a(Drawable drawable, int i) {
|
||||
int i2 = Build.VERSION.SDK_INT;
|
||||
if (i2 >= 23) {
|
||||
return drawable.setLayoutDirection(i);
|
||||
}
|
||||
if (i2 >= 17) {
|
||||
if (!b) {
|
||||
try {
|
||||
a = Drawable.class.getDeclaredMethod("setLayoutDirection", Integer.TYPE);
|
||||
a.setAccessible(true);
|
||||
} catch (NoSuchMethodException e) {
|
||||
Log.i("DrawableCompat", "Failed to retrieve setLayoutDirection(int) method", e);
|
||||
}
|
||||
b = true;
|
||||
}
|
||||
Method method = a;
|
||||
if (method != null) {
|
||||
try {
|
||||
method.invoke(drawable, Integer.valueOf(i));
|
||||
return true;
|
||||
} catch (Exception e2) {
|
||||
Log.i("DrawableCompat", "Failed to invoke setLayoutDirection(int) via reflection", e2);
|
||||
a = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
268
sources/androidx/core/graphics/drawable/IconCompat.java
Normal file
268
sources/androidx/core/graphics/drawable/IconCompat.java
Normal file
@@ -0,0 +1,268 @@
|
||||
package androidx.core.graphics.drawable;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.os.Build;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
import androidx.versionedparcelable.CustomVersionedParcelable;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class IconCompat extends CustomVersionedParcelable {
|
||||
static final PorterDuff.Mode j = PorterDuff.Mode.SRC_IN;
|
||||
public int a;
|
||||
Object b;
|
||||
public byte[] c;
|
||||
public Parcelable d;
|
||||
public int e;
|
||||
public int f;
|
||||
public ColorStateList g = null;
|
||||
PorterDuff.Mode h = j;
|
||||
public String i;
|
||||
|
||||
private static String a(int i) {
|
||||
return i != 1 ? i != 2 ? i != 3 ? i != 4 ? i != 5 ? "UNKNOWN" : "BITMAP_MASKABLE" : "URI" : "DATA" : "RESOURCE" : "BITMAP";
|
||||
}
|
||||
|
||||
public int a() {
|
||||
if (this.a == -1 && Build.VERSION.SDK_INT >= 23) {
|
||||
return a((Icon) this.b);
|
||||
}
|
||||
if (this.a == 2) {
|
||||
return this.e;
|
||||
}
|
||||
throw new IllegalStateException("called getResId() on " + this);
|
||||
}
|
||||
|
||||
public String b() {
|
||||
if (this.a == -1 && Build.VERSION.SDK_INT >= 23) {
|
||||
return b((Icon) this.b);
|
||||
}
|
||||
if (this.a == 2) {
|
||||
return ((String) this.b).split(":", -1)[0];
|
||||
}
|
||||
throw new IllegalStateException("called getResPackage() on " + this);
|
||||
}
|
||||
|
||||
public void c() {
|
||||
this.h = PorterDuff.Mode.valueOf(this.i);
|
||||
int i = this.a;
|
||||
if (i == -1) {
|
||||
Parcelable parcelable = this.d;
|
||||
if (parcelable == null) {
|
||||
throw new IllegalArgumentException("Invalid icon");
|
||||
}
|
||||
this.b = parcelable;
|
||||
return;
|
||||
}
|
||||
if (i != 1) {
|
||||
if (i != 2) {
|
||||
if (i == 3) {
|
||||
this.b = this.c;
|
||||
return;
|
||||
} else if (i != 4) {
|
||||
if (i != 5) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.b = new String(this.c, Charset.forName("UTF-16"));
|
||||
return;
|
||||
}
|
||||
Parcelable parcelable2 = this.d;
|
||||
if (parcelable2 != null) {
|
||||
this.b = parcelable2;
|
||||
return;
|
||||
}
|
||||
byte[] bArr = this.c;
|
||||
this.b = bArr;
|
||||
this.a = 3;
|
||||
this.e = 0;
|
||||
this.f = bArr.length;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:15:0x002b, code lost:
|
||||
|
||||
if (r1 != 5) goto L23;
|
||||
*/
|
||||
/* JADX WARN: Removed duplicated region for block: B:18:0x009e */
|
||||
/* JADX WARN: Removed duplicated region for block: B:21:0x00ae */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public java.lang.String toString() {
|
||||
/*
|
||||
r4 = this;
|
||||
int r0 = r4.a
|
||||
r1 = -1
|
||||
if (r0 != r1) goto Lc
|
||||
java.lang.Object r0 = r4.b
|
||||
java.lang.String r0 = java.lang.String.valueOf(r0)
|
||||
return r0
|
||||
Lc:
|
||||
java.lang.StringBuilder r0 = new java.lang.StringBuilder
|
||||
java.lang.String r1 = "Icon(typ="
|
||||
r0.<init>(r1)
|
||||
int r1 = r4.a
|
||||
java.lang.String r1 = a(r1)
|
||||
r0.append(r1)
|
||||
int r1 = r4.a
|
||||
r2 = 1
|
||||
if (r1 == r2) goto L7a
|
||||
r3 = 2
|
||||
if (r1 == r3) goto L52
|
||||
r2 = 3
|
||||
if (r1 == r2) goto L39
|
||||
r2 = 4
|
||||
if (r1 == r2) goto L2e
|
||||
r2 = 5
|
||||
if (r1 == r2) goto L7a
|
||||
goto L9a
|
||||
L2e:
|
||||
java.lang.String r1 = " uri="
|
||||
r0.append(r1)
|
||||
java.lang.Object r1 = r4.b
|
||||
r0.append(r1)
|
||||
goto L9a
|
||||
L39:
|
||||
java.lang.String r1 = " len="
|
||||
r0.append(r1)
|
||||
int r1 = r4.e
|
||||
r0.append(r1)
|
||||
int r1 = r4.f
|
||||
if (r1 == 0) goto L9a
|
||||
java.lang.String r1 = " off="
|
||||
r0.append(r1)
|
||||
int r1 = r4.f
|
||||
r0.append(r1)
|
||||
goto L9a
|
||||
L52:
|
||||
java.lang.String r1 = " pkg="
|
||||
r0.append(r1)
|
||||
java.lang.String r1 = r4.b()
|
||||
r0.append(r1)
|
||||
java.lang.String r1 = " id="
|
||||
r0.append(r1)
|
||||
java.lang.Object[] r1 = new java.lang.Object[r2]
|
||||
r2 = 0
|
||||
int r3 = r4.a()
|
||||
java.lang.Integer r3 = java.lang.Integer.valueOf(r3)
|
||||
r1[r2] = r3
|
||||
java.lang.String r2 = "0x%08x"
|
||||
java.lang.String r1 = java.lang.String.format(r2, r1)
|
||||
r0.append(r1)
|
||||
goto L9a
|
||||
L7a:
|
||||
java.lang.String r1 = " size="
|
||||
r0.append(r1)
|
||||
java.lang.Object r1 = r4.b
|
||||
android.graphics.Bitmap r1 = (android.graphics.Bitmap) r1
|
||||
int r1 = r1.getWidth()
|
||||
r0.append(r1)
|
||||
java.lang.String r1 = "x"
|
||||
r0.append(r1)
|
||||
java.lang.Object r1 = r4.b
|
||||
android.graphics.Bitmap r1 = (android.graphics.Bitmap) r1
|
||||
int r1 = r1.getHeight()
|
||||
r0.append(r1)
|
||||
L9a:
|
||||
android.content.res.ColorStateList r1 = r4.g
|
||||
if (r1 == 0) goto La8
|
||||
java.lang.String r1 = " tint="
|
||||
r0.append(r1)
|
||||
android.content.res.ColorStateList r1 = r4.g
|
||||
r0.append(r1)
|
||||
La8:
|
||||
android.graphics.PorterDuff$Mode r1 = r4.h
|
||||
android.graphics.PorterDuff$Mode r2 = androidx.core.graphics.drawable.IconCompat.j
|
||||
if (r1 == r2) goto Lb8
|
||||
java.lang.String r1 = " mode="
|
||||
r0.append(r1)
|
||||
android.graphics.PorterDuff$Mode r1 = r4.h
|
||||
r0.append(r1)
|
||||
Lb8:
|
||||
java.lang.String r1 = ")"
|
||||
r0.append(r1)
|
||||
java.lang.String r0 = r0.toString()
|
||||
return r0
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.core.graphics.drawable.IconCompat.toString():java.lang.String");
|
||||
}
|
||||
|
||||
private static String b(Icon icon) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return icon.getResPackage();
|
||||
}
|
||||
try {
|
||||
return (String) icon.getClass().getMethod("getResPackage", new Class[0]).invoke(icon, new Object[0]);
|
||||
} catch (IllegalAccessException e) {
|
||||
Log.e("IconCompat", "Unable to get icon package", e);
|
||||
return null;
|
||||
} catch (NoSuchMethodException e2) {
|
||||
Log.e("IconCompat", "Unable to get icon package", e2);
|
||||
return null;
|
||||
} catch (InvocationTargetException e3) {
|
||||
Log.e("IconCompat", "Unable to get icon package", e3);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
this.i = this.h.name();
|
||||
int i = this.a;
|
||||
if (i == -1) {
|
||||
if (!z) {
|
||||
this.d = (Parcelable) this.b;
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Can't serialize Icon created with IconCompat#createFromIcon");
|
||||
}
|
||||
if (i != 1) {
|
||||
if (i == 2) {
|
||||
this.c = ((String) this.b).getBytes(Charset.forName("UTF-16"));
|
||||
return;
|
||||
}
|
||||
if (i == 3) {
|
||||
this.c = (byte[]) this.b;
|
||||
return;
|
||||
} else if (i == 4) {
|
||||
this.c = this.b.toString().getBytes(Charset.forName("UTF-16"));
|
||||
return;
|
||||
} else if (i != 5) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (z) {
|
||||
Bitmap bitmap = (Bitmap) this.b;
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
bitmap.compress(Bitmap.CompressFormat.PNG, 90, byteArrayOutputStream);
|
||||
this.c = byteArrayOutputStream.toByteArray();
|
||||
return;
|
||||
}
|
||||
this.d = (Parcelable) this.b;
|
||||
}
|
||||
|
||||
private static int a(Icon icon) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return icon.getResId();
|
||||
}
|
||||
try {
|
||||
return ((Integer) icon.getClass().getMethod("getResId", new Class[0]).invoke(icon, new Object[0])).intValue();
|
||||
} catch (IllegalAccessException e) {
|
||||
Log.e("IconCompat", "Unable to get icon resource", e);
|
||||
return 0;
|
||||
} catch (NoSuchMethodException e2) {
|
||||
Log.e("IconCompat", "Unable to get icon resource", e2);
|
||||
return 0;
|
||||
} catch (InvocationTargetException e3) {
|
||||
Log.e("IconCompat", "Unable to get icon resource", e3);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package androidx.core.graphics.drawable;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import androidx.versionedparcelable.VersionedParcel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class IconCompatParcelizer {
|
||||
public static IconCompat read(VersionedParcel versionedParcel) {
|
||||
IconCompat iconCompat = new IconCompat();
|
||||
iconCompat.a = versionedParcel.a(iconCompat.a, 1);
|
||||
iconCompat.c = versionedParcel.a(iconCompat.c, 2);
|
||||
iconCompat.d = versionedParcel.a((VersionedParcel) iconCompat.d, 3);
|
||||
iconCompat.e = versionedParcel.a(iconCompat.e, 4);
|
||||
iconCompat.f = versionedParcel.a(iconCompat.f, 5);
|
||||
iconCompat.g = (ColorStateList) versionedParcel.a((VersionedParcel) iconCompat.g, 6);
|
||||
iconCompat.i = versionedParcel.a(iconCompat.i, 7);
|
||||
iconCompat.c();
|
||||
return iconCompat;
|
||||
}
|
||||
|
||||
public static void write(IconCompat iconCompat, VersionedParcel versionedParcel) {
|
||||
versionedParcel.a(true, true);
|
||||
iconCompat.a(versionedParcel.c());
|
||||
versionedParcel.b(iconCompat.a, 1);
|
||||
versionedParcel.b(iconCompat.c, 2);
|
||||
versionedParcel.b(iconCompat.d, 3);
|
||||
versionedParcel.b(iconCompat.e, 4);
|
||||
versionedParcel.b(iconCompat.f, 5);
|
||||
versionedParcel.b(iconCompat.g, 6);
|
||||
versionedParcel.b(iconCompat.i, 7);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package androidx.core.graphics.drawable;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface TintAwareDrawable {
|
||||
void setTint(int i);
|
||||
|
||||
void setTintList(ColorStateList colorStateList);
|
||||
|
||||
void setTintMode(PorterDuff.Mode mode);
|
||||
}
|
||||
10
sources/androidx/core/graphics/drawable/WrappedDrawable.java
Normal file
10
sources/androidx/core/graphics/drawable/WrappedDrawable.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package androidx.core.graphics.drawable;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface WrappedDrawable {
|
||||
Drawable a();
|
||||
|
||||
void a(Drawable drawable);
|
||||
}
|
||||
@@ -0,0 +1,332 @@
|
||||
package androidx.core.graphics.drawable;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Region;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class WrappedDrawableApi14 extends Drawable implements Drawable.Callback, WrappedDrawable, TintAwareDrawable {
|
||||
static final PorterDuff.Mode g = PorterDuff.Mode.SRC_IN;
|
||||
private int a;
|
||||
private PorterDuff.Mode b;
|
||||
private boolean c;
|
||||
DrawableWrapperState d;
|
||||
private boolean e;
|
||||
Drawable f;
|
||||
|
||||
protected static abstract class DrawableWrapperState extends Drawable.ConstantState {
|
||||
int a;
|
||||
Drawable.ConstantState b;
|
||||
ColorStateList c;
|
||||
PorterDuff.Mode d;
|
||||
|
||||
DrawableWrapperState(DrawableWrapperState drawableWrapperState, Resources resources) {
|
||||
this.c = null;
|
||||
this.d = WrappedDrawableApi14.g;
|
||||
if (drawableWrapperState != null) {
|
||||
this.a = drawableWrapperState.a;
|
||||
this.b = drawableWrapperState.b;
|
||||
this.c = drawableWrapperState.c;
|
||||
this.d = drawableWrapperState.d;
|
||||
}
|
||||
}
|
||||
|
||||
boolean a() {
|
||||
return this.b != null;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable.ConstantState
|
||||
public int getChangingConfigurations() {
|
||||
int i = this.a;
|
||||
Drawable.ConstantState constantState = this.b;
|
||||
return i | (constantState != null ? constantState.getChangingConfigurations() : 0);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable.ConstantState
|
||||
public Drawable newDrawable() {
|
||||
return newDrawable(null);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable.ConstantState
|
||||
public abstract Drawable newDrawable(Resources resources);
|
||||
}
|
||||
|
||||
private static class DrawableWrapperStateBase extends DrawableWrapperState {
|
||||
DrawableWrapperStateBase(DrawableWrapperState drawableWrapperState, Resources resources) {
|
||||
super(drawableWrapperState, resources);
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.drawable.WrappedDrawableApi14.DrawableWrapperState, android.graphics.drawable.Drawable.ConstantState
|
||||
public Drawable newDrawable(Resources resources) {
|
||||
return new WrappedDrawableApi14(this, resources);
|
||||
}
|
||||
}
|
||||
|
||||
WrappedDrawableApi14(DrawableWrapperState drawableWrapperState, Resources resources) {
|
||||
this.d = drawableWrapperState;
|
||||
a(resources);
|
||||
}
|
||||
|
||||
private void a(Resources resources) {
|
||||
Drawable.ConstantState constantState;
|
||||
DrawableWrapperState drawableWrapperState = this.d;
|
||||
if (drawableWrapperState == null || (constantState = drawableWrapperState.b) == null) {
|
||||
return;
|
||||
}
|
||||
a(constantState.newDrawable(resources));
|
||||
}
|
||||
|
||||
protected boolean b() {
|
||||
return true;
|
||||
}
|
||||
|
||||
DrawableWrapperState c() {
|
||||
return new DrawableWrapperStateBase(this.d, null);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void draw(Canvas canvas) {
|
||||
this.f.draw(canvas);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getChangingConfigurations() {
|
||||
int changingConfigurations = super.getChangingConfigurations();
|
||||
DrawableWrapperState drawableWrapperState = this.d;
|
||||
return changingConfigurations | (drawableWrapperState != null ? drawableWrapperState.getChangingConfigurations() : 0) | this.f.getChangingConfigurations();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public Drawable.ConstantState getConstantState() {
|
||||
DrawableWrapperState drawableWrapperState = this.d;
|
||||
if (drawableWrapperState == null || !drawableWrapperState.a()) {
|
||||
return null;
|
||||
}
|
||||
this.d.a = getChangingConfigurations();
|
||||
return this.d;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public Drawable getCurrent() {
|
||||
return this.f.getCurrent();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getIntrinsicHeight() {
|
||||
return this.f.getIntrinsicHeight();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getIntrinsicWidth() {
|
||||
return this.f.getIntrinsicWidth();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getMinimumHeight() {
|
||||
return this.f.getMinimumHeight();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getMinimumWidth() {
|
||||
return this.f.getMinimumWidth();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getOpacity() {
|
||||
return this.f.getOpacity();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean getPadding(Rect rect) {
|
||||
return this.f.getPadding(rect);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int[] getState() {
|
||||
return this.f.getState();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public Region getTransparentRegion() {
|
||||
return this.f.getTransparentRegion();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable.Callback
|
||||
public void invalidateDrawable(Drawable drawable) {
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean isAutoMirrored() {
|
||||
return this.f.isAutoMirrored();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean isStateful() {
|
||||
DrawableWrapperState drawableWrapperState;
|
||||
ColorStateList colorStateList = (!b() || (drawableWrapperState = this.d) == null) ? null : drawableWrapperState.c;
|
||||
return (colorStateList != null && colorStateList.isStateful()) || this.f.isStateful();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void jumpToCurrentState() {
|
||||
this.f.jumpToCurrentState();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public Drawable mutate() {
|
||||
if (!this.e && super.mutate() == this) {
|
||||
this.d = c();
|
||||
Drawable drawable = this.f;
|
||||
if (drawable != null) {
|
||||
drawable.mutate();
|
||||
}
|
||||
DrawableWrapperState drawableWrapperState = this.d;
|
||||
if (drawableWrapperState != null) {
|
||||
Drawable drawable2 = this.f;
|
||||
drawableWrapperState.b = drawable2 != null ? drawable2.getConstantState() : null;
|
||||
}
|
||||
this.e = true;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
protected void onBoundsChange(Rect rect) {
|
||||
Drawable drawable = this.f;
|
||||
if (drawable != null) {
|
||||
drawable.setBounds(rect);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
protected boolean onLevelChange(int i) {
|
||||
return this.f.setLevel(i);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable.Callback
|
||||
public void scheduleDrawable(Drawable drawable, Runnable runnable, long j) {
|
||||
scheduleSelf(runnable, j);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setAlpha(int i) {
|
||||
this.f.setAlpha(i);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setAutoMirrored(boolean z) {
|
||||
this.f.setAutoMirrored(z);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setChangingConfigurations(int i) {
|
||||
this.f.setChangingConfigurations(i);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setColorFilter(ColorFilter colorFilter) {
|
||||
this.f.setColorFilter(colorFilter);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setDither(boolean z) {
|
||||
this.f.setDither(z);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setFilterBitmap(boolean z) {
|
||||
this.f.setFilterBitmap(z);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean setState(int[] iArr) {
|
||||
return a(iArr) || this.f.setState(iArr);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable, androidx.core.graphics.drawable.TintAwareDrawable
|
||||
public void setTint(int i) {
|
||||
setTintList(ColorStateList.valueOf(i));
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable, androidx.core.graphics.drawable.TintAwareDrawable
|
||||
public void setTintList(ColorStateList colorStateList) {
|
||||
this.d.c = colorStateList;
|
||||
a(getState());
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable, androidx.core.graphics.drawable.TintAwareDrawable
|
||||
public void setTintMode(PorterDuff.Mode mode) {
|
||||
this.d.d = mode;
|
||||
a(getState());
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean setVisible(boolean z, boolean z2) {
|
||||
return super.setVisible(z, z2) || this.f.setVisible(z, z2);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable.Callback
|
||||
public void unscheduleDrawable(Drawable drawable, Runnable runnable) {
|
||||
unscheduleSelf(runnable);
|
||||
}
|
||||
|
||||
private boolean a(int[] iArr) {
|
||||
if (!b()) {
|
||||
return false;
|
||||
}
|
||||
DrawableWrapperState drawableWrapperState = this.d;
|
||||
ColorStateList colorStateList = drawableWrapperState.c;
|
||||
PorterDuff.Mode mode = drawableWrapperState.d;
|
||||
if (colorStateList != null && mode != null) {
|
||||
int colorForState = colorStateList.getColorForState(iArr, colorStateList.getDefaultColor());
|
||||
if (!this.c || colorForState != this.a || mode != this.b) {
|
||||
setColorFilter(colorForState, mode);
|
||||
this.a = colorForState;
|
||||
this.b = mode;
|
||||
this.c = true;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
this.c = false;
|
||||
clearColorFilter();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
WrappedDrawableApi14(Drawable drawable) {
|
||||
this.d = c();
|
||||
a(drawable);
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.drawable.WrappedDrawable
|
||||
public final Drawable a() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.drawable.WrappedDrawable
|
||||
public final void a(Drawable drawable) {
|
||||
Drawable drawable2 = this.f;
|
||||
if (drawable2 != null) {
|
||||
drawable2.setCallback(null);
|
||||
}
|
||||
this.f = drawable;
|
||||
if (drawable != null) {
|
||||
drawable.setCallback(this);
|
||||
setVisible(drawable.isVisible(), true);
|
||||
setState(drawable.getState());
|
||||
setLevel(drawable.getLevel());
|
||||
setBounds(drawable.getBounds());
|
||||
DrawableWrapperState drawableWrapperState = this.d;
|
||||
if (drawableWrapperState != null) {
|
||||
drawableWrapperState.b = drawable.getConstantState();
|
||||
}
|
||||
}
|
||||
invalidateSelf();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package androidx.core.graphics.drawable;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.DrawableContainer;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.graphics.drawable.InsetDrawable;
|
||||
import android.graphics.drawable.RippleDrawable;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import androidx.core.graphics.drawable.WrappedDrawableApi14;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class WrappedDrawableApi21 extends WrappedDrawableApi14 {
|
||||
private static Method h;
|
||||
|
||||
private static class DrawableWrapperStateLollipop extends WrappedDrawableApi14.DrawableWrapperState {
|
||||
DrawableWrapperStateLollipop(WrappedDrawableApi14.DrawableWrapperState drawableWrapperState, Resources resources) {
|
||||
super(drawableWrapperState, resources);
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.drawable.WrappedDrawableApi14.DrawableWrapperState, android.graphics.drawable.Drawable.ConstantState
|
||||
public Drawable newDrawable(Resources resources) {
|
||||
return new WrappedDrawableApi21(this, resources);
|
||||
}
|
||||
}
|
||||
|
||||
WrappedDrawableApi21(Drawable drawable) {
|
||||
super(drawable);
|
||||
d();
|
||||
}
|
||||
|
||||
private void d() {
|
||||
if (h == null) {
|
||||
try {
|
||||
h = Drawable.class.getDeclaredMethod("isProjected", new Class[0]);
|
||||
} catch (Exception e) {
|
||||
Log.w("WrappedDrawableApi21", "Failed to retrieve Drawable#isProjected() method", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.drawable.WrappedDrawableApi14
|
||||
protected boolean b() {
|
||||
if (Build.VERSION.SDK_INT != 21) {
|
||||
return false;
|
||||
}
|
||||
Drawable drawable = this.f;
|
||||
return (drawable instanceof GradientDrawable) || (drawable instanceof DrawableContainer) || (drawable instanceof InsetDrawable) || (drawable instanceof RippleDrawable);
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.drawable.WrappedDrawableApi14
|
||||
WrappedDrawableApi14.DrawableWrapperState c() {
|
||||
return new DrawableWrapperStateLollipop(this.d, null);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public Rect getDirtyBounds() {
|
||||
return this.f.getDirtyBounds();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void getOutline(Outline outline) {
|
||||
this.f.getOutline(outline);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean isProjected() {
|
||||
Method method;
|
||||
Drawable drawable = this.f;
|
||||
if (drawable != null && (method = h) != null) {
|
||||
try {
|
||||
return ((Boolean) method.invoke(drawable, new Object[0])).booleanValue();
|
||||
} catch (Exception e) {
|
||||
Log.w("WrappedDrawableApi21", "Error calling Drawable#isProjected() method", e);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setHotspot(float f, float f2) {
|
||||
this.f.setHotspot(f, f2);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setHotspotBounds(int i, int i2, int i3, int i4) {
|
||||
this.f.setHotspotBounds(i, i2, i3, i4);
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.drawable.WrappedDrawableApi14, android.graphics.drawable.Drawable
|
||||
public boolean setState(int[] iArr) {
|
||||
if (!super.setState(iArr)) {
|
||||
return false;
|
||||
}
|
||||
invalidateSelf();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.drawable.WrappedDrawableApi14, android.graphics.drawable.Drawable, androidx.core.graphics.drawable.TintAwareDrawable
|
||||
public void setTint(int i) {
|
||||
if (b()) {
|
||||
super.setTint(i);
|
||||
} else {
|
||||
this.f.setTint(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.drawable.WrappedDrawableApi14, android.graphics.drawable.Drawable, androidx.core.graphics.drawable.TintAwareDrawable
|
||||
public void setTintList(ColorStateList colorStateList) {
|
||||
if (b()) {
|
||||
super.setTintList(colorStateList);
|
||||
} else {
|
||||
this.f.setTintList(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.drawable.WrappedDrawableApi14, android.graphics.drawable.Drawable, androidx.core.graphics.drawable.TintAwareDrawable
|
||||
public void setTintMode(PorterDuff.Mode mode) {
|
||||
if (b()) {
|
||||
super.setTintMode(mode);
|
||||
} else {
|
||||
this.f.setTintMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
WrappedDrawableApi21(WrappedDrawableApi14.DrawableWrapperState drawableWrapperState, Resources resources) {
|
||||
super(drawableWrapperState, resources);
|
||||
d();
|
||||
}
|
||||
}
|
||||
7
sources/androidx/core/internal/view/SupportMenu.java
Normal file
7
sources/androidx/core/internal/view/SupportMenu.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package androidx.core.internal.view;
|
||||
|
||||
import android.view.Menu;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface SupportMenu extends Menu {
|
||||
}
|
||||
77
sources/androidx/core/internal/view/SupportMenuItem.java
Normal file
77
sources/androidx/core/internal/view/SupportMenuItem.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package androidx.core.internal.view;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import androidx.core.view.ActionProvider;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface SupportMenuItem extends MenuItem {
|
||||
SupportMenuItem a(ActionProvider actionProvider);
|
||||
|
||||
ActionProvider a();
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
boolean collapseActionView();
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
boolean expandActionView();
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
View getActionView();
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
int getAlphabeticModifiers();
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
CharSequence getContentDescription();
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
ColorStateList getIconTintList();
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
PorterDuff.Mode getIconTintMode();
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
int getNumericModifiers();
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
CharSequence getTooltipText();
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
boolean isActionViewExpanded();
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
MenuItem setActionView(int i);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
MenuItem setActionView(View view);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
MenuItem setAlphabeticShortcut(char c, int i);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
SupportMenuItem setContentDescription(CharSequence charSequence);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
MenuItem setIconTintList(ColorStateList colorStateList);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
MenuItem setIconTintMode(PorterDuff.Mode mode);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
MenuItem setNumericShortcut(char c, int i);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
MenuItem setShortcut(char c, char c2, int i, int i2);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
void setShowAsAction(int i);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
MenuItem setShowAsActionFlags(int i);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
SupportMenuItem setTooltipText(CharSequence charSequence);
|
||||
}
|
||||
7
sources/androidx/core/internal/view/SupportSubMenu.java
Normal file
7
sources/androidx/core/internal/view/SupportSubMenu.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package androidx.core.internal.view;
|
||||
|
||||
import android.view.SubMenu;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface SupportSubMenu extends SupportMenu, SubMenu {
|
||||
}
|
||||
12
sources/androidx/core/math/MathUtils.java
Normal file
12
sources/androidx/core/math/MathUtils.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package androidx.core.math;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MathUtils {
|
||||
public static float a(float f, float f2, float f3) {
|
||||
return f < f2 ? f2 : f > f3 ? f3 : f;
|
||||
}
|
||||
|
||||
public static int a(int i, int i2, int i3) {
|
||||
return i < i2 ? i2 : i > i3 ? i3 : i;
|
||||
}
|
||||
}
|
||||
12
sources/androidx/core/os/OperationCanceledException.java
Normal file
12
sources/androidx/core/os/OperationCanceledException.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package androidx.core.os;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class OperationCanceledException extends RuntimeException {
|
||||
public OperationCanceledException() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public OperationCanceledException(String str) {
|
||||
super(str == null ? "The operation has been canceled." : str);
|
||||
}
|
||||
}
|
||||
19
sources/androidx/core/os/TraceCompat.java
Normal file
19
sources/androidx/core/os/TraceCompat.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package androidx.core.os;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Trace;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class TraceCompat {
|
||||
public static void a(String str) {
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
Trace.beginSection(str);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a() {
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
Trace.endSection();
|
||||
}
|
||||
}
|
||||
}
|
||||
70
sources/androidx/core/provider/FontRequest.java
Normal file
70
sources/androidx/core/provider/FontRequest.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package androidx.core.provider;
|
||||
|
||||
import android.util.Base64;
|
||||
import androidx.core.util.Preconditions;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class FontRequest {
|
||||
private final String a;
|
||||
private final String b;
|
||||
private final String c;
|
||||
private final List<List<byte[]>> d;
|
||||
private final int e;
|
||||
private final String f;
|
||||
|
||||
public FontRequest(String str, String str2, String str3, List<List<byte[]>> list) {
|
||||
Preconditions.a(str);
|
||||
this.a = str;
|
||||
Preconditions.a(str2);
|
||||
this.b = str2;
|
||||
Preconditions.a(str3);
|
||||
this.c = str3;
|
||||
Preconditions.a(list);
|
||||
this.d = list;
|
||||
this.e = 0;
|
||||
this.f = this.a + "-" + this.b + "-" + this.c;
|
||||
}
|
||||
|
||||
public List<List<byte[]>> a() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public int b() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public String c() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
public String d() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public String e() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public String f() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("FontRequest {mProviderAuthority: " + this.a + ", mProviderPackage: " + this.b + ", mQuery: " + this.c + ", mCertificates:");
|
||||
for (int i = 0; i < this.d.size(); i++) {
|
||||
sb.append(" [");
|
||||
List<byte[]> list = this.d.get(i);
|
||||
for (int i2 = 0; i2 < list.size(); i2++) {
|
||||
sb.append(" \"");
|
||||
sb.append(Base64.encodeToString(list.get(i2), 0));
|
||||
sb.append("\"");
|
||||
}
|
||||
sb.append(" ]");
|
||||
}
|
||||
sb.append("}");
|
||||
sb.append("mCertificatesArray: " + this.e);
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
335
sources/androidx/core/provider/FontsContractCompat.java
Normal file
335
sources/androidx/core/provider/FontsContractCompat.java
Normal file
@@ -0,0 +1,335 @@
|
||||
package androidx.core.provider;
|
||||
|
||||
import android.content.ContentUris;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ProviderInfo;
|
||||
import android.content.pm.Signature;
|
||||
import android.content.res.Resources;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Typeface;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.CancellationSignal;
|
||||
import android.os.Handler;
|
||||
import androidx.collection.LruCache;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
import androidx.core.content.res.FontResourcesParserCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.core.graphics.TypefaceCompat;
|
||||
import androidx.core.graphics.TypefaceCompatUtil;
|
||||
import androidx.core.provider.SelfDestructiveThread;
|
||||
import androidx.core.util.Preconditions;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FontsContractCompat {
|
||||
static final LruCache<String, Typeface> a = new LruCache<>(16);
|
||||
private static final SelfDestructiveThread b = new SelfDestructiveThread("fonts", 10, XStream.PRIORITY_VERY_HIGH);
|
||||
static final Object c = new Object();
|
||||
static final SimpleArrayMap<String, ArrayList<SelfDestructiveThread.ReplyCallback<TypefaceResult>>> d = new SimpleArrayMap<>();
|
||||
private static final Comparator<byte[]> e = new Comparator<byte[]>() { // from class: androidx.core.provider.FontsContractCompat.5
|
||||
@Override // java.util.Comparator
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public int compare(byte[] bArr, byte[] bArr2) {
|
||||
int i;
|
||||
int i2;
|
||||
if (bArr.length == bArr2.length) {
|
||||
for (int i3 = 0; i3 < bArr.length; i3++) {
|
||||
if (bArr[i3] != bArr2[i3]) {
|
||||
i = bArr[i3];
|
||||
i2 = bArr2[i3];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
i = bArr.length;
|
||||
i2 = bArr2.length;
|
||||
return i - i2;
|
||||
}
|
||||
};
|
||||
|
||||
public static class FontFamilyResult {
|
||||
private final int a;
|
||||
private final FontInfo[] b;
|
||||
|
||||
public FontFamilyResult(int i, FontInfo[] fontInfoArr) {
|
||||
this.a = i;
|
||||
this.b = fontInfoArr;
|
||||
}
|
||||
|
||||
public FontInfo[] a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public int b() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
public static class FontInfo {
|
||||
private final Uri a;
|
||||
private final int b;
|
||||
private final int c;
|
||||
private final boolean d;
|
||||
private final int e;
|
||||
|
||||
public FontInfo(Uri uri, int i, int i2, boolean z, int i3) {
|
||||
Preconditions.a(uri);
|
||||
this.a = uri;
|
||||
this.b = i;
|
||||
this.c = i2;
|
||||
this.d = z;
|
||||
this.e = i3;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public int b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public Uri c() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public int d() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public boolean e() {
|
||||
return this.d;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class TypefaceResult {
|
||||
final Typeface a;
|
||||
final int b;
|
||||
|
||||
TypefaceResult(Typeface typeface, int i) {
|
||||
this.a = typeface;
|
||||
this.b = i;
|
||||
}
|
||||
}
|
||||
|
||||
static TypefaceResult a(Context context, FontRequest fontRequest, int i) {
|
||||
try {
|
||||
FontFamilyResult a2 = a(context, (CancellationSignal) null, fontRequest);
|
||||
if (a2.b() != 0) {
|
||||
return new TypefaceResult(null, a2.b() == 1 ? -2 : -3);
|
||||
}
|
||||
Typeface a3 = TypefaceCompat.a(context, null, a2.a(), i);
|
||||
return new TypefaceResult(a3, a3 != null ? 0 : -3);
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
return new TypefaceResult(null, -1);
|
||||
}
|
||||
}
|
||||
|
||||
public static Typeface a(final Context context, final FontRequest fontRequest, final ResourcesCompat.FontCallback fontCallback, final Handler handler, boolean z, int i, final int i2) {
|
||||
final String str = fontRequest.c() + "-" + i2;
|
||||
Typeface b2 = a.b(str);
|
||||
if (b2 != null) {
|
||||
if (fontCallback != null) {
|
||||
fontCallback.a(b2);
|
||||
}
|
||||
return b2;
|
||||
}
|
||||
if (z && i == -1) {
|
||||
TypefaceResult a2 = a(context, fontRequest, i2);
|
||||
if (fontCallback != null) {
|
||||
int i3 = a2.b;
|
||||
if (i3 == 0) {
|
||||
fontCallback.a(a2.a, handler);
|
||||
} else {
|
||||
fontCallback.a(i3, handler);
|
||||
}
|
||||
}
|
||||
return a2.a;
|
||||
}
|
||||
Callable<TypefaceResult> callable = new Callable<TypefaceResult>() { // from class: androidx.core.provider.FontsContractCompat.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // java.util.concurrent.Callable
|
||||
public TypefaceResult call() throws Exception {
|
||||
TypefaceResult a3 = FontsContractCompat.a(context, fontRequest, i2);
|
||||
Typeface typeface = a3.a;
|
||||
if (typeface != null) {
|
||||
FontsContractCompat.a.a(str, typeface);
|
||||
}
|
||||
return a3;
|
||||
}
|
||||
};
|
||||
if (z) {
|
||||
try {
|
||||
return ((TypefaceResult) b.a(callable, i)).a;
|
||||
} catch (InterruptedException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
SelfDestructiveThread.ReplyCallback<TypefaceResult> replyCallback = fontCallback == null ? null : new SelfDestructiveThread.ReplyCallback<TypefaceResult>() { // from class: androidx.core.provider.FontsContractCompat.2
|
||||
@Override // androidx.core.provider.SelfDestructiveThread.ReplyCallback
|
||||
public void a(TypefaceResult typefaceResult) {
|
||||
if (typefaceResult == null) {
|
||||
ResourcesCompat.FontCallback.this.a(1, handler);
|
||||
return;
|
||||
}
|
||||
int i4 = typefaceResult.b;
|
||||
if (i4 == 0) {
|
||||
ResourcesCompat.FontCallback.this.a(typefaceResult.a, handler);
|
||||
} else {
|
||||
ResourcesCompat.FontCallback.this.a(i4, handler);
|
||||
}
|
||||
}
|
||||
};
|
||||
synchronized (c) {
|
||||
if (d.containsKey(str)) {
|
||||
if (replyCallback != null) {
|
||||
d.get(str).add(replyCallback);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (replyCallback != null) {
|
||||
ArrayList<SelfDestructiveThread.ReplyCallback<TypefaceResult>> arrayList = new ArrayList<>();
|
||||
arrayList.add(replyCallback);
|
||||
d.put(str, arrayList);
|
||||
}
|
||||
b.a(callable, new SelfDestructiveThread.ReplyCallback<TypefaceResult>() { // from class: androidx.core.provider.FontsContractCompat.3
|
||||
@Override // androidx.core.provider.SelfDestructiveThread.ReplyCallback
|
||||
public void a(TypefaceResult typefaceResult) {
|
||||
synchronized (FontsContractCompat.c) {
|
||||
ArrayList<SelfDestructiveThread.ReplyCallback<TypefaceResult>> arrayList2 = FontsContractCompat.d.get(str);
|
||||
if (arrayList2 == null) {
|
||||
return;
|
||||
}
|
||||
FontsContractCompat.d.remove(str);
|
||||
for (int i4 = 0; i4 < arrayList2.size(); i4++) {
|
||||
arrayList2.get(i4).a(typefaceResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Map<Uri, ByteBuffer> a(Context context, FontInfo[] fontInfoArr, CancellationSignal cancellationSignal) {
|
||||
HashMap hashMap = new HashMap();
|
||||
for (FontInfo fontInfo : fontInfoArr) {
|
||||
if (fontInfo.a() == 0) {
|
||||
Uri c2 = fontInfo.c();
|
||||
if (!hashMap.containsKey(c2)) {
|
||||
hashMap.put(c2, TypefaceCompatUtil.a(context, cancellationSignal, c2));
|
||||
}
|
||||
}
|
||||
}
|
||||
return Collections.unmodifiableMap(hashMap);
|
||||
}
|
||||
|
||||
public static FontFamilyResult a(Context context, CancellationSignal cancellationSignal, FontRequest fontRequest) throws PackageManager.NameNotFoundException {
|
||||
ProviderInfo a2 = a(context.getPackageManager(), fontRequest, context.getResources());
|
||||
if (a2 == null) {
|
||||
return new FontFamilyResult(1, null);
|
||||
}
|
||||
return new FontFamilyResult(0, a(context, fontRequest, a2.authority, cancellationSignal));
|
||||
}
|
||||
|
||||
public static ProviderInfo a(PackageManager packageManager, FontRequest fontRequest, Resources resources) throws PackageManager.NameNotFoundException {
|
||||
String d2 = fontRequest.d();
|
||||
ProviderInfo resolveContentProvider = packageManager.resolveContentProvider(d2, 0);
|
||||
if (resolveContentProvider != null) {
|
||||
if (resolveContentProvider.packageName.equals(fontRequest.e())) {
|
||||
List<byte[]> a2 = a(packageManager.getPackageInfo(resolveContentProvider.packageName, 64).signatures);
|
||||
Collections.sort(a2, e);
|
||||
List<List<byte[]>> a3 = a(fontRequest, resources);
|
||||
for (int i = 0; i < a3.size(); i++) {
|
||||
ArrayList arrayList = new ArrayList(a3.get(i));
|
||||
Collections.sort(arrayList, e);
|
||||
if (a(a2, arrayList)) {
|
||||
return resolveContentProvider;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
throw new PackageManager.NameNotFoundException("Found content provider " + d2 + ", but package was not " + fontRequest.e());
|
||||
}
|
||||
throw new PackageManager.NameNotFoundException("No package found for authority: " + d2);
|
||||
}
|
||||
|
||||
private static List<List<byte[]>> a(FontRequest fontRequest, Resources resources) {
|
||||
if (fontRequest.a() != null) {
|
||||
return fontRequest.a();
|
||||
}
|
||||
return FontResourcesParserCompat.a(resources, fontRequest.b());
|
||||
}
|
||||
|
||||
private static boolean a(List<byte[]> list, List<byte[]> list2) {
|
||||
if (list.size() != list2.size()) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if (!Arrays.equals(list.get(i), list2.get(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static List<byte[]> a(Signature[] signatureArr) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (Signature signature : signatureArr) {
|
||||
arrayList.add(signature.toByteArray());
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
static FontInfo[] a(Context context, FontRequest fontRequest, String str, CancellationSignal cancellationSignal) {
|
||||
Uri withAppendedId;
|
||||
ArrayList arrayList = new ArrayList();
|
||||
Uri build = new Uri.Builder().scheme("content").authority(str).build();
|
||||
Uri build2 = new Uri.Builder().scheme("content").authority(str).appendPath("file").build();
|
||||
Cursor cursor = null;
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT > 16) {
|
||||
cursor = context.getContentResolver().query(build, new String[]{FileDownloadModel.ID, "file_id", "font_ttc_index", "font_variation_settings", "font_weight", "font_italic", "result_code"}, "query = ?", new String[]{fontRequest.f()}, null, cancellationSignal);
|
||||
} else {
|
||||
cursor = context.getContentResolver().query(build, new String[]{FileDownloadModel.ID, "file_id", "font_ttc_index", "font_variation_settings", "font_weight", "font_italic", "result_code"}, "query = ?", new String[]{fontRequest.f()}, null);
|
||||
}
|
||||
if (cursor != null && cursor.getCount() > 0) {
|
||||
int columnIndex = cursor.getColumnIndex("result_code");
|
||||
ArrayList arrayList2 = new ArrayList();
|
||||
int columnIndex2 = cursor.getColumnIndex(FileDownloadModel.ID);
|
||||
int columnIndex3 = cursor.getColumnIndex("file_id");
|
||||
int columnIndex4 = cursor.getColumnIndex("font_ttc_index");
|
||||
int columnIndex5 = cursor.getColumnIndex("font_weight");
|
||||
int columnIndex6 = cursor.getColumnIndex("font_italic");
|
||||
while (cursor.moveToNext()) {
|
||||
int i = columnIndex != -1 ? cursor.getInt(columnIndex) : 0;
|
||||
int i2 = columnIndex4 != -1 ? cursor.getInt(columnIndex4) : 0;
|
||||
if (columnIndex3 == -1) {
|
||||
withAppendedId = ContentUris.withAppendedId(build, cursor.getLong(columnIndex2));
|
||||
} else {
|
||||
withAppendedId = ContentUris.withAppendedId(build2, cursor.getLong(columnIndex3));
|
||||
}
|
||||
arrayList2.add(new FontInfo(withAppendedId, i2, columnIndex5 != -1 ? cursor.getInt(columnIndex5) : 400, columnIndex6 != -1 && cursor.getInt(columnIndex6) == 1, i));
|
||||
}
|
||||
arrayList = arrayList2;
|
||||
}
|
||||
return (FontInfo[]) arrayList.toArray(new FontInfo[0]);
|
||||
} finally {
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
142
sources/androidx/core/provider/SelfDestructiveThread.java
Normal file
142
sources/androidx/core/provider/SelfDestructiveThread.java
Normal file
@@ -0,0 +1,142 @@
|
||||
package androidx.core.provider;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Message;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.concurrent.locks.Condition;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SelfDestructiveThread {
|
||||
private HandlerThread b;
|
||||
private Handler c;
|
||||
private final int f;
|
||||
private final int g;
|
||||
private final String h;
|
||||
private final Object a = new Object();
|
||||
private Handler.Callback e = new Handler.Callback() { // from class: androidx.core.provider.SelfDestructiveThread.1
|
||||
@Override // android.os.Handler.Callback
|
||||
public boolean handleMessage(Message message) {
|
||||
int i = message.what;
|
||||
if (i == 0) {
|
||||
SelfDestructiveThread.this.a();
|
||||
return true;
|
||||
}
|
||||
if (i != 1) {
|
||||
return true;
|
||||
}
|
||||
SelfDestructiveThread.this.a((Runnable) message.obj);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
private int d = 0;
|
||||
|
||||
public interface ReplyCallback<T> {
|
||||
void a(T t);
|
||||
}
|
||||
|
||||
public SelfDestructiveThread(String str, int i, int i2) {
|
||||
this.h = str;
|
||||
this.g = i;
|
||||
this.f = i2;
|
||||
}
|
||||
|
||||
private void b(Runnable runnable) {
|
||||
synchronized (this.a) {
|
||||
if (this.b == null) {
|
||||
this.b = new HandlerThread(this.h, this.g);
|
||||
this.b.start();
|
||||
this.c = new Handler(this.b.getLooper(), this.e);
|
||||
this.d++;
|
||||
}
|
||||
this.c.removeMessages(0);
|
||||
this.c.sendMessage(this.c.obtainMessage(1, runnable));
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void a(final Callable<T> callable, final ReplyCallback<T> replyCallback) {
|
||||
final Handler handler = new Handler();
|
||||
b(new Runnable(this) { // from class: androidx.core.provider.SelfDestructiveThread.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
final Object obj;
|
||||
try {
|
||||
obj = callable.call();
|
||||
} catch (Exception unused) {
|
||||
obj = null;
|
||||
}
|
||||
handler.post(new Runnable() { // from class: androidx.core.provider.SelfDestructiveThread.2.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
replyCallback.a(obj);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public <T> T a(final Callable<T> callable, int i) throws InterruptedException {
|
||||
final ReentrantLock reentrantLock = new ReentrantLock();
|
||||
final Condition newCondition = reentrantLock.newCondition();
|
||||
final AtomicReference atomicReference = new AtomicReference();
|
||||
final AtomicBoolean atomicBoolean = new AtomicBoolean(true);
|
||||
b(new Runnable(this) { // from class: androidx.core.provider.SelfDestructiveThread.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
try {
|
||||
atomicReference.set(callable.call());
|
||||
} catch (Exception unused) {
|
||||
}
|
||||
reentrantLock.lock();
|
||||
try {
|
||||
atomicBoolean.set(false);
|
||||
newCondition.signal();
|
||||
} finally {
|
||||
reentrantLock.unlock();
|
||||
}
|
||||
}
|
||||
});
|
||||
reentrantLock.lock();
|
||||
try {
|
||||
if (!atomicBoolean.get()) {
|
||||
return (T) atomicReference.get();
|
||||
}
|
||||
long nanos = TimeUnit.MILLISECONDS.toNanos(i);
|
||||
do {
|
||||
try {
|
||||
nanos = newCondition.awaitNanos(nanos);
|
||||
} catch (InterruptedException unused) {
|
||||
}
|
||||
if (!atomicBoolean.get()) {
|
||||
return (T) atomicReference.get();
|
||||
}
|
||||
} while (nanos > 0);
|
||||
throw new InterruptedException("timeout");
|
||||
} finally {
|
||||
reentrantLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
void a(Runnable runnable) {
|
||||
runnable.run();
|
||||
synchronized (this.a) {
|
||||
this.c.removeMessages(0);
|
||||
this.c.sendMessageDelayed(this.c.obtainMessage(0), this.f);
|
||||
}
|
||||
}
|
||||
|
||||
void a() {
|
||||
synchronized (this.a) {
|
||||
if (this.c.hasMessages(1)) {
|
||||
return;
|
||||
}
|
||||
this.b.quit();
|
||||
this.b = null;
|
||||
this.c = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
81
sources/androidx/core/text/ICUCompat.java
Normal file
81
sources/androidx/core/text/ICUCompat.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package androidx.core.text;
|
||||
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ICUCompat {
|
||||
private static Method a;
|
||||
private static Method b;
|
||||
|
||||
static {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
try {
|
||||
b = Class.forName("libcore.icu.ICU").getMethod("addLikelySubtags", Locale.class);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
try {
|
||||
Class<?> cls = Class.forName("libcore.icu.ICU");
|
||||
if (cls != null) {
|
||||
a = cls.getMethod("getScript", String.class);
|
||||
b = cls.getMethod("addLikelySubtags", String.class);
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
a = null;
|
||||
b = null;
|
||||
Log.w("ICUCompat", e2);
|
||||
}
|
||||
}
|
||||
|
||||
private static String a(String str) {
|
||||
try {
|
||||
if (a != null) {
|
||||
return (String) a.invoke(null, str);
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
Log.w("ICUCompat", e);
|
||||
} catch (InvocationTargetException e2) {
|
||||
Log.w("ICUCompat", e2);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String b(Locale locale) {
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
String a2 = a(locale);
|
||||
if (a2 != null) {
|
||||
return a(a2);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return ((Locale) b.invoke(null, locale)).getScript();
|
||||
} catch (IllegalAccessException e) {
|
||||
Log.w("ICUCompat", e);
|
||||
return locale.getScript();
|
||||
} catch (InvocationTargetException e2) {
|
||||
Log.w("ICUCompat", e2);
|
||||
return locale.getScript();
|
||||
}
|
||||
}
|
||||
|
||||
private static String a(Locale locale) {
|
||||
String locale2 = locale.toString();
|
||||
try {
|
||||
if (b != null) {
|
||||
return (String) b.invoke(null, locale2);
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
Log.w("ICUCompat", e);
|
||||
} catch (InvocationTargetException e2) {
|
||||
Log.w("ICUCompat", e2);
|
||||
}
|
||||
return locale2;
|
||||
}
|
||||
}
|
||||
255
sources/androidx/core/text/PrecomputedTextCompat.java
Normal file
255
sources/androidx/core/text/PrecomputedTextCompat.java
Normal file
@@ -0,0 +1,255 @@
|
||||
package androidx.core.text;
|
||||
|
||||
import android.os.Build;
|
||||
import android.text.PrecomputedText;
|
||||
import android.text.Spannable;
|
||||
import android.text.TextDirectionHeuristic;
|
||||
import android.text.TextDirectionHeuristics;
|
||||
import android.text.TextPaint;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.MetricAffectingSpan;
|
||||
import androidx.core.util.ObjectsCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PrecomputedTextCompat implements Spannable {
|
||||
private final Spannable a;
|
||||
private final Params b;
|
||||
private final PrecomputedText c;
|
||||
|
||||
public Params a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public PrecomputedText b() {
|
||||
Spannable spannable = this.a;
|
||||
if (spannable instanceof PrecomputedText) {
|
||||
return (PrecomputedText) spannable;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // java.lang.CharSequence
|
||||
public char charAt(int i) {
|
||||
return this.a.charAt(i);
|
||||
}
|
||||
|
||||
@Override // android.text.Spanned
|
||||
public int getSpanEnd(Object obj) {
|
||||
return this.a.getSpanEnd(obj);
|
||||
}
|
||||
|
||||
@Override // android.text.Spanned
|
||||
public int getSpanFlags(Object obj) {
|
||||
return this.a.getSpanFlags(obj);
|
||||
}
|
||||
|
||||
@Override // android.text.Spanned
|
||||
public int getSpanStart(Object obj) {
|
||||
return this.a.getSpanStart(obj);
|
||||
}
|
||||
|
||||
@Override // android.text.Spanned
|
||||
public <T> T[] getSpans(int i, int i2, Class<T> cls) {
|
||||
return Build.VERSION.SDK_INT >= 28 ? (T[]) this.c.getSpans(i, i2, cls) : (T[]) this.a.getSpans(i, i2, cls);
|
||||
}
|
||||
|
||||
@Override // java.lang.CharSequence
|
||||
public int length() {
|
||||
return this.a.length();
|
||||
}
|
||||
|
||||
@Override // android.text.Spanned
|
||||
public int nextSpanTransition(int i, int i2, Class cls) {
|
||||
return this.a.nextSpanTransition(i, i2, cls);
|
||||
}
|
||||
|
||||
@Override // android.text.Spannable
|
||||
public void removeSpan(Object obj) {
|
||||
if (obj instanceof MetricAffectingSpan) {
|
||||
throw new IllegalArgumentException("MetricAffectingSpan can not be removed from PrecomputedText.");
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
this.c.removeSpan(obj);
|
||||
} else {
|
||||
this.a.removeSpan(obj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.text.Spannable
|
||||
public void setSpan(Object obj, int i, int i2, int i3) {
|
||||
if (obj instanceof MetricAffectingSpan) {
|
||||
throw new IllegalArgumentException("MetricAffectingSpan can not be set to PrecomputedText.");
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
this.c.setSpan(obj, i, i2, i3);
|
||||
} else {
|
||||
this.a.setSpan(obj, i, i2, i3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.lang.CharSequence
|
||||
public CharSequence subSequence(int i, int i2) {
|
||||
return this.a.subSequence(i, i2);
|
||||
}
|
||||
|
||||
@Override // java.lang.CharSequence
|
||||
public String toString() {
|
||||
return this.a.toString();
|
||||
}
|
||||
|
||||
public static final class Params {
|
||||
private final TextPaint a;
|
||||
private final TextDirectionHeuristic b;
|
||||
private final int c;
|
||||
private final int d;
|
||||
final PrecomputedText.Params e;
|
||||
|
||||
public static class Builder {
|
||||
private final TextPaint a;
|
||||
private TextDirectionHeuristic b;
|
||||
private int c;
|
||||
private int d;
|
||||
|
||||
public Builder(TextPaint textPaint) {
|
||||
this.a = textPaint;
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
this.c = 1;
|
||||
this.d = 1;
|
||||
} else {
|
||||
this.d = 0;
|
||||
this.c = 0;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
this.b = TextDirectionHeuristics.FIRSTSTRONG_LTR;
|
||||
} else {
|
||||
this.b = null;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder a(int i) {
|
||||
this.c = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder b(int i) {
|
||||
this.d = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(TextDirectionHeuristic textDirectionHeuristic) {
|
||||
this.b = textDirectionHeuristic;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Params a() {
|
||||
return new Params(this.a, this.b, this.c, this.d);
|
||||
}
|
||||
}
|
||||
|
||||
Params(TextPaint textPaint, TextDirectionHeuristic textDirectionHeuristic, int i, int i2) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
this.e = new PrecomputedText.Params.Builder(textPaint).setBreakStrategy(i).setHyphenationFrequency(i2).setTextDirection(textDirectionHeuristic).build();
|
||||
} else {
|
||||
this.e = null;
|
||||
}
|
||||
this.a = textPaint;
|
||||
this.b = textDirectionHeuristic;
|
||||
this.c = i;
|
||||
this.d = i2;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public int b() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public TextDirectionHeuristic c() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public TextPaint d() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || !(obj instanceof Params)) {
|
||||
return false;
|
||||
}
|
||||
Params params = (Params) obj;
|
||||
PrecomputedText.Params params2 = this.e;
|
||||
if (params2 != null) {
|
||||
return params2.equals(params.e);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 23 && (this.c != params.a() || this.d != params.b())) {
|
||||
return false;
|
||||
}
|
||||
if ((Build.VERSION.SDK_INT >= 18 && this.b != params.c()) || this.a.getTextSize() != params.d().getTextSize() || this.a.getTextScaleX() != params.d().getTextScaleX() || this.a.getTextSkewX() != params.d().getTextSkewX()) {
|
||||
return false;
|
||||
}
|
||||
if ((Build.VERSION.SDK_INT >= 21 && (this.a.getLetterSpacing() != params.d().getLetterSpacing() || !TextUtils.equals(this.a.getFontFeatureSettings(), params.d().getFontFeatureSettings()))) || this.a.getFlags() != params.d().getFlags()) {
|
||||
return false;
|
||||
}
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 24) {
|
||||
if (!this.a.getTextLocales().equals(params.d().getTextLocales())) {
|
||||
return false;
|
||||
}
|
||||
} else if (i >= 17 && !this.a.getTextLocale().equals(params.d().getTextLocale())) {
|
||||
return false;
|
||||
}
|
||||
if (this.a.getTypeface() == null) {
|
||||
if (params.d().getTypeface() != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.a.getTypeface().equals(params.d().getTypeface())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
return i >= 24 ? ObjectsCompat.a(Float.valueOf(this.a.getTextSize()), Float.valueOf(this.a.getTextScaleX()), Float.valueOf(this.a.getTextSkewX()), Float.valueOf(this.a.getLetterSpacing()), Integer.valueOf(this.a.getFlags()), this.a.getTextLocales(), this.a.getTypeface(), Boolean.valueOf(this.a.isElegantTextHeight()), this.b, Integer.valueOf(this.c), Integer.valueOf(this.d)) : i >= 21 ? ObjectsCompat.a(Float.valueOf(this.a.getTextSize()), Float.valueOf(this.a.getTextScaleX()), Float.valueOf(this.a.getTextSkewX()), Float.valueOf(this.a.getLetterSpacing()), Integer.valueOf(this.a.getFlags()), this.a.getTextLocale(), this.a.getTypeface(), Boolean.valueOf(this.a.isElegantTextHeight()), this.b, Integer.valueOf(this.c), Integer.valueOf(this.d)) : i >= 18 ? ObjectsCompat.a(Float.valueOf(this.a.getTextSize()), Float.valueOf(this.a.getTextScaleX()), Float.valueOf(this.a.getTextSkewX()), Integer.valueOf(this.a.getFlags()), this.a.getTextLocale(), this.a.getTypeface(), this.b, Integer.valueOf(this.c), Integer.valueOf(this.d)) : i >= 17 ? ObjectsCompat.a(Float.valueOf(this.a.getTextSize()), Float.valueOf(this.a.getTextScaleX()), Float.valueOf(this.a.getTextSkewX()), Integer.valueOf(this.a.getFlags()), this.a.getTextLocale(), this.a.getTypeface(), this.b, Integer.valueOf(this.c), Integer.valueOf(this.d)) : ObjectsCompat.a(Float.valueOf(this.a.getTextSize()), Float.valueOf(this.a.getTextScaleX()), Float.valueOf(this.a.getTextSkewX()), Integer.valueOf(this.a.getFlags()), this.a.getTypeface(), this.b, Integer.valueOf(this.c), Integer.valueOf(this.d));
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("textSize=" + this.a.getTextSize());
|
||||
sb.append(", textScaleX=" + this.a.getTextScaleX());
|
||||
sb.append(", textSkewX=" + this.a.getTextSkewX());
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
sb.append(", letterSpacing=" + this.a.getLetterSpacing());
|
||||
sb.append(", elegantTextHeight=" + this.a.isElegantTextHeight());
|
||||
}
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 24) {
|
||||
sb.append(", textLocale=" + this.a.getTextLocales());
|
||||
} else if (i >= 17) {
|
||||
sb.append(", textLocale=" + this.a.getTextLocale());
|
||||
}
|
||||
sb.append(", typeface=" + this.a.getTypeface());
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
sb.append(", variationSettings=" + this.a.getFontVariationSettings());
|
||||
}
|
||||
sb.append(", textDir=" + this.b);
|
||||
sb.append(", breakStrategy=" + this.c);
|
||||
sb.append(", hyphenationFrequency=" + this.d);
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public Params(PrecomputedText.Params params) {
|
||||
this.a = params.getTextPaint();
|
||||
this.b = params.getTextDirection();
|
||||
this.c = params.getBreakStrategy();
|
||||
this.d = params.getHyphenationFrequency();
|
||||
this.e = params;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package androidx.core.text;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface TextDirectionHeuristicCompat {
|
||||
boolean a(CharSequence charSequence, int i, int i2);
|
||||
}
|
||||
160
sources/androidx/core/text/TextDirectionHeuristicsCompat.java
Normal file
160
sources/androidx/core/text/TextDirectionHeuristicsCompat.java
Normal file
@@ -0,0 +1,160 @@
|
||||
package androidx.core.text;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class TextDirectionHeuristicsCompat {
|
||||
public static final TextDirectionHeuristicCompat a;
|
||||
public static final TextDirectionHeuristicCompat b;
|
||||
|
||||
private static class AnyStrong implements TextDirectionAlgorithm {
|
||||
static final AnyStrong b = new AnyStrong(true);
|
||||
private final boolean a;
|
||||
|
||||
static {
|
||||
new AnyStrong(false);
|
||||
}
|
||||
|
||||
private AnyStrong(boolean z) {
|
||||
this.a = z;
|
||||
}
|
||||
|
||||
@Override // androidx.core.text.TextDirectionHeuristicsCompat.TextDirectionAlgorithm
|
||||
public int a(CharSequence charSequence, int i, int i2) {
|
||||
int i3 = i2 + i;
|
||||
boolean z = false;
|
||||
while (i < i3) {
|
||||
int a = TextDirectionHeuristicsCompat.a(Character.getDirectionality(charSequence.charAt(i)));
|
||||
if (a != 0) {
|
||||
if (a != 1) {
|
||||
continue;
|
||||
i++;
|
||||
} else if (!this.a) {
|
||||
return 1;
|
||||
}
|
||||
} else if (this.a) {
|
||||
return 0;
|
||||
}
|
||||
z = true;
|
||||
i++;
|
||||
}
|
||||
if (z) {
|
||||
return this.a ? 1 : 0;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
private static class FirstStrong implements TextDirectionAlgorithm {
|
||||
static final FirstStrong a = new FirstStrong();
|
||||
|
||||
private FirstStrong() {
|
||||
}
|
||||
|
||||
@Override // androidx.core.text.TextDirectionHeuristicsCompat.TextDirectionAlgorithm
|
||||
public int a(CharSequence charSequence, int i, int i2) {
|
||||
int i3 = i2 + i;
|
||||
int i4 = 2;
|
||||
while (i < i3 && i4 == 2) {
|
||||
i4 = TextDirectionHeuristicsCompat.b(Character.getDirectionality(charSequence.charAt(i)));
|
||||
i++;
|
||||
}
|
||||
return i4;
|
||||
}
|
||||
}
|
||||
|
||||
private interface TextDirectionAlgorithm {
|
||||
int a(CharSequence charSequence, int i, int i2);
|
||||
}
|
||||
|
||||
private static abstract class TextDirectionHeuristicImpl implements TextDirectionHeuristicCompat {
|
||||
private final TextDirectionAlgorithm a;
|
||||
|
||||
TextDirectionHeuristicImpl(TextDirectionAlgorithm textDirectionAlgorithm) {
|
||||
this.a = textDirectionAlgorithm;
|
||||
}
|
||||
|
||||
private boolean b(CharSequence charSequence, int i, int i2) {
|
||||
int a = this.a.a(charSequence, i, i2);
|
||||
if (a == 0) {
|
||||
return true;
|
||||
}
|
||||
if (a != 1) {
|
||||
return a();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected abstract boolean a();
|
||||
|
||||
@Override // androidx.core.text.TextDirectionHeuristicCompat
|
||||
public boolean a(CharSequence charSequence, int i, int i2) {
|
||||
if (charSequence == null || i < 0 || i2 < 0 || charSequence.length() - i2 < i) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
return this.a == null ? a() : b(charSequence, i, i2);
|
||||
}
|
||||
}
|
||||
|
||||
private static class TextDirectionHeuristicInternal extends TextDirectionHeuristicImpl {
|
||||
private final boolean b;
|
||||
|
||||
TextDirectionHeuristicInternal(TextDirectionAlgorithm textDirectionAlgorithm, boolean z) {
|
||||
super(textDirectionAlgorithm);
|
||||
this.b = z;
|
||||
}
|
||||
|
||||
@Override // androidx.core.text.TextDirectionHeuristicsCompat.TextDirectionHeuristicImpl
|
||||
protected boolean a() {
|
||||
return this.b;
|
||||
}
|
||||
}
|
||||
|
||||
private static class TextDirectionHeuristicLocale extends TextDirectionHeuristicImpl {
|
||||
static final TextDirectionHeuristicLocale b = new TextDirectionHeuristicLocale();
|
||||
|
||||
TextDirectionHeuristicLocale() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
@Override // androidx.core.text.TextDirectionHeuristicsCompat.TextDirectionHeuristicImpl
|
||||
protected boolean a() {
|
||||
return TextUtilsCompat.b(Locale.getDefault()) == 1;
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
new TextDirectionHeuristicInternal(null, false);
|
||||
new TextDirectionHeuristicInternal(null, true);
|
||||
a = new TextDirectionHeuristicInternal(FirstStrong.a, false);
|
||||
b = new TextDirectionHeuristicInternal(FirstStrong.a, true);
|
||||
new TextDirectionHeuristicInternal(AnyStrong.b, false);
|
||||
TextDirectionHeuristicLocale textDirectionHeuristicLocale = TextDirectionHeuristicLocale.b;
|
||||
}
|
||||
|
||||
static int a(int i) {
|
||||
if (i != 0) {
|
||||
return (i == 1 || i == 2) ? 0 : 2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int b(int i) {
|
||||
if (i != 0) {
|
||||
if (i == 1 || i == 2) {
|
||||
return 0;
|
||||
}
|
||||
switch (i) {
|
||||
case 14:
|
||||
case 15:
|
||||
break;
|
||||
case 16:
|
||||
case 17:
|
||||
return 0;
|
||||
default:
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
26
sources/androidx/core/text/TextUtilsCompat.java
Normal file
26
sources/androidx/core/text/TextUtilsCompat.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package androidx.core.text;
|
||||
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class TextUtilsCompat {
|
||||
private static final Locale a = new Locale("", "");
|
||||
|
||||
private static int a(Locale locale) {
|
||||
byte directionality = Character.getDirectionality(locale.getDisplayName(locale).charAt(0));
|
||||
return (directionality == 1 || directionality == 2) ? 1 : 0;
|
||||
}
|
||||
|
||||
public static int b(Locale locale) {
|
||||
if (Build.VERSION.SDK_INT >= 17) {
|
||||
return TextUtils.getLayoutDirectionFromLocale(locale);
|
||||
}
|
||||
if (locale == null || locale.equals(a)) {
|
||||
return 0;
|
||||
}
|
||||
String b = ICUCompat.b(locale);
|
||||
return b == null ? a(locale) : (b.equalsIgnoreCase("Arab") || b.equalsIgnoreCase("Hebr")) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
19
sources/androidx/core/util/DebugUtils.java
Normal file
19
sources/androidx/core/util/DebugUtils.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DebugUtils {
|
||||
public static void a(Object obj, StringBuilder sb) {
|
||||
int lastIndexOf;
|
||||
if (obj == null) {
|
||||
sb.append("null");
|
||||
return;
|
||||
}
|
||||
String simpleName = obj.getClass().getSimpleName();
|
||||
if ((simpleName == null || simpleName.length() <= 0) && (lastIndexOf = (simpleName = obj.getClass().getName()).lastIndexOf(46)) > 0) {
|
||||
simpleName = simpleName.substring(lastIndexOf + 1);
|
||||
}
|
||||
sb.append(simpleName);
|
||||
sb.append('{');
|
||||
sb.append(Integer.toHexString(System.identityHashCode(obj)));
|
||||
}
|
||||
}
|
||||
45
sources/androidx/core/util/LogWriter.java
Normal file
45
sources/androidx/core/util/LogWriter.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package androidx.core.util;
|
||||
|
||||
import android.util.Log;
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
import java.io.Writer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class LogWriter extends Writer {
|
||||
private final String a;
|
||||
private StringBuilder b = new StringBuilder(PeripheralType.SERVO);
|
||||
|
||||
public LogWriter(String str) {
|
||||
this.a = str;
|
||||
}
|
||||
|
||||
private void a() {
|
||||
if (this.b.length() > 0) {
|
||||
Log.d(this.a, this.b.toString());
|
||||
StringBuilder sb = this.b;
|
||||
sb.delete(0, sb.length());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.io.Writer, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
a();
|
||||
}
|
||||
|
||||
@Override // java.io.Writer, java.io.Flushable
|
||||
public void flush() {
|
||||
a();
|
||||
}
|
||||
|
||||
@Override // java.io.Writer
|
||||
public void write(char[] cArr, int i, int i2) {
|
||||
for (int i3 = 0; i3 < i2; i3++) {
|
||||
char c = cArr[i + i3];
|
||||
if (c == '\n') {
|
||||
a();
|
||||
} else {
|
||||
this.b.append(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
19
sources/androidx/core/util/ObjectsCompat.java
Normal file
19
sources/androidx/core/util/ObjectsCompat.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package androidx.core.util;
|
||||
|
||||
import android.os.Build;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ObjectsCompat {
|
||||
public static boolean a(Object obj, Object obj2) {
|
||||
return Build.VERSION.SDK_INT >= 19 ? Objects.equals(obj, obj2) : obj == obj2 || (obj != null && obj.equals(obj2));
|
||||
}
|
||||
|
||||
public static int a(Object... objArr) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
return Objects.hash(objArr);
|
||||
}
|
||||
return Arrays.hashCode(objArr);
|
||||
}
|
||||
}
|
||||
35
sources/androidx/core/util/Pair.java
Normal file
35
sources/androidx/core/util/Pair.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Pair<F, S> {
|
||||
public final F a;
|
||||
public final S b;
|
||||
|
||||
public Pair(F f, S s) {
|
||||
this.a = f;
|
||||
this.b = s;
|
||||
}
|
||||
|
||||
public static <A, B> Pair<A, B> a(A a, B b) {
|
||||
return new Pair<>(a, b);
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof Pair)) {
|
||||
return false;
|
||||
}
|
||||
Pair pair = (Pair) obj;
|
||||
return ObjectsCompat.a(pair.a, this.a) && ObjectsCompat.a(pair.b, this.b);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
F f = this.a;
|
||||
int hashCode = f == null ? 0 : f.hashCode();
|
||||
S s = this.b;
|
||||
return hashCode ^ (s != null ? s.hashCode() : 0);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Pair{" + String.valueOf(this.a) + " " + String.valueOf(this.b) + "}";
|
||||
}
|
||||
}
|
||||
8
sources/androidx/core/util/Pools$Pool.java
Normal file
8
sources/androidx/core/util/Pools$Pool.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Pools$Pool<T> {
|
||||
T a();
|
||||
|
||||
boolean a(T t);
|
||||
}
|
||||
52
sources/androidx/core/util/Pools$SimplePool.java
Normal file
52
sources/androidx/core/util/Pools$SimplePool.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Pools$SimplePool<T> implements Pools$Pool<T> {
|
||||
private final Object[] a;
|
||||
private int b;
|
||||
|
||||
public Pools$SimplePool(int i) {
|
||||
if (i <= 0) {
|
||||
throw new IllegalArgumentException("The max pool size must be > 0");
|
||||
}
|
||||
this.a = new Object[i];
|
||||
}
|
||||
|
||||
private boolean b(T t) {
|
||||
for (int i = 0; i < this.b; i++) {
|
||||
if (this.a[i] == t) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.core.util.Pools$Pool
|
||||
public T a() {
|
||||
int i = this.b;
|
||||
if (i <= 0) {
|
||||
return null;
|
||||
}
|
||||
int i2 = i - 1;
|
||||
Object[] objArr = this.a;
|
||||
T t = (T) objArr[i2];
|
||||
objArr[i2] = null;
|
||||
this.b = i - 1;
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // androidx.core.util.Pools$Pool
|
||||
public boolean a(T t) {
|
||||
if (!b(t)) {
|
||||
int i = this.b;
|
||||
Object[] objArr = this.a;
|
||||
if (i >= objArr.length) {
|
||||
return false;
|
||||
}
|
||||
objArr[i] = t;
|
||||
this.b = i + 1;
|
||||
return true;
|
||||
}
|
||||
throw new IllegalStateException("Already in the pool!");
|
||||
}
|
||||
}
|
||||
29
sources/androidx/core/util/Pools$SynchronizedPool.java
Normal file
29
sources/androidx/core/util/Pools$SynchronizedPool.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Pools$SynchronizedPool<T> extends Pools$SimplePool<T> {
|
||||
private final Object c;
|
||||
|
||||
public Pools$SynchronizedPool(int i) {
|
||||
super(i);
|
||||
this.c = new Object();
|
||||
}
|
||||
|
||||
@Override // androidx.core.util.Pools$SimplePool, androidx.core.util.Pools$Pool
|
||||
public T a() {
|
||||
T t;
|
||||
synchronized (this.c) {
|
||||
t = (T) super.a();
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // androidx.core.util.Pools$SimplePool, androidx.core.util.Pools$Pool
|
||||
public boolean a(T t) {
|
||||
boolean a;
|
||||
synchronized (this.c) {
|
||||
a = super.a(t);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
25
sources/androidx/core/util/Preconditions.java
Normal file
25
sources/androidx/core/util/Preconditions.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Preconditions {
|
||||
public static <T> T a(T t) {
|
||||
if (t != null) {
|
||||
return t;
|
||||
}
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
public static <T> T a(T t, Object obj) {
|
||||
if (t != null) {
|
||||
return t;
|
||||
}
|
||||
throw new NullPointerException(String.valueOf(obj));
|
||||
}
|
||||
|
||||
public static int a(int i) {
|
||||
if (i >= 0) {
|
||||
return i;
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
121
sources/androidx/core/view/AccessibilityDelegateCompat.java
Normal file
121
sources/androidx/core/view/AccessibilityDelegateCompat.java
Normal file
@@ -0,0 +1,121 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import android.view.accessibility.AccessibilityNodeProvider;
|
||||
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
|
||||
import androidx.core.view.accessibility.AccessibilityNodeProviderCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AccessibilityDelegateCompat {
|
||||
private static final View.AccessibilityDelegate b = new View.AccessibilityDelegate();
|
||||
private final View.AccessibilityDelegate a = new AccessibilityDelegateAdapter(this);
|
||||
|
||||
private static final class AccessibilityDelegateAdapter extends View.AccessibilityDelegate {
|
||||
private final AccessibilityDelegateCompat a;
|
||||
|
||||
AccessibilityDelegateAdapter(AccessibilityDelegateCompat accessibilityDelegateCompat) {
|
||||
this.a = accessibilityDelegateCompat;
|
||||
}
|
||||
|
||||
@Override // android.view.View.AccessibilityDelegate
|
||||
public boolean dispatchPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
|
||||
return this.a.a(view, accessibilityEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.View.AccessibilityDelegate
|
||||
public AccessibilityNodeProvider getAccessibilityNodeProvider(View view) {
|
||||
AccessibilityNodeProviderCompat a = this.a.a(view);
|
||||
if (a != null) {
|
||||
return (AccessibilityNodeProvider) a.a();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.view.View.AccessibilityDelegate
|
||||
public void onInitializeAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
|
||||
this.a.b(view, accessibilityEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.View.AccessibilityDelegate
|
||||
public void onInitializeAccessibilityNodeInfo(View view, AccessibilityNodeInfo accessibilityNodeInfo) {
|
||||
this.a.a(view, AccessibilityNodeInfoCompat.a(accessibilityNodeInfo));
|
||||
}
|
||||
|
||||
@Override // android.view.View.AccessibilityDelegate
|
||||
public void onPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
|
||||
this.a.c(view, accessibilityEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.View.AccessibilityDelegate
|
||||
public boolean onRequestSendAccessibilityEvent(ViewGroup viewGroup, View view, AccessibilityEvent accessibilityEvent) {
|
||||
return this.a.a(viewGroup, view, accessibilityEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.View.AccessibilityDelegate
|
||||
public boolean performAccessibilityAction(View view, int i, Bundle bundle) {
|
||||
return this.a.a(view, i, bundle);
|
||||
}
|
||||
|
||||
@Override // android.view.View.AccessibilityDelegate
|
||||
public void sendAccessibilityEvent(View view, int i) {
|
||||
this.a.a(view, i);
|
||||
}
|
||||
|
||||
@Override // android.view.View.AccessibilityDelegate
|
||||
public void sendAccessibilityEventUnchecked(View view, AccessibilityEvent accessibilityEvent) {
|
||||
this.a.d(view, accessibilityEvent);
|
||||
}
|
||||
}
|
||||
|
||||
View.AccessibilityDelegate a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void b(View view, AccessibilityEvent accessibilityEvent) {
|
||||
b.onInitializeAccessibilityEvent(view, accessibilityEvent);
|
||||
}
|
||||
|
||||
public void c(View view, AccessibilityEvent accessibilityEvent) {
|
||||
b.onPopulateAccessibilityEvent(view, accessibilityEvent);
|
||||
}
|
||||
|
||||
public void d(View view, AccessibilityEvent accessibilityEvent) {
|
||||
b.sendAccessibilityEventUnchecked(view, accessibilityEvent);
|
||||
}
|
||||
|
||||
public void a(View view, int i) {
|
||||
b.sendAccessibilityEvent(view, i);
|
||||
}
|
||||
|
||||
public boolean a(View view, AccessibilityEvent accessibilityEvent) {
|
||||
return b.dispatchPopulateAccessibilityEvent(view, accessibilityEvent);
|
||||
}
|
||||
|
||||
public void a(View view, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat) {
|
||||
b.onInitializeAccessibilityNodeInfo(view, accessibilityNodeInfoCompat.r());
|
||||
}
|
||||
|
||||
public boolean a(ViewGroup viewGroup, View view, AccessibilityEvent accessibilityEvent) {
|
||||
return b.onRequestSendAccessibilityEvent(viewGroup, view, accessibilityEvent);
|
||||
}
|
||||
|
||||
public AccessibilityNodeProviderCompat a(View view) {
|
||||
AccessibilityNodeProvider accessibilityNodeProvider;
|
||||
if (Build.VERSION.SDK_INT < 16 || (accessibilityNodeProvider = b.getAccessibilityNodeProvider(view)) == null) {
|
||||
return null;
|
||||
}
|
||||
return new AccessibilityNodeProviderCompat(accessibilityNodeProvider);
|
||||
}
|
||||
|
||||
public boolean a(View view, int i, Bundle bundle) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return b.performAccessibilityAction(view, i, bundle);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
61
sources/androidx/core/view/ActionProvider.java
Normal file
61
sources/androidx/core/view/ActionProvider.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ActionProvider {
|
||||
private VisibilityListener a;
|
||||
|
||||
public interface SubUiVisibilityListener {
|
||||
}
|
||||
|
||||
public interface VisibilityListener {
|
||||
void onActionProviderVisibilityChanged(boolean z);
|
||||
}
|
||||
|
||||
public ActionProvider(Context context) {
|
||||
}
|
||||
|
||||
public View a(MenuItem menuItem) {
|
||||
return c();
|
||||
}
|
||||
|
||||
public void a(SubMenu subMenu) {
|
||||
}
|
||||
|
||||
public void a(SubUiVisibilityListener subUiVisibilityListener) {
|
||||
}
|
||||
|
||||
public boolean a() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean b() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract View c();
|
||||
|
||||
public boolean d() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean e() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void f() {
|
||||
this.a = null;
|
||||
}
|
||||
|
||||
public void a(VisibilityListener visibilityListener) {
|
||||
if (this.a != null && visibilityListener != null) {
|
||||
Log.w("ActionProvider(support)", "setVisibilityListener: Setting a new ActionProvider.VisibilityListener when one is already set. Are you reusing this " + getClass().getSimpleName() + " instance while it is still in use somewhere else?");
|
||||
}
|
||||
this.a = visibilityListener;
|
||||
}
|
||||
}
|
||||
204
sources/androidx/core/view/GestureDetectorCompat.java
Normal file
204
sources/androidx/core/view/GestureDetectorCompat.java
Normal file
@@ -0,0 +1,204 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.VelocityTracker;
|
||||
import android.view.ViewConfiguration;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class GestureDetectorCompat {
|
||||
private final GestureDetectorCompatImpl a;
|
||||
|
||||
interface GestureDetectorCompatImpl {
|
||||
boolean a(MotionEvent motionEvent);
|
||||
}
|
||||
|
||||
static class GestureDetectorCompatImplBase implements GestureDetectorCompatImpl {
|
||||
private static final int v = ViewConfiguration.getLongPressTimeout();
|
||||
private static final int w = ViewConfiguration.getTapTimeout();
|
||||
private static final int x = ViewConfiguration.getDoubleTapTimeout();
|
||||
private int a;
|
||||
private int b;
|
||||
private int c;
|
||||
private int d;
|
||||
private final Handler e;
|
||||
final GestureDetector.OnGestureListener f;
|
||||
GestureDetector.OnDoubleTapListener g;
|
||||
boolean h;
|
||||
boolean i;
|
||||
private boolean j;
|
||||
private boolean k;
|
||||
private boolean l;
|
||||
MotionEvent m;
|
||||
private MotionEvent n;
|
||||
private boolean o;
|
||||
private float p;
|
||||
private float q;
|
||||
private float r;
|
||||
private float s;
|
||||
private boolean t;
|
||||
private VelocityTracker u;
|
||||
|
||||
GestureDetectorCompatImplBase(Context context, GestureDetector.OnGestureListener onGestureListener, Handler handler) {
|
||||
if (handler != null) {
|
||||
this.e = new GestureHandler(handler);
|
||||
} else {
|
||||
this.e = new GestureHandler();
|
||||
}
|
||||
this.f = onGestureListener;
|
||||
if (onGestureListener instanceof GestureDetector.OnDoubleTapListener) {
|
||||
a((GestureDetector.OnDoubleTapListener) onGestureListener);
|
||||
}
|
||||
a(context);
|
||||
}
|
||||
|
||||
private void a(Context context) {
|
||||
if (context == null) {
|
||||
throw new IllegalArgumentException("Context must not be null");
|
||||
}
|
||||
if (this.f == null) {
|
||||
throw new IllegalArgumentException("OnGestureListener must not be null");
|
||||
}
|
||||
this.t = true;
|
||||
ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
|
||||
int scaledTouchSlop = viewConfiguration.getScaledTouchSlop();
|
||||
int scaledDoubleTapSlop = viewConfiguration.getScaledDoubleTapSlop();
|
||||
this.c = viewConfiguration.getScaledMinimumFlingVelocity();
|
||||
this.d = viewConfiguration.getScaledMaximumFlingVelocity();
|
||||
this.a = scaledTouchSlop * scaledTouchSlop;
|
||||
this.b = scaledDoubleTapSlop * scaledDoubleTapSlop;
|
||||
}
|
||||
|
||||
private void b() {
|
||||
this.e.removeMessages(1);
|
||||
this.e.removeMessages(2);
|
||||
this.e.removeMessages(3);
|
||||
this.u.recycle();
|
||||
this.u = null;
|
||||
this.o = false;
|
||||
this.h = false;
|
||||
this.k = false;
|
||||
this.l = false;
|
||||
this.i = false;
|
||||
if (this.j) {
|
||||
this.j = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void c() {
|
||||
this.e.removeMessages(1);
|
||||
this.e.removeMessages(2);
|
||||
this.e.removeMessages(3);
|
||||
this.o = false;
|
||||
this.k = false;
|
||||
this.l = false;
|
||||
this.i = false;
|
||||
if (this.j) {
|
||||
this.j = false;
|
||||
}
|
||||
}
|
||||
|
||||
private class GestureHandler extends Handler {
|
||||
GestureHandler() {
|
||||
}
|
||||
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message message) {
|
||||
int i = message.what;
|
||||
if (i == 1) {
|
||||
GestureDetectorCompatImplBase gestureDetectorCompatImplBase = GestureDetectorCompatImplBase.this;
|
||||
gestureDetectorCompatImplBase.f.onShowPress(gestureDetectorCompatImplBase.m);
|
||||
return;
|
||||
}
|
||||
if (i == 2) {
|
||||
GestureDetectorCompatImplBase.this.a();
|
||||
return;
|
||||
}
|
||||
if (i != 3) {
|
||||
throw new RuntimeException("Unknown message " + message);
|
||||
}
|
||||
GestureDetectorCompatImplBase gestureDetectorCompatImplBase2 = GestureDetectorCompatImplBase.this;
|
||||
GestureDetector.OnDoubleTapListener onDoubleTapListener = gestureDetectorCompatImplBase2.g;
|
||||
if (onDoubleTapListener != null) {
|
||||
if (gestureDetectorCompatImplBase2.h) {
|
||||
gestureDetectorCompatImplBase2.i = true;
|
||||
} else {
|
||||
onDoubleTapListener.onSingleTapConfirmed(gestureDetectorCompatImplBase2.m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GestureHandler(Handler handler) {
|
||||
super(handler.getLooper());
|
||||
}
|
||||
}
|
||||
|
||||
public void a(GestureDetector.OnDoubleTapListener onDoubleTapListener) {
|
||||
this.g = onDoubleTapListener;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:114:0x0208 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:117:0x021f */
|
||||
@Override // androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImpl
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public boolean a(android.view.MotionEvent r13) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 591
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImplBase.a(android.view.MotionEvent):boolean");
|
||||
}
|
||||
|
||||
private boolean a(MotionEvent motionEvent, MotionEvent motionEvent2, MotionEvent motionEvent3) {
|
||||
if (!this.l || motionEvent3.getEventTime() - motionEvent2.getEventTime() > x) {
|
||||
return false;
|
||||
}
|
||||
int x2 = ((int) motionEvent.getX()) - ((int) motionEvent3.getX());
|
||||
int y = ((int) motionEvent.getY()) - ((int) motionEvent3.getY());
|
||||
return (x2 * x2) + (y * y) < this.b;
|
||||
}
|
||||
|
||||
void a() {
|
||||
this.e.removeMessages(3);
|
||||
this.i = false;
|
||||
this.j = true;
|
||||
this.f.onLongPress(this.m);
|
||||
}
|
||||
}
|
||||
|
||||
static class GestureDetectorCompatImplJellybeanMr2 implements GestureDetectorCompatImpl {
|
||||
private final GestureDetector a;
|
||||
|
||||
GestureDetectorCompatImplJellybeanMr2(Context context, GestureDetector.OnGestureListener onGestureListener, Handler handler) {
|
||||
this.a = new GestureDetector(context, onGestureListener, handler);
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImpl
|
||||
public boolean a(MotionEvent motionEvent) {
|
||||
return this.a.onTouchEvent(motionEvent);
|
||||
}
|
||||
}
|
||||
|
||||
public GestureDetectorCompat(Context context, GestureDetector.OnGestureListener onGestureListener) {
|
||||
this(context, onGestureListener, null);
|
||||
}
|
||||
|
||||
public boolean a(MotionEvent motionEvent) {
|
||||
return this.a.a(motionEvent);
|
||||
}
|
||||
|
||||
public GestureDetectorCompat(Context context, GestureDetector.OnGestureListener onGestureListener, Handler handler) {
|
||||
if (Build.VERSION.SDK_INT > 17) {
|
||||
this.a = new GestureDetectorCompatImplJellybeanMr2(context, onGestureListener, handler);
|
||||
} else {
|
||||
this.a = new GestureDetectorCompatImplBase(context, onGestureListener, handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
20
sources/androidx/core/view/GravityCompat.java
Normal file
20
sources/androidx/core/view/GravityCompat.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.view.Gravity;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class GravityCompat {
|
||||
public static void a(int i, int i2, int i3, Rect rect, Rect rect2, int i4) {
|
||||
if (Build.VERSION.SDK_INT >= 17) {
|
||||
Gravity.apply(i, i2, i3, rect, rect2, i4);
|
||||
} else {
|
||||
Gravity.apply(i, i2, i3, rect, rect2);
|
||||
}
|
||||
}
|
||||
|
||||
public static int a(int i, int i2) {
|
||||
return Build.VERSION.SDK_INT >= 17 ? Gravity.getAbsoluteGravity(i, i2) : i & (-8388609);
|
||||
}
|
||||
}
|
||||
109
sources/androidx/core/view/KeyEventDispatcher.java
Normal file
109
sources/androidx/core/view/KeyEventDispatcher.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Build;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class KeyEventDispatcher {
|
||||
private static boolean a = false;
|
||||
private static Method b = null;
|
||||
private static boolean c = false;
|
||||
private static Field d;
|
||||
|
||||
public interface Component {
|
||||
boolean superDispatchKeyEvent(KeyEvent keyEvent);
|
||||
}
|
||||
|
||||
public static boolean a(View view, KeyEvent keyEvent) {
|
||||
return ViewCompat.b(view, keyEvent);
|
||||
}
|
||||
|
||||
public static boolean a(Component component, View view, Window.Callback callback, KeyEvent keyEvent) {
|
||||
if (component == null) {
|
||||
return false;
|
||||
}
|
||||
return Build.VERSION.SDK_INT >= 28 ? component.superDispatchKeyEvent(keyEvent) : callback instanceof Activity ? a((Activity) callback, keyEvent) : callback instanceof Dialog ? a((Dialog) callback, keyEvent) : (view != null && ViewCompat.a(view, keyEvent)) || component.superDispatchKeyEvent(keyEvent);
|
||||
}
|
||||
|
||||
private static boolean a(ActionBar actionBar, KeyEvent keyEvent) {
|
||||
if (!a) {
|
||||
try {
|
||||
b = actionBar.getClass().getMethod("onMenuKeyEvent", KeyEvent.class);
|
||||
} catch (NoSuchMethodException unused) {
|
||||
}
|
||||
a = true;
|
||||
}
|
||||
Method method = b;
|
||||
if (method != null) {
|
||||
try {
|
||||
return ((Boolean) method.invoke(actionBar, keyEvent)).booleanValue();
|
||||
} catch (IllegalAccessException | InvocationTargetException unused2) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean a(Activity activity, KeyEvent keyEvent) {
|
||||
activity.onUserInteraction();
|
||||
Window window = activity.getWindow();
|
||||
if (window.hasFeature(8)) {
|
||||
ActionBar actionBar = activity.getActionBar();
|
||||
if (keyEvent.getKeyCode() == 82 && actionBar != null && a(actionBar, keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (window.superDispatchKeyEvent(keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
View decorView = window.getDecorView();
|
||||
if (ViewCompat.a(decorView, keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
return keyEvent.dispatch(activity, decorView != null ? decorView.getKeyDispatcherState() : null, activity);
|
||||
}
|
||||
|
||||
private static DialogInterface.OnKeyListener a(Dialog dialog) {
|
||||
if (!c) {
|
||||
try {
|
||||
d = Dialog.class.getDeclaredField("mOnKeyListener");
|
||||
d.setAccessible(true);
|
||||
} catch (NoSuchFieldException unused) {
|
||||
}
|
||||
c = true;
|
||||
}
|
||||
Field field = d;
|
||||
if (field == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return (DialogInterface.OnKeyListener) field.get(dialog);
|
||||
} catch (IllegalAccessException unused2) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean a(Dialog dialog, KeyEvent keyEvent) {
|
||||
DialogInterface.OnKeyListener a2 = a(dialog);
|
||||
if (a2 != null && a2.onKey(dialog, keyEvent.getKeyCode(), keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
Window window = dialog.getWindow();
|
||||
if (window.superDispatchKeyEvent(keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
View decorView = window.getDecorView();
|
||||
if (ViewCompat.a(decorView, keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
return keyEvent.dispatch(dialog, decorView != null ? decorView.getKeyDispatcherState() : null, dialog);
|
||||
}
|
||||
}
|
||||
44
sources/androidx/core/view/LayoutInflaterCompat.java
Normal file
44
sources/androidx/core/view/LayoutInflaterCompat.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class LayoutInflaterCompat {
|
||||
private static Field a;
|
||||
private static boolean b;
|
||||
|
||||
private static void a(LayoutInflater layoutInflater, LayoutInflater.Factory2 factory2) {
|
||||
if (!b) {
|
||||
try {
|
||||
a = LayoutInflater.class.getDeclaredField("mFactory2");
|
||||
a.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
Log.e("LayoutInflaterCompatHC", "forceSetFactory2 Could not find field 'mFactory2' on class " + LayoutInflater.class.getName() + "; inflation may have unexpected results.", e);
|
||||
}
|
||||
b = true;
|
||||
}
|
||||
Field field = a;
|
||||
if (field != null) {
|
||||
try {
|
||||
field.set(layoutInflater, factory2);
|
||||
} catch (IllegalAccessException e2) {
|
||||
Log.e("LayoutInflaterCompatHC", "forceSetFactory2 could not set the Factory2 on LayoutInflater " + layoutInflater + "; inflation may have unexpected results.", e2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(LayoutInflater layoutInflater, LayoutInflater.Factory2 factory2) {
|
||||
layoutInflater.setFactory2(factory2);
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
LayoutInflater.Factory factory = layoutInflater.getFactory();
|
||||
if (factory instanceof LayoutInflater.Factory2) {
|
||||
a(layoutInflater, (LayoutInflater.Factory2) factory);
|
||||
} else {
|
||||
a(layoutInflater, factory2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
sources/androidx/core/view/MarginLayoutParamsCompat.java
Normal file
23
sources/androidx/core/view/MarginLayoutParamsCompat.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.os.Build;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MarginLayoutParamsCompat {
|
||||
public static int a(ViewGroup.MarginLayoutParams marginLayoutParams) {
|
||||
return Build.VERSION.SDK_INT >= 17 ? marginLayoutParams.getMarginEnd() : marginLayoutParams.rightMargin;
|
||||
}
|
||||
|
||||
public static int b(ViewGroup.MarginLayoutParams marginLayoutParams) {
|
||||
return Build.VERSION.SDK_INT >= 17 ? marginLayoutParams.getMarginStart() : marginLayoutParams.leftMargin;
|
||||
}
|
||||
|
||||
public static void a(ViewGroup.MarginLayoutParams marginLayoutParams, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 17) {
|
||||
marginLayoutParams.setMarginEnd(i);
|
||||
} else {
|
||||
marginLayoutParams.rightMargin = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
67
sources/androidx/core/view/MenuItemCompat.java
Normal file
67
sources/androidx/core/view/MenuItemCompat.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import androidx.core.internal.view.SupportMenuItem;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MenuItemCompat {
|
||||
public static MenuItem a(MenuItem menuItem, ActionProvider actionProvider) {
|
||||
if (menuItem instanceof SupportMenuItem) {
|
||||
return ((SupportMenuItem) menuItem).a(actionProvider);
|
||||
}
|
||||
Log.w("MenuItemCompat", "setActionProvider: item does not implement SupportMenuItem; ignoring");
|
||||
return menuItem;
|
||||
}
|
||||
|
||||
public static void b(MenuItem menuItem, CharSequence charSequence) {
|
||||
if (menuItem instanceof SupportMenuItem) {
|
||||
((SupportMenuItem) menuItem).setTooltipText(charSequence);
|
||||
} else if (Build.VERSION.SDK_INT >= 26) {
|
||||
menuItem.setTooltipText(charSequence);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(MenuItem menuItem, CharSequence charSequence) {
|
||||
if (menuItem instanceof SupportMenuItem) {
|
||||
((SupportMenuItem) menuItem).setContentDescription(charSequence);
|
||||
} else if (Build.VERSION.SDK_INT >= 26) {
|
||||
menuItem.setContentDescription(charSequence);
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(MenuItem menuItem, char c, int i) {
|
||||
if (menuItem instanceof SupportMenuItem) {
|
||||
((SupportMenuItem) menuItem).setNumericShortcut(c, i);
|
||||
} else if (Build.VERSION.SDK_INT >= 26) {
|
||||
menuItem.setNumericShortcut(c, i);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(MenuItem menuItem, char c, int i) {
|
||||
if (menuItem instanceof SupportMenuItem) {
|
||||
((SupportMenuItem) menuItem).setAlphabeticShortcut(c, i);
|
||||
} else if (Build.VERSION.SDK_INT >= 26) {
|
||||
menuItem.setAlphabeticShortcut(c, i);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(MenuItem menuItem, ColorStateList colorStateList) {
|
||||
if (menuItem instanceof SupportMenuItem) {
|
||||
((SupportMenuItem) menuItem).setIconTintList(colorStateList);
|
||||
} else if (Build.VERSION.SDK_INT >= 26) {
|
||||
menuItem.setIconTintList(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(MenuItem menuItem, PorterDuff.Mode mode) {
|
||||
if (menuItem instanceof SupportMenuItem) {
|
||||
((SupportMenuItem) menuItem).setIconTintMode(mode);
|
||||
} else if (Build.VERSION.SDK_INT >= 26) {
|
||||
menuItem.setIconTintMode(mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
20
sources/androidx/core/view/MotionEventCompat.java
Normal file
20
sources/androidx/core/view/MotionEventCompat.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.view.MotionEvent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MotionEventCompat {
|
||||
@Deprecated
|
||||
public static int a(MotionEvent motionEvent) {
|
||||
return motionEvent.getActionMasked();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int b(MotionEvent motionEvent) {
|
||||
return motionEvent.getPointerCount();
|
||||
}
|
||||
|
||||
public static boolean a(MotionEvent motionEvent, int i) {
|
||||
return (motionEvent.getSource() & i) == i;
|
||||
}
|
||||
}
|
||||
8
sources/androidx/core/view/NestedScrollingChild.java
Normal file
8
sources/androidx/core/view/NestedScrollingChild.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package androidx.core.view;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface NestedScrollingChild {
|
||||
boolean isNestedScrollingEnabled();
|
||||
|
||||
void stopNestedScroll();
|
||||
}
|
||||
6
sources/androidx/core/view/NestedScrollingChild2.java
Normal file
6
sources/androidx/core/view/NestedScrollingChild2.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package androidx.core.view;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface NestedScrollingChild2 extends NestedScrollingChild {
|
||||
void a(int i);
|
||||
}
|
||||
188
sources/androidx/core/view/NestedScrollingChildHelper.java
Normal file
188
sources/androidx/core/view/NestedScrollingChildHelper.java
Normal file
@@ -0,0 +1,188 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewParent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class NestedScrollingChildHelper {
|
||||
private ViewParent a;
|
||||
private ViewParent b;
|
||||
private final View c;
|
||||
private boolean d;
|
||||
private int[] e;
|
||||
|
||||
public NestedScrollingChildHelper(View view) {
|
||||
this.c = view;
|
||||
}
|
||||
|
||||
private ViewParent d(int i) {
|
||||
if (i == 0) {
|
||||
return this.a;
|
||||
}
|
||||
if (i != 1) {
|
||||
return null;
|
||||
}
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
if (this.d) {
|
||||
ViewCompat.C(this.c);
|
||||
}
|
||||
this.d = z;
|
||||
}
|
||||
|
||||
public boolean b() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public void c() {
|
||||
c(0);
|
||||
}
|
||||
|
||||
public boolean b(int i) {
|
||||
return a(i, 0);
|
||||
}
|
||||
|
||||
public void c(int i) {
|
||||
ViewParent d = d(i);
|
||||
if (d != null) {
|
||||
ViewParentCompat.a(d, this.c, i);
|
||||
a(i, (ViewParent) null);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean a() {
|
||||
return a(0);
|
||||
}
|
||||
|
||||
public boolean a(int i) {
|
||||
return d(i) != null;
|
||||
}
|
||||
|
||||
public boolean a(int i, int i2) {
|
||||
if (a(i2)) {
|
||||
return true;
|
||||
}
|
||||
if (!b()) {
|
||||
return false;
|
||||
}
|
||||
View view = this.c;
|
||||
for (ViewParent parent = this.c.getParent(); parent != null; parent = parent.getParent()) {
|
||||
if (ViewParentCompat.b(parent, view, this.c, i, i2)) {
|
||||
a(i2, parent);
|
||||
ViewParentCompat.a(parent, view, this.c, i, i2);
|
||||
return true;
|
||||
}
|
||||
if (parent instanceof View) {
|
||||
view = (View) parent;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean a(int i, int i2, int i3, int i4, int[] iArr) {
|
||||
return a(i, i2, i3, i4, iArr, 0);
|
||||
}
|
||||
|
||||
public boolean a(int i, int i2, int i3, int i4, int[] iArr, int i5) {
|
||||
ViewParent d;
|
||||
int i6;
|
||||
int i7;
|
||||
if (!b() || (d = d(i5)) == null) {
|
||||
return false;
|
||||
}
|
||||
if (i == 0 && i2 == 0 && i3 == 0 && i4 == 0) {
|
||||
if (iArr != null) {
|
||||
iArr[0] = 0;
|
||||
iArr[1] = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (iArr != null) {
|
||||
this.c.getLocationInWindow(iArr);
|
||||
i6 = iArr[0];
|
||||
i7 = iArr[1];
|
||||
} else {
|
||||
i6 = 0;
|
||||
i7 = 0;
|
||||
}
|
||||
ViewParentCompat.a(d, this.c, i, i2, i3, i4, i5);
|
||||
if (iArr != null) {
|
||||
this.c.getLocationInWindow(iArr);
|
||||
iArr[0] = iArr[0] - i6;
|
||||
iArr[1] = iArr[1] - i7;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean a(int i, int i2, int[] iArr, int[] iArr2) {
|
||||
return a(i, i2, iArr, iArr2, 0);
|
||||
}
|
||||
|
||||
public boolean a(int i, int i2, int[] iArr, int[] iArr2, int i3) {
|
||||
ViewParent d;
|
||||
int i4;
|
||||
int i5;
|
||||
if (!b() || (d = d(i3)) == null) {
|
||||
return false;
|
||||
}
|
||||
if (i == 0 && i2 == 0) {
|
||||
if (iArr2 != null) {
|
||||
iArr2[0] = 0;
|
||||
iArr2[1] = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (iArr2 != null) {
|
||||
this.c.getLocationInWindow(iArr2);
|
||||
i4 = iArr2[0];
|
||||
i5 = iArr2[1];
|
||||
} else {
|
||||
i4 = 0;
|
||||
i5 = 0;
|
||||
}
|
||||
if (iArr == null) {
|
||||
if (this.e == null) {
|
||||
this.e = new int[2];
|
||||
}
|
||||
iArr = this.e;
|
||||
}
|
||||
iArr[0] = 0;
|
||||
iArr[1] = 0;
|
||||
ViewParentCompat.a(d, this.c, i, i2, iArr, i3);
|
||||
if (iArr2 != null) {
|
||||
this.c.getLocationInWindow(iArr2);
|
||||
iArr2[0] = iArr2[0] - i4;
|
||||
iArr2[1] = iArr2[1] - i5;
|
||||
}
|
||||
return (iArr[0] == 0 && iArr[1] == 0) ? false : true;
|
||||
}
|
||||
|
||||
public boolean a(float f, float f2, boolean z) {
|
||||
ViewParent d;
|
||||
if (!b() || (d = d(0)) == null) {
|
||||
return false;
|
||||
}
|
||||
return ViewParentCompat.a(d, this.c, f, f2, z);
|
||||
}
|
||||
|
||||
public boolean a(float f, float f2) {
|
||||
ViewParent d;
|
||||
if (!b() || (d = d(0)) == null) {
|
||||
return false;
|
||||
}
|
||||
return ViewParentCompat.a(d, this.c, f, f2);
|
||||
}
|
||||
|
||||
private void a(int i, ViewParent viewParent) {
|
||||
if (i == 0) {
|
||||
this.a = viewParent;
|
||||
} else {
|
||||
if (i != 1) {
|
||||
return;
|
||||
}
|
||||
this.b = viewParent;
|
||||
}
|
||||
}
|
||||
}
|
||||
20
sources/androidx/core/view/NestedScrollingParent.java
Normal file
20
sources/androidx/core/view/NestedScrollingParent.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface NestedScrollingParent {
|
||||
boolean onNestedFling(View view, float f, float f2, boolean z);
|
||||
|
||||
boolean onNestedPreFling(View view, float f, float f2);
|
||||
|
||||
void onNestedPreScroll(View view, int i, int i2, int[] iArr);
|
||||
|
||||
void onNestedScroll(View view, int i, int i2, int i3, int i4);
|
||||
|
||||
void onNestedScrollAccepted(View view, View view2, int i);
|
||||
|
||||
boolean onStartNestedScroll(View view, View view2, int i);
|
||||
|
||||
void onStopNestedScroll(View view);
|
||||
}
|
||||
16
sources/androidx/core/view/NestedScrollingParent2.java
Normal file
16
sources/androidx/core/view/NestedScrollingParent2.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface NestedScrollingParent2 extends NestedScrollingParent {
|
||||
void a(View view, int i);
|
||||
|
||||
void a(View view, int i, int i2, int i3, int i4, int i5);
|
||||
|
||||
void a(View view, int i, int i2, int[] iArr, int i3);
|
||||
|
||||
boolean a(View view, View view2, int i, int i2);
|
||||
|
||||
void b(View view, View view2, int i, int i2);
|
||||
}
|
||||
28
sources/androidx/core/view/NestedScrollingParentHelper.java
Normal file
28
sources/androidx/core/view/NestedScrollingParentHelper.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class NestedScrollingParentHelper {
|
||||
private int a;
|
||||
|
||||
public NestedScrollingParentHelper(ViewGroup viewGroup) {
|
||||
}
|
||||
|
||||
public void a(View view, View view2, int i) {
|
||||
a(view, view2, i, 0);
|
||||
}
|
||||
|
||||
public void a(View view, View view2, int i, int i2) {
|
||||
this.a = i;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void a(View view, int i) {
|
||||
this.a = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface OnApplyWindowInsetsListener {
|
||||
WindowInsetsCompat a(View view, WindowInsetsCompat windowInsetsCompat);
|
||||
}
|
||||
22
sources/androidx/core/view/PointerIconCompat.java
Normal file
22
sources/androidx/core/view/PointerIconCompat.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.view.PointerIcon;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class PointerIconCompat {
|
||||
private Object a;
|
||||
|
||||
private PointerIconCompat(Object obj) {
|
||||
this.a = obj;
|
||||
}
|
||||
|
||||
public Object a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public static PointerIconCompat a(Context context, int i) {
|
||||
return Build.VERSION.SDK_INT >= 24 ? new PointerIconCompat(PointerIcon.getSystemIcon(context, i)) : new PointerIconCompat(null);
|
||||
}
|
||||
}
|
||||
5
sources/androidx/core/view/ScrollingView.java
Normal file
5
sources/androidx/core/view/ScrollingView.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package androidx.core.view;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ScrollingView {
|
||||
}
|
||||
15
sources/androidx/core/view/TintableBackgroundView.java
Normal file
15
sources/androidx/core/view/TintableBackgroundView.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface TintableBackgroundView {
|
||||
ColorStateList getSupportBackgroundTintList();
|
||||
|
||||
PorterDuff.Mode getSupportBackgroundTintMode();
|
||||
|
||||
void setSupportBackgroundTintList(ColorStateList colorStateList);
|
||||
|
||||
void setSupportBackgroundTintMode(PorterDuff.Mode mode);
|
||||
}
|
||||
795
sources/androidx/core/view/ViewCompat.java
Normal file
795
sources/androidx/core/view/ViewCompat.java
Normal file
@@ -0,0 +1,795 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.SparseArray;
|
||||
import android.view.Display;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.PointerIcon;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewParent;
|
||||
import android.view.WindowInsets;
|
||||
import android.view.WindowManager;
|
||||
import androidx.core.R$id;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ViewCompat {
|
||||
private static Field a;
|
||||
private static boolean b;
|
||||
private static Field c;
|
||||
private static boolean d;
|
||||
private static WeakHashMap<View, String> e;
|
||||
private static WeakHashMap<View, ViewPropertyAnimatorCompat> f;
|
||||
private static Field g;
|
||||
private static boolean h;
|
||||
private static ThreadLocal<Rect> i;
|
||||
|
||||
public interface OnUnhandledKeyEventListenerCompat {
|
||||
boolean a(View view, KeyEvent keyEvent);
|
||||
}
|
||||
|
||||
static {
|
||||
new AtomicInteger(1);
|
||||
f = null;
|
||||
h = false;
|
||||
}
|
||||
|
||||
public static void A(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
view.postInvalidateOnAnimation();
|
||||
} else {
|
||||
view.postInvalidate();
|
||||
}
|
||||
}
|
||||
|
||||
public static void B(View view) {
|
||||
int i2 = Build.VERSION.SDK_INT;
|
||||
if (i2 >= 20) {
|
||||
view.requestApplyInsets();
|
||||
} else if (i2 >= 16) {
|
||||
view.requestFitSystemWindows();
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static void C(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
view.stopNestedScroll();
|
||||
} else if (view instanceof NestedScrollingChild) {
|
||||
((NestedScrollingChild) view).stopNestedScroll();
|
||||
}
|
||||
}
|
||||
|
||||
private static void D(View view) {
|
||||
float translationY = view.getTranslationY();
|
||||
view.setTranslationY(1.0f + translationY);
|
||||
view.setTranslationY(translationY);
|
||||
}
|
||||
|
||||
private static Rect a() {
|
||||
if (i == null) {
|
||||
i = new ThreadLocal<>();
|
||||
}
|
||||
Rect rect = i.get();
|
||||
if (rect == null) {
|
||||
rect = new Rect();
|
||||
i.set(rect);
|
||||
}
|
||||
rect.setEmpty();
|
||||
return rect;
|
||||
}
|
||||
|
||||
public static void b(View view, boolean z) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
view.setHasTransientState(z);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void c(View view, float f2) {
|
||||
view.setPivotX(f2);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void d(View view, float f2) {
|
||||
view.setPivotY(f2);
|
||||
}
|
||||
|
||||
public static void e(View view, int i2) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
view.setAccessibilityLiveRegion(i2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void f(View view, int i2) {
|
||||
int i3 = Build.VERSION.SDK_INT;
|
||||
if (i3 >= 19) {
|
||||
view.setImportantForAccessibility(i2);
|
||||
} else if (i3 >= 16) {
|
||||
if (i2 == 4) {
|
||||
i2 = 2;
|
||||
}
|
||||
view.setImportantForAccessibility(i2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void g(View view, int i2) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
view.setImportantForAutofill(i2);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void h(View view, float f2) {
|
||||
view.setScaleX(f2);
|
||||
}
|
||||
|
||||
public static int i(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return view.getImportantForAccessibility();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SuppressLint({"InlinedApi"})
|
||||
public static int j(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
return view.getImportantForAutofill();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int k(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 17) {
|
||||
return view.getLayoutDirection();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int l(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return view.getMinimumHeight();
|
||||
}
|
||||
if (!d) {
|
||||
try {
|
||||
c = View.class.getDeclaredField("mMinHeight");
|
||||
c.setAccessible(true);
|
||||
} catch (NoSuchFieldException unused) {
|
||||
}
|
||||
d = true;
|
||||
}
|
||||
Field field = c;
|
||||
if (field == null) {
|
||||
return 0;
|
||||
}
|
||||
try {
|
||||
return ((Integer) field.get(view)).intValue();
|
||||
} catch (Exception unused2) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static int m(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return view.getMinimumWidth();
|
||||
}
|
||||
if (!b) {
|
||||
try {
|
||||
a = View.class.getDeclaredField("mMinWidth");
|
||||
a.setAccessible(true);
|
||||
} catch (NoSuchFieldException unused) {
|
||||
}
|
||||
b = true;
|
||||
}
|
||||
Field field = a;
|
||||
if (field == null) {
|
||||
return 0;
|
||||
}
|
||||
try {
|
||||
return ((Integer) field.get(view)).intValue();
|
||||
} catch (Exception unused2) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static int n(View view) {
|
||||
return Build.VERSION.SDK_INT >= 17 ? view.getPaddingEnd() : view.getPaddingRight();
|
||||
}
|
||||
|
||||
public static int o(View view) {
|
||||
return Build.VERSION.SDK_INT >= 17 ? view.getPaddingStart() : view.getPaddingLeft();
|
||||
}
|
||||
|
||||
public static String p(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return view.getTransitionName();
|
||||
}
|
||||
WeakHashMap<View, String> weakHashMap = e;
|
||||
if (weakHashMap == null) {
|
||||
return null;
|
||||
}
|
||||
return weakHashMap.get(view);
|
||||
}
|
||||
|
||||
public static int q(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return view.getWindowSystemUiVisibility();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static float r(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return view.getZ();
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public static boolean s(View view) {
|
||||
if (h) {
|
||||
return false;
|
||||
}
|
||||
if (g == null) {
|
||||
try {
|
||||
g = View.class.getDeclaredField("mAccessibilityDelegate");
|
||||
g.setAccessible(true);
|
||||
} catch (Throwable unused) {
|
||||
h = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
try {
|
||||
return g.get(view) != null;
|
||||
} catch (Throwable unused2) {
|
||||
h = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean t(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 15) {
|
||||
return view.hasOnClickListeners();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean u(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return view.hasOverlappingRendering();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean v(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return view.hasTransientState();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean w(View view) {
|
||||
return Build.VERSION.SDK_INT >= 19 ? view.isAttachedToWindow() : view.getWindowToken() != null;
|
||||
}
|
||||
|
||||
public static boolean x(View view) {
|
||||
return Build.VERSION.SDK_INT >= 19 ? view.isLaidOut() : view.getWidth() > 0 && view.getHeight() > 0;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static boolean y(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return view.isNestedScrollingEnabled();
|
||||
}
|
||||
if (view instanceof NestedScrollingChild) {
|
||||
return ((NestedScrollingChild) view).isNestedScrollingEnabled();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean z(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 17) {
|
||||
return view.isPaddingRelative();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static ColorStateList c(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return view.getBackgroundTintList();
|
||||
}
|
||||
if (view instanceof TintableBackgroundView) {
|
||||
return ((TintableBackgroundView) view).getSupportBackgroundTintList();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static PorterDuff.Mode d(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return view.getBackgroundTintMode();
|
||||
}
|
||||
if (view instanceof TintableBackgroundView) {
|
||||
return ((TintableBackgroundView) view).getSupportBackgroundTintMode();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean h(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return view.getFitsSystemWindows();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static class UnhandledKeyEventManager {
|
||||
private static final ArrayList<WeakReference<View>> d = new ArrayList<>();
|
||||
private WeakHashMap<View, Boolean> a = null;
|
||||
private SparseArray<WeakReference<View>> b = null;
|
||||
private WeakReference<KeyEvent> c = null;
|
||||
|
||||
UnhandledKeyEventManager() {
|
||||
}
|
||||
|
||||
private SparseArray<WeakReference<View>> a() {
|
||||
if (this.b == null) {
|
||||
this.b = new SparseArray<>();
|
||||
}
|
||||
return this.b;
|
||||
}
|
||||
|
||||
private View b(View view, KeyEvent keyEvent) {
|
||||
WeakHashMap<View, Boolean> weakHashMap = this.a;
|
||||
if (weakHashMap != null && weakHashMap.containsKey(view)) {
|
||||
if (view instanceof ViewGroup) {
|
||||
ViewGroup viewGroup = (ViewGroup) view;
|
||||
for (int childCount = viewGroup.getChildCount() - 1; childCount >= 0; childCount--) {
|
||||
View b = b(viewGroup.getChildAt(childCount), keyEvent);
|
||||
if (b != null) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (c(view, keyEvent)) {
|
||||
return view;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean c(View view, KeyEvent keyEvent) {
|
||||
ArrayList arrayList = (ArrayList) view.getTag(R$id.tag_unhandled_key_listeners);
|
||||
if (arrayList == null) {
|
||||
return false;
|
||||
}
|
||||
for (int size = arrayList.size() - 1; size >= 0; size--) {
|
||||
if (((OnUnhandledKeyEventListenerCompat) arrayList.get(size)).a(view, keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static UnhandledKeyEventManager a(View view) {
|
||||
UnhandledKeyEventManager unhandledKeyEventManager = (UnhandledKeyEventManager) view.getTag(R$id.tag_unhandled_key_event_manager);
|
||||
if (unhandledKeyEventManager != null) {
|
||||
return unhandledKeyEventManager;
|
||||
}
|
||||
UnhandledKeyEventManager unhandledKeyEventManager2 = new UnhandledKeyEventManager();
|
||||
view.setTag(R$id.tag_unhandled_key_event_manager, unhandledKeyEventManager2);
|
||||
return unhandledKeyEventManager2;
|
||||
}
|
||||
|
||||
private void b() {
|
||||
WeakHashMap<View, Boolean> weakHashMap = this.a;
|
||||
if (weakHashMap != null) {
|
||||
weakHashMap.clear();
|
||||
}
|
||||
if (d.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
synchronized (d) {
|
||||
if (this.a == null) {
|
||||
this.a = new WeakHashMap<>();
|
||||
}
|
||||
for (int size = d.size() - 1; size >= 0; size--) {
|
||||
View view = d.get(size).get();
|
||||
if (view == null) {
|
||||
d.remove(size);
|
||||
} else {
|
||||
this.a.put(view, Boolean.TRUE);
|
||||
for (ViewParent parent = view.getParent(); parent instanceof View; parent = parent.getParent()) {
|
||||
this.a.put((View) parent, Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean a(View view, KeyEvent keyEvent) {
|
||||
if (keyEvent.getAction() == 0) {
|
||||
b();
|
||||
}
|
||||
View b = b(view, keyEvent);
|
||||
if (keyEvent.getAction() == 0) {
|
||||
int keyCode = keyEvent.getKeyCode();
|
||||
if (b != null && !KeyEvent.isModifierKey(keyCode)) {
|
||||
a().put(keyCode, new WeakReference<>(b));
|
||||
}
|
||||
}
|
||||
return b != null;
|
||||
}
|
||||
|
||||
boolean a(KeyEvent keyEvent) {
|
||||
int indexOfKey;
|
||||
WeakReference<KeyEvent> weakReference = this.c;
|
||||
if (weakReference != null && weakReference.get() == keyEvent) {
|
||||
return false;
|
||||
}
|
||||
this.c = new WeakReference<>(keyEvent);
|
||||
WeakReference<View> weakReference2 = null;
|
||||
SparseArray<WeakReference<View>> a = a();
|
||||
if (keyEvent.getAction() == 1 && (indexOfKey = a.indexOfKey(keyEvent.getKeyCode())) >= 0) {
|
||||
weakReference2 = a.valueAt(indexOfKey);
|
||||
a.removeAt(indexOfKey);
|
||||
}
|
||||
if (weakReference2 == null) {
|
||||
weakReference2 = a.get(keyEvent.getKeyCode());
|
||||
}
|
||||
if (weakReference2 == null) {
|
||||
return false;
|
||||
}
|
||||
View view = weakReference2.get();
|
||||
if (view != null && ViewCompat.w(view)) {
|
||||
c(view, keyEvent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static int b(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
return view.getAccessibilityLiveRegion();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void e(View view, float f2) {
|
||||
view.setRotation(f2);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void g(View view, float f2) {
|
||||
view.setRotationY(f2);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void i(View view, float f2) {
|
||||
view.setScaleY(f2);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void j(View view, float f2) {
|
||||
view.setTranslationX(f2);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void k(View view, float f2) {
|
||||
view.setTranslationY(f2);
|
||||
}
|
||||
|
||||
public static Rect e(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
return view.getClipBounds();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void f(View view, float f2) {
|
||||
view.setRotationX(f2);
|
||||
}
|
||||
|
||||
public static float g(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return view.getElevation();
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static void h(View view, int i2) {
|
||||
if (view instanceof NestedScrollingChild2) {
|
||||
((NestedScrollingChild2) view).a(i2);
|
||||
} else if (i2 == 0) {
|
||||
C(view);
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(View view, float f2) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
view.setElevation(f2);
|
||||
}
|
||||
}
|
||||
|
||||
public static Display f(View view) {
|
||||
if (Build.VERSION.SDK_INT >= 17) {
|
||||
return view.getDisplay();
|
||||
}
|
||||
if (w(view)) {
|
||||
return ((WindowManager) view.getContext().getSystemService("window")).getDefaultDisplay();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void c(View view, int i2) {
|
||||
int i3 = Build.VERSION.SDK_INT;
|
||||
if (i3 >= 23) {
|
||||
view.offsetLeftAndRight(i2);
|
||||
return;
|
||||
}
|
||||
if (i3 >= 21) {
|
||||
Rect a2 = a();
|
||||
boolean z = false;
|
||||
Object parent = view.getParent();
|
||||
if (parent instanceof View) {
|
||||
View view2 = (View) parent;
|
||||
a2.set(view2.getLeft(), view2.getTop(), view2.getRight(), view2.getBottom());
|
||||
z = !a2.intersects(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
|
||||
}
|
||||
a(view, i2);
|
||||
if (z && a2.intersect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom())) {
|
||||
((View) parent).invalidate(a2);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
a(view, i2);
|
||||
}
|
||||
|
||||
public static void d(View view, int i2) {
|
||||
int i3 = Build.VERSION.SDK_INT;
|
||||
if (i3 >= 23) {
|
||||
view.offsetTopAndBottom(i2);
|
||||
return;
|
||||
}
|
||||
if (i3 >= 21) {
|
||||
Rect a2 = a();
|
||||
boolean z = false;
|
||||
Object parent = view.getParent();
|
||||
if (parent instanceof View) {
|
||||
View view2 = (View) parent;
|
||||
a2.set(view2.getLeft(), view2.getTop(), view2.getRight(), view2.getBottom());
|
||||
z = !a2.intersects(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
|
||||
}
|
||||
b(view, i2);
|
||||
if (z && a2.intersect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom())) {
|
||||
((View) parent).invalidate(a2);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
b(view, i2);
|
||||
}
|
||||
|
||||
public static void a(View view, AccessibilityDelegateCompat accessibilityDelegateCompat) {
|
||||
view.setAccessibilityDelegate(accessibilityDelegateCompat == null ? null : accessibilityDelegateCompat.a());
|
||||
}
|
||||
|
||||
public static WindowInsetsCompat b(View view, WindowInsetsCompat windowInsetsCompat) {
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
return windowInsetsCompat;
|
||||
}
|
||||
WindowInsets windowInsets = (WindowInsets) WindowInsetsCompat.a(windowInsetsCompat);
|
||||
WindowInsets onApplyWindowInsets = view.onApplyWindowInsets(windowInsets);
|
||||
if (onApplyWindowInsets != windowInsets) {
|
||||
windowInsets = new WindowInsets(onApplyWindowInsets);
|
||||
}
|
||||
return WindowInsetsCompat.a(windowInsets);
|
||||
}
|
||||
|
||||
public static void a(View view, Runnable runnable) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
view.postOnAnimation(runnable);
|
||||
} else {
|
||||
view.postDelayed(runnable, ValueAnimator.getFrameDelay());
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(View view, Runnable runnable, long j) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
view.postOnAnimationDelayed(runnable, j);
|
||||
} else {
|
||||
view.postDelayed(runnable, ValueAnimator.getFrameDelay() + j);
|
||||
}
|
||||
}
|
||||
|
||||
private static void b(View view, int i2) {
|
||||
view.offsetTopAndBottom(i2);
|
||||
if (view.getVisibility() == 0) {
|
||||
D(view);
|
||||
Object parent = view.getParent();
|
||||
if (parent instanceof View) {
|
||||
D((View) parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(View view, int i2, int i3, int i4, int i5) {
|
||||
if (Build.VERSION.SDK_INT >= 17) {
|
||||
view.setPaddingRelative(i2, i3, i4, i5);
|
||||
} else {
|
||||
view.setPadding(i2, i3, i4, i5);
|
||||
}
|
||||
}
|
||||
|
||||
public static ViewPropertyAnimatorCompat a(View view) {
|
||||
if (f == null) {
|
||||
f = new WeakHashMap<>();
|
||||
}
|
||||
ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = f.get(view);
|
||||
if (viewPropertyAnimatorCompat != null) {
|
||||
return viewPropertyAnimatorCompat;
|
||||
}
|
||||
ViewPropertyAnimatorCompat viewPropertyAnimatorCompat2 = new ViewPropertyAnimatorCompat(view);
|
||||
f.put(view, viewPropertyAnimatorCompat2);
|
||||
return viewPropertyAnimatorCompat2;
|
||||
}
|
||||
|
||||
static boolean b(View view, KeyEvent keyEvent) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return false;
|
||||
}
|
||||
return UnhandledKeyEventManager.a(view).a(keyEvent);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void a(View view, float f2) {
|
||||
view.setAlpha(f2);
|
||||
}
|
||||
|
||||
public static void a(View view, String str) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
view.setTransitionName(str);
|
||||
return;
|
||||
}
|
||||
if (e == null) {
|
||||
e = new WeakHashMap<>();
|
||||
}
|
||||
e.put(view, str);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void a(View view, boolean z) {
|
||||
view.setFitsSystemWindows(z);
|
||||
}
|
||||
|
||||
public static void a(View view, final OnApplyWindowInsetsListener onApplyWindowInsetsListener) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
if (onApplyWindowInsetsListener == null) {
|
||||
view.setOnApplyWindowInsetsListener(null);
|
||||
} else {
|
||||
view.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() { // from class: androidx.core.view.ViewCompat.1
|
||||
@Override // android.view.View.OnApplyWindowInsetsListener
|
||||
public WindowInsets onApplyWindowInsets(View view2, WindowInsets windowInsets) {
|
||||
return (WindowInsets) WindowInsetsCompat.a(OnApplyWindowInsetsListener.this.a(view2, WindowInsetsCompat.a(windowInsets)));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static WindowInsetsCompat a(View view, WindowInsetsCompat windowInsetsCompat) {
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
return windowInsetsCompat;
|
||||
}
|
||||
WindowInsets windowInsets = (WindowInsets) WindowInsetsCompat.a(windowInsetsCompat);
|
||||
WindowInsets dispatchApplyWindowInsets = view.dispatchApplyWindowInsets(windowInsets);
|
||||
if (dispatchApplyWindowInsets != windowInsets) {
|
||||
windowInsets = new WindowInsets(dispatchApplyWindowInsets);
|
||||
}
|
||||
return WindowInsetsCompat.a(windowInsets);
|
||||
}
|
||||
|
||||
public static void a(View view, Drawable drawable) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
view.setBackground(drawable);
|
||||
} else {
|
||||
view.setBackgroundDrawable(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static void a(View view, ColorStateList colorStateList) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
view.setBackgroundTintList(colorStateList);
|
||||
if (Build.VERSION.SDK_INT == 21) {
|
||||
Drawable background = view.getBackground();
|
||||
boolean z = (view.getBackgroundTintList() == null && view.getBackgroundTintMode() == null) ? false : true;
|
||||
if (background == null || !z) {
|
||||
return;
|
||||
}
|
||||
if (background.isStateful()) {
|
||||
background.setState(view.getDrawableState());
|
||||
}
|
||||
view.setBackground(background);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (view instanceof TintableBackgroundView) {
|
||||
((TintableBackgroundView) view).setSupportBackgroundTintList(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static void a(View view, PorterDuff.Mode mode) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
view.setBackgroundTintMode(mode);
|
||||
if (Build.VERSION.SDK_INT == 21) {
|
||||
Drawable background = view.getBackground();
|
||||
boolean z = (view.getBackgroundTintList() == null && view.getBackgroundTintMode() == null) ? false : true;
|
||||
if (background == null || !z) {
|
||||
return;
|
||||
}
|
||||
if (background.isStateful()) {
|
||||
background.setState(view.getDrawableState());
|
||||
}
|
||||
view.setBackground(background);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (view instanceof TintableBackgroundView) {
|
||||
((TintableBackgroundView) view).setSupportBackgroundTintMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
private static void a(View view, int i2) {
|
||||
view.offsetLeftAndRight(i2);
|
||||
if (view.getVisibility() == 0) {
|
||||
D(view);
|
||||
Object parent = view.getParent();
|
||||
if (parent instanceof View) {
|
||||
D((View) parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(View view, Rect rect) {
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
view.setClipBounds(rect);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(View view, int i2, int i3) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
view.setScrollIndicators(i2, i3);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(View view, PointerIconCompat pointerIconCompat) {
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
view.setPointerIcon((PointerIcon) (pointerIconCompat != null ? pointerIconCompat.a() : null));
|
||||
}
|
||||
}
|
||||
|
||||
static boolean a(View view, KeyEvent keyEvent) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return false;
|
||||
}
|
||||
return UnhandledKeyEventManager.a(view).a(view, keyEvent);
|
||||
}
|
||||
}
|
||||
65
sources/androidx/core/view/ViewConfigurationCompat.java
Normal file
65
sources/androidx/core/view/ViewConfigurationCompat.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.ViewConfiguration;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ViewConfigurationCompat {
|
||||
private static Method a;
|
||||
|
||||
static {
|
||||
if (Build.VERSION.SDK_INT == 25) {
|
||||
try {
|
||||
a = ViewConfiguration.class.getDeclaredMethod("getScaledScrollFactor", new Class[0]);
|
||||
} catch (Exception unused) {
|
||||
Log.i("ViewConfigCompat", "Could not find method getScaledScrollFactor() on ViewConfiguration");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static float a(ViewConfiguration viewConfiguration, Context context) {
|
||||
Method method;
|
||||
if (Build.VERSION.SDK_INT >= 25 && (method = a) != null) {
|
||||
try {
|
||||
return ((Integer) method.invoke(viewConfiguration, new Object[0])).intValue();
|
||||
} catch (Exception unused) {
|
||||
Log.i("ViewConfigCompat", "Could not find method getScaledScrollFactor() on ViewConfiguration");
|
||||
}
|
||||
}
|
||||
TypedValue typedValue = new TypedValue();
|
||||
if (context.getTheme().resolveAttribute(R.attr.listPreferredItemHeight, typedValue, true)) {
|
||||
return typedValue.getDimension(context.getResources().getDisplayMetrics());
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public static float b(ViewConfiguration viewConfiguration, Context context) {
|
||||
return Build.VERSION.SDK_INT >= 26 ? viewConfiguration.getScaledHorizontalScrollFactor() : a(viewConfiguration, context);
|
||||
}
|
||||
|
||||
public static float c(ViewConfiguration viewConfiguration, Context context) {
|
||||
return Build.VERSION.SDK_INT >= 26 ? viewConfiguration.getScaledVerticalScrollFactor() : a(viewConfiguration, context);
|
||||
}
|
||||
|
||||
public static boolean d(ViewConfiguration viewConfiguration, Context context) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return viewConfiguration.shouldShowMenuShortcutsWhenKeyboardPresent();
|
||||
}
|
||||
Resources resources = context.getResources();
|
||||
int identifier = resources.getIdentifier("config_showMenuShortcutsWhenKeyboardPresent", "bool", "android");
|
||||
return identifier != 0 && resources.getBoolean(identifier);
|
||||
}
|
||||
|
||||
public static int a(ViewConfiguration viewConfiguration) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return viewConfiguration.getScaledHoverSlop();
|
||||
}
|
||||
return viewConfiguration.getScaledTouchSlop() / 2;
|
||||
}
|
||||
}
|
||||
16
sources/androidx/core/view/ViewGroupCompat.java
Normal file
16
sources/androidx/core/view/ViewGroupCompat.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.os.Build;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.core.R$id;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ViewGroupCompat {
|
||||
public static boolean a(ViewGroup viewGroup) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return viewGroup.isTransitionGroup();
|
||||
}
|
||||
Boolean bool = (Boolean) viewGroup.getTag(R$id.tag_transition_group);
|
||||
return ((bool == null || !bool.booleanValue()) && viewGroup.getBackground() == null && ViewCompat.p(viewGroup) == null) ? false : true;
|
||||
}
|
||||
}
|
||||
144
sources/androidx/core/view/ViewParentCompat.java
Normal file
144
sources/androidx/core/view/ViewParentCompat.java
Normal file
@@ -0,0 +1,144 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewParent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ViewParentCompat {
|
||||
public static void a(ViewParent viewParent, View view, View view2, int i, int i2) {
|
||||
if (viewParent instanceof NestedScrollingParent2) {
|
||||
((NestedScrollingParent2) viewParent).b(view, view2, i, i2);
|
||||
return;
|
||||
}
|
||||
if (i2 == 0) {
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
if (viewParent instanceof NestedScrollingParent) {
|
||||
((NestedScrollingParent) viewParent).onNestedScrollAccepted(view, view2, i);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
viewParent.onNestedScrollAccepted(view, view2, i);
|
||||
} catch (AbstractMethodError e) {
|
||||
Log.e("ViewParentCompat", "ViewParent " + viewParent + " does not implement interface method onNestedScrollAccepted", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean b(ViewParent viewParent, View view, View view2, int i, int i2) {
|
||||
if (viewParent instanceof NestedScrollingParent2) {
|
||||
return ((NestedScrollingParent2) viewParent).a(view, view2, i, i2);
|
||||
}
|
||||
if (i2 != 0) {
|
||||
return false;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
if (viewParent instanceof NestedScrollingParent) {
|
||||
return ((NestedScrollingParent) viewParent).onStartNestedScroll(view, view2, i);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return viewParent.onStartNestedScroll(view, view2, i);
|
||||
} catch (AbstractMethodError e) {
|
||||
Log.e("ViewParentCompat", "ViewParent " + viewParent + " does not implement interface method onStartNestedScroll", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(ViewParent viewParent, View view, int i) {
|
||||
if (viewParent instanceof NestedScrollingParent2) {
|
||||
((NestedScrollingParent2) viewParent).a(view, i);
|
||||
return;
|
||||
}
|
||||
if (i == 0) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
try {
|
||||
viewParent.onStopNestedScroll(view);
|
||||
return;
|
||||
} catch (AbstractMethodError e) {
|
||||
Log.e("ViewParentCompat", "ViewParent " + viewParent + " does not implement interface method onStopNestedScroll", e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (viewParent instanceof NestedScrollingParent) {
|
||||
((NestedScrollingParent) viewParent).onStopNestedScroll(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(ViewParent viewParent, View view, int i, int i2, int i3, int i4, int i5) {
|
||||
if (viewParent instanceof NestedScrollingParent2) {
|
||||
((NestedScrollingParent2) viewParent).a(view, i, i2, i3, i4, i5);
|
||||
return;
|
||||
}
|
||||
if (i5 == 0) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
try {
|
||||
viewParent.onNestedScroll(view, i, i2, i3, i4);
|
||||
return;
|
||||
} catch (AbstractMethodError e) {
|
||||
Log.e("ViewParentCompat", "ViewParent " + viewParent + " does not implement interface method onNestedScroll", e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (viewParent instanceof NestedScrollingParent) {
|
||||
((NestedScrollingParent) viewParent).onNestedScroll(view, i, i2, i3, i4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(ViewParent viewParent, View view, int i, int i2, int[] iArr, int i3) {
|
||||
if (viewParent instanceof NestedScrollingParent2) {
|
||||
((NestedScrollingParent2) viewParent).a(view, i, i2, iArr, i3);
|
||||
return;
|
||||
}
|
||||
if (i3 == 0) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
try {
|
||||
viewParent.onNestedPreScroll(view, i, i2, iArr);
|
||||
return;
|
||||
} catch (AbstractMethodError e) {
|
||||
Log.e("ViewParentCompat", "ViewParent " + viewParent + " does not implement interface method onNestedPreScroll", e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (viewParent instanceof NestedScrollingParent) {
|
||||
((NestedScrollingParent) viewParent).onNestedPreScroll(view, i, i2, iArr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean a(ViewParent viewParent, View view, float f, float f2, boolean z) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
try {
|
||||
return viewParent.onNestedFling(view, f, f2, z);
|
||||
} catch (AbstractMethodError e) {
|
||||
Log.e("ViewParentCompat", "ViewParent " + viewParent + " does not implement interface method onNestedFling", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (viewParent instanceof NestedScrollingParent) {
|
||||
return ((NestedScrollingParent) viewParent).onNestedFling(view, f, f2, z);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean a(ViewParent viewParent, View view, float f, float f2) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
try {
|
||||
return viewParent.onNestedPreFling(view, f, f2);
|
||||
} catch (AbstractMethodError e) {
|
||||
Log.e("ViewParentCompat", "ViewParent " + viewParent + " does not implement interface method onNestedPreFling", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (viewParent instanceof NestedScrollingParent) {
|
||||
return ((NestedScrollingParent) viewParent).onNestedPreFling(view, f, f2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
192
sources/androidx/core/view/ViewPropertyAnimatorCompat.java
Normal file
192
sources/androidx/core/view/ViewPropertyAnimatorCompat.java
Normal file
@@ -0,0 +1,192 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.view.animation.Interpolator;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ViewPropertyAnimatorCompat {
|
||||
private WeakReference<View> a;
|
||||
Runnable b = null;
|
||||
Runnable c = null;
|
||||
int d = -1;
|
||||
|
||||
static class ViewPropertyAnimatorListenerApi14 implements ViewPropertyAnimatorListener {
|
||||
ViewPropertyAnimatorCompat a;
|
||||
boolean b;
|
||||
|
||||
ViewPropertyAnimatorListenerApi14(ViewPropertyAnimatorCompat viewPropertyAnimatorCompat) {
|
||||
this.a = viewPropertyAnimatorCompat;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void a(View view) {
|
||||
Object tag = view.getTag(2113929216);
|
||||
ViewPropertyAnimatorListener viewPropertyAnimatorListener = tag instanceof ViewPropertyAnimatorListener ? (ViewPropertyAnimatorListener) tag : null;
|
||||
if (viewPropertyAnimatorListener != null) {
|
||||
viewPropertyAnimatorListener.a(view);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void b(View view) {
|
||||
int i = this.a.d;
|
||||
if (i > -1) {
|
||||
view.setLayerType(i, null);
|
||||
this.a.d = -1;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 16 || !this.b) {
|
||||
ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = this.a;
|
||||
Runnable runnable = viewPropertyAnimatorCompat.c;
|
||||
if (runnable != null) {
|
||||
viewPropertyAnimatorCompat.c = null;
|
||||
runnable.run();
|
||||
}
|
||||
Object tag = view.getTag(2113929216);
|
||||
ViewPropertyAnimatorListener viewPropertyAnimatorListener = tag instanceof ViewPropertyAnimatorListener ? (ViewPropertyAnimatorListener) tag : null;
|
||||
if (viewPropertyAnimatorListener != null) {
|
||||
viewPropertyAnimatorListener.b(view);
|
||||
}
|
||||
this.b = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void c(View view) {
|
||||
this.b = false;
|
||||
if (this.a.d > -1) {
|
||||
view.setLayerType(2, null);
|
||||
}
|
||||
ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = this.a;
|
||||
Runnable runnable = viewPropertyAnimatorCompat.b;
|
||||
if (runnable != null) {
|
||||
viewPropertyAnimatorCompat.b = null;
|
||||
runnable.run();
|
||||
}
|
||||
Object tag = view.getTag(2113929216);
|
||||
ViewPropertyAnimatorListener viewPropertyAnimatorListener = tag instanceof ViewPropertyAnimatorListener ? (ViewPropertyAnimatorListener) tag : null;
|
||||
if (viewPropertyAnimatorListener != null) {
|
||||
viewPropertyAnimatorListener.c(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ViewPropertyAnimatorCompat(View view) {
|
||||
this.a = new WeakReference<>(view);
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompat a(long j) {
|
||||
View view = this.a.get();
|
||||
if (view != null) {
|
||||
view.animate().setDuration(j);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompat b(float f) {
|
||||
View view = this.a.get();
|
||||
if (view != null) {
|
||||
view.animate().translationY(f);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public void c() {
|
||||
View view = this.a.get();
|
||||
if (view != null) {
|
||||
view.animate().start();
|
||||
}
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompat a(float f) {
|
||||
View view = this.a.get();
|
||||
if (view != null) {
|
||||
view.animate().alpha(f);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public long b() {
|
||||
View view = this.a.get();
|
||||
if (view != null) {
|
||||
return view.animate().getDuration();
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompat a(Interpolator interpolator) {
|
||||
View view = this.a.get();
|
||||
if (view != null) {
|
||||
view.animate().setInterpolator(interpolator);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompat b(long j) {
|
||||
View view = this.a.get();
|
||||
if (view != null) {
|
||||
view.animate().setStartDelay(j);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public void a() {
|
||||
View view = this.a.get();
|
||||
if (view != null) {
|
||||
view.animate().cancel();
|
||||
}
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompat a(ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
|
||||
View view = this.a.get();
|
||||
if (view != null) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
a(view, viewPropertyAnimatorListener);
|
||||
} else {
|
||||
view.setTag(2113929216, viewPropertyAnimatorListener);
|
||||
a(view, new ViewPropertyAnimatorListenerApi14(this));
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private void a(final View view, final ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
|
||||
if (viewPropertyAnimatorListener != null) {
|
||||
view.animate().setListener(new AnimatorListenerAdapter(this) { // from class: androidx.core.view.ViewPropertyAnimatorCompat.1
|
||||
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
||||
public void onAnimationCancel(Animator animator) {
|
||||
viewPropertyAnimatorListener.a(view);
|
||||
}
|
||||
|
||||
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
viewPropertyAnimatorListener.b(view);
|
||||
}
|
||||
|
||||
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
||||
public void onAnimationStart(Animator animator) {
|
||||
viewPropertyAnimatorListener.c(view);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
view.animate().setListener(null);
|
||||
}
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompat a(final ViewPropertyAnimatorUpdateListener viewPropertyAnimatorUpdateListener) {
|
||||
final View view = this.a.get();
|
||||
if (view != null && Build.VERSION.SDK_INT >= 19) {
|
||||
view.animate().setUpdateListener(viewPropertyAnimatorUpdateListener != null ? new ValueAnimator.AnimatorUpdateListener(this) { // from class: androidx.core.view.ViewPropertyAnimatorCompat.2
|
||||
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
|
||||
public void onAnimationUpdate(ValueAnimator valueAnimator) {
|
||||
viewPropertyAnimatorUpdateListener.a(view);
|
||||
}
|
||||
} : null);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
12
sources/androidx/core/view/ViewPropertyAnimatorListener.java
Normal file
12
sources/androidx/core/view/ViewPropertyAnimatorListener.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ViewPropertyAnimatorListener {
|
||||
void a(View view);
|
||||
|
||||
void b(View view);
|
||||
|
||||
void c(View view);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ViewPropertyAnimatorListenerAdapter implements ViewPropertyAnimatorListener {
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void a(View view) {
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void c(View view) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ViewPropertyAnimatorUpdateListener {
|
||||
void a(View view);
|
||||
}
|
||||
96
sources/androidx/core/view/WindowInsetsCompat.java
Normal file
96
sources/androidx/core/view/WindowInsetsCompat.java
Normal file
@@ -0,0 +1,96 @@
|
||||
package androidx.core.view;
|
||||
|
||||
import android.os.Build;
|
||||
import android.view.WindowInsets;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WindowInsetsCompat {
|
||||
private final Object a;
|
||||
|
||||
private WindowInsetsCompat(Object obj) {
|
||||
this.a = obj;
|
||||
}
|
||||
|
||||
public WindowInsetsCompat a() {
|
||||
if (Build.VERSION.SDK_INT >= 20) {
|
||||
return new WindowInsetsCompat(((WindowInsets) this.a).consumeSystemWindowInsets());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int b() {
|
||||
if (Build.VERSION.SDK_INT >= 20) {
|
||||
return ((WindowInsets) this.a).getSystemWindowInsetBottom();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int c() {
|
||||
if (Build.VERSION.SDK_INT >= 20) {
|
||||
return ((WindowInsets) this.a).getSystemWindowInsetLeft();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int d() {
|
||||
if (Build.VERSION.SDK_INT >= 20) {
|
||||
return ((WindowInsets) this.a).getSystemWindowInsetRight();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int e() {
|
||||
if (Build.VERSION.SDK_INT >= 20) {
|
||||
return ((WindowInsets) this.a).getSystemWindowInsetTop();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || WindowInsetsCompat.class != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Object obj2 = this.a;
|
||||
Object obj3 = ((WindowInsetsCompat) obj).a;
|
||||
return obj2 == null ? obj3 == null : obj2.equals(obj3);
|
||||
}
|
||||
|
||||
public boolean f() {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return ((WindowInsets) this.a).isConsumed();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
Object obj = this.a;
|
||||
if (obj == null) {
|
||||
return 0;
|
||||
}
|
||||
return obj.hashCode();
|
||||
}
|
||||
|
||||
public WindowInsetsCompat a(int i, int i2, int i3, int i4) {
|
||||
if (Build.VERSION.SDK_INT >= 20) {
|
||||
return new WindowInsetsCompat(((WindowInsets) this.a).replaceSystemWindowInsets(i, i2, i3, i4));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static WindowInsetsCompat a(Object obj) {
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
return new WindowInsetsCompat(obj);
|
||||
}
|
||||
|
||||
static Object a(WindowInsetsCompat windowInsetsCompat) {
|
||||
if (windowInsetsCompat == null) {
|
||||
return null;
|
||||
}
|
||||
return windowInsetsCompat.a;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package androidx.core.view.accessibility;
|
||||
|
||||
import android.os.Build;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AccessibilityEventCompat {
|
||||
public static void a(AccessibilityEvent accessibilityEvent, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
accessibilityEvent.setContentChangeTypes(i);
|
||||
}
|
||||
}
|
||||
|
||||
public static int a(AccessibilityEvent accessibilityEvent) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
return accessibilityEvent.getContentChangeTypes();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package androidx.core.view.accessibility;
|
||||
|
||||
import android.os.Build;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AccessibilityManagerCompat {
|
||||
|
||||
public interface TouchExplorationStateChangeListener {
|
||||
void onTouchExplorationStateChanged(boolean z);
|
||||
}
|
||||
|
||||
private static class TouchExplorationStateChangeListenerWrapper implements AccessibilityManager.TouchExplorationStateChangeListener {
|
||||
final TouchExplorationStateChangeListener a;
|
||||
|
||||
TouchExplorationStateChangeListenerWrapper(TouchExplorationStateChangeListener touchExplorationStateChangeListener) {
|
||||
this.a = touchExplorationStateChangeListener;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || TouchExplorationStateChangeListenerWrapper.class != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
return this.a.equals(((TouchExplorationStateChangeListenerWrapper) obj).a);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.a.hashCode();
|
||||
}
|
||||
|
||||
@Override // android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener
|
||||
public void onTouchExplorationStateChanged(boolean z) {
|
||||
this.a.onTouchExplorationStateChanged(z);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean a(AccessibilityManager accessibilityManager, TouchExplorationStateChangeListener touchExplorationStateChangeListener) {
|
||||
if (Build.VERSION.SDK_INT < 19 || touchExplorationStateChangeListener == null) {
|
||||
return false;
|
||||
}
|
||||
return accessibilityManager.addTouchExplorationStateChangeListener(new TouchExplorationStateChangeListenerWrapper(touchExplorationStateChangeListener));
|
||||
}
|
||||
|
||||
public static boolean b(AccessibilityManager accessibilityManager, TouchExplorationStateChangeListener touchExplorationStateChangeListener) {
|
||||
if (Build.VERSION.SDK_INT < 19 || touchExplorationStateChangeListener == null) {
|
||||
return false;
|
||||
}
|
||||
return accessibilityManager.removeTouchExplorationStateChangeListener(new TouchExplorationStateChangeListenerWrapper(touchExplorationStateChangeListener));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
package androidx.core.view.accessibility;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import com.ijm.dataencryption.de.DataDecryptTool;
|
||||
import com.ubt.jimu.base.util.FileUtil;
|
||||
import com.ubt.jimu.unity.bluetooth.UnityActivity;
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AccessibilityNodeInfoCompat {
|
||||
private final AccessibilityNodeInfo a;
|
||||
|
||||
public static class CollectionInfoCompat {
|
||||
final Object a;
|
||||
|
||||
CollectionInfoCompat(Object obj) {
|
||||
this.a = obj;
|
||||
}
|
||||
|
||||
public static CollectionInfoCompat a(int i, int i2, boolean z, int i3) {
|
||||
int i4 = Build.VERSION.SDK_INT;
|
||||
return i4 >= 21 ? new CollectionInfoCompat(AccessibilityNodeInfo.CollectionInfo.obtain(i, i2, z, i3)) : i4 >= 19 ? new CollectionInfoCompat(AccessibilityNodeInfo.CollectionInfo.obtain(i, i2, z)) : new CollectionInfoCompat(null);
|
||||
}
|
||||
}
|
||||
|
||||
public static class CollectionItemInfoCompat {
|
||||
final Object a;
|
||||
|
||||
CollectionItemInfoCompat(Object obj) {
|
||||
this.a = obj;
|
||||
}
|
||||
|
||||
public static CollectionItemInfoCompat a(int i, int i2, int i3, int i4, boolean z, boolean z2) {
|
||||
int i5 = Build.VERSION.SDK_INT;
|
||||
return i5 >= 21 ? new CollectionItemInfoCompat(AccessibilityNodeInfo.CollectionItemInfo.obtain(i, i2, i3, i4, z, z2)) : i5 >= 19 ? new CollectionItemInfoCompat(AccessibilityNodeInfo.CollectionItemInfo.obtain(i, i2, i3, i4, z)) : new CollectionItemInfoCompat(null);
|
||||
}
|
||||
}
|
||||
|
||||
private AccessibilityNodeInfoCompat(AccessibilityNodeInfo accessibilityNodeInfo) {
|
||||
this.a = accessibilityNodeInfo;
|
||||
}
|
||||
|
||||
public static AccessibilityNodeInfoCompat a(AccessibilityNodeInfo accessibilityNodeInfo) {
|
||||
return new AccessibilityNodeInfoCompat(accessibilityNodeInfo);
|
||||
}
|
||||
|
||||
private static String b(int i) {
|
||||
if (i == 1) {
|
||||
return "ACTION_FOCUS";
|
||||
}
|
||||
if (i == 2) {
|
||||
return "ACTION_CLEAR_FOCUS";
|
||||
}
|
||||
switch (i) {
|
||||
case 4:
|
||||
return "ACTION_SELECT";
|
||||
case 8:
|
||||
return "ACTION_CLEAR_SELECTION";
|
||||
case 16:
|
||||
return "ACTION_CLICK";
|
||||
case 32:
|
||||
return "ACTION_LONG_CLICK";
|
||||
case 64:
|
||||
return "ACTION_ACCESSIBILITY_FOCUS";
|
||||
case PeripheralType.SERVO /* 128 */:
|
||||
return "ACTION_CLEAR_ACCESSIBILITY_FOCUS";
|
||||
case DataDecryptTool.DECRYPT_ALL_FILE /* 256 */:
|
||||
return "ACTION_NEXT_AT_MOVEMENT_GRANULARITY";
|
||||
case DataDecryptTool.DECRYPT_DB_FILE /* 512 */:
|
||||
return "ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY";
|
||||
case DataDecryptTool.DECRYPT_SP_FILE /* 1024 */:
|
||||
return "ACTION_NEXT_HTML_ELEMENT";
|
||||
case 2048:
|
||||
return "ACTION_PREVIOUS_HTML_ELEMENT";
|
||||
case FileUtil.ZIP_BUFFER_SIZE /* 4096 */:
|
||||
return "ACTION_SCROLL_FORWARD";
|
||||
case UnityActivity.BLOCKLY_TYPE_NONE /* 8192 */:
|
||||
return "ACTION_SCROLL_BACKWARD";
|
||||
case 16384:
|
||||
return "ACTION_COPY";
|
||||
case 32768:
|
||||
return "ACTION_PASTE";
|
||||
case 65536:
|
||||
return "ACTION_CUT";
|
||||
case 131072:
|
||||
return "ACTION_SET_SELECTION";
|
||||
default:
|
||||
return "ACTION_UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
public void b(Rect rect) {
|
||||
this.a.getBoundsInScreen(rect);
|
||||
}
|
||||
|
||||
public CharSequence c() {
|
||||
return this.a.getContentDescription();
|
||||
}
|
||||
|
||||
public void d(boolean z) {
|
||||
this.a.setScrollable(z);
|
||||
}
|
||||
|
||||
public CharSequence e() {
|
||||
return this.a.getPackageName();
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || AccessibilityNodeInfoCompat.class != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AccessibilityNodeInfoCompat accessibilityNodeInfoCompat = (AccessibilityNodeInfoCompat) obj;
|
||||
AccessibilityNodeInfo accessibilityNodeInfo = this.a;
|
||||
if (accessibilityNodeInfo == null) {
|
||||
if (accessibilityNodeInfoCompat.a != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!accessibilityNodeInfo.equals(accessibilityNodeInfoCompat.a)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public CharSequence f() {
|
||||
return this.a.getText();
|
||||
}
|
||||
|
||||
public String g() {
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
return this.a.getViewIdResourceName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean h() {
|
||||
return this.a.isCheckable();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
AccessibilityNodeInfo accessibilityNodeInfo = this.a;
|
||||
if (accessibilityNodeInfo == null) {
|
||||
return 0;
|
||||
}
|
||||
return accessibilityNodeInfo.hashCode();
|
||||
}
|
||||
|
||||
public boolean i() {
|
||||
return this.a.isChecked();
|
||||
}
|
||||
|
||||
public boolean j() {
|
||||
return this.a.isClickable();
|
||||
}
|
||||
|
||||
public boolean k() {
|
||||
return this.a.isEnabled();
|
||||
}
|
||||
|
||||
public boolean l() {
|
||||
return this.a.isFocusable();
|
||||
}
|
||||
|
||||
public boolean m() {
|
||||
return this.a.isFocused();
|
||||
}
|
||||
|
||||
public boolean n() {
|
||||
return this.a.isLongClickable();
|
||||
}
|
||||
|
||||
public boolean o() {
|
||||
return this.a.isPassword();
|
||||
}
|
||||
|
||||
public boolean p() {
|
||||
return this.a.isScrollable();
|
||||
}
|
||||
|
||||
public boolean q() {
|
||||
return this.a.isSelected();
|
||||
}
|
||||
|
||||
public AccessibilityNodeInfo r() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(super.toString());
|
||||
Rect rect = new Rect();
|
||||
a(rect);
|
||||
sb.append("; boundsInParent: " + rect);
|
||||
b(rect);
|
||||
sb.append("; boundsInScreen: " + rect);
|
||||
sb.append("; packageName: ");
|
||||
sb.append(e());
|
||||
sb.append("; className: ");
|
||||
sb.append(b());
|
||||
sb.append("; text: ");
|
||||
sb.append(f());
|
||||
sb.append("; contentDescription: ");
|
||||
sb.append(c());
|
||||
sb.append("; viewId: ");
|
||||
sb.append(g());
|
||||
sb.append("; checkable: ");
|
||||
sb.append(h());
|
||||
sb.append("; checked: ");
|
||||
sb.append(i());
|
||||
sb.append("; focusable: ");
|
||||
sb.append(l());
|
||||
sb.append("; focused: ");
|
||||
sb.append(m());
|
||||
sb.append("; selected: ");
|
||||
sb.append(q());
|
||||
sb.append("; clickable: ");
|
||||
sb.append(j());
|
||||
sb.append("; longClickable: ");
|
||||
sb.append(n());
|
||||
sb.append("; enabled: ");
|
||||
sb.append(k());
|
||||
sb.append("; password: ");
|
||||
sb.append(o());
|
||||
sb.append("; scrollable: " + p());
|
||||
sb.append("; [");
|
||||
int a = a();
|
||||
while (a != 0) {
|
||||
int numberOfTrailingZeros = 1 << Integer.numberOfTrailingZeros(a);
|
||||
a &= ~numberOfTrailingZeros;
|
||||
sb.append(b(numberOfTrailingZeros));
|
||||
if (a != 0) {
|
||||
sb.append(", ");
|
||||
}
|
||||
}
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.a.getActions();
|
||||
}
|
||||
|
||||
public void b(boolean z) {
|
||||
this.a.setChecked(z);
|
||||
}
|
||||
|
||||
public void c(boolean z) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
this.a.setContentInvalid(z);
|
||||
}
|
||||
}
|
||||
|
||||
public void d(CharSequence charSequence) {
|
||||
this.a.setText(charSequence);
|
||||
}
|
||||
|
||||
public void e(boolean z) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.a.setShowingHintText(z);
|
||||
} else {
|
||||
a(4, z);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.a.addAction(i);
|
||||
}
|
||||
|
||||
public CharSequence b() {
|
||||
return this.a.getClassName();
|
||||
}
|
||||
|
||||
public Bundle d() {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
return this.a.getExtras();
|
||||
}
|
||||
return new Bundle();
|
||||
}
|
||||
|
||||
public void a(Rect rect) {
|
||||
this.a.getBoundsInParent(rect);
|
||||
}
|
||||
|
||||
public void b(Object obj) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
this.a.setCollectionItemInfo(obj == null ? null : (AccessibilityNodeInfo.CollectionItemInfo) ((CollectionItemInfoCompat) obj).a);
|
||||
}
|
||||
}
|
||||
|
||||
public void c(CharSequence charSequence) {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 26) {
|
||||
this.a.setHintText(charSequence);
|
||||
} else if (i >= 19) {
|
||||
this.a.getExtras().putCharSequence("androidx.view.accessibility.AccessibilityNodeInfoCompat.HINT_TEXT_KEY", charSequence);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
this.a.setCheckable(z);
|
||||
}
|
||||
|
||||
public void a(CharSequence charSequence) {
|
||||
this.a.setClassName(charSequence);
|
||||
}
|
||||
|
||||
public void b(CharSequence charSequence) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
this.a.setError(charSequence);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Object obj) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
this.a.setCollectionInfo(obj == null ? null : (AccessibilityNodeInfo.CollectionInfo) ((CollectionInfoCompat) obj).a);
|
||||
}
|
||||
}
|
||||
|
||||
private void a(int i, boolean z) {
|
||||
Bundle d = d();
|
||||
if (d != null) {
|
||||
int i2 = d.getInt("androidx.view.accessibility.AccessibilityNodeInfoCompat.BOOLEAN_PROPERTY_KEY", 0) & (~i);
|
||||
if (!z) {
|
||||
i = 0;
|
||||
}
|
||||
d.putInt("androidx.view.accessibility.AccessibilityNodeInfoCompat.BOOLEAN_PROPERTY_KEY", i | i2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.core.view.accessibility;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AccessibilityNodeProviderCompat {
|
||||
private final Object a;
|
||||
|
||||
public AccessibilityNodeProviderCompat(Object obj) {
|
||||
this.a = obj;
|
||||
}
|
||||
|
||||
public Object a() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package androidx.core.view.accessibility;
|
||||
|
||||
import android.os.Build;
|
||||
import android.view.accessibility.AccessibilityRecord;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AccessibilityRecordCompat {
|
||||
public static void a(AccessibilityRecord accessibilityRecord, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 15) {
|
||||
accessibilityRecord.setMaxScrollX(i);
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(AccessibilityRecord accessibilityRecord, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 15) {
|
||||
accessibilityRecord.setMaxScrollY(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user