mirror of
https://github.com/FuzzingLabs/fuzzforge_ai.git
synced 2026-07-10 00:58:35 +02:00
first commit
This commit is contained in:
@@ -0,0 +1,256 @@
|
||||
package androidx.activity;
|
||||
|
||||
import app.beetlebug.C0572R;
|
||||
|
||||
/* renamed from: androidx.activity.R */
|
||||
/* loaded from: classes2.dex */
|
||||
public final class C0039R {
|
||||
|
||||
/* renamed from: androidx.activity.R$attr */
|
||||
public static final class attr {
|
||||
public static final int alpha = 2130968620;
|
||||
public static final int font = 2130968967;
|
||||
public static final int fontProviderAuthority = 2130968969;
|
||||
public static final int fontProviderCerts = 2130968970;
|
||||
public static final int fontProviderFetchStrategy = 2130968971;
|
||||
public static final int fontProviderFetchTimeout = 2130968972;
|
||||
public static final int fontProviderPackage = 2130968973;
|
||||
public static final int fontProviderQuery = 2130968974;
|
||||
public static final int fontStyle = 2130968976;
|
||||
public static final int fontVariationSettings = 2130968977;
|
||||
public static final int fontWeight = 2130968978;
|
||||
public static final int ttcIndex = 2130969565;
|
||||
|
||||
private attr() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$color */
|
||||
public static final class color {
|
||||
public static final int notification_action_color_filter = 2131099844;
|
||||
public static final int notification_icon_bg_color = 2131099845;
|
||||
public static final int ripple_material_light = 2131099863;
|
||||
public static final int secondary_text_default_material_light = 2131099865;
|
||||
|
||||
private color() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$dimen */
|
||||
public static final class dimen {
|
||||
public static final int compat_button_inset_horizontal_material = 2131165273;
|
||||
public static final int compat_button_inset_vertical_material = 2131165274;
|
||||
public static final int compat_button_padding_horizontal_material = 2131165275;
|
||||
public static final int compat_button_padding_vertical_material = 2131165276;
|
||||
public static final int compat_control_corner_material = 2131165277;
|
||||
public static final int compat_notification_large_icon_max_height = 2131165278;
|
||||
public static final int compat_notification_large_icon_max_width = 2131165279;
|
||||
public static final int notification_action_icon_size = 2131165574;
|
||||
public static final int notification_action_text_size = 2131165575;
|
||||
public static final int notification_big_circle_margin = 2131165576;
|
||||
public static final int notification_content_margin_start = 2131165577;
|
||||
public static final int notification_large_icon_height = 2131165578;
|
||||
public static final int notification_large_icon_width = 2131165579;
|
||||
public static final int notification_main_column_padding_top = 2131165580;
|
||||
public static final int notification_media_narrow_margin = 2131165581;
|
||||
public static final int notification_right_icon_size = 2131165582;
|
||||
public static final int notification_right_side_padding_top = 2131165583;
|
||||
public static final int notification_small_icon_background_padding = 2131165584;
|
||||
public static final int notification_small_icon_size_as_large = 2131165585;
|
||||
public static final int notification_subtext_size = 2131165586;
|
||||
public static final int notification_top_pad = 2131165587;
|
||||
public static final int notification_top_pad_large_text = 2131165588;
|
||||
|
||||
private dimen() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$drawable */
|
||||
public static final class drawable {
|
||||
public static final int notification_action_background = 2131230925;
|
||||
public static final int notification_bg = 2131230926;
|
||||
public static final int notification_bg_low = 2131230927;
|
||||
public static final int notification_bg_low_normal = 2131230928;
|
||||
public static final int notification_bg_low_pressed = 2131230929;
|
||||
public static final int notification_bg_normal = 2131230930;
|
||||
public static final int notification_bg_normal_pressed = 2131230931;
|
||||
public static final int notification_icon_background = 2131230932;
|
||||
public static final int notification_template_icon_bg = 2131230933;
|
||||
public static final int notification_template_icon_low_bg = 2131230934;
|
||||
public static final int notification_tile_bg = 2131230935;
|
||||
public static final int notify_panel_notification_icon_bg = 2131230936;
|
||||
|
||||
private drawable() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$id */
|
||||
public static final class id {
|
||||
public static final int accessibility_action_clickable_span = 2131361808;
|
||||
public static final int accessibility_custom_action_0 = 2131361809;
|
||||
public static final int accessibility_custom_action_1 = 2131361810;
|
||||
public static final int accessibility_custom_action_10 = 2131361811;
|
||||
public static final int accessibility_custom_action_11 = 2131361812;
|
||||
public static final int accessibility_custom_action_12 = 2131361813;
|
||||
public static final int accessibility_custom_action_13 = 2131361814;
|
||||
public static final int accessibility_custom_action_14 = 2131361815;
|
||||
public static final int accessibility_custom_action_15 = 2131361816;
|
||||
public static final int accessibility_custom_action_16 = 2131361817;
|
||||
public static final int accessibility_custom_action_17 = 2131361818;
|
||||
public static final int accessibility_custom_action_18 = 2131361819;
|
||||
public static final int accessibility_custom_action_19 = 2131361820;
|
||||
public static final int accessibility_custom_action_2 = 2131361821;
|
||||
public static final int accessibility_custom_action_20 = 2131361822;
|
||||
public static final int accessibility_custom_action_21 = 2131361823;
|
||||
public static final int accessibility_custom_action_22 = 2131361824;
|
||||
public static final int accessibility_custom_action_23 = 2131361825;
|
||||
public static final int accessibility_custom_action_24 = 2131361826;
|
||||
public static final int accessibility_custom_action_25 = 2131361827;
|
||||
public static final int accessibility_custom_action_26 = 2131361828;
|
||||
public static final int accessibility_custom_action_27 = 2131361829;
|
||||
public static final int accessibility_custom_action_28 = 2131361830;
|
||||
public static final int accessibility_custom_action_29 = 2131361831;
|
||||
public static final int accessibility_custom_action_3 = 2131361832;
|
||||
public static final int accessibility_custom_action_30 = 2131361833;
|
||||
public static final int accessibility_custom_action_31 = 2131361834;
|
||||
public static final int accessibility_custom_action_4 = 2131361835;
|
||||
public static final int accessibility_custom_action_5 = 2131361836;
|
||||
public static final int accessibility_custom_action_6 = 2131361837;
|
||||
public static final int accessibility_custom_action_7 = 2131361838;
|
||||
public static final int accessibility_custom_action_8 = 2131361839;
|
||||
public static final int accessibility_custom_action_9 = 2131361840;
|
||||
public static final int action_container = 2131361852;
|
||||
public static final int action_divider = 2131361854;
|
||||
public static final int action_image = 2131361855;
|
||||
public static final int action_text = 2131361861;
|
||||
public static final int actions = 2131361862;
|
||||
public static final int async = 2131361882;
|
||||
public static final int blocking = 2131361896;
|
||||
public static final int chronometer = 2131361941;
|
||||
public static final int dialog_button = 2131361984;
|
||||
public static final int forever = 2131362054;
|
||||
public static final int icon = 2131362076;
|
||||
public static final int icon_group = 2131362077;
|
||||
public static final int info = 2131362109;
|
||||
public static final int italic = 2131362113;
|
||||
public static final int line1 = 2131362124;
|
||||
public static final int line3 = 2131362125;
|
||||
public static final int normal = 2131362212;
|
||||
public static final int notification_background = 2131362214;
|
||||
public static final int notification_main_column = 2131362215;
|
||||
public static final int notification_main_column_container = 2131362216;
|
||||
public static final int right_icon = 2131362261;
|
||||
public static final int right_side = 2131362262;
|
||||
public static final int tag_accessibility_actions = 2131362335;
|
||||
public static final int tag_accessibility_clickable_spans = 2131362336;
|
||||
public static final int tag_accessibility_heading = 2131362337;
|
||||
public static final int tag_accessibility_pane_title = 2131362338;
|
||||
public static final int tag_screen_reader_focusable = 2131362342;
|
||||
public static final int tag_transition_group = 2131362344;
|
||||
public static final int tag_unhandled_key_event_manager = 2131362345;
|
||||
public static final int tag_unhandled_key_listeners = 2131362346;
|
||||
public static final int text = 2131362352;
|
||||
public static final int text2 = 2131362353;
|
||||
public static final int time = 2131362403;
|
||||
public static final int title = 2131362404;
|
||||
public static final int view_tree_lifecycle_owner = 2131362432;
|
||||
public static final int view_tree_saved_state_registry_owner = 2131362433;
|
||||
public static final int view_tree_view_model_store_owner = 2131362434;
|
||||
|
||||
private id() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$integer */
|
||||
public static final class integer {
|
||||
public static final int status_bar_notification_info_maxnum = 2131427356;
|
||||
|
||||
private integer() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$layout */
|
||||
public static final class layout {
|
||||
public static final int custom_dialog = 2131558464;
|
||||
public static final int notification_action = 2131558541;
|
||||
public static final int notification_action_tombstone = 2131558542;
|
||||
public static final int notification_template_custom_big = 2131558549;
|
||||
public static final int notification_template_icon_group = 2131558550;
|
||||
public static final int notification_template_part_chronometer = 2131558554;
|
||||
public static final int notification_template_part_time = 2131558555;
|
||||
|
||||
private layout() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$string */
|
||||
public static final class string {
|
||||
public static final int status_bar_notification_info_overflow = 2131886227;
|
||||
|
||||
private string() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$style */
|
||||
public static final class style {
|
||||
public static final int TextAppearance_Compat_Notification = 2131951969;
|
||||
public static final int TextAppearance_Compat_Notification_Info = 2131951970;
|
||||
public static final int TextAppearance_Compat_Notification_Line2 = 2131951972;
|
||||
public static final int TextAppearance_Compat_Notification_Time = 2131951975;
|
||||
public static final int TextAppearance_Compat_Notification_Title = 2131951977;
|
||||
public static final int Widget_Compat_NotificationActionContainer = 2131952210;
|
||||
public static final int Widget_Compat_NotificationActionText = 2131952211;
|
||||
|
||||
private style() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$styleable */
|
||||
public static final class 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 FontFamily_fontProviderSystemFontFamily = 6;
|
||||
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 = {android.R.attr.color, android.R.attr.alpha, C0572R.attr.alpha};
|
||||
public static final int[] FontFamily = {C0572R.attr.fontProviderAuthority, C0572R.attr.fontProviderCerts, C0572R.attr.fontProviderFetchStrategy, C0572R.attr.fontProviderFetchTimeout, C0572R.attr.fontProviderPackage, C0572R.attr.fontProviderQuery, C0572R.attr.fontProviderSystemFontFamily};
|
||||
public static final int[] FontFamilyFont = {android.R.attr.font, android.R.attr.fontWeight, android.R.attr.fontStyle, android.R.attr.ttcIndex, android.R.attr.fontVariationSettings, C0572R.attr.font, C0572R.attr.fontStyle, C0572R.attr.fontVariationSettings, C0572R.attr.fontWeight, C0572R.attr.ttcIndex};
|
||||
public static final int[] GradientColor = {android.R.attr.startColor, android.R.attr.endColor, android.R.attr.type, android.R.attr.centerX, android.R.attr.centerY, android.R.attr.gradientRadius, android.R.attr.tileMode, android.R.attr.centerColor, android.R.attr.startX, android.R.attr.startY, android.R.attr.endX, android.R.attr.endY};
|
||||
public static final int[] GradientColorItem = {android.R.attr.color, android.R.attr.offset};
|
||||
|
||||
private styleable() {
|
||||
}
|
||||
}
|
||||
|
||||
private C0039R() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package androidx.activity;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
interface Cancellable {
|
||||
void cancel();
|
||||
}
|
||||
@@ -0,0 +1,431 @@
|
||||
package androidx.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import androidx.activity.contextaware.ContextAware;
|
||||
import androidx.activity.contextaware.ContextAwareHelper;
|
||||
import androidx.activity.contextaware.OnContextAvailableListener;
|
||||
import androidx.activity.result.ActivityResultCallback;
|
||||
import androidx.activity.result.ActivityResultCaller;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.ActivityResultRegistry;
|
||||
import androidx.activity.result.ActivityResultRegistryOwner;
|
||||
import androidx.activity.result.IntentSenderRequest;
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.HasDefaultViewModelProviderFactory;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleEventObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.LifecycleRegistry;
|
||||
import androidx.lifecycle.ReportFragment;
|
||||
import androidx.lifecycle.SavedStateViewModelFactory;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.ViewModelStore;
|
||||
import androidx.lifecycle.ViewModelStoreOwner;
|
||||
import androidx.lifecycle.ViewTreeLifecycleOwner;
|
||||
import androidx.lifecycle.ViewTreeViewModelStoreOwner;
|
||||
import androidx.savedstate.SavedStateRegistry;
|
||||
import androidx.savedstate.SavedStateRegistryController;
|
||||
import androidx.savedstate.SavedStateRegistryOwner;
|
||||
import androidx.savedstate.ViewTreeSavedStateRegistryOwner;
|
||||
import androidx.tracing.Trace;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ComponentActivity extends androidx.core.app.ComponentActivity implements ContextAware, LifecycleOwner, ViewModelStoreOwner, HasDefaultViewModelProviderFactory, SavedStateRegistryOwner, OnBackPressedDispatcherOwner, ActivityResultRegistryOwner, ActivityResultCaller {
|
||||
private static final String ACTIVITY_RESULT_TAG = "android:support:activity-result";
|
||||
private final ActivityResultRegistry mActivityResultRegistry;
|
||||
private int mContentLayoutId;
|
||||
final ContextAwareHelper mContextAwareHelper;
|
||||
private ViewModelProvider.Factory mDefaultFactory;
|
||||
private final LifecycleRegistry mLifecycleRegistry;
|
||||
private final AtomicInteger mNextLocalRequestCode;
|
||||
private final OnBackPressedDispatcher mOnBackPressedDispatcher;
|
||||
final SavedStateRegistryController mSavedStateRegistryController;
|
||||
private ViewModelStore mViewModelStore;
|
||||
|
||||
static final class NonConfigurationInstances {
|
||||
Object custom;
|
||||
ViewModelStore viewModelStore;
|
||||
|
||||
NonConfigurationInstances() {
|
||||
}
|
||||
}
|
||||
|
||||
public ComponentActivity() {
|
||||
this.mContextAwareHelper = new ContextAwareHelper();
|
||||
this.mLifecycleRegistry = new LifecycleRegistry(this);
|
||||
this.mSavedStateRegistryController = SavedStateRegistryController.create(this);
|
||||
this.mOnBackPressedDispatcher = new OnBackPressedDispatcher(new Runnable() { // from class: androidx.activity.ComponentActivity.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
try {
|
||||
ComponentActivity.super.onBackPressed();
|
||||
} catch (IllegalStateException e) {
|
||||
if (!TextUtils.equals(e.getMessage(), "Can not perform this action after onSaveInstanceState")) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.mNextLocalRequestCode = new AtomicInteger();
|
||||
this.mActivityResultRegistry = new ActivityResultRegistry() { // from class: androidx.activity.ComponentActivity.2
|
||||
@Override // androidx.activity.result.ActivityResultRegistry
|
||||
public <I, O> void onLaunch(final int requestCode, ActivityResultContract<I, O> contract, I input, ActivityOptionsCompat options) {
|
||||
Bundle optionsBundle;
|
||||
Bundle optionsBundle2;
|
||||
ComponentActivity activity = ComponentActivity.this;
|
||||
final ActivityResultContract.SynchronousResult<O> synchronousResult = contract.getSynchronousResult(activity, input);
|
||||
if (synchronousResult != null) {
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: androidx.activity.ComponentActivity.2.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
dispatchResult(requestCode, synchronousResult.getValue());
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
Intent intent = contract.createIntent(activity, input);
|
||||
if (intent.getExtras() != null && intent.getExtras().getClassLoader() == null) {
|
||||
intent.setExtrasClassLoader(activity.getClassLoader());
|
||||
}
|
||||
if (intent.hasExtra(ActivityResultContracts.StartActivityForResult.EXTRA_ACTIVITY_OPTIONS_BUNDLE)) {
|
||||
Bundle optionsBundle3 = intent.getBundleExtra(ActivityResultContracts.StartActivityForResult.EXTRA_ACTIVITY_OPTIONS_BUNDLE);
|
||||
intent.removeExtra(ActivityResultContracts.StartActivityForResult.EXTRA_ACTIVITY_OPTIONS_BUNDLE);
|
||||
optionsBundle = optionsBundle3;
|
||||
} else if (options == null) {
|
||||
optionsBundle = null;
|
||||
} else {
|
||||
Bundle optionsBundle4 = options.toBundle();
|
||||
optionsBundle = optionsBundle4;
|
||||
}
|
||||
if (ActivityResultContracts.RequestMultiplePermissions.ACTION_REQUEST_PERMISSIONS.equals(intent.getAction())) {
|
||||
String[] permissions = intent.getStringArrayExtra(ActivityResultContracts.RequestMultiplePermissions.EXTRA_PERMISSIONS);
|
||||
if (permissions == null) {
|
||||
permissions = new String[0];
|
||||
}
|
||||
ActivityCompat.requestPermissions(activity, permissions, requestCode);
|
||||
return;
|
||||
}
|
||||
if (ActivityResultContracts.StartIntentSenderForResult.ACTION_INTENT_SENDER_REQUEST.equals(intent.getAction())) {
|
||||
IntentSenderRequest request = (IntentSenderRequest) intent.getParcelableExtra(ActivityResultContracts.StartIntentSenderForResult.EXTRA_INTENT_SENDER_REQUEST);
|
||||
try {
|
||||
optionsBundle2 = optionsBundle;
|
||||
try {
|
||||
ActivityCompat.startIntentSenderForResult(activity, request.getIntentSender(), requestCode, request.getFillInIntent(), request.getFlagsMask(), request.getFlagsValues(), 0, optionsBundle);
|
||||
} catch (IntentSender.SendIntentException e) {
|
||||
e = e;
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: androidx.activity.ComponentActivity.2.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
dispatchResult(requestCode, 0, new Intent().setAction(ActivityResultContracts.StartIntentSenderForResult.ACTION_INTENT_SENDER_REQUEST).putExtra(ActivityResultContracts.StartIntentSenderForResult.EXTRA_SEND_INTENT_EXCEPTION, e));
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
} catch (IntentSender.SendIntentException e2) {
|
||||
e = e2;
|
||||
optionsBundle2 = optionsBundle;
|
||||
}
|
||||
return;
|
||||
}
|
||||
ActivityCompat.startActivityForResult(activity, intent, requestCode, optionsBundle);
|
||||
}
|
||||
};
|
||||
Lifecycle lifecycle = getLifecycle();
|
||||
if (lifecycle == null) {
|
||||
throw new IllegalStateException("getLifecycle() returned null in ComponentActivity's constructor. Please make sure you are lazily constructing your Lifecycle in the first call to getLifecycle() rather than relying on field initialization.");
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
getLifecycle().addObserver(new LifecycleEventObserver() { // from class: androidx.activity.ComponentActivity.3
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
if (event == Lifecycle.Event.ON_STOP) {
|
||||
Window window = ComponentActivity.this.getWindow();
|
||||
View decor = window != null ? window.peekDecorView() : null;
|
||||
if (decor != null) {
|
||||
decor.cancelPendingInputEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
getLifecycle().addObserver(new LifecycleEventObserver() { // from class: androidx.activity.ComponentActivity.4
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
if (event == Lifecycle.Event.ON_DESTROY) {
|
||||
ComponentActivity.this.mContextAwareHelper.clearAvailableContext();
|
||||
if (!ComponentActivity.this.isChangingConfigurations()) {
|
||||
ComponentActivity.this.getViewModelStore().clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
getLifecycle().addObserver(new LifecycleEventObserver() { // from class: androidx.activity.ComponentActivity.5
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
ComponentActivity.this.ensureViewModelStore();
|
||||
ComponentActivity.this.getLifecycle().removeObserver(this);
|
||||
}
|
||||
});
|
||||
if (19 <= Build.VERSION.SDK_INT && Build.VERSION.SDK_INT <= 23) {
|
||||
getLifecycle().addObserver(new ImmLeaksCleaner(this));
|
||||
}
|
||||
getSavedStateRegistry().registerSavedStateProvider(ACTIVITY_RESULT_TAG, new SavedStateRegistry.SavedStateProvider() { // from class: androidx.activity.ComponentActivity.6
|
||||
@Override // androidx.savedstate.SavedStateRegistry.SavedStateProvider
|
||||
public Bundle saveState() {
|
||||
Bundle outState = new Bundle();
|
||||
ComponentActivity.this.mActivityResultRegistry.onSaveInstanceState(outState);
|
||||
return outState;
|
||||
}
|
||||
});
|
||||
addOnContextAvailableListener(new OnContextAvailableListener() { // from class: androidx.activity.ComponentActivity.7
|
||||
@Override // androidx.activity.contextaware.OnContextAvailableListener
|
||||
public void onContextAvailable(Context context) {
|
||||
Bundle savedInstanceState = ComponentActivity.this.getSavedStateRegistry().consumeRestoredStateForKey(ComponentActivity.ACTIVITY_RESULT_TAG);
|
||||
if (savedInstanceState != null) {
|
||||
ComponentActivity.this.mActivityResultRegistry.onRestoreInstanceState(savedInstanceState);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public ComponentActivity(int contentLayoutId) {
|
||||
this();
|
||||
this.mContentLayoutId = contentLayoutId;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
this.mSavedStateRegistryController.performRestore(savedInstanceState);
|
||||
this.mContextAwareHelper.dispatchOnContextAvailable(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
ReportFragment.injectIfNeededIn(this);
|
||||
int i = this.mContentLayoutId;
|
||||
if (i != 0) {
|
||||
setContentView(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
Lifecycle lifecycle = getLifecycle();
|
||||
if (lifecycle instanceof LifecycleRegistry) {
|
||||
((LifecycleRegistry) lifecycle).setCurrentState(Lifecycle.State.CREATED);
|
||||
}
|
||||
super.onSaveInstanceState(outState);
|
||||
this.mSavedStateRegistryController.performSave(outState);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public final Object onRetainNonConfigurationInstance() {
|
||||
NonConfigurationInstances nc;
|
||||
Object custom = onRetainCustomNonConfigurationInstance();
|
||||
ViewModelStore viewModelStore = this.mViewModelStore;
|
||||
if (viewModelStore == null && (nc = (NonConfigurationInstances) getLastNonConfigurationInstance()) != null) {
|
||||
viewModelStore = nc.viewModelStore;
|
||||
}
|
||||
if (viewModelStore == null && custom == null) {
|
||||
return null;
|
||||
}
|
||||
NonConfigurationInstances nci = new NonConfigurationInstances();
|
||||
nci.custom = custom;
|
||||
nci.viewModelStore = viewModelStore;
|
||||
return nci;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Object onRetainCustomNonConfigurationInstance() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Object getLastCustomNonConfigurationInstance() {
|
||||
NonConfigurationInstances nc = (NonConfigurationInstances) getLastNonConfigurationInstance();
|
||||
if (nc != null) {
|
||||
return nc.custom;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void setContentView(int layoutResID) {
|
||||
initViewTreeOwners();
|
||||
super.setContentView(layoutResID);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void setContentView(View view) {
|
||||
initViewTreeOwners();
|
||||
super.setContentView(view);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void setContentView(View view, ViewGroup.LayoutParams params) {
|
||||
initViewTreeOwners();
|
||||
super.setContentView(view, params);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void addContentView(View view, ViewGroup.LayoutParams params) {
|
||||
initViewTreeOwners();
|
||||
super.addContentView(view, params);
|
||||
}
|
||||
|
||||
private void initViewTreeOwners() {
|
||||
ViewTreeLifecycleOwner.set(getWindow().getDecorView(), this);
|
||||
ViewTreeViewModelStoreOwner.set(getWindow().getDecorView(), this);
|
||||
ViewTreeSavedStateRegistryOwner.set(getWindow().getDecorView(), this);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.contextaware.ContextAware
|
||||
public Context peekAvailableContext() {
|
||||
return this.mContextAwareHelper.peekAvailableContext();
|
||||
}
|
||||
|
||||
@Override // androidx.activity.contextaware.ContextAware
|
||||
public final void addOnContextAvailableListener(OnContextAvailableListener listener) {
|
||||
this.mContextAwareHelper.addOnContextAvailableListener(listener);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.contextaware.ContextAware
|
||||
public final void removeOnContextAvailableListener(OnContextAvailableListener listener) {
|
||||
this.mContextAwareHelper.removeOnContextAvailableListener(listener);
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ComponentActivity, androidx.lifecycle.LifecycleOwner
|
||||
public Lifecycle getLifecycle() {
|
||||
return this.mLifecycleRegistry;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelStoreOwner
|
||||
public ViewModelStore getViewModelStore() {
|
||||
if (getApplication() == null) {
|
||||
throw new IllegalStateException("Your activity is not yet attached to the Application instance. You can't request ViewModel before onCreate call.");
|
||||
}
|
||||
ensureViewModelStore();
|
||||
return this.mViewModelStore;
|
||||
}
|
||||
|
||||
void ensureViewModelStore() {
|
||||
if (this.mViewModelStore == null) {
|
||||
NonConfigurationInstances nc = (NonConfigurationInstances) getLastNonConfigurationInstance();
|
||||
if (nc != null) {
|
||||
this.mViewModelStore = nc.viewModelStore;
|
||||
}
|
||||
if (this.mViewModelStore == null) {
|
||||
this.mViewModelStore = new ViewModelStore();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.HasDefaultViewModelProviderFactory
|
||||
public ViewModelProvider.Factory getDefaultViewModelProviderFactory() {
|
||||
if (getApplication() == null) {
|
||||
throw new IllegalStateException("Your activity is not yet attached to the Application instance. You can't request ViewModel before onCreate call.");
|
||||
}
|
||||
if (this.mDefaultFactory == null) {
|
||||
this.mDefaultFactory = new SavedStateViewModelFactory(getApplication(), this, getIntent() != null ? getIntent().getExtras() : null);
|
||||
}
|
||||
return this.mDefaultFactory;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void onBackPressed() {
|
||||
this.mOnBackPressedDispatcher.onBackPressed();
|
||||
}
|
||||
|
||||
@Override // androidx.activity.OnBackPressedDispatcherOwner
|
||||
public final OnBackPressedDispatcher getOnBackPressedDispatcher() {
|
||||
return this.mOnBackPressedDispatcher;
|
||||
}
|
||||
|
||||
@Override // androidx.savedstate.SavedStateRegistryOwner
|
||||
public final SavedStateRegistry getSavedStateRegistry() {
|
||||
return this.mSavedStateRegistryController.getSavedStateRegistry();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
public void startActivityForResult(Intent intent, int requestCode) {
|
||||
super.startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
|
||||
super.startActivityForResult(intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
public void startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags) throws IntentSender.SendIntentException {
|
||||
super.startIntentSenderForResult(intent, requestCode, fillInIntent, flagsMask, flagsValues, extraFlags);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
public void startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) throws IntentSender.SendIntentException {
|
||||
super.startIntentSenderForResult(intent, requestCode, fillInIntent, flagsMask, flagsValues, extraFlags, options);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (!this.mActivityResultRegistry.dispatchResult(requestCode, resultCode, data)) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||
if (!this.mActivityResultRegistry.dispatchResult(requestCode, -1, new Intent().putExtra(ActivityResultContracts.RequestMultiplePermissions.EXTRA_PERMISSIONS, permissions).putExtra(ActivityResultContracts.RequestMultiplePermissions.EXTRA_PERMISSION_GRANT_RESULTS, grantResults)) && Build.VERSION.SDK_INT >= 23) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultCaller
|
||||
public final <I, O> ActivityResultLauncher<I> registerForActivityResult(ActivityResultContract<I, O> contract, ActivityResultRegistry registry, ActivityResultCallback<O> callback) {
|
||||
return registry.register("activity_rq#" + this.mNextLocalRequestCode.getAndIncrement(), this, contract, callback);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultCaller
|
||||
public final <I, O> ActivityResultLauncher<I> registerForActivityResult(ActivityResultContract<I, O> contract, ActivityResultCallback<O> callback) {
|
||||
return registerForActivityResult(contract, this.mActivityResultRegistry, callback);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultRegistryOwner
|
||||
public final ActivityResultRegistry getActivityResultRegistry() {
|
||||
return this.mActivityResultRegistry;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void reportFullyDrawn() {
|
||||
try {
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.beginSection("reportFullyDrawn() for " + getComponentName());
|
||||
}
|
||||
if (Build.VERSION.SDK_INT > 19) {
|
||||
super.reportFullyDrawn();
|
||||
} else if (Build.VERSION.SDK_INT == 19 && ContextCompat.checkSelfPermission(this, "android.permission.UPDATE_DEVICE_STATS") == 0) {
|
||||
super.reportFullyDrawn();
|
||||
}
|
||||
} finally {
|
||||
Trace.endSection();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package androidx.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleEventObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class ImmLeaksCleaner implements LifecycleEventObserver {
|
||||
private static final int INIT_FAILED = 2;
|
||||
private static final int INIT_SUCCESS = 1;
|
||||
private static final int NOT_INITIALIAZED = 0;
|
||||
private static Field sHField;
|
||||
private static Field sNextServedViewField;
|
||||
private static int sReflectedFieldsInitialized = 0;
|
||||
private static Field sServedViewField;
|
||||
private Activity mActivity;
|
||||
|
||||
ImmLeaksCleaner(Activity activity) {
|
||||
this.mActivity = activity;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
if (event != Lifecycle.Event.ON_DESTROY) {
|
||||
return;
|
||||
}
|
||||
if (sReflectedFieldsInitialized == 0) {
|
||||
initializeReflectiveFields();
|
||||
}
|
||||
if (sReflectedFieldsInitialized == 1) {
|
||||
InputMethodManager inputMethodManager = (InputMethodManager) this.mActivity.getSystemService("input_method");
|
||||
try {
|
||||
Object lock = sHField.get(inputMethodManager);
|
||||
if (lock == null) {
|
||||
return;
|
||||
}
|
||||
synchronized (lock) {
|
||||
try {
|
||||
try {
|
||||
View servedView = (View) sServedViewField.get(inputMethodManager);
|
||||
if (servedView == null) {
|
||||
return;
|
||||
}
|
||||
if (servedView.isAttachedToWindow()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
sNextServedViewField.set(inputMethodManager, null);
|
||||
inputMethodManager.isActive();
|
||||
} catch (IllegalAccessException e) {
|
||||
}
|
||||
} catch (ClassCastException e2) {
|
||||
} catch (IllegalAccessException e3) {
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException e4) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void initializeReflectiveFields() {
|
||||
try {
|
||||
sReflectedFieldsInitialized = 2;
|
||||
Field declaredField = InputMethodManager.class.getDeclaredField("mServedView");
|
||||
sServedViewField = declaredField;
|
||||
declaredField.setAccessible(true);
|
||||
Field declaredField2 = InputMethodManager.class.getDeclaredField("mNextServedView");
|
||||
sNextServedViewField = declaredField2;
|
||||
declaredField2.setAccessible(true);
|
||||
Field declaredField3 = InputMethodManager.class.getDeclaredField("mH");
|
||||
sHField = declaredField3;
|
||||
declaredField3.setAccessible(true);
|
||||
sReflectedFieldsInitialized = 1;
|
||||
} catch (NoSuchFieldException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package androidx.activity;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class OnBackPressedCallback {
|
||||
private CopyOnWriteArrayList<Cancellable> mCancellables = new CopyOnWriteArrayList<>();
|
||||
private boolean mEnabled;
|
||||
|
||||
public abstract void handleOnBackPressed();
|
||||
|
||||
public OnBackPressedCallback(boolean enabled) {
|
||||
this.mEnabled = enabled;
|
||||
}
|
||||
|
||||
public final void setEnabled(boolean enabled) {
|
||||
this.mEnabled = enabled;
|
||||
}
|
||||
|
||||
public final boolean isEnabled() {
|
||||
return this.mEnabled;
|
||||
}
|
||||
|
||||
public final void remove() {
|
||||
Iterator<Cancellable> it = this.mCancellables.iterator();
|
||||
while (it.hasNext()) {
|
||||
Cancellable cancellable = it.next();
|
||||
cancellable.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
void addCancellable(Cancellable cancellable) {
|
||||
this.mCancellables.add(cancellable);
|
||||
}
|
||||
|
||||
void removeCancellable(Cancellable cancellable) {
|
||||
this.mCancellables.remove(cancellable);
|
||||
}
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package androidx.activity;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleEventObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class OnBackPressedDispatcher {
|
||||
private final Runnable mFallbackOnBackPressed;
|
||||
final ArrayDeque<OnBackPressedCallback> mOnBackPressedCallbacks;
|
||||
|
||||
public OnBackPressedDispatcher() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public OnBackPressedDispatcher(Runnable fallbackOnBackPressed) {
|
||||
this.mOnBackPressedCallbacks = new ArrayDeque<>();
|
||||
this.mFallbackOnBackPressed = fallbackOnBackPressed;
|
||||
}
|
||||
|
||||
public void addCallback(OnBackPressedCallback onBackPressedCallback) {
|
||||
addCancellableCallback(onBackPressedCallback);
|
||||
}
|
||||
|
||||
Cancellable addCancellableCallback(OnBackPressedCallback onBackPressedCallback) {
|
||||
this.mOnBackPressedCallbacks.add(onBackPressedCallback);
|
||||
OnBackPressedCancellable cancellable = new OnBackPressedCancellable(onBackPressedCallback);
|
||||
onBackPressedCallback.addCancellable(cancellable);
|
||||
return cancellable;
|
||||
}
|
||||
|
||||
public void addCallback(LifecycleOwner owner, OnBackPressedCallback onBackPressedCallback) {
|
||||
Lifecycle lifecycle = owner.getLifecycle();
|
||||
if (lifecycle.getCurrentState() == Lifecycle.State.DESTROYED) {
|
||||
return;
|
||||
}
|
||||
onBackPressedCallback.addCancellable(new LifecycleOnBackPressedCancellable(lifecycle, onBackPressedCallback));
|
||||
}
|
||||
|
||||
public boolean hasEnabledCallbacks() {
|
||||
Iterator<OnBackPressedCallback> iterator = this.mOnBackPressedCallbacks.descendingIterator();
|
||||
while (iterator.hasNext()) {
|
||||
if (iterator.next().isEnabled()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onBackPressed() {
|
||||
Iterator<OnBackPressedCallback> iterator = this.mOnBackPressedCallbacks.descendingIterator();
|
||||
while (iterator.hasNext()) {
|
||||
OnBackPressedCallback callback = iterator.next();
|
||||
if (callback.isEnabled()) {
|
||||
callback.handleOnBackPressed();
|
||||
return;
|
||||
}
|
||||
}
|
||||
Runnable runnable = this.mFallbackOnBackPressed;
|
||||
if (runnable != null) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
private class OnBackPressedCancellable implements Cancellable {
|
||||
private final OnBackPressedCallback mOnBackPressedCallback;
|
||||
|
||||
OnBackPressedCancellable(OnBackPressedCallback onBackPressedCallback) {
|
||||
this.mOnBackPressedCallback = onBackPressedCallback;
|
||||
}
|
||||
|
||||
@Override // androidx.activity.Cancellable
|
||||
public void cancel() {
|
||||
OnBackPressedDispatcher.this.mOnBackPressedCallbacks.remove(this.mOnBackPressedCallback);
|
||||
this.mOnBackPressedCallback.removeCancellable(this);
|
||||
}
|
||||
}
|
||||
|
||||
private class LifecycleOnBackPressedCancellable implements LifecycleEventObserver, Cancellable {
|
||||
private Cancellable mCurrentCancellable;
|
||||
private final Lifecycle mLifecycle;
|
||||
private final OnBackPressedCallback mOnBackPressedCallback;
|
||||
|
||||
LifecycleOnBackPressedCancellable(Lifecycle lifecycle, OnBackPressedCallback onBackPressedCallback) {
|
||||
this.mLifecycle = lifecycle;
|
||||
this.mOnBackPressedCallback = onBackPressedCallback;
|
||||
lifecycle.addObserver(this);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
if (event == Lifecycle.Event.ON_START) {
|
||||
this.mCurrentCancellable = OnBackPressedDispatcher.this.addCancellableCallback(this.mOnBackPressedCallback);
|
||||
return;
|
||||
}
|
||||
if (event == Lifecycle.Event.ON_STOP) {
|
||||
Cancellable cancellable = this.mCurrentCancellable;
|
||||
if (cancellable != null) {
|
||||
cancellable.cancel();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (event == Lifecycle.Event.ON_DESTROY) {
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.activity.Cancellable
|
||||
public void cancel() {
|
||||
this.mLifecycle.removeObserver(this);
|
||||
this.mOnBackPressedCallback.removeCancellable(this);
|
||||
Cancellable cancellable = this.mCurrentCancellable;
|
||||
if (cancellable != null) {
|
||||
cancellable.cancel();
|
||||
this.mCurrentCancellable = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package androidx.activity;
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface OnBackPressedDispatcherOwner extends LifecycleOwner {
|
||||
OnBackPressedDispatcher getOnBackPressedDispatcher();
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package androidx.activity.contextaware;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ContextAware {
|
||||
void addOnContextAvailableListener(OnContextAvailableListener onContextAvailableListener);
|
||||
|
||||
Context peekAvailableContext();
|
||||
|
||||
void removeOnContextAvailableListener(OnContextAvailableListener onContextAvailableListener);
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package androidx.activity.contextaware;
|
||||
|
||||
import android.content.Context;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ContextAwareHelper {
|
||||
private volatile Context mContext;
|
||||
private final Set<OnContextAvailableListener> mListeners = new CopyOnWriteArraySet();
|
||||
|
||||
public Context peekAvailableContext() {
|
||||
return this.mContext;
|
||||
}
|
||||
|
||||
public void addOnContextAvailableListener(OnContextAvailableListener listener) {
|
||||
if (this.mContext != null) {
|
||||
listener.onContextAvailable(this.mContext);
|
||||
}
|
||||
this.mListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeOnContextAvailableListener(OnContextAvailableListener listener) {
|
||||
this.mListeners.remove(listener);
|
||||
}
|
||||
|
||||
public void dispatchOnContextAvailable(Context context) {
|
||||
this.mContext = context;
|
||||
for (OnContextAvailableListener listener : this.mListeners) {
|
||||
listener.onContextAvailable(context);
|
||||
}
|
||||
}
|
||||
|
||||
public void clearAvailableContext() {
|
||||
this.mContext = null;
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package androidx.activity.contextaware;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface OnContextAvailableListener {
|
||||
void onContextAvailable(Context context);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ActivityResult implements Parcelable {
|
||||
public static final Parcelable.Creator<ActivityResult> CREATOR = new Parcelable.Creator<ActivityResult>() { // from class: androidx.activity.result.ActivityResult.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ActivityResult createFromParcel(Parcel in) {
|
||||
return new ActivityResult(in);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ActivityResult[] newArray(int size) {
|
||||
return new ActivityResult[size];
|
||||
}
|
||||
};
|
||||
private final Intent mData;
|
||||
private final int mResultCode;
|
||||
|
||||
public ActivityResult(int resultCode, Intent data) {
|
||||
this.mResultCode = resultCode;
|
||||
this.mData = data;
|
||||
}
|
||||
|
||||
ActivityResult(Parcel in) {
|
||||
this.mResultCode = in.readInt();
|
||||
this.mData = in.readInt() == 0 ? null : (Intent) Intent.CREATOR.createFromParcel(in);
|
||||
}
|
||||
|
||||
public int getResultCode() {
|
||||
return this.mResultCode;
|
||||
}
|
||||
|
||||
public Intent getData() {
|
||||
return this.mData;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "ActivityResult{resultCode=" + resultCodeToString(this.mResultCode) + ", data=" + this.mData + '}';
|
||||
}
|
||||
|
||||
public static String resultCodeToString(int resultCode) {
|
||||
switch (resultCode) {
|
||||
case -1:
|
||||
return "RESULT_OK";
|
||||
case 0:
|
||||
return "RESULT_CANCELED";
|
||||
default:
|
||||
return String.valueOf(resultCode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(this.mResultCode);
|
||||
dest.writeInt(this.mData == null ? 0 : 1);
|
||||
Intent intent = this.mData;
|
||||
if (intent != null) {
|
||||
intent.writeToParcel(dest, flags);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ActivityResultCallback<O> {
|
||||
void onActivityResult(O o);
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ActivityResultCaller {
|
||||
<I, O> ActivityResultLauncher<I> registerForActivityResult(ActivityResultContract<I, O> activityResultContract, ActivityResultCallback<O> activityResultCallback);
|
||||
|
||||
<I, O> ActivityResultLauncher<I> registerForActivityResult(ActivityResultContract<I, O> activityResultContract, ActivityResultRegistry activityResultRegistry, ActivityResultCallback<O> activityResultCallback);
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ActivityResultLauncher<I> {
|
||||
public abstract ActivityResultContract<I, ?> getContract();
|
||||
|
||||
public abstract void launch(I i, ActivityOptionsCompat activityOptionsCompat);
|
||||
|
||||
public abstract void unregister();
|
||||
|
||||
public void launch(I input) {
|
||||
launch(input, null);
|
||||
}
|
||||
}
|
||||
+277
@@ -0,0 +1,277 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleEventObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ActivityResultRegistry {
|
||||
private static final int INITIAL_REQUEST_CODE_VALUE = 65536;
|
||||
private static final String KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS = "KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS";
|
||||
private static final String KEY_COMPONENT_ACTIVITY_PENDING_RESULTS = "KEY_COMPONENT_ACTIVITY_PENDING_RESULT";
|
||||
private static final String KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT = "KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT";
|
||||
private static final String KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS = "KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS";
|
||||
private static final String KEY_COMPONENT_ACTIVITY_REGISTERED_RCS = "KEY_COMPONENT_ACTIVITY_REGISTERED_RCS";
|
||||
private static final String LOG_TAG = "ActivityResultRegistry";
|
||||
private Random mRandom = new Random();
|
||||
private final Map<Integer, String> mRcToKey = new HashMap();
|
||||
final Map<String, Integer> mKeyToRc = new HashMap();
|
||||
private final Map<String, LifecycleContainer> mKeyToLifecycleContainers = new HashMap();
|
||||
ArrayList<String> mLaunchedKeys = new ArrayList<>();
|
||||
final transient Map<String, CallbackAndContract<?>> mKeyToCallback = new HashMap();
|
||||
final Map<String, Object> mParsedPendingResults = new HashMap();
|
||||
final Bundle mPendingResults = new Bundle();
|
||||
|
||||
public abstract <I, O> void onLaunch(int i, ActivityResultContract<I, O> activityResultContract, I i2, ActivityOptionsCompat activityOptionsCompat);
|
||||
|
||||
public final <I, O> ActivityResultLauncher<I> register(final String key, LifecycleOwner lifecycleOwner, final ActivityResultContract<I, O> contract, final ActivityResultCallback<O> callback) {
|
||||
Lifecycle lifecycle = lifecycleOwner.getLifecycle();
|
||||
if (lifecycle.getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
|
||||
throw new IllegalStateException("LifecycleOwner " + lifecycleOwner + " is attempting to register while current state is " + lifecycle.getCurrentState() + ". LifecycleOwners must call register before they are STARTED.");
|
||||
}
|
||||
final int requestCode = registerKey(key);
|
||||
LifecycleContainer lifecycleContainer = this.mKeyToLifecycleContainers.get(key);
|
||||
if (lifecycleContainer == null) {
|
||||
lifecycleContainer = new LifecycleContainer(lifecycle);
|
||||
}
|
||||
LifecycleEventObserver observer = new LifecycleEventObserver() { // from class: androidx.activity.result.ActivityResultRegistry.1
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner lifecycleOwner2, Lifecycle.Event event) {
|
||||
if (!Lifecycle.Event.ON_START.equals(event)) {
|
||||
if (Lifecycle.Event.ON_STOP.equals(event)) {
|
||||
ActivityResultRegistry.this.mKeyToCallback.remove(key);
|
||||
return;
|
||||
} else {
|
||||
if (Lifecycle.Event.ON_DESTROY.equals(event)) {
|
||||
ActivityResultRegistry.this.unregister(key);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
ActivityResultRegistry.this.mKeyToCallback.put(key, new CallbackAndContract<>(callback, contract));
|
||||
if (ActivityResultRegistry.this.mParsedPendingResults.containsKey(key)) {
|
||||
Object obj = ActivityResultRegistry.this.mParsedPendingResults.get(key);
|
||||
ActivityResultRegistry.this.mParsedPendingResults.remove(key);
|
||||
callback.onActivityResult(obj);
|
||||
}
|
||||
ActivityResult pendingResult = (ActivityResult) ActivityResultRegistry.this.mPendingResults.getParcelable(key);
|
||||
if (pendingResult != null) {
|
||||
ActivityResultRegistry.this.mPendingResults.remove(key);
|
||||
callback.onActivityResult(contract.parseResult(pendingResult.getResultCode(), pendingResult.getData()));
|
||||
}
|
||||
}
|
||||
};
|
||||
lifecycleContainer.addObserver(observer);
|
||||
this.mKeyToLifecycleContainers.put(key, lifecycleContainer);
|
||||
return new ActivityResultLauncher<I>() { // from class: androidx.activity.result.ActivityResultRegistry.2
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public void launch(I input, ActivityOptionsCompat options) {
|
||||
ActivityResultRegistry.this.mLaunchedKeys.add(key);
|
||||
Integer innerCode = ActivityResultRegistry.this.mKeyToRc.get(key);
|
||||
ActivityResultRegistry.this.onLaunch(innerCode != null ? innerCode.intValue() : requestCode, contract, input, options);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public void unregister() {
|
||||
ActivityResultRegistry.this.unregister(key);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public ActivityResultContract<I, ?> getContract() {
|
||||
return contract;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public final <I, O> ActivityResultLauncher<I> register(final String key, final ActivityResultContract<I, O> contract, ActivityResultCallback<O> activityResultCallback) {
|
||||
final int requestCode = registerKey(key);
|
||||
this.mKeyToCallback.put(key, new CallbackAndContract<>(activityResultCallback, contract));
|
||||
if (this.mParsedPendingResults.containsKey(key)) {
|
||||
Object obj = this.mParsedPendingResults.get(key);
|
||||
this.mParsedPendingResults.remove(key);
|
||||
activityResultCallback.onActivityResult(obj);
|
||||
}
|
||||
ActivityResult pendingResult = (ActivityResult) this.mPendingResults.getParcelable(key);
|
||||
if (pendingResult != null) {
|
||||
this.mPendingResults.remove(key);
|
||||
activityResultCallback.onActivityResult(contract.parseResult(pendingResult.getResultCode(), pendingResult.getData()));
|
||||
}
|
||||
return new ActivityResultLauncher<I>() { // from class: androidx.activity.result.ActivityResultRegistry.3
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public void launch(I input, ActivityOptionsCompat options) {
|
||||
ActivityResultRegistry.this.mLaunchedKeys.add(key);
|
||||
Integer innerCode = ActivityResultRegistry.this.mKeyToRc.get(key);
|
||||
ActivityResultRegistry.this.onLaunch(innerCode != null ? innerCode.intValue() : requestCode, contract, input, options);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public void unregister() {
|
||||
ActivityResultRegistry.this.unregister(key);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public ActivityResultContract<I, ?> getContract() {
|
||||
return contract;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
final void unregister(String key) {
|
||||
Integer rc;
|
||||
if (!this.mLaunchedKeys.contains(key) && (rc = this.mKeyToRc.remove(key)) != null) {
|
||||
this.mRcToKey.remove(rc);
|
||||
}
|
||||
this.mKeyToCallback.remove(key);
|
||||
if (this.mParsedPendingResults.containsKey(key)) {
|
||||
Log.w(LOG_TAG, "Dropping pending result for request " + key + ": " + this.mParsedPendingResults.get(key));
|
||||
this.mParsedPendingResults.remove(key);
|
||||
}
|
||||
if (this.mPendingResults.containsKey(key)) {
|
||||
Log.w(LOG_TAG, "Dropping pending result for request " + key + ": " + this.mPendingResults.getParcelable(key));
|
||||
this.mPendingResults.remove(key);
|
||||
}
|
||||
LifecycleContainer lifecycleContainer = this.mKeyToLifecycleContainers.get(key);
|
||||
if (lifecycleContainer != null) {
|
||||
lifecycleContainer.clearObservers();
|
||||
this.mKeyToLifecycleContainers.remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
public final void onSaveInstanceState(Bundle outState) {
|
||||
outState.putIntegerArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_RCS, new ArrayList<>(this.mKeyToRc.values()));
|
||||
outState.putStringArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS, new ArrayList<>(this.mKeyToRc.keySet()));
|
||||
outState.putStringArrayList(KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS, new ArrayList<>(this.mLaunchedKeys));
|
||||
outState.putBundle(KEY_COMPONENT_ACTIVITY_PENDING_RESULTS, (Bundle) this.mPendingResults.clone());
|
||||
outState.putSerializable(KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT, this.mRandom);
|
||||
}
|
||||
|
||||
public final void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||
if (savedInstanceState == null) {
|
||||
return;
|
||||
}
|
||||
ArrayList<Integer> rcs = savedInstanceState.getIntegerArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_RCS);
|
||||
ArrayList<String> keys = savedInstanceState.getStringArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS);
|
||||
if (keys == null || rcs == null) {
|
||||
return;
|
||||
}
|
||||
this.mLaunchedKeys = savedInstanceState.getStringArrayList(KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS);
|
||||
this.mRandom = (Random) savedInstanceState.getSerializable(KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT);
|
||||
this.mPendingResults.putAll(savedInstanceState.getBundle(KEY_COMPONENT_ACTIVITY_PENDING_RESULTS));
|
||||
for (int i = 0; i < keys.size(); i++) {
|
||||
String key = keys.get(i);
|
||||
if (this.mKeyToRc.containsKey(key)) {
|
||||
Integer newRequestCode = this.mKeyToRc.remove(key);
|
||||
if (!this.mPendingResults.containsKey(key)) {
|
||||
this.mRcToKey.remove(newRequestCode);
|
||||
}
|
||||
}
|
||||
Integer newRequestCode2 = rcs.get(i);
|
||||
bindRcKey(newRequestCode2.intValue(), keys.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean dispatchResult(int requestCode, int resultCode, Intent data) {
|
||||
String key = this.mRcToKey.get(Integer.valueOf(requestCode));
|
||||
if (key == null) {
|
||||
return false;
|
||||
}
|
||||
this.mLaunchedKeys.remove(key);
|
||||
doDispatch(key, resultCode, data, this.mKeyToCallback.get(key));
|
||||
return true;
|
||||
}
|
||||
|
||||
public final <O> boolean dispatchResult(int requestCode, O result) {
|
||||
String key = this.mRcToKey.get(Integer.valueOf(requestCode));
|
||||
if (key == null) {
|
||||
return false;
|
||||
}
|
||||
this.mLaunchedKeys.remove(key);
|
||||
CallbackAndContract<?> callbackAndContract = this.mKeyToCallback.get(key);
|
||||
if (callbackAndContract == null || callbackAndContract.mCallback == null) {
|
||||
this.mPendingResults.remove(key);
|
||||
this.mParsedPendingResults.put(key, result);
|
||||
return true;
|
||||
}
|
||||
callbackAndContract.mCallback.onActivityResult(result);
|
||||
return true;
|
||||
}
|
||||
|
||||
private <O> void doDispatch(String key, int resultCode, Intent data, CallbackAndContract<O> callbackAndContract) {
|
||||
if (callbackAndContract != null && callbackAndContract.mCallback != null) {
|
||||
ActivityResultCallback<O> callback = callbackAndContract.mCallback;
|
||||
ActivityResultContract<?, O> contract = callbackAndContract.mContract;
|
||||
callback.onActivityResult(contract.parseResult(resultCode, data));
|
||||
} else {
|
||||
this.mParsedPendingResults.remove(key);
|
||||
this.mPendingResults.putParcelable(key, new ActivityResult(resultCode, data));
|
||||
}
|
||||
}
|
||||
|
||||
private int registerKey(String key) {
|
||||
Integer existing = this.mKeyToRc.get(key);
|
||||
if (existing != null) {
|
||||
return existing.intValue();
|
||||
}
|
||||
int rc = generateRandomNumber();
|
||||
bindRcKey(rc, key);
|
||||
return rc;
|
||||
}
|
||||
|
||||
private int generateRandomNumber() {
|
||||
int number = this.mRandom.nextInt(2147418112) + 65536;
|
||||
while (this.mRcToKey.containsKey(Integer.valueOf(number))) {
|
||||
number = this.mRandom.nextInt(2147418112) + 65536;
|
||||
}
|
||||
return number;
|
||||
}
|
||||
|
||||
private void bindRcKey(int rc, String key) {
|
||||
this.mRcToKey.put(Integer.valueOf(rc), key);
|
||||
this.mKeyToRc.put(key, Integer.valueOf(rc));
|
||||
}
|
||||
|
||||
private static class CallbackAndContract<O> {
|
||||
final ActivityResultCallback<O> mCallback;
|
||||
final ActivityResultContract<?, O> mContract;
|
||||
|
||||
CallbackAndContract(ActivityResultCallback<O> callback, ActivityResultContract<?, O> contract) {
|
||||
this.mCallback = callback;
|
||||
this.mContract = contract;
|
||||
}
|
||||
}
|
||||
|
||||
private static class LifecycleContainer {
|
||||
final Lifecycle mLifecycle;
|
||||
private final ArrayList<LifecycleEventObserver> mObservers = new ArrayList<>();
|
||||
|
||||
LifecycleContainer(Lifecycle lifecycle) {
|
||||
this.mLifecycle = lifecycle;
|
||||
}
|
||||
|
||||
void addObserver(LifecycleEventObserver observer) {
|
||||
this.mLifecycle.addObserver(observer);
|
||||
this.mObservers.add(observer);
|
||||
}
|
||||
|
||||
void clearObservers() {
|
||||
Iterator<LifecycleEventObserver> it = this.mObservers.iterator();
|
||||
while (it.hasNext()) {
|
||||
LifecycleEventObserver observer = it.next();
|
||||
this.mLifecycle.removeObserver(observer);
|
||||
}
|
||||
this.mObservers.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ActivityResultRegistryOwner {
|
||||
ActivityResultRegistry getActivityResultRegistry();
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class IntentSenderRequest implements Parcelable {
|
||||
public static final Parcelable.Creator<IntentSenderRequest> CREATOR = new Parcelable.Creator<IntentSenderRequest>() { // from class: androidx.activity.result.IntentSenderRequest.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public IntentSenderRequest createFromParcel(Parcel in) {
|
||||
return new IntentSenderRequest(in);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public IntentSenderRequest[] newArray(int size) {
|
||||
return new IntentSenderRequest[size];
|
||||
}
|
||||
};
|
||||
private final Intent mFillInIntent;
|
||||
private final int mFlagsMask;
|
||||
private final int mFlagsValues;
|
||||
private final IntentSender mIntentSender;
|
||||
|
||||
IntentSenderRequest(IntentSender intentSender, Intent intent, int flagsMask, int flagsValues) {
|
||||
this.mIntentSender = intentSender;
|
||||
this.mFillInIntent = intent;
|
||||
this.mFlagsMask = flagsMask;
|
||||
this.mFlagsValues = flagsValues;
|
||||
}
|
||||
|
||||
public IntentSender getIntentSender() {
|
||||
return this.mIntentSender;
|
||||
}
|
||||
|
||||
public Intent getFillInIntent() {
|
||||
return this.mFillInIntent;
|
||||
}
|
||||
|
||||
public int getFlagsMask() {
|
||||
return this.mFlagsMask;
|
||||
}
|
||||
|
||||
public int getFlagsValues() {
|
||||
return this.mFlagsValues;
|
||||
}
|
||||
|
||||
IntentSenderRequest(Parcel in) {
|
||||
this.mIntentSender = (IntentSender) in.readParcelable(IntentSender.class.getClassLoader());
|
||||
this.mFillInIntent = (Intent) in.readParcelable(Intent.class.getClassLoader());
|
||||
this.mFlagsMask = in.readInt();
|
||||
this.mFlagsValues = in.readInt();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeParcelable(this.mIntentSender, flags);
|
||||
dest.writeParcelable(this.mFillInIntent, flags);
|
||||
dest.writeInt(this.mFlagsMask);
|
||||
dest.writeInt(this.mFlagsValues);
|
||||
}
|
||||
|
||||
public static final class Builder {
|
||||
private Intent mFillInIntent;
|
||||
private int mFlagsMask;
|
||||
private int mFlagsValues;
|
||||
private IntentSender mIntentSender;
|
||||
|
||||
public Builder(IntentSender intentSender) {
|
||||
this.mIntentSender = intentSender;
|
||||
}
|
||||
|
||||
public Builder(PendingIntent pendingIntent) {
|
||||
this(pendingIntent.getIntentSender());
|
||||
}
|
||||
|
||||
public Builder setFillInIntent(Intent fillInIntent) {
|
||||
this.mFillInIntent = fillInIntent;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setFlags(int values, int mask) {
|
||||
this.mFlagsValues = values;
|
||||
this.mFlagsMask = mask;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentSenderRequest build() {
|
||||
return new IntentSenderRequest(this.mIntentSender, this.mFillInIntent, this.mFlagsMask, this.mFlagsValues);
|
||||
}
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package androidx.activity.result.contract;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ActivityResultContract<I, O> {
|
||||
public abstract Intent createIntent(Context context, I i);
|
||||
|
||||
public abstract O parseResult(int i, Intent intent);
|
||||
|
||||
public SynchronousResult<O> getSynchronousResult(Context context, I input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static final class SynchronousResult<T> {
|
||||
private final T mValue;
|
||||
|
||||
public SynchronousResult(T value) {
|
||||
this.mValue = value;
|
||||
}
|
||||
|
||||
public T getValue() {
|
||||
return this.mValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
+362
@@ -0,0 +1,362 @@
|
||||
package androidx.activity.result.contract;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import androidx.activity.result.ActivityResult;
|
||||
import androidx.activity.result.IntentSenderRequest;
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
import androidx.collection.ArrayMap;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ActivityResultContracts {
|
||||
private ActivityResultContracts() {
|
||||
}
|
||||
|
||||
public static final class StartActivityForResult extends ActivityResultContract<Intent, ActivityResult> {
|
||||
public static final String EXTRA_ACTIVITY_OPTIONS_BUNDLE = "androidx.activity.result.contract.extra.ACTIVITY_OPTIONS_BUNDLE";
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Intent input) {
|
||||
return input;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public ActivityResult parseResult(int resultCode, Intent intent) {
|
||||
return new ActivityResult(resultCode, intent);
|
||||
}
|
||||
}
|
||||
|
||||
public static final class StartIntentSenderForResult extends ActivityResultContract<IntentSenderRequest, ActivityResult> {
|
||||
public static final String ACTION_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.action.INTENT_SENDER_REQUEST";
|
||||
public static final String EXTRA_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.extra.INTENT_SENDER_REQUEST";
|
||||
public static final String EXTRA_SEND_INTENT_EXCEPTION = "androidx.activity.result.contract.extra.SEND_INTENT_EXCEPTION";
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, IntentSenderRequest input) {
|
||||
return new Intent(ACTION_INTENT_SENDER_REQUEST).putExtra(EXTRA_INTENT_SENDER_REQUEST, input);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public ActivityResult parseResult(int resultCode, Intent intent) {
|
||||
return new ActivityResult(resultCode, intent);
|
||||
}
|
||||
}
|
||||
|
||||
public static final class RequestMultiplePermissions extends ActivityResultContract<String[], Map<String, Boolean>> {
|
||||
public static final String ACTION_REQUEST_PERMISSIONS = "androidx.activity.result.contract.action.REQUEST_PERMISSIONS";
|
||||
public static final String EXTRA_PERMISSIONS = "androidx.activity.result.contract.extra.PERMISSIONS";
|
||||
public static final String EXTRA_PERMISSION_GRANT_RESULTS = "androidx.activity.result.contract.extra.PERMISSION_GRANT_RESULTS";
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String[] input) {
|
||||
return createIntent(input);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public ActivityResultContract.SynchronousResult<Map<String, Boolean>> getSynchronousResult(Context context, String[] input) {
|
||||
if (input == null || input.length == 0) {
|
||||
return new ActivityResultContract.SynchronousResult<>(Collections.emptyMap());
|
||||
}
|
||||
Map<String, Boolean> grantState = new ArrayMap<>();
|
||||
boolean allGranted = true;
|
||||
for (String permission : input) {
|
||||
boolean granted = ContextCompat.checkSelfPermission(context, permission) == 0;
|
||||
grantState.put(permission, Boolean.valueOf(granted));
|
||||
if (!granted) {
|
||||
allGranted = false;
|
||||
}
|
||||
}
|
||||
if (allGranted) {
|
||||
return new ActivityResultContract.SynchronousResult<>(grantState);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Map<String, Boolean> parseResult(int resultCode, Intent intent) {
|
||||
if (resultCode == -1 && intent != null) {
|
||||
String[] permissions = intent.getStringArrayExtra(EXTRA_PERMISSIONS);
|
||||
int[] grantResults = intent.getIntArrayExtra(EXTRA_PERMISSION_GRANT_RESULTS);
|
||||
if (grantResults == null || permissions == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<String, Boolean> result = new HashMap<>();
|
||||
int size = permissions.length;
|
||||
for (int i = 0; i < size; i++) {
|
||||
result.put(permissions[i], Boolean.valueOf(grantResults[i] == 0));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
static Intent createIntent(String[] input) {
|
||||
return new Intent(ACTION_REQUEST_PERMISSIONS).putExtra(EXTRA_PERMISSIONS, input);
|
||||
}
|
||||
}
|
||||
|
||||
public static final class RequestPermission extends ActivityResultContract<String, Boolean> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String input) {
|
||||
return RequestMultiplePermissions.createIntent(new String[]{input});
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Boolean parseResult(int resultCode, Intent intent) {
|
||||
int[] grantResults;
|
||||
if (intent == null || resultCode != -1 || (grantResults = intent.getIntArrayExtra(RequestMultiplePermissions.EXTRA_PERMISSION_GRANT_RESULTS)) == null || grantResults.length == 0) {
|
||||
return false;
|
||||
}
|
||||
return Boolean.valueOf(grantResults[0] == 0);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public ActivityResultContract.SynchronousResult<Boolean> getSynchronousResult(Context context, String input) {
|
||||
if (input == null) {
|
||||
return new ActivityResultContract.SynchronousResult<>(false);
|
||||
}
|
||||
if (ContextCompat.checkSelfPermission(context, input) == 0) {
|
||||
return new ActivityResultContract.SynchronousResult<>(true);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static class TakePicturePreview extends ActivityResultContract<Void, Bitmap> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Void input) {
|
||||
return new Intent("android.media.action.IMAGE_CAPTURE");
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Bitmap> getSynchronousResult(Context context, Void input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Bitmap parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return (Bitmap) intent.getParcelableExtra("data");
|
||||
}
|
||||
}
|
||||
|
||||
public static class TakePicture extends ActivityResultContract<Uri, Boolean> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Uri input) {
|
||||
return new Intent("android.media.action.IMAGE_CAPTURE").putExtra("output", input);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Boolean> getSynchronousResult(Context context, Uri input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Boolean parseResult(int resultCode, Intent intent) {
|
||||
return Boolean.valueOf(resultCode == -1);
|
||||
}
|
||||
}
|
||||
|
||||
public static class TakeVideo extends ActivityResultContract<Uri, Bitmap> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Uri input) {
|
||||
return new Intent("android.media.action.VIDEO_CAPTURE").putExtra("output", input);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Bitmap> getSynchronousResult(Context context, Uri input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Bitmap parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return (Bitmap) intent.getParcelableExtra("data");
|
||||
}
|
||||
}
|
||||
|
||||
public static final class PickContact extends ActivityResultContract<Void, Uri> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Void input) {
|
||||
return new Intent("android.intent.action.PICK").setType("vnd.android.cursor.dir/contact");
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Uri parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return intent.getData();
|
||||
}
|
||||
}
|
||||
|
||||
public static class GetContent extends ActivityResultContract<String, Uri> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String input) {
|
||||
return new Intent("android.intent.action.GET_CONTENT").addCategory("android.intent.category.OPENABLE").setType(input);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, String input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Uri parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return intent.getData();
|
||||
}
|
||||
}
|
||||
|
||||
public static class GetMultipleContents extends ActivityResultContract<String, List<Uri>> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String input) {
|
||||
return new Intent("android.intent.action.GET_CONTENT").addCategory("android.intent.category.OPENABLE").setType(input).putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<List<Uri>> getSynchronousResult(Context context, String input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final List<Uri> parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getClipDataUris(intent);
|
||||
}
|
||||
|
||||
static List<Uri> getClipDataUris(Intent intent) {
|
||||
LinkedHashSet<Uri> resultSet = new LinkedHashSet<>();
|
||||
if (intent.getData() != null) {
|
||||
resultSet.add(intent.getData());
|
||||
}
|
||||
ClipData clipData = intent.getClipData();
|
||||
if (clipData == null && resultSet.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (clipData != null) {
|
||||
for (int i = 0; i < clipData.getItemCount(); i++) {
|
||||
Uri uri = clipData.getItemAt(i).getUri();
|
||||
if (uri != null) {
|
||||
resultSet.add(uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList(resultSet);
|
||||
}
|
||||
}
|
||||
|
||||
public static class OpenDocument extends ActivityResultContract<String[], Uri> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String[] input) {
|
||||
return new Intent("android.intent.action.OPEN_DOCUMENT").putExtra("android.intent.extra.MIME_TYPES", input).setType("*/*");
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, String[] input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Uri parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return intent.getData();
|
||||
}
|
||||
}
|
||||
|
||||
public static class OpenMultipleDocuments extends ActivityResultContract<String[], List<Uri>> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String[] input) {
|
||||
return new Intent("android.intent.action.OPEN_DOCUMENT").putExtra("android.intent.extra.MIME_TYPES", input).putExtra("android.intent.extra.ALLOW_MULTIPLE", true).setType("*/*");
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<List<Uri>> getSynchronousResult(Context context, String[] input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final List<Uri> parseResult(int resultCode, Intent intent) {
|
||||
if (resultCode != -1 || intent == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return GetMultipleContents.getClipDataUris(intent);
|
||||
}
|
||||
}
|
||||
|
||||
public static class OpenDocumentTree extends ActivityResultContract<Uri, Uri> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Uri input) {
|
||||
Intent intent = new Intent("android.intent.action.OPEN_DOCUMENT_TREE");
|
||||
if (Build.VERSION.SDK_INT >= 26 && input != null) {
|
||||
intent.putExtra("android.provider.extra.INITIAL_URI", input);
|
||||
}
|
||||
return intent;
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, Uri input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Uri parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return intent.getData();
|
||||
}
|
||||
}
|
||||
|
||||
public static class CreateDocument extends ActivityResultContract<String, Uri> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String input) {
|
||||
return new Intent("android.intent.action.CREATE_DOCUMENT").setType("*/*").putExtra("android.intent.extra.TITLE", input);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, String input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Uri parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return intent.getData();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface AnimRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface AnimatorRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface AnyRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.PARAMETER})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface AnyThread {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ArrayRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface AttrRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.PARAMETER})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface BinderThread {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface BoolRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface CallSuper {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface CheckResult {
|
||||
String suggest() default "";
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.FIELD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ChecksSdkIntAtLeast {
|
||||
int api() default -1;
|
||||
|
||||
String codename() default "";
|
||||
|
||||
int lambda() default -1;
|
||||
|
||||
int parameter() default -1;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.LOCAL_VARIABLE, ElementType.FIELD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ColorInt {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.LOCAL_VARIABLE, ElementType.FIELD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ColorLong {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ColorRes {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.CONSTRUCTOR})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ContentView {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface DimenRes {
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface Dimension {
|
||||
|
||||
/* renamed from: DP */
|
||||
public static final int f0DP = 0;
|
||||
|
||||
/* renamed from: PX */
|
||||
public static final int f1PX = 1;
|
||||
|
||||
/* renamed from: SP */
|
||||
public static final int f2SP = 2;
|
||||
|
||||
int unit() default 1;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface DoNotInline {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface DrawableRes {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface FloatRange {
|
||||
double from() default Double.NEGATIVE_INFINITY;
|
||||
|
||||
boolean fromInclusive() default true;
|
||||
|
||||
/* renamed from: to */
|
||||
double m0to() default Double.POSITIVE_INFINITY;
|
||||
|
||||
boolean toInclusive() default true;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface FontRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface FractionRes {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.FIELD, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface GuardedBy {
|
||||
String value();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.LOCAL_VARIABLE, ElementType.FIELD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface HalfFloat {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface IdRes {
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface InspectableProperty {
|
||||
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface EnumEntry {
|
||||
String name();
|
||||
|
||||
int value();
|
||||
}
|
||||
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface FlagEntry {
|
||||
int mask() default 0;
|
||||
|
||||
String name();
|
||||
|
||||
int target();
|
||||
}
|
||||
|
||||
public enum ValueType {
|
||||
NONE,
|
||||
INFERRED,
|
||||
INT_ENUM,
|
||||
INT_FLAG,
|
||||
COLOR,
|
||||
GRAVITY,
|
||||
RESOURCE_ID
|
||||
}
|
||||
|
||||
int attributeId() default 0;
|
||||
|
||||
EnumEntry[] enumMapping() default {};
|
||||
|
||||
FlagEntry[] flagMapping() default {};
|
||||
|
||||
boolean hasAttributeId() default true;
|
||||
|
||||
String name() default "";
|
||||
|
||||
ValueType valueType() default ValueType.INFERRED;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface IntDef {
|
||||
boolean flag() default false;
|
||||
|
||||
boolean open() default false;
|
||||
|
||||
int[] value() default {};
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface IntRange {
|
||||
long from() default Long.MIN_VALUE;
|
||||
|
||||
/* renamed from: to */
|
||||
long m1to() default Long.MAX_VALUE;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface IntegerRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface InterpolatorRes {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PACKAGE, ElementType.TYPE, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface Keep {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface LayoutRes {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface LongDef {
|
||||
boolean flag() default false;
|
||||
|
||||
boolean open() default false;
|
||||
|
||||
long[] value() default {};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.PARAMETER})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface MainThread {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface MenuRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface NavigationRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE, ElementType.PACKAGE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface NonNull {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE, ElementType.PACKAGE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface Nullable {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface PluralsRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface Px {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface RawRes {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.PACKAGE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface RequiresApi {
|
||||
int api() default 1;
|
||||
|
||||
int value() default 1;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface RequiresFeature {
|
||||
String enforcement();
|
||||
|
||||
String name();
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.PARAMETER})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface RequiresPermission {
|
||||
|
||||
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
|
||||
public @interface Read {
|
||||
RequiresPermission value() default @RequiresPermission;
|
||||
}
|
||||
|
||||
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
|
||||
public @interface Write {
|
||||
RequiresPermission value() default @RequiresPermission;
|
||||
}
|
||||
|
||||
String[] allOf() default {};
|
||||
|
||||
String[] anyOf() default {};
|
||||
|
||||
boolean conditional() default false;
|
||||
|
||||
String value() default "";
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.PACKAGE})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface RestrictTo {
|
||||
|
||||
public enum Scope {
|
||||
LIBRARY,
|
||||
LIBRARY_GROUP,
|
||||
LIBRARY_GROUP_PREFIX,
|
||||
GROUP_ID,
|
||||
TESTS,
|
||||
SUBCLASSES
|
||||
}
|
||||
|
||||
Scope[] value();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface Size {
|
||||
long max() default Long.MAX_VALUE;
|
||||
|
||||
long min() default Long.MIN_VALUE;
|
||||
|
||||
long multiple() default 1;
|
||||
|
||||
long value() default -1;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface StringDef {
|
||||
boolean open() default false;
|
||||
|
||||
String[] value() default {};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface StringRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface StyleRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface StyleableRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface TransitionRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.PARAMETER})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface UiThread {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface VisibleForTesting {
|
||||
public static final int NONE = 5;
|
||||
public static final int PACKAGE_PRIVATE = 3;
|
||||
public static final int PRIVATE = 2;
|
||||
public static final int PROTECTED = 4;
|
||||
|
||||
int otherwise() default 2;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.PARAMETER})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface WorkerThread {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface XmlRes {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package androidx.annotation.experimental;
|
||||
|
||||
/* renamed from: androidx.annotation.experimental.R */
|
||||
/* loaded from: classes2.dex */
|
||||
public final class C0045R {
|
||||
private C0045R() {
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package androidx.annotation.experimental;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface Experimental {
|
||||
|
||||
public enum Level {
|
||||
WARNING,
|
||||
ERROR
|
||||
}
|
||||
|
||||
Level level() default Level.ERROR;
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package androidx.annotation.experimental;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.PACKAGE})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface UseExperimental {
|
||||
Class<?> markerClass();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,359 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.SpinnerAdapter;
|
||||
import androidx.appcompat.C0046R;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ActionBar {
|
||||
public static final int DISPLAY_HOME_AS_UP = 4;
|
||||
public static final int DISPLAY_SHOW_CUSTOM = 16;
|
||||
public static final int DISPLAY_SHOW_HOME = 2;
|
||||
public static final int DISPLAY_SHOW_TITLE = 8;
|
||||
public static final int DISPLAY_USE_LOGO = 1;
|
||||
|
||||
@Deprecated
|
||||
public static final int NAVIGATION_MODE_LIST = 1;
|
||||
|
||||
@Deprecated
|
||||
public static final int NAVIGATION_MODE_STANDARD = 0;
|
||||
|
||||
@Deprecated
|
||||
public static final int NAVIGATION_MODE_TABS = 2;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface DisplayOptions {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface NavigationMode {
|
||||
}
|
||||
|
||||
public interface OnMenuVisibilityListener {
|
||||
void onMenuVisibilityChanged(boolean z);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public interface OnNavigationListener {
|
||||
boolean onNavigationItemSelected(int i, long j);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static abstract class Tab {
|
||||
public static final int INVALID_POSITION = -1;
|
||||
|
||||
public abstract CharSequence getContentDescription();
|
||||
|
||||
public abstract View getCustomView();
|
||||
|
||||
public abstract Drawable getIcon();
|
||||
|
||||
public abstract int getPosition();
|
||||
|
||||
public abstract Object getTag();
|
||||
|
||||
public abstract CharSequence getText();
|
||||
|
||||
public abstract void select();
|
||||
|
||||
public abstract Tab setContentDescription(int i);
|
||||
|
||||
public abstract Tab setContentDescription(CharSequence charSequence);
|
||||
|
||||
public abstract Tab setCustomView(int i);
|
||||
|
||||
public abstract Tab setCustomView(View view);
|
||||
|
||||
public abstract Tab setIcon(int i);
|
||||
|
||||
public abstract Tab setIcon(Drawable drawable);
|
||||
|
||||
public abstract Tab setTabListener(TabListener tabListener);
|
||||
|
||||
public abstract Tab setTag(Object obj);
|
||||
|
||||
public abstract Tab setText(int i);
|
||||
|
||||
public abstract Tab setText(CharSequence charSequence);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public interface TabListener {
|
||||
void onTabReselected(Tab tab, FragmentTransaction fragmentTransaction);
|
||||
|
||||
void onTabSelected(Tab tab, FragmentTransaction fragmentTransaction);
|
||||
|
||||
void onTabUnselected(Tab tab, FragmentTransaction fragmentTransaction);
|
||||
}
|
||||
|
||||
public abstract void addOnMenuVisibilityListener(OnMenuVisibilityListener onMenuVisibilityListener);
|
||||
|
||||
@Deprecated
|
||||
public abstract void addTab(Tab tab);
|
||||
|
||||
@Deprecated
|
||||
public abstract void addTab(Tab tab, int i);
|
||||
|
||||
@Deprecated
|
||||
public abstract void addTab(Tab tab, int i, boolean z);
|
||||
|
||||
@Deprecated
|
||||
public abstract void addTab(Tab tab, boolean z);
|
||||
|
||||
public abstract View getCustomView();
|
||||
|
||||
public abstract int getDisplayOptions();
|
||||
|
||||
public abstract int getHeight();
|
||||
|
||||
@Deprecated
|
||||
public abstract int getNavigationItemCount();
|
||||
|
||||
@Deprecated
|
||||
public abstract int getNavigationMode();
|
||||
|
||||
@Deprecated
|
||||
public abstract int getSelectedNavigationIndex();
|
||||
|
||||
@Deprecated
|
||||
public abstract Tab getSelectedTab();
|
||||
|
||||
public abstract CharSequence getSubtitle();
|
||||
|
||||
@Deprecated
|
||||
public abstract Tab getTabAt(int i);
|
||||
|
||||
@Deprecated
|
||||
public abstract int getTabCount();
|
||||
|
||||
public abstract CharSequence getTitle();
|
||||
|
||||
public abstract void hide();
|
||||
|
||||
public abstract boolean isShowing();
|
||||
|
||||
@Deprecated
|
||||
public abstract Tab newTab();
|
||||
|
||||
@Deprecated
|
||||
public abstract void removeAllTabs();
|
||||
|
||||
public abstract void removeOnMenuVisibilityListener(OnMenuVisibilityListener onMenuVisibilityListener);
|
||||
|
||||
@Deprecated
|
||||
public abstract void removeTab(Tab tab);
|
||||
|
||||
@Deprecated
|
||||
public abstract void removeTabAt(int i);
|
||||
|
||||
@Deprecated
|
||||
public abstract void selectTab(Tab tab);
|
||||
|
||||
public abstract void setBackgroundDrawable(Drawable drawable);
|
||||
|
||||
public abstract void setCustomView(int i);
|
||||
|
||||
public abstract void setCustomView(View view);
|
||||
|
||||
public abstract void setCustomView(View view, LayoutParams layoutParams);
|
||||
|
||||
public abstract void setDisplayHomeAsUpEnabled(boolean z);
|
||||
|
||||
public abstract void setDisplayOptions(int i);
|
||||
|
||||
public abstract void setDisplayOptions(int i, int i2);
|
||||
|
||||
public abstract void setDisplayShowCustomEnabled(boolean z);
|
||||
|
||||
public abstract void setDisplayShowHomeEnabled(boolean z);
|
||||
|
||||
public abstract void setDisplayShowTitleEnabled(boolean z);
|
||||
|
||||
public abstract void setDisplayUseLogoEnabled(boolean z);
|
||||
|
||||
public abstract void setIcon(int i);
|
||||
|
||||
public abstract void setIcon(Drawable drawable);
|
||||
|
||||
@Deprecated
|
||||
public abstract void setListNavigationCallbacks(SpinnerAdapter spinnerAdapter, OnNavigationListener onNavigationListener);
|
||||
|
||||
public abstract void setLogo(int i);
|
||||
|
||||
public abstract void setLogo(Drawable drawable);
|
||||
|
||||
@Deprecated
|
||||
public abstract void setNavigationMode(int i);
|
||||
|
||||
@Deprecated
|
||||
public abstract void setSelectedNavigationItem(int i);
|
||||
|
||||
public abstract void setSubtitle(int i);
|
||||
|
||||
public abstract void setSubtitle(CharSequence charSequence);
|
||||
|
||||
public abstract void setTitle(int i);
|
||||
|
||||
public abstract void setTitle(CharSequence charSequence);
|
||||
|
||||
public abstract void show();
|
||||
|
||||
public void setStackedBackgroundDrawable(Drawable d) {
|
||||
}
|
||||
|
||||
public void setSplitBackgroundDrawable(Drawable d) {
|
||||
}
|
||||
|
||||
public void setHomeButtonEnabled(boolean enabled) {
|
||||
}
|
||||
|
||||
public Context getThemedContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isTitleTruncated() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setHomeAsUpIndicator(Drawable indicator) {
|
||||
}
|
||||
|
||||
public void setHomeAsUpIndicator(int resId) {
|
||||
}
|
||||
|
||||
public void setHomeActionContentDescription(CharSequence description) {
|
||||
}
|
||||
|
||||
public void setHomeActionContentDescription(int resId) {
|
||||
}
|
||||
|
||||
public void setHideOnContentScrollEnabled(boolean hideOnContentScroll) {
|
||||
if (hideOnContentScroll) {
|
||||
throw new UnsupportedOperationException("Hide on content scroll is not supported in this action bar configuration.");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isHideOnContentScrollEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getHideOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setHideOffset(int offset) {
|
||||
if (offset != 0) {
|
||||
throw new UnsupportedOperationException("Setting an explicit action bar hide offset is not supported in this action bar configuration.");
|
||||
}
|
||||
}
|
||||
|
||||
public void setElevation(float elevation) {
|
||||
if (elevation != 0.0f) {
|
||||
throw new UnsupportedOperationException("Setting a non-zero elevation is not supported in this action bar configuration.");
|
||||
}
|
||||
}
|
||||
|
||||
public float getElevation() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public void setDefaultDisplayHomeAsUpEnabled(boolean enabled) {
|
||||
}
|
||||
|
||||
public void setShowHideAnimationEnabled(boolean enabled) {
|
||||
}
|
||||
|
||||
public void onConfigurationChanged(Configuration config) {
|
||||
}
|
||||
|
||||
public void dispatchMenuVisibilityChanged(boolean visible) {
|
||||
}
|
||||
|
||||
public ActionMode startActionMode(ActionMode.Callback callback) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean openOptionsMenu() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean closeOptionsMenu() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean invalidateOptionsMenu() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onMenuKeyEvent(KeyEvent event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onKeyShortcut(int keyCode, KeyEvent ev) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean collapseActionView() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setWindowTitle(CharSequence title) {
|
||||
}
|
||||
|
||||
boolean requestFocus() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void onDestroy() {
|
||||
}
|
||||
|
||||
public static class LayoutParams extends ViewGroup.MarginLayoutParams {
|
||||
public int gravity;
|
||||
|
||||
public LayoutParams(Context c, AttributeSet attrs) {
|
||||
super(c, attrs);
|
||||
this.gravity = 0;
|
||||
TypedArray a = c.obtainStyledAttributes(attrs, C0046R.styleable.ActionBarLayout);
|
||||
this.gravity = a.getInt(C0046R.styleable.ActionBarLayout_android_layout_gravity, 0);
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
public LayoutParams(int width, int height) {
|
||||
super(width, height);
|
||||
this.gravity = 0;
|
||||
this.gravity = 8388627;
|
||||
}
|
||||
|
||||
public LayoutParams(int width, int height, int gravity) {
|
||||
super(width, height);
|
||||
this.gravity = 0;
|
||||
this.gravity = gravity;
|
||||
}
|
||||
|
||||
public LayoutParams(int gravity) {
|
||||
this(-2, -1, gravity);
|
||||
}
|
||||
|
||||
public LayoutParams(LayoutParams source) {
|
||||
super((ViewGroup.MarginLayoutParams) source);
|
||||
this.gravity = 0;
|
||||
this.gravity = source.gravity;
|
||||
}
|
||||
|
||||
public LayoutParams(ViewGroup.LayoutParams source) {
|
||||
super(source);
|
||||
this.gravity = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+347
@@ -0,0 +1,347 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.R;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.app.ActionBarDrawerToggleHoneycomb;
|
||||
import androidx.appcompat.graphics.drawable.DrawerArrowDrawable;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.view.GravityCompat;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActionBarDrawerToggle implements DrawerLayout.DrawerListener {
|
||||
private final Delegate mActivityImpl;
|
||||
private final int mCloseDrawerContentDescRes;
|
||||
boolean mDrawerIndicatorEnabled;
|
||||
private final DrawerLayout mDrawerLayout;
|
||||
private boolean mDrawerSlideAnimationEnabled;
|
||||
private boolean mHasCustomUpIndicator;
|
||||
private Drawable mHomeAsUpIndicator;
|
||||
private final int mOpenDrawerContentDescRes;
|
||||
private DrawerArrowDrawable mSlider;
|
||||
View.OnClickListener mToolbarNavigationClickListener;
|
||||
private boolean mWarnedForDisplayHomeAsUp;
|
||||
|
||||
public interface Delegate {
|
||||
Context getActionBarThemedContext();
|
||||
|
||||
Drawable getThemeUpIndicator();
|
||||
|
||||
boolean isNavigationVisible();
|
||||
|
||||
void setActionBarDescription(int i);
|
||||
|
||||
void setActionBarUpIndicator(Drawable drawable, int i);
|
||||
}
|
||||
|
||||
public interface DelegateProvider {
|
||||
Delegate getDrawerToggleDelegate();
|
||||
}
|
||||
|
||||
public ActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, int openDrawerContentDescRes, int closeDrawerContentDescRes) {
|
||||
this(activity, null, drawerLayout, null, openDrawerContentDescRes, closeDrawerContentDescRes);
|
||||
}
|
||||
|
||||
public ActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, Toolbar toolbar, int openDrawerContentDescRes, int closeDrawerContentDescRes) {
|
||||
this(activity, toolbar, drawerLayout, null, openDrawerContentDescRes, closeDrawerContentDescRes);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
ActionBarDrawerToggle(Activity activity, Toolbar toolbar, DrawerLayout drawerLayout, DrawerArrowDrawable slider, int openDrawerContentDescRes, int closeDrawerContentDescRes) {
|
||||
this.mDrawerSlideAnimationEnabled = true;
|
||||
this.mDrawerIndicatorEnabled = true;
|
||||
this.mWarnedForDisplayHomeAsUp = false;
|
||||
if (toolbar != null) {
|
||||
this.mActivityImpl = new ToolbarCompatDelegate(toolbar);
|
||||
toolbar.setNavigationOnClickListener(new View.OnClickListener() { // from class: androidx.appcompat.app.ActionBarDrawerToggle.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View v) {
|
||||
if (ActionBarDrawerToggle.this.mDrawerIndicatorEnabled) {
|
||||
ActionBarDrawerToggle.this.toggle();
|
||||
} else if (ActionBarDrawerToggle.this.mToolbarNavigationClickListener != null) {
|
||||
ActionBarDrawerToggle.this.mToolbarNavigationClickListener.onClick(v);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (activity instanceof DelegateProvider) {
|
||||
this.mActivityImpl = ((DelegateProvider) activity).getDrawerToggleDelegate();
|
||||
} else {
|
||||
this.mActivityImpl = new FrameworkActionBarDelegate(activity);
|
||||
}
|
||||
this.mDrawerLayout = drawerLayout;
|
||||
this.mOpenDrawerContentDescRes = openDrawerContentDescRes;
|
||||
this.mCloseDrawerContentDescRes = closeDrawerContentDescRes;
|
||||
if (slider == null) {
|
||||
this.mSlider = new DrawerArrowDrawable(this.mActivityImpl.getActionBarThemedContext());
|
||||
} else {
|
||||
this.mSlider = slider;
|
||||
}
|
||||
this.mHomeAsUpIndicator = getThemeUpIndicator();
|
||||
}
|
||||
|
||||
public void syncState() {
|
||||
if (this.mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
|
||||
setPosition(1.0f);
|
||||
} else {
|
||||
setPosition(0.0f);
|
||||
}
|
||||
if (this.mDrawerIndicatorEnabled) {
|
||||
setActionBarUpIndicator(this.mSlider, this.mDrawerLayout.isDrawerOpen(GravityCompat.START) ? this.mCloseDrawerContentDescRes : this.mOpenDrawerContentDescRes);
|
||||
}
|
||||
}
|
||||
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
if (!this.mHasCustomUpIndicator) {
|
||||
this.mHomeAsUpIndicator = getThemeUpIndicator();
|
||||
}
|
||||
syncState();
|
||||
}
|
||||
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item != null && item.getItemId() == 16908332 && this.mDrawerIndicatorEnabled) {
|
||||
toggle();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void toggle() {
|
||||
int drawerLockMode = this.mDrawerLayout.getDrawerLockMode(GravityCompat.START);
|
||||
if (this.mDrawerLayout.isDrawerVisible(GravityCompat.START) && drawerLockMode != 2) {
|
||||
this.mDrawerLayout.closeDrawer(GravityCompat.START);
|
||||
} else if (drawerLockMode != 1) {
|
||||
this.mDrawerLayout.openDrawer(GravityCompat.START);
|
||||
}
|
||||
}
|
||||
|
||||
public void setHomeAsUpIndicator(Drawable indicator) {
|
||||
if (indicator == null) {
|
||||
this.mHomeAsUpIndicator = getThemeUpIndicator();
|
||||
this.mHasCustomUpIndicator = false;
|
||||
} else {
|
||||
this.mHomeAsUpIndicator = indicator;
|
||||
this.mHasCustomUpIndicator = true;
|
||||
}
|
||||
if (!this.mDrawerIndicatorEnabled) {
|
||||
setActionBarUpIndicator(this.mHomeAsUpIndicator, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void setHomeAsUpIndicator(int resId) {
|
||||
Drawable indicator = null;
|
||||
if (resId != 0) {
|
||||
indicator = this.mDrawerLayout.getResources().getDrawable(resId);
|
||||
}
|
||||
setHomeAsUpIndicator(indicator);
|
||||
}
|
||||
|
||||
public boolean isDrawerIndicatorEnabled() {
|
||||
return this.mDrawerIndicatorEnabled;
|
||||
}
|
||||
|
||||
public void setDrawerIndicatorEnabled(boolean enable) {
|
||||
if (enable != this.mDrawerIndicatorEnabled) {
|
||||
if (enable) {
|
||||
setActionBarUpIndicator(this.mSlider, this.mDrawerLayout.isDrawerOpen(GravityCompat.START) ? this.mCloseDrawerContentDescRes : this.mOpenDrawerContentDescRes);
|
||||
} else {
|
||||
setActionBarUpIndicator(this.mHomeAsUpIndicator, 0);
|
||||
}
|
||||
this.mDrawerIndicatorEnabled = enable;
|
||||
}
|
||||
}
|
||||
|
||||
public DrawerArrowDrawable getDrawerArrowDrawable() {
|
||||
return this.mSlider;
|
||||
}
|
||||
|
||||
public void setDrawerArrowDrawable(DrawerArrowDrawable drawable) {
|
||||
this.mSlider = drawable;
|
||||
syncState();
|
||||
}
|
||||
|
||||
public void setDrawerSlideAnimationEnabled(boolean enabled) {
|
||||
this.mDrawerSlideAnimationEnabled = enabled;
|
||||
if (!enabled) {
|
||||
setPosition(0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDrawerSlideAnimationEnabled() {
|
||||
return this.mDrawerSlideAnimationEnabled;
|
||||
}
|
||||
|
||||
@Override // androidx.drawerlayout.widget.DrawerLayout.DrawerListener
|
||||
public void onDrawerSlide(View drawerView, float slideOffset) {
|
||||
if (this.mDrawerSlideAnimationEnabled) {
|
||||
setPosition(Math.min(1.0f, Math.max(0.0f, slideOffset)));
|
||||
} else {
|
||||
setPosition(0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.drawerlayout.widget.DrawerLayout.DrawerListener
|
||||
public void onDrawerOpened(View drawerView) {
|
||||
setPosition(1.0f);
|
||||
if (this.mDrawerIndicatorEnabled) {
|
||||
setActionBarDescription(this.mCloseDrawerContentDescRes);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.drawerlayout.widget.DrawerLayout.DrawerListener
|
||||
public void onDrawerClosed(View drawerView) {
|
||||
setPosition(0.0f);
|
||||
if (this.mDrawerIndicatorEnabled) {
|
||||
setActionBarDescription(this.mOpenDrawerContentDescRes);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.drawerlayout.widget.DrawerLayout.DrawerListener
|
||||
public void onDrawerStateChanged(int newState) {
|
||||
}
|
||||
|
||||
public View.OnClickListener getToolbarNavigationClickListener() {
|
||||
return this.mToolbarNavigationClickListener;
|
||||
}
|
||||
|
||||
public void setToolbarNavigationClickListener(View.OnClickListener onToolbarNavigationClickListener) {
|
||||
this.mToolbarNavigationClickListener = onToolbarNavigationClickListener;
|
||||
}
|
||||
|
||||
void setActionBarUpIndicator(Drawable upDrawable, int contentDescRes) {
|
||||
if (!this.mWarnedForDisplayHomeAsUp && !this.mActivityImpl.isNavigationVisible()) {
|
||||
Log.w("ActionBarDrawerToggle", "DrawerToggle may not show up because NavigationIcon is not visible. You may need to call actionbar.setDisplayHomeAsUpEnabled(true);");
|
||||
this.mWarnedForDisplayHomeAsUp = true;
|
||||
}
|
||||
this.mActivityImpl.setActionBarUpIndicator(upDrawable, contentDescRes);
|
||||
}
|
||||
|
||||
void setActionBarDescription(int contentDescRes) {
|
||||
this.mActivityImpl.setActionBarDescription(contentDescRes);
|
||||
}
|
||||
|
||||
Drawable getThemeUpIndicator() {
|
||||
return this.mActivityImpl.getThemeUpIndicator();
|
||||
}
|
||||
|
||||
private void setPosition(float position) {
|
||||
if (position == 1.0f) {
|
||||
this.mSlider.setVerticalMirror(true);
|
||||
} else if (position == 0.0f) {
|
||||
this.mSlider.setVerticalMirror(false);
|
||||
}
|
||||
this.mSlider.setProgress(position);
|
||||
}
|
||||
|
||||
private static class FrameworkActionBarDelegate implements Delegate {
|
||||
private final Activity mActivity;
|
||||
private ActionBarDrawerToggleHoneycomb.SetIndicatorInfo mSetIndicatorInfo;
|
||||
|
||||
FrameworkActionBarDelegate(Activity activity) {
|
||||
this.mActivity = activity;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBarDrawerToggle.Delegate
|
||||
public Drawable getThemeUpIndicator() {
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
TypedArray a = getActionBarThemedContext().obtainStyledAttributes(null, new int[]{R.attr.homeAsUpIndicator}, R.attr.actionBarStyle, 0);
|
||||
Drawable result = a.getDrawable(0);
|
||||
a.recycle();
|
||||
return result;
|
||||
}
|
||||
return ActionBarDrawerToggleHoneycomb.getThemeUpIndicator(this.mActivity);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBarDrawerToggle.Delegate
|
||||
public Context getActionBarThemedContext() {
|
||||
android.app.ActionBar actionBar = this.mActivity.getActionBar();
|
||||
if (actionBar != null) {
|
||||
return actionBar.getThemedContext();
|
||||
}
|
||||
return this.mActivity;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBarDrawerToggle.Delegate
|
||||
public boolean isNavigationVisible() {
|
||||
android.app.ActionBar actionBar = this.mActivity.getActionBar();
|
||||
return (actionBar == null || (actionBar.getDisplayOptions() & 4) == 0) ? false : true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBarDrawerToggle.Delegate
|
||||
public void setActionBarUpIndicator(Drawable themeImage, int contentDescRes) {
|
||||
android.app.ActionBar actionBar = this.mActivity.getActionBar();
|
||||
if (actionBar != null) {
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
actionBar.setHomeAsUpIndicator(themeImage);
|
||||
actionBar.setHomeActionContentDescription(contentDescRes);
|
||||
} else {
|
||||
actionBar.setDisplayShowHomeEnabled(true);
|
||||
this.mSetIndicatorInfo = ActionBarDrawerToggleHoneycomb.setActionBarUpIndicator(this.mActivity, themeImage, contentDescRes);
|
||||
actionBar.setDisplayShowHomeEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBarDrawerToggle.Delegate
|
||||
public void setActionBarDescription(int contentDescRes) {
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
android.app.ActionBar actionBar = this.mActivity.getActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setHomeActionContentDescription(contentDescRes);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.mSetIndicatorInfo = ActionBarDrawerToggleHoneycomb.setActionBarDescription(this.mSetIndicatorInfo, this.mActivity, contentDescRes);
|
||||
}
|
||||
}
|
||||
|
||||
static class ToolbarCompatDelegate implements Delegate {
|
||||
final CharSequence mDefaultContentDescription;
|
||||
final Drawable mDefaultUpIndicator;
|
||||
final Toolbar mToolbar;
|
||||
|
||||
ToolbarCompatDelegate(Toolbar toolbar) {
|
||||
this.mToolbar = toolbar;
|
||||
this.mDefaultUpIndicator = toolbar.getNavigationIcon();
|
||||
this.mDefaultContentDescription = toolbar.getNavigationContentDescription();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBarDrawerToggle.Delegate
|
||||
public void setActionBarUpIndicator(Drawable upDrawable, int contentDescRes) {
|
||||
this.mToolbar.setNavigationIcon(upDrawable);
|
||||
setActionBarDescription(contentDescRes);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBarDrawerToggle.Delegate
|
||||
public void setActionBarDescription(int contentDescRes) {
|
||||
if (contentDescRes == 0) {
|
||||
this.mToolbar.setNavigationContentDescription(this.mDefaultContentDescription);
|
||||
} else {
|
||||
this.mToolbar.setNavigationContentDescription(contentDescRes);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBarDrawerToggle.Delegate
|
||||
public Drawable getThemeUpIndicator() {
|
||||
return this.mDefaultUpIndicator;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBarDrawerToggle.Delegate
|
||||
public Context getActionBarThemedContext() {
|
||||
return this.mToolbar.getContext();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBarDrawerToggle.Delegate
|
||||
public boolean isNavigationVisible() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.R;
|
||||
import android.app.Activity;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class ActionBarDrawerToggleHoneycomb {
|
||||
private static final String TAG = "ActionBarDrawerToggleHC";
|
||||
private static final int[] THEME_ATTRS = {R.attr.homeAsUpIndicator};
|
||||
|
||||
public static SetIndicatorInfo setActionBarUpIndicator(Activity activity, Drawable drawable, int contentDescRes) {
|
||||
SetIndicatorInfo info = new SetIndicatorInfo(activity);
|
||||
if (info.setHomeAsUpIndicator != null) {
|
||||
try {
|
||||
android.app.ActionBar actionBar = activity.getActionBar();
|
||||
info.setHomeAsUpIndicator.invoke(actionBar, drawable);
|
||||
info.setHomeActionContentDescription.invoke(actionBar, Integer.valueOf(contentDescRes));
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't set home-as-up indicator via JB-MR2 API", e);
|
||||
}
|
||||
} else if (info.upIndicatorView != null) {
|
||||
info.upIndicatorView.setImageDrawable(drawable);
|
||||
} else {
|
||||
Log.w(TAG, "Couldn't set home-as-up indicator");
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
public static SetIndicatorInfo setActionBarDescription(SetIndicatorInfo info, Activity activity, int contentDescRes) {
|
||||
if (info == null) {
|
||||
info = new SetIndicatorInfo(activity);
|
||||
}
|
||||
if (info.setHomeAsUpIndicator != null) {
|
||||
try {
|
||||
android.app.ActionBar actionBar = activity.getActionBar();
|
||||
info.setHomeActionContentDescription.invoke(actionBar, Integer.valueOf(contentDescRes));
|
||||
if (Build.VERSION.SDK_INT <= 19) {
|
||||
actionBar.setSubtitle(actionBar.getSubtitle());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't set content description via JB-MR2 API", e);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
public static Drawable getThemeUpIndicator(Activity activity) {
|
||||
TypedArray a = activity.obtainStyledAttributes(THEME_ATTRS);
|
||||
Drawable result = a.getDrawable(0);
|
||||
a.recycle();
|
||||
return result;
|
||||
}
|
||||
|
||||
static class SetIndicatorInfo {
|
||||
public Method setHomeActionContentDescription;
|
||||
public Method setHomeAsUpIndicator;
|
||||
public ImageView upIndicatorView;
|
||||
|
||||
SetIndicatorInfo(Activity activity) {
|
||||
try {
|
||||
this.setHomeAsUpIndicator = android.app.ActionBar.class.getDeclaredMethod("setHomeAsUpIndicator", Drawable.class);
|
||||
this.setHomeActionContentDescription = android.app.ActionBar.class.getDeclaredMethod("setHomeActionContentDescription", Integer.TYPE);
|
||||
} catch (NoSuchMethodException e) {
|
||||
View home = activity.findViewById(R.id.home);
|
||||
if (home == null) {
|
||||
return;
|
||||
}
|
||||
ViewGroup parent = (ViewGroup) home.getParent();
|
||||
int childCount = parent.getChildCount();
|
||||
if (childCount != 2) {
|
||||
return;
|
||||
}
|
||||
View first = parent.getChildAt(0);
|
||||
View second = parent.getChildAt(1);
|
||||
View up = first.getId() == 16908332 ? second : first;
|
||||
if (up instanceof ImageView) {
|
||||
this.upIndicatorView = (ImageView) up;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ActionBarDrawerToggleHoneycomb() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,881 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.res.TypedArray;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewParent;
|
||||
import android.view.ViewStub;
|
||||
import android.view.Window;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckedTextView;
|
||||
import android.widget.CursorAdapter;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.ListView;
|
||||
import android.widget.SimpleCursorAdapter;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.C0046R;
|
||||
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class AlertController {
|
||||
ListAdapter mAdapter;
|
||||
private int mAlertDialogLayout;
|
||||
private final int mButtonIconDimen;
|
||||
Button mButtonNegative;
|
||||
private Drawable mButtonNegativeIcon;
|
||||
Message mButtonNegativeMessage;
|
||||
private CharSequence mButtonNegativeText;
|
||||
Button mButtonNeutral;
|
||||
private Drawable mButtonNeutralIcon;
|
||||
Message mButtonNeutralMessage;
|
||||
private CharSequence mButtonNeutralText;
|
||||
private int mButtonPanelSideLayout;
|
||||
Button mButtonPositive;
|
||||
private Drawable mButtonPositiveIcon;
|
||||
Message mButtonPositiveMessage;
|
||||
private CharSequence mButtonPositiveText;
|
||||
private final Context mContext;
|
||||
private View mCustomTitleView;
|
||||
final AppCompatDialog mDialog;
|
||||
Handler mHandler;
|
||||
private Drawable mIcon;
|
||||
private ImageView mIconView;
|
||||
int mListItemLayout;
|
||||
int mListLayout;
|
||||
ListView mListView;
|
||||
private CharSequence mMessage;
|
||||
private TextView mMessageView;
|
||||
int mMultiChoiceItemLayout;
|
||||
NestedScrollView mScrollView;
|
||||
private boolean mShowTitle;
|
||||
int mSingleChoiceItemLayout;
|
||||
private CharSequence mTitle;
|
||||
private TextView mTitleView;
|
||||
private View mView;
|
||||
private int mViewLayoutResId;
|
||||
private int mViewSpacingBottom;
|
||||
private int mViewSpacingLeft;
|
||||
private int mViewSpacingRight;
|
||||
private int mViewSpacingTop;
|
||||
private final Window mWindow;
|
||||
private boolean mViewSpacingSpecified = false;
|
||||
private int mIconId = 0;
|
||||
int mCheckedItem = -1;
|
||||
private int mButtonPanelLayoutHint = 0;
|
||||
private final View.OnClickListener mButtonHandler = new View.OnClickListener() { // from class: androidx.appcompat.app.AlertController.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View v) {
|
||||
Message m;
|
||||
if (v == AlertController.this.mButtonPositive && AlertController.this.mButtonPositiveMessage != null) {
|
||||
m = Message.obtain(AlertController.this.mButtonPositiveMessage);
|
||||
} else if (v == AlertController.this.mButtonNegative && AlertController.this.mButtonNegativeMessage != null) {
|
||||
m = Message.obtain(AlertController.this.mButtonNegativeMessage);
|
||||
} else if (v == AlertController.this.mButtonNeutral && AlertController.this.mButtonNeutralMessage != null) {
|
||||
m = Message.obtain(AlertController.this.mButtonNeutralMessage);
|
||||
} else {
|
||||
m = null;
|
||||
}
|
||||
if (m != null) {
|
||||
m.sendToTarget();
|
||||
}
|
||||
AlertController.this.mHandler.obtainMessage(1, AlertController.this.mDialog).sendToTarget();
|
||||
}
|
||||
};
|
||||
|
||||
private static final class ButtonHandler extends Handler {
|
||||
private static final int MSG_DISMISS_DIALOG = 1;
|
||||
private WeakReference<DialogInterface> mDialog;
|
||||
|
||||
public ButtonHandler(DialogInterface dialog) {
|
||||
this.mDialog = new WeakReference<>(dialog);
|
||||
}
|
||||
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
case -3:
|
||||
case -2:
|
||||
case -1:
|
||||
((DialogInterface.OnClickListener) msg.obj).onClick(this.mDialog.get(), msg.what);
|
||||
break;
|
||||
case 1:
|
||||
((DialogInterface) msg.obj).dismiss();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean shouldCenterSingleButton(Context context) {
|
||||
TypedValue outValue = new TypedValue();
|
||||
context.getTheme().resolveAttribute(C0046R.attr.alertDialogCenterButtons, outValue, true);
|
||||
return outValue.data != 0;
|
||||
}
|
||||
|
||||
public AlertController(Context context, AppCompatDialog di, Window window) {
|
||||
this.mContext = context;
|
||||
this.mDialog = di;
|
||||
this.mWindow = window;
|
||||
this.mHandler = new ButtonHandler(di);
|
||||
TypedArray a = context.obtainStyledAttributes(null, C0046R.styleable.AlertDialog, C0046R.attr.alertDialogStyle, 0);
|
||||
this.mAlertDialogLayout = a.getResourceId(C0046R.styleable.AlertDialog_android_layout, 0);
|
||||
this.mButtonPanelSideLayout = a.getResourceId(C0046R.styleable.AlertDialog_buttonPanelSideLayout, 0);
|
||||
this.mListLayout = a.getResourceId(C0046R.styleable.AlertDialog_listLayout, 0);
|
||||
this.mMultiChoiceItemLayout = a.getResourceId(C0046R.styleable.AlertDialog_multiChoiceItemLayout, 0);
|
||||
this.mSingleChoiceItemLayout = a.getResourceId(C0046R.styleable.AlertDialog_singleChoiceItemLayout, 0);
|
||||
this.mListItemLayout = a.getResourceId(C0046R.styleable.AlertDialog_listItemLayout, 0);
|
||||
this.mShowTitle = a.getBoolean(C0046R.styleable.AlertDialog_showTitle, true);
|
||||
this.mButtonIconDimen = a.getDimensionPixelSize(C0046R.styleable.AlertDialog_buttonIconDimen, 0);
|
||||
a.recycle();
|
||||
di.supportRequestWindowFeature(1);
|
||||
}
|
||||
|
||||
static boolean canTextInput(View v) {
|
||||
if (v.onCheckIsTextEditor()) {
|
||||
return true;
|
||||
}
|
||||
if (!(v instanceof ViewGroup)) {
|
||||
return false;
|
||||
}
|
||||
ViewGroup vg = (ViewGroup) v;
|
||||
int i = vg.getChildCount();
|
||||
while (i > 0) {
|
||||
i--;
|
||||
if (canTextInput(vg.getChildAt(i))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void installContent() {
|
||||
int contentView = selectContentView();
|
||||
this.mDialog.setContentView(contentView);
|
||||
setupView();
|
||||
}
|
||||
|
||||
private int selectContentView() {
|
||||
int i = this.mButtonPanelSideLayout;
|
||||
if (i == 0) {
|
||||
return this.mAlertDialogLayout;
|
||||
}
|
||||
if (this.mButtonPanelLayoutHint == 1) {
|
||||
return i;
|
||||
}
|
||||
return this.mAlertDialogLayout;
|
||||
}
|
||||
|
||||
public void setTitle(CharSequence title) {
|
||||
this.mTitle = title;
|
||||
TextView textView = this.mTitleView;
|
||||
if (textView != null) {
|
||||
textView.setText(title);
|
||||
}
|
||||
}
|
||||
|
||||
public void setCustomTitle(View customTitleView) {
|
||||
this.mCustomTitleView = customTitleView;
|
||||
}
|
||||
|
||||
public void setMessage(CharSequence message) {
|
||||
this.mMessage = message;
|
||||
TextView textView = this.mMessageView;
|
||||
if (textView != null) {
|
||||
textView.setText(message);
|
||||
}
|
||||
}
|
||||
|
||||
public void setView(int layoutResId) {
|
||||
this.mView = null;
|
||||
this.mViewLayoutResId = layoutResId;
|
||||
this.mViewSpacingSpecified = false;
|
||||
}
|
||||
|
||||
public void setView(View view) {
|
||||
this.mView = view;
|
||||
this.mViewLayoutResId = 0;
|
||||
this.mViewSpacingSpecified = false;
|
||||
}
|
||||
|
||||
public void setView(View view, int viewSpacingLeft, int viewSpacingTop, int viewSpacingRight, int viewSpacingBottom) {
|
||||
this.mView = view;
|
||||
this.mViewLayoutResId = 0;
|
||||
this.mViewSpacingSpecified = true;
|
||||
this.mViewSpacingLeft = viewSpacingLeft;
|
||||
this.mViewSpacingTop = viewSpacingTop;
|
||||
this.mViewSpacingRight = viewSpacingRight;
|
||||
this.mViewSpacingBottom = viewSpacingBottom;
|
||||
}
|
||||
|
||||
public void setButtonPanelLayoutHint(int layoutHint) {
|
||||
this.mButtonPanelLayoutHint = layoutHint;
|
||||
}
|
||||
|
||||
public void setButton(int whichButton, CharSequence text, DialogInterface.OnClickListener listener, Message msg, Drawable icon) {
|
||||
if (msg == null && listener != null) {
|
||||
msg = this.mHandler.obtainMessage(whichButton, listener);
|
||||
}
|
||||
switch (whichButton) {
|
||||
case -3:
|
||||
this.mButtonNeutralText = text;
|
||||
this.mButtonNeutralMessage = msg;
|
||||
this.mButtonNeutralIcon = icon;
|
||||
return;
|
||||
case -2:
|
||||
this.mButtonNegativeText = text;
|
||||
this.mButtonNegativeMessage = msg;
|
||||
this.mButtonNegativeIcon = icon;
|
||||
return;
|
||||
case -1:
|
||||
this.mButtonPositiveText = text;
|
||||
this.mButtonPositiveMessage = msg;
|
||||
this.mButtonPositiveIcon = icon;
|
||||
return;
|
||||
default:
|
||||
throw new IllegalArgumentException("Button does not exist");
|
||||
}
|
||||
}
|
||||
|
||||
public void setIcon(int resId) {
|
||||
this.mIcon = null;
|
||||
this.mIconId = resId;
|
||||
ImageView imageView = this.mIconView;
|
||||
if (imageView != null) {
|
||||
if (resId != 0) {
|
||||
imageView.setVisibility(0);
|
||||
this.mIconView.setImageResource(this.mIconId);
|
||||
} else {
|
||||
imageView.setVisibility(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setIcon(Drawable icon) {
|
||||
this.mIcon = icon;
|
||||
this.mIconId = 0;
|
||||
ImageView imageView = this.mIconView;
|
||||
if (imageView != null) {
|
||||
if (icon != null) {
|
||||
imageView.setVisibility(0);
|
||||
this.mIconView.setImageDrawable(icon);
|
||||
} else {
|
||||
imageView.setVisibility(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getIconAttributeResId(int attrId) {
|
||||
TypedValue out = new TypedValue();
|
||||
this.mContext.getTheme().resolveAttribute(attrId, out, true);
|
||||
return out.resourceId;
|
||||
}
|
||||
|
||||
public ListView getListView() {
|
||||
return this.mListView;
|
||||
}
|
||||
|
||||
public Button getButton(int whichButton) {
|
||||
switch (whichButton) {
|
||||
case -3:
|
||||
return this.mButtonNeutral;
|
||||
case -2:
|
||||
return this.mButtonNegative;
|
||||
case -1:
|
||||
return this.mButtonPositive;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
NestedScrollView nestedScrollView = this.mScrollView;
|
||||
return nestedScrollView != null && nestedScrollView.executeKeyEvent(event);
|
||||
}
|
||||
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
NestedScrollView nestedScrollView = this.mScrollView;
|
||||
return nestedScrollView != null && nestedScrollView.executeKeyEvent(event);
|
||||
}
|
||||
|
||||
private ViewGroup resolvePanel(View customPanel, View defaultPanel) {
|
||||
if (customPanel == null) {
|
||||
if (defaultPanel instanceof ViewStub) {
|
||||
defaultPanel = ((ViewStub) defaultPanel).inflate();
|
||||
}
|
||||
return (ViewGroup) defaultPanel;
|
||||
}
|
||||
if (defaultPanel != null) {
|
||||
ViewParent parent = defaultPanel.getParent();
|
||||
if (parent instanceof ViewGroup) {
|
||||
((ViewGroup) parent).removeView(defaultPanel);
|
||||
}
|
||||
}
|
||||
if (customPanel instanceof ViewStub) {
|
||||
customPanel = ((ViewStub) customPanel).inflate();
|
||||
}
|
||||
return (ViewGroup) customPanel;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:20:0x008e, code lost:
|
||||
|
||||
r1 = r18.mScrollView;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:21:0x0090, code lost:
|
||||
|
||||
if (r1 == null) goto L30;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:22:0x0092, code lost:
|
||||
|
||||
r1.setClipToPadding(true);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:23:0x0096, code lost:
|
||||
|
||||
r1 = null;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:24:0x0099, code lost:
|
||||
|
||||
if (r18.mMessage != null) goto L34;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:26:0x009d, code lost:
|
||||
|
||||
if (r18.mListView == null) goto L35;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:27:0x00a5, code lost:
|
||||
|
||||
if (r1 == null) goto L37;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:28:0x00a7, code lost:
|
||||
|
||||
r1.setVisibility(0);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:59:0x009f, code lost:
|
||||
|
||||
r1 = r9.findViewById(androidx.appcompat.C0046R.id.titleDividerNoCustom);
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
private void setupView() {
|
||||
/*
|
||||
Method dump skipped, instructions count: 263
|
||||
To view this dump add '--comments-level debug' option
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.app.AlertController.setupView():void");
|
||||
}
|
||||
|
||||
private void setScrollIndicators(ViewGroup contentPanel, View content, int indicators, int mask) {
|
||||
View indicatorUp = this.mWindow.findViewById(C0046R.id.scrollIndicatorUp);
|
||||
View indicatorDown = this.mWindow.findViewById(C0046R.id.scrollIndicatorDown);
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
ViewCompat.setScrollIndicators(content, indicators, mask);
|
||||
if (indicatorUp != null) {
|
||||
contentPanel.removeView(indicatorUp);
|
||||
}
|
||||
if (indicatorDown != null) {
|
||||
contentPanel.removeView(indicatorDown);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (indicatorUp != null && (indicators & 1) == 0) {
|
||||
contentPanel.removeView(indicatorUp);
|
||||
indicatorUp = null;
|
||||
}
|
||||
if (indicatorDown != null && (indicators & 2) == 0) {
|
||||
contentPanel.removeView(indicatorDown);
|
||||
indicatorDown = null;
|
||||
}
|
||||
if (indicatorUp != null || indicatorDown != null) {
|
||||
final View top = indicatorUp;
|
||||
final View bottom = indicatorDown;
|
||||
if (this.mMessage != null) {
|
||||
this.mScrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() { // from class: androidx.appcompat.app.AlertController.2
|
||||
@Override // androidx.core.widget.NestedScrollView.OnScrollChangeListener
|
||||
public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
|
||||
AlertController.manageScrollIndicators(v, top, bottom);
|
||||
}
|
||||
});
|
||||
this.mScrollView.post(new Runnable() { // from class: androidx.appcompat.app.AlertController.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
AlertController.manageScrollIndicators(AlertController.this.mScrollView, top, bottom);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
ListView listView = this.mListView;
|
||||
if (listView != null) {
|
||||
listView.setOnScrollListener(new AbsListView.OnScrollListener() { // from class: androidx.appcompat.app.AlertController.4
|
||||
@Override // android.widget.AbsListView.OnScrollListener
|
||||
public void onScrollStateChanged(AbsListView view, int scrollState) {
|
||||
}
|
||||
|
||||
@Override // android.widget.AbsListView.OnScrollListener
|
||||
public void onScroll(AbsListView v, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
AlertController.manageScrollIndicators(v, top, bottom);
|
||||
}
|
||||
});
|
||||
this.mListView.post(new Runnable() { // from class: androidx.appcompat.app.AlertController.5
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
AlertController.manageScrollIndicators(AlertController.this.mListView, top, bottom);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (top != null) {
|
||||
contentPanel.removeView(top);
|
||||
}
|
||||
if (bottom != null) {
|
||||
contentPanel.removeView(bottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setupCustomContent(ViewGroup customPanel) {
|
||||
View customView;
|
||||
if (this.mView != null) {
|
||||
customView = this.mView;
|
||||
} else if (this.mViewLayoutResId != 0) {
|
||||
LayoutInflater inflater = LayoutInflater.from(this.mContext);
|
||||
customView = inflater.inflate(this.mViewLayoutResId, customPanel, false);
|
||||
} else {
|
||||
customView = null;
|
||||
}
|
||||
boolean hasCustomView = customView != null;
|
||||
if (!hasCustomView || !canTextInput(customView)) {
|
||||
this.mWindow.setFlags(131072, 131072);
|
||||
}
|
||||
if (hasCustomView) {
|
||||
FrameLayout custom = (FrameLayout) this.mWindow.findViewById(C0046R.id.custom);
|
||||
custom.addView(customView, new ViewGroup.LayoutParams(-1, -1));
|
||||
if (this.mViewSpacingSpecified) {
|
||||
custom.setPadding(this.mViewSpacingLeft, this.mViewSpacingTop, this.mViewSpacingRight, this.mViewSpacingBottom);
|
||||
}
|
||||
if (this.mListView != null) {
|
||||
((LinearLayoutCompat.LayoutParams) customPanel.getLayoutParams()).weight = 0.0f;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
customPanel.setVisibility(8);
|
||||
}
|
||||
|
||||
private void setupTitle(ViewGroup topPanel) {
|
||||
if (this.mCustomTitleView != null) {
|
||||
ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(-1, -2);
|
||||
topPanel.addView(this.mCustomTitleView, 0, lp);
|
||||
View titleTemplate = this.mWindow.findViewById(C0046R.id.title_template);
|
||||
titleTemplate.setVisibility(8);
|
||||
return;
|
||||
}
|
||||
this.mIconView = (ImageView) this.mWindow.findViewById(R.id.icon);
|
||||
boolean hasTextTitle = !TextUtils.isEmpty(this.mTitle);
|
||||
if (hasTextTitle && this.mShowTitle) {
|
||||
TextView textView = (TextView) this.mWindow.findViewById(C0046R.id.alertTitle);
|
||||
this.mTitleView = textView;
|
||||
textView.setText(this.mTitle);
|
||||
int i = this.mIconId;
|
||||
if (i != 0) {
|
||||
this.mIconView.setImageResource(i);
|
||||
return;
|
||||
}
|
||||
Drawable drawable = this.mIcon;
|
||||
if (drawable != null) {
|
||||
this.mIconView.setImageDrawable(drawable);
|
||||
return;
|
||||
} else {
|
||||
this.mTitleView.setPadding(this.mIconView.getPaddingLeft(), this.mIconView.getPaddingTop(), this.mIconView.getPaddingRight(), this.mIconView.getPaddingBottom());
|
||||
this.mIconView.setVisibility(8);
|
||||
return;
|
||||
}
|
||||
}
|
||||
View titleTemplate2 = this.mWindow.findViewById(C0046R.id.title_template);
|
||||
titleTemplate2.setVisibility(8);
|
||||
this.mIconView.setVisibility(8);
|
||||
topPanel.setVisibility(8);
|
||||
}
|
||||
|
||||
private void setupContent(ViewGroup contentPanel) {
|
||||
NestedScrollView nestedScrollView = (NestedScrollView) this.mWindow.findViewById(C0046R.id.scrollView);
|
||||
this.mScrollView = nestedScrollView;
|
||||
nestedScrollView.setFocusable(false);
|
||||
this.mScrollView.setNestedScrollingEnabled(false);
|
||||
TextView textView = (TextView) contentPanel.findViewById(R.id.message);
|
||||
this.mMessageView = textView;
|
||||
if (textView == null) {
|
||||
return;
|
||||
}
|
||||
CharSequence charSequence = this.mMessage;
|
||||
if (charSequence != null) {
|
||||
textView.setText(charSequence);
|
||||
return;
|
||||
}
|
||||
textView.setVisibility(8);
|
||||
this.mScrollView.removeView(this.mMessageView);
|
||||
if (this.mListView != null) {
|
||||
ViewGroup scrollParent = (ViewGroup) this.mScrollView.getParent();
|
||||
int childIndex = scrollParent.indexOfChild(this.mScrollView);
|
||||
scrollParent.removeViewAt(childIndex);
|
||||
scrollParent.addView(this.mListView, childIndex, new ViewGroup.LayoutParams(-1, -1));
|
||||
return;
|
||||
}
|
||||
contentPanel.setVisibility(8);
|
||||
}
|
||||
|
||||
static void manageScrollIndicators(View v, View upIndicator, View downIndicator) {
|
||||
if (upIndicator != null) {
|
||||
upIndicator.setVisibility(v.canScrollVertically(-1) ? 0 : 4);
|
||||
}
|
||||
if (downIndicator != null) {
|
||||
downIndicator.setVisibility(v.canScrollVertically(1) ? 0 : 4);
|
||||
}
|
||||
}
|
||||
|
||||
private void setupButtons(ViewGroup buttonPanel) {
|
||||
int whichButtons = 0;
|
||||
Button button = (Button) buttonPanel.findViewById(R.id.button1);
|
||||
this.mButtonPositive = button;
|
||||
button.setOnClickListener(this.mButtonHandler);
|
||||
if (TextUtils.isEmpty(this.mButtonPositiveText) && this.mButtonPositiveIcon == null) {
|
||||
this.mButtonPositive.setVisibility(8);
|
||||
} else {
|
||||
this.mButtonPositive.setText(this.mButtonPositiveText);
|
||||
Drawable drawable = this.mButtonPositiveIcon;
|
||||
if (drawable != null) {
|
||||
int i = this.mButtonIconDimen;
|
||||
drawable.setBounds(0, 0, i, i);
|
||||
this.mButtonPositive.setCompoundDrawables(this.mButtonPositiveIcon, null, null, null);
|
||||
}
|
||||
this.mButtonPositive.setVisibility(0);
|
||||
whichButtons = 0 | 1;
|
||||
}
|
||||
Button button2 = (Button) buttonPanel.findViewById(R.id.button2);
|
||||
this.mButtonNegative = button2;
|
||||
button2.setOnClickListener(this.mButtonHandler);
|
||||
if (TextUtils.isEmpty(this.mButtonNegativeText) && this.mButtonNegativeIcon == null) {
|
||||
this.mButtonNegative.setVisibility(8);
|
||||
} else {
|
||||
this.mButtonNegative.setText(this.mButtonNegativeText);
|
||||
Drawable drawable2 = this.mButtonNegativeIcon;
|
||||
if (drawable2 != null) {
|
||||
int i2 = this.mButtonIconDimen;
|
||||
drawable2.setBounds(0, 0, i2, i2);
|
||||
this.mButtonNegative.setCompoundDrawables(this.mButtonNegativeIcon, null, null, null);
|
||||
}
|
||||
this.mButtonNegative.setVisibility(0);
|
||||
whichButtons |= 2;
|
||||
}
|
||||
Button button3 = (Button) buttonPanel.findViewById(R.id.button3);
|
||||
this.mButtonNeutral = button3;
|
||||
button3.setOnClickListener(this.mButtonHandler);
|
||||
if (TextUtils.isEmpty(this.mButtonNeutralText) && this.mButtonNeutralIcon == null) {
|
||||
this.mButtonNeutral.setVisibility(8);
|
||||
} else {
|
||||
this.mButtonNeutral.setText(this.mButtonNeutralText);
|
||||
Drawable drawable3 = this.mButtonNeutralIcon;
|
||||
if (drawable3 != null) {
|
||||
int i3 = this.mButtonIconDimen;
|
||||
drawable3.setBounds(0, 0, i3, i3);
|
||||
this.mButtonNeutral.setCompoundDrawables(this.mButtonNeutralIcon, null, null, null);
|
||||
}
|
||||
this.mButtonNeutral.setVisibility(0);
|
||||
whichButtons |= 4;
|
||||
}
|
||||
if (shouldCenterSingleButton(this.mContext)) {
|
||||
if (whichButtons == 1) {
|
||||
centerButton(this.mButtonPositive);
|
||||
} else if (whichButtons == 2) {
|
||||
centerButton(this.mButtonNegative);
|
||||
} else if (whichButtons == 4) {
|
||||
centerButton(this.mButtonNeutral);
|
||||
}
|
||||
}
|
||||
boolean hasButtons = whichButtons != 0;
|
||||
if (!hasButtons) {
|
||||
buttonPanel.setVisibility(8);
|
||||
}
|
||||
}
|
||||
|
||||
private void centerButton(Button button) {
|
||||
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) button.getLayoutParams();
|
||||
params.gravity = 1;
|
||||
params.weight = 0.5f;
|
||||
button.setLayoutParams(params);
|
||||
}
|
||||
|
||||
public static class RecycleListView extends ListView {
|
||||
private final int mPaddingBottomNoButtons;
|
||||
private final int mPaddingTopNoTitle;
|
||||
|
||||
public RecycleListView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public RecycleListView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
TypedArray ta = context.obtainStyledAttributes(attrs, C0046R.styleable.RecycleListView);
|
||||
this.mPaddingBottomNoButtons = ta.getDimensionPixelOffset(C0046R.styleable.RecycleListView_paddingBottomNoButtons, -1);
|
||||
this.mPaddingTopNoTitle = ta.getDimensionPixelOffset(C0046R.styleable.RecycleListView_paddingTopNoTitle, -1);
|
||||
}
|
||||
|
||||
public void setHasDecor(boolean hasTitle, boolean hasButtons) {
|
||||
if (!hasButtons || !hasTitle) {
|
||||
int paddingLeft = getPaddingLeft();
|
||||
int paddingTop = hasTitle ? getPaddingTop() : this.mPaddingTopNoTitle;
|
||||
int paddingRight = getPaddingRight();
|
||||
int paddingBottom = hasButtons ? getPaddingBottom() : this.mPaddingBottomNoButtons;
|
||||
setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class AlertParams {
|
||||
public ListAdapter mAdapter;
|
||||
public boolean[] mCheckedItems;
|
||||
public final Context mContext;
|
||||
public Cursor mCursor;
|
||||
public View mCustomTitleView;
|
||||
public boolean mForceInverseBackground;
|
||||
public Drawable mIcon;
|
||||
public final LayoutInflater mInflater;
|
||||
public String mIsCheckedColumn;
|
||||
public boolean mIsMultiChoice;
|
||||
public boolean mIsSingleChoice;
|
||||
public CharSequence[] mItems;
|
||||
public String mLabelColumn;
|
||||
public CharSequence mMessage;
|
||||
public Drawable mNegativeButtonIcon;
|
||||
public DialogInterface.OnClickListener mNegativeButtonListener;
|
||||
public CharSequence mNegativeButtonText;
|
||||
public Drawable mNeutralButtonIcon;
|
||||
public DialogInterface.OnClickListener mNeutralButtonListener;
|
||||
public CharSequence mNeutralButtonText;
|
||||
public DialogInterface.OnCancelListener mOnCancelListener;
|
||||
public DialogInterface.OnMultiChoiceClickListener mOnCheckboxClickListener;
|
||||
public DialogInterface.OnClickListener mOnClickListener;
|
||||
public DialogInterface.OnDismissListener mOnDismissListener;
|
||||
public AdapterView.OnItemSelectedListener mOnItemSelectedListener;
|
||||
public DialogInterface.OnKeyListener mOnKeyListener;
|
||||
public OnPrepareListViewListener mOnPrepareListViewListener;
|
||||
public Drawable mPositiveButtonIcon;
|
||||
public DialogInterface.OnClickListener mPositiveButtonListener;
|
||||
public CharSequence mPositiveButtonText;
|
||||
public CharSequence mTitle;
|
||||
public View mView;
|
||||
public int mViewLayoutResId;
|
||||
public int mViewSpacingBottom;
|
||||
public int mViewSpacingLeft;
|
||||
public int mViewSpacingRight;
|
||||
public int mViewSpacingTop;
|
||||
public int mIconId = 0;
|
||||
public int mIconAttrId = 0;
|
||||
public boolean mViewSpacingSpecified = false;
|
||||
public int mCheckedItem = -1;
|
||||
public boolean mRecycleOnMeasure = true;
|
||||
public boolean mCancelable = true;
|
||||
|
||||
public interface OnPrepareListViewListener {
|
||||
void onPrepareListView(ListView listView);
|
||||
}
|
||||
|
||||
public AlertParams(Context context) {
|
||||
this.mContext = context;
|
||||
this.mInflater = (LayoutInflater) context.getSystemService("layout_inflater");
|
||||
}
|
||||
|
||||
public void apply(AlertController dialog) {
|
||||
View view = this.mCustomTitleView;
|
||||
if (view != null) {
|
||||
dialog.setCustomTitle(view);
|
||||
} else {
|
||||
CharSequence charSequence = this.mTitle;
|
||||
if (charSequence != null) {
|
||||
dialog.setTitle(charSequence);
|
||||
}
|
||||
Drawable drawable = this.mIcon;
|
||||
if (drawable != null) {
|
||||
dialog.setIcon(drawable);
|
||||
}
|
||||
int i = this.mIconId;
|
||||
if (i != 0) {
|
||||
dialog.setIcon(i);
|
||||
}
|
||||
int i2 = this.mIconAttrId;
|
||||
if (i2 != 0) {
|
||||
dialog.setIcon(dialog.getIconAttributeResId(i2));
|
||||
}
|
||||
}
|
||||
CharSequence charSequence2 = this.mMessage;
|
||||
if (charSequence2 != null) {
|
||||
dialog.setMessage(charSequence2);
|
||||
}
|
||||
CharSequence charSequence3 = this.mPositiveButtonText;
|
||||
if (charSequence3 != null || this.mPositiveButtonIcon != null) {
|
||||
dialog.setButton(-1, charSequence3, this.mPositiveButtonListener, null, this.mPositiveButtonIcon);
|
||||
}
|
||||
CharSequence charSequence4 = this.mNegativeButtonText;
|
||||
if (charSequence4 != null || this.mNegativeButtonIcon != null) {
|
||||
dialog.setButton(-2, charSequence4, this.mNegativeButtonListener, null, this.mNegativeButtonIcon);
|
||||
}
|
||||
CharSequence charSequence5 = this.mNeutralButtonText;
|
||||
if (charSequence5 != null || this.mNeutralButtonIcon != null) {
|
||||
dialog.setButton(-3, charSequence5, this.mNeutralButtonListener, null, this.mNeutralButtonIcon);
|
||||
}
|
||||
if (this.mItems != null || this.mCursor != null || this.mAdapter != null) {
|
||||
createListView(dialog);
|
||||
}
|
||||
View view2 = this.mView;
|
||||
if (view2 != null) {
|
||||
if (this.mViewSpacingSpecified) {
|
||||
dialog.setView(view2, this.mViewSpacingLeft, this.mViewSpacingTop, this.mViewSpacingRight, this.mViewSpacingBottom);
|
||||
return;
|
||||
} else {
|
||||
dialog.setView(view2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
int i3 = this.mViewLayoutResId;
|
||||
if (i3 != 0) {
|
||||
dialog.setView(i3);
|
||||
}
|
||||
}
|
||||
|
||||
private void createListView(final AlertController dialog) {
|
||||
int layout;
|
||||
ListAdapter adapter;
|
||||
final RecycleListView listView = (RecycleListView) this.mInflater.inflate(dialog.mListLayout, (ViewGroup) null);
|
||||
if (this.mIsMultiChoice) {
|
||||
if (this.mCursor == null) {
|
||||
adapter = new ArrayAdapter<CharSequence>(this.mContext, dialog.mMultiChoiceItemLayout, R.id.text1, this.mItems) { // from class: androidx.appcompat.app.AlertController.AlertParams.1
|
||||
@Override // android.widget.ArrayAdapter, android.widget.Adapter
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View view = super.getView(position, convertView, parent);
|
||||
if (AlertParams.this.mCheckedItems != null) {
|
||||
boolean isItemChecked = AlertParams.this.mCheckedItems[position];
|
||||
if (isItemChecked) {
|
||||
listView.setItemChecked(position, true);
|
||||
}
|
||||
}
|
||||
return view;
|
||||
}
|
||||
};
|
||||
} else {
|
||||
adapter = new CursorAdapter(this.mContext, this.mCursor, false) { // from class: androidx.appcompat.app.AlertController.AlertParams.2
|
||||
private final int mIsCheckedIndex;
|
||||
private final int mLabelIndex;
|
||||
|
||||
{
|
||||
Cursor cursor = getCursor();
|
||||
this.mLabelIndex = cursor.getColumnIndexOrThrow(AlertParams.this.mLabelColumn);
|
||||
this.mIsCheckedIndex = cursor.getColumnIndexOrThrow(AlertParams.this.mIsCheckedColumn);
|
||||
}
|
||||
|
||||
@Override // android.widget.CursorAdapter
|
||||
public void bindView(View view, Context context, Cursor cursor) {
|
||||
CheckedTextView text = (CheckedTextView) view.findViewById(R.id.text1);
|
||||
text.setText(cursor.getString(this.mLabelIndex));
|
||||
listView.setItemChecked(cursor.getPosition(), cursor.getInt(this.mIsCheckedIndex) == 1);
|
||||
}
|
||||
|
||||
@Override // android.widget.CursorAdapter
|
||||
public View newView(Context context, Cursor cursor, ViewGroup parent) {
|
||||
return AlertParams.this.mInflater.inflate(dialog.mMultiChoiceItemLayout, parent, false);
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
if (this.mIsSingleChoice) {
|
||||
layout = dialog.mSingleChoiceItemLayout;
|
||||
} else {
|
||||
layout = dialog.mListItemLayout;
|
||||
}
|
||||
if (this.mCursor != null) {
|
||||
adapter = new SimpleCursorAdapter(this.mContext, layout, this.mCursor, new String[]{this.mLabelColumn}, new int[]{R.id.text1});
|
||||
} else {
|
||||
ListAdapter adapter2 = this.mAdapter;
|
||||
if (adapter2 != null) {
|
||||
adapter = this.mAdapter;
|
||||
} else {
|
||||
adapter = new CheckedItemAdapter(this.mContext, layout, R.id.text1, this.mItems);
|
||||
}
|
||||
}
|
||||
}
|
||||
OnPrepareListViewListener onPrepareListViewListener = this.mOnPrepareListViewListener;
|
||||
if (onPrepareListViewListener != null) {
|
||||
onPrepareListViewListener.onPrepareListView(listView);
|
||||
}
|
||||
dialog.mAdapter = adapter;
|
||||
dialog.mCheckedItem = this.mCheckedItem;
|
||||
if (this.mOnClickListener != null) {
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { // from class: androidx.appcompat.app.AlertController.AlertParams.3
|
||||
@Override // android.widget.AdapterView.OnItemClickListener
|
||||
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
|
||||
AlertParams.this.mOnClickListener.onClick(dialog.mDialog, position);
|
||||
if (!AlertParams.this.mIsSingleChoice) {
|
||||
dialog.mDialog.dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (this.mOnCheckboxClickListener != null) {
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { // from class: androidx.appcompat.app.AlertController.AlertParams.4
|
||||
@Override // android.widget.AdapterView.OnItemClickListener
|
||||
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
|
||||
if (AlertParams.this.mCheckedItems != null) {
|
||||
AlertParams.this.mCheckedItems[position] = listView.isItemChecked(position);
|
||||
}
|
||||
AlertParams.this.mOnCheckboxClickListener.onClick(dialog.mDialog, position, listView.isItemChecked(position));
|
||||
}
|
||||
});
|
||||
}
|
||||
AdapterView.OnItemSelectedListener onItemSelectedListener = this.mOnItemSelectedListener;
|
||||
if (onItemSelectedListener != null) {
|
||||
listView.setOnItemSelectedListener(onItemSelectedListener);
|
||||
}
|
||||
if (this.mIsSingleChoice) {
|
||||
listView.setChoiceMode(1);
|
||||
} else if (this.mIsMultiChoice) {
|
||||
listView.setChoiceMode(2);
|
||||
}
|
||||
dialog.mListView = listView;
|
||||
}
|
||||
}
|
||||
|
||||
private static class CheckedItemAdapter extends ArrayAdapter<CharSequence> {
|
||||
public CheckedItemAdapter(Context context, int resource, int textViewResourceId, CharSequence[] objects) {
|
||||
super(context, resource, textViewResourceId, objects);
|
||||
}
|
||||
|
||||
@Override // android.widget.BaseAdapter, android.widget.Adapter
|
||||
public boolean hasStableIds() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.widget.ArrayAdapter, android.widget.Adapter
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,418 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.TypedValue;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.ListView;
|
||||
import androidx.appcompat.C0046R;
|
||||
import androidx.appcompat.app.AlertController;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AlertDialog extends AppCompatDialog implements DialogInterface {
|
||||
static final int LAYOUT_HINT_NONE = 0;
|
||||
static final int LAYOUT_HINT_SIDE = 1;
|
||||
final AlertController mAlert;
|
||||
|
||||
protected AlertDialog(Context context) {
|
||||
this(context, 0);
|
||||
}
|
||||
|
||||
protected AlertDialog(Context context, int themeResId) {
|
||||
super(context, resolveDialogTheme(context, themeResId));
|
||||
this.mAlert = new AlertController(getContext(), this, getWindow());
|
||||
}
|
||||
|
||||
protected AlertDialog(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener) {
|
||||
this(context, 0);
|
||||
setCancelable(cancelable);
|
||||
setOnCancelListener(cancelListener);
|
||||
}
|
||||
|
||||
static int resolveDialogTheme(Context context, int resid) {
|
||||
if (((resid >>> 24) & 255) >= 1) {
|
||||
return resid;
|
||||
}
|
||||
TypedValue outValue = new TypedValue();
|
||||
context.getTheme().resolveAttribute(C0046R.attr.alertDialogTheme, outValue, true);
|
||||
return outValue.resourceId;
|
||||
}
|
||||
|
||||
public Button getButton(int whichButton) {
|
||||
return this.mAlert.getButton(whichButton);
|
||||
}
|
||||
|
||||
public ListView getListView() {
|
||||
return this.mAlert.getListView();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatDialog, android.app.Dialog
|
||||
public void setTitle(CharSequence title) {
|
||||
super.setTitle(title);
|
||||
this.mAlert.setTitle(title);
|
||||
}
|
||||
|
||||
public void setCustomTitle(View customTitleView) {
|
||||
this.mAlert.setCustomTitle(customTitleView);
|
||||
}
|
||||
|
||||
public void setMessage(CharSequence message) {
|
||||
this.mAlert.setMessage(message);
|
||||
}
|
||||
|
||||
public void setView(View view) {
|
||||
this.mAlert.setView(view);
|
||||
}
|
||||
|
||||
public void setView(View view, int viewSpacingLeft, int viewSpacingTop, int viewSpacingRight, int viewSpacingBottom) {
|
||||
this.mAlert.setView(view, viewSpacingLeft, viewSpacingTop, viewSpacingRight, viewSpacingBottom);
|
||||
}
|
||||
|
||||
void setButtonPanelLayoutHint(int layoutHint) {
|
||||
this.mAlert.setButtonPanelLayoutHint(layoutHint);
|
||||
}
|
||||
|
||||
public void setButton(int whichButton, CharSequence text, Message msg) {
|
||||
this.mAlert.setButton(whichButton, text, null, msg, null);
|
||||
}
|
||||
|
||||
public void setButton(int whichButton, CharSequence text, DialogInterface.OnClickListener listener) {
|
||||
this.mAlert.setButton(whichButton, text, listener, null, null);
|
||||
}
|
||||
|
||||
public void setButton(int whichButton, CharSequence text, Drawable icon, DialogInterface.OnClickListener listener) {
|
||||
this.mAlert.setButton(whichButton, text, listener, null, icon);
|
||||
}
|
||||
|
||||
public void setIcon(int resId) {
|
||||
this.mAlert.setIcon(resId);
|
||||
}
|
||||
|
||||
public void setIcon(Drawable icon) {
|
||||
this.mAlert.setIcon(icon);
|
||||
}
|
||||
|
||||
public void setIconAttribute(int attrId) {
|
||||
TypedValue out = new TypedValue();
|
||||
getContext().getTheme().resolveAttribute(attrId, out, true);
|
||||
this.mAlert.setIcon(out.resourceId);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatDialog, android.app.Dialog
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
this.mAlert.installContent();
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (this.mAlert.onKeyDown(keyCode, event)) {
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog, android.view.KeyEvent.Callback
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
if (this.mAlert.onKeyUp(keyCode, event)) {
|
||||
return true;
|
||||
}
|
||||
return super.onKeyUp(keyCode, event);
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
|
||||
/* renamed from: P */
|
||||
private final AlertController.AlertParams f5P;
|
||||
private final int mTheme;
|
||||
|
||||
public Builder(Context context) {
|
||||
this(context, AlertDialog.resolveDialogTheme(context, 0));
|
||||
}
|
||||
|
||||
public Builder(Context context, int themeResId) {
|
||||
this.f5P = new AlertController.AlertParams(new ContextThemeWrapper(context, AlertDialog.resolveDialogTheme(context, themeResId)));
|
||||
this.mTheme = themeResId;
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return this.f5P.mContext;
|
||||
}
|
||||
|
||||
public Builder setTitle(int titleId) {
|
||||
AlertController.AlertParams alertParams = this.f5P;
|
||||
alertParams.mTitle = alertParams.mContext.getText(titleId);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTitle(CharSequence title) {
|
||||
this.f5P.mTitle = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setCustomTitle(View customTitleView) {
|
||||
this.f5P.mCustomTitleView = customTitleView;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessage(int messageId) {
|
||||
AlertController.AlertParams alertParams = this.f5P;
|
||||
alertParams.mMessage = alertParams.mContext.getText(messageId);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessage(CharSequence message) {
|
||||
this.f5P.mMessage = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setIcon(int iconId) {
|
||||
this.f5P.mIconId = iconId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setIcon(Drawable icon) {
|
||||
this.f5P.mIcon = icon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setIconAttribute(int attrId) {
|
||||
TypedValue out = new TypedValue();
|
||||
this.f5P.mContext.getTheme().resolveAttribute(attrId, out, true);
|
||||
this.f5P.mIconId = out.resourceId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPositiveButton(int textId, DialogInterface.OnClickListener listener) {
|
||||
AlertController.AlertParams alertParams = this.f5P;
|
||||
alertParams.mPositiveButtonText = alertParams.mContext.getText(textId);
|
||||
this.f5P.mPositiveButtonListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPositiveButton(CharSequence text, DialogInterface.OnClickListener listener) {
|
||||
this.f5P.mPositiveButtonText = text;
|
||||
this.f5P.mPositiveButtonListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPositiveButtonIcon(Drawable icon) {
|
||||
this.f5P.mPositiveButtonIcon = icon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setNegativeButton(int textId, DialogInterface.OnClickListener listener) {
|
||||
AlertController.AlertParams alertParams = this.f5P;
|
||||
alertParams.mNegativeButtonText = alertParams.mContext.getText(textId);
|
||||
this.f5P.mNegativeButtonListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setNegativeButton(CharSequence text, DialogInterface.OnClickListener listener) {
|
||||
this.f5P.mNegativeButtonText = text;
|
||||
this.f5P.mNegativeButtonListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setNegativeButtonIcon(Drawable icon) {
|
||||
this.f5P.mNegativeButtonIcon = icon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setNeutralButton(int textId, DialogInterface.OnClickListener listener) {
|
||||
AlertController.AlertParams alertParams = this.f5P;
|
||||
alertParams.mNeutralButtonText = alertParams.mContext.getText(textId);
|
||||
this.f5P.mNeutralButtonListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setNeutralButton(CharSequence text, DialogInterface.OnClickListener listener) {
|
||||
this.f5P.mNeutralButtonText = text;
|
||||
this.f5P.mNeutralButtonListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setNeutralButtonIcon(Drawable icon) {
|
||||
this.f5P.mNeutralButtonIcon = icon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setCancelable(boolean cancelable) {
|
||||
this.f5P.mCancelable = cancelable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setOnCancelListener(DialogInterface.OnCancelListener onCancelListener) {
|
||||
this.f5P.mOnCancelListener = onCancelListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
|
||||
this.f5P.mOnDismissListener = onDismissListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setOnKeyListener(DialogInterface.OnKeyListener onKeyListener) {
|
||||
this.f5P.mOnKeyListener = onKeyListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setItems(int itemsId, DialogInterface.OnClickListener listener) {
|
||||
AlertController.AlertParams alertParams = this.f5P;
|
||||
alertParams.mItems = alertParams.mContext.getResources().getTextArray(itemsId);
|
||||
this.f5P.mOnClickListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setItems(CharSequence[] items, DialogInterface.OnClickListener listener) {
|
||||
this.f5P.mItems = items;
|
||||
this.f5P.mOnClickListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setAdapter(ListAdapter adapter, DialogInterface.OnClickListener listener) {
|
||||
this.f5P.mAdapter = adapter;
|
||||
this.f5P.mOnClickListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setCursor(Cursor cursor, DialogInterface.OnClickListener listener, String labelColumn) {
|
||||
this.f5P.mCursor = cursor;
|
||||
this.f5P.mLabelColumn = labelColumn;
|
||||
this.f5P.mOnClickListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMultiChoiceItems(int itemsId, boolean[] checkedItems, DialogInterface.OnMultiChoiceClickListener listener) {
|
||||
AlertController.AlertParams alertParams = this.f5P;
|
||||
alertParams.mItems = alertParams.mContext.getResources().getTextArray(itemsId);
|
||||
this.f5P.mOnCheckboxClickListener = listener;
|
||||
this.f5P.mCheckedItems = checkedItems;
|
||||
this.f5P.mIsMultiChoice = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMultiChoiceItems(CharSequence[] items, boolean[] checkedItems, DialogInterface.OnMultiChoiceClickListener listener) {
|
||||
this.f5P.mItems = items;
|
||||
this.f5P.mOnCheckboxClickListener = listener;
|
||||
this.f5P.mCheckedItems = checkedItems;
|
||||
this.f5P.mIsMultiChoice = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMultiChoiceItems(Cursor cursor, String isCheckedColumn, String labelColumn, DialogInterface.OnMultiChoiceClickListener listener) {
|
||||
this.f5P.mCursor = cursor;
|
||||
this.f5P.mOnCheckboxClickListener = listener;
|
||||
this.f5P.mIsCheckedColumn = isCheckedColumn;
|
||||
this.f5P.mLabelColumn = labelColumn;
|
||||
this.f5P.mIsMultiChoice = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSingleChoiceItems(int itemsId, int checkedItem, DialogInterface.OnClickListener listener) {
|
||||
AlertController.AlertParams alertParams = this.f5P;
|
||||
alertParams.mItems = alertParams.mContext.getResources().getTextArray(itemsId);
|
||||
this.f5P.mOnClickListener = listener;
|
||||
this.f5P.mCheckedItem = checkedItem;
|
||||
this.f5P.mIsSingleChoice = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSingleChoiceItems(Cursor cursor, int checkedItem, String labelColumn, DialogInterface.OnClickListener listener) {
|
||||
this.f5P.mCursor = cursor;
|
||||
this.f5P.mOnClickListener = listener;
|
||||
this.f5P.mCheckedItem = checkedItem;
|
||||
this.f5P.mLabelColumn = labelColumn;
|
||||
this.f5P.mIsSingleChoice = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSingleChoiceItems(CharSequence[] items, int checkedItem, DialogInterface.OnClickListener listener) {
|
||||
this.f5P.mItems = items;
|
||||
this.f5P.mOnClickListener = listener;
|
||||
this.f5P.mCheckedItem = checkedItem;
|
||||
this.f5P.mIsSingleChoice = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSingleChoiceItems(ListAdapter adapter, int checkedItem, DialogInterface.OnClickListener listener) {
|
||||
this.f5P.mAdapter = adapter;
|
||||
this.f5P.mOnClickListener = listener;
|
||||
this.f5P.mCheckedItem = checkedItem;
|
||||
this.f5P.mIsSingleChoice = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setOnItemSelectedListener(AdapterView.OnItemSelectedListener listener) {
|
||||
this.f5P.mOnItemSelectedListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setView(int layoutResId) {
|
||||
this.f5P.mView = null;
|
||||
this.f5P.mViewLayoutResId = layoutResId;
|
||||
this.f5P.mViewSpacingSpecified = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setView(View view) {
|
||||
this.f5P.mView = view;
|
||||
this.f5P.mViewLayoutResId = 0;
|
||||
this.f5P.mViewSpacingSpecified = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Builder setView(View view, int viewSpacingLeft, int viewSpacingTop, int viewSpacingRight, int viewSpacingBottom) {
|
||||
this.f5P.mView = view;
|
||||
this.f5P.mViewLayoutResId = 0;
|
||||
this.f5P.mViewSpacingSpecified = true;
|
||||
this.f5P.mViewSpacingLeft = viewSpacingLeft;
|
||||
this.f5P.mViewSpacingTop = viewSpacingTop;
|
||||
this.f5P.mViewSpacingRight = viewSpacingRight;
|
||||
this.f5P.mViewSpacingBottom = viewSpacingBottom;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Builder setInverseBackgroundForced(boolean useInverseBackground) {
|
||||
this.f5P.mForceInverseBackground = useInverseBackground;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setRecycleOnMeasureEnabled(boolean enabled) {
|
||||
this.f5P.mRecycleOnMeasure = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlertDialog create() {
|
||||
AlertDialog dialog = new AlertDialog(this.f5P.mContext, this.mTheme);
|
||||
this.f5P.apply(dialog.mAlert);
|
||||
dialog.setCancelable(this.f5P.mCancelable);
|
||||
if (this.f5P.mCancelable) {
|
||||
dialog.setCanceledOnTouchOutside(true);
|
||||
}
|
||||
dialog.setOnCancelListener(this.f5P.mOnCancelListener);
|
||||
dialog.setOnDismissListener(this.f5P.mOnDismissListener);
|
||||
if (this.f5P.mOnKeyListener != null) {
|
||||
dialog.setOnKeyListener(this.f5P.mOnKeyListener);
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public AlertDialog show() {
|
||||
AlertDialog dialog = create();
|
||||
dialog.show();
|
||||
return dialog;
|
||||
}
|
||||
}
|
||||
}
|
||||
+363
@@ -0,0 +1,363 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import androidx.activity.contextaware.OnContextAvailableListener;
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.appcompat.widget.VectorEnabledTintResources;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.NavUtils;
|
||||
import androidx.core.app.TaskStackBuilder;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.lifecycle.ViewTreeLifecycleOwner;
|
||||
import androidx.lifecycle.ViewTreeViewModelStoreOwner;
|
||||
import androidx.savedstate.SavedStateRegistry;
|
||||
import androidx.savedstate.ViewTreeSavedStateRegistryOwner;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatActivity extends FragmentActivity implements AppCompatCallback, TaskStackBuilder.SupportParentable, ActionBarDrawerToggle.DelegateProvider {
|
||||
private static final String DELEGATE_TAG = "androidx:appcompat";
|
||||
private AppCompatDelegate mDelegate;
|
||||
private Resources mResources;
|
||||
|
||||
public AppCompatActivity() {
|
||||
initDelegate();
|
||||
}
|
||||
|
||||
public AppCompatActivity(int contentLayoutId) {
|
||||
super(contentLayoutId);
|
||||
initDelegate();
|
||||
}
|
||||
|
||||
private void initDelegate() {
|
||||
getSavedStateRegistry().registerSavedStateProvider(DELEGATE_TAG, new SavedStateRegistry.SavedStateProvider() { // from class: androidx.appcompat.app.AppCompatActivity.1
|
||||
@Override // androidx.savedstate.SavedStateRegistry.SavedStateProvider
|
||||
public Bundle saveState() {
|
||||
Bundle outState = new Bundle();
|
||||
AppCompatActivity.this.getDelegate().onSaveInstanceState(outState);
|
||||
return outState;
|
||||
}
|
||||
});
|
||||
addOnContextAvailableListener(new OnContextAvailableListener() { // from class: androidx.appcompat.app.AppCompatActivity.2
|
||||
@Override // androidx.activity.contextaware.OnContextAvailableListener
|
||||
public void onContextAvailable(Context context) {
|
||||
AppCompatDelegate delegate = AppCompatActivity.this.getDelegate();
|
||||
delegate.installViewFactory();
|
||||
delegate.onCreate(AppCompatActivity.this.getSavedStateRegistry().consumeRestoredStateForKey(AppCompatActivity.DELEGATE_TAG));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.ContextThemeWrapper, android.content.ContextWrapper
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
super.attachBaseContext(getDelegate().attachBaseContext2(newBase));
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.ContextThemeWrapper, android.content.ContextWrapper, android.content.Context
|
||||
public void setTheme(int resId) {
|
||||
super.setTheme(resId);
|
||||
getDelegate().setTheme(resId);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
getDelegate().onPostCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
public ActionBar getSupportActionBar() {
|
||||
return getDelegate().getSupportActionBar();
|
||||
}
|
||||
|
||||
public void setSupportActionBar(Toolbar toolbar) {
|
||||
getDelegate().setSupportActionBar(toolbar);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public MenuInflater getMenuInflater() {
|
||||
return getDelegate().getMenuInflater();
|
||||
}
|
||||
|
||||
@Override // androidx.activity.ComponentActivity, android.app.Activity
|
||||
public void setContentView(int layoutResID) {
|
||||
initViewTreeOwners();
|
||||
getDelegate().setContentView(layoutResID);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.ComponentActivity, android.app.Activity
|
||||
public void setContentView(View view) {
|
||||
initViewTreeOwners();
|
||||
getDelegate().setContentView(view);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.ComponentActivity, android.app.Activity
|
||||
public void setContentView(View view, ViewGroup.LayoutParams params) {
|
||||
initViewTreeOwners();
|
||||
getDelegate().setContentView(view, params);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.ComponentActivity, android.app.Activity
|
||||
public void addContentView(View view, ViewGroup.LayoutParams params) {
|
||||
initViewTreeOwners();
|
||||
getDelegate().addContentView(view, params);
|
||||
}
|
||||
|
||||
private void initViewTreeOwners() {
|
||||
ViewTreeLifecycleOwner.set(getWindow().getDecorView(), this);
|
||||
ViewTreeViewModelStoreOwner.set(getWindow().getDecorView(), this);
|
||||
ViewTreeSavedStateRegistryOwner.set(getWindow().getDecorView(), this);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity, android.content.ComponentCallbacks
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
if (this.mResources != null) {
|
||||
DisplayMetrics newMetrics = super.getResources().getDisplayMetrics();
|
||||
this.mResources.updateConfiguration(newConfig, newMetrics);
|
||||
}
|
||||
getDelegate().onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onPostResume() {
|
||||
super.onPostResume();
|
||||
getDelegate().onPostResume();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
getDelegate().onStart();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
getDelegate().onStop();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public <T extends View> T findViewById(int i) {
|
||||
return (T) getDelegate().findViewById(i);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity, android.view.Window.Callback
|
||||
public final boolean onMenuItemSelected(int featureId, MenuItem item) {
|
||||
if (super.onMenuItemSelected(featureId, item)) {
|
||||
return true;
|
||||
}
|
||||
ActionBar ab = getSupportActionBar();
|
||||
if (item.getItemId() == 16908332 && ab != null && (ab.getDisplayOptions() & 4) != 0) {
|
||||
return onSupportNavigateUp();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
getDelegate().onDestroy();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onTitleChanged(CharSequence title, int color) {
|
||||
super.onTitleChanged(title, color);
|
||||
getDelegate().setTitle(title);
|
||||
}
|
||||
|
||||
public boolean supportRequestWindowFeature(int featureId) {
|
||||
return getDelegate().requestWindowFeature(featureId);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity
|
||||
public void supportInvalidateOptionsMenu() {
|
||||
getDelegate().invalidateOptionsMenu();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void invalidateOptionsMenu() {
|
||||
getDelegate().invalidateOptionsMenu();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public void onSupportActionModeStarted(ActionMode mode) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public void onSupportActionModeFinished(ActionMode mode) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public ActionMode onWindowStartingSupportActionMode(ActionMode.Callback callback) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ActionMode startSupportActionMode(ActionMode.Callback callback) {
|
||||
return getDelegate().startSupportActionMode(callback);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setSupportProgressBarVisibility(boolean visible) {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setSupportProgressBarIndeterminateVisibility(boolean visible) {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setSupportProgressBarIndeterminate(boolean indeterminate) {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setSupportProgress(int progress) {
|
||||
}
|
||||
|
||||
public void onCreateSupportNavigateUpTaskStack(TaskStackBuilder builder) {
|
||||
builder.addParentStack(this);
|
||||
}
|
||||
|
||||
public void onPrepareSupportNavigateUpTaskStack(TaskStackBuilder builder) {
|
||||
}
|
||||
|
||||
public boolean onSupportNavigateUp() {
|
||||
Intent upIntent = getSupportParentActivityIntent();
|
||||
if (upIntent != null) {
|
||||
if (supportShouldUpRecreateTask(upIntent)) {
|
||||
TaskStackBuilder b = TaskStackBuilder.create(this);
|
||||
onCreateSupportNavigateUpTaskStack(b);
|
||||
onPrepareSupportNavigateUpTaskStack(b);
|
||||
b.startActivities();
|
||||
try {
|
||||
ActivityCompat.finishAffinity(this);
|
||||
return true;
|
||||
} catch (IllegalStateException e) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
supportNavigateUpTo(upIntent);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.TaskStackBuilder.SupportParentable
|
||||
public Intent getSupportParentActivityIntent() {
|
||||
return NavUtils.getParentActivityIntent(this);
|
||||
}
|
||||
|
||||
public boolean supportShouldUpRecreateTask(Intent targetIntent) {
|
||||
return NavUtils.shouldUpRecreateTask(this, targetIntent);
|
||||
}
|
||||
|
||||
public void supportNavigateUpTo(Intent upIntent) {
|
||||
NavUtils.navigateUpTo(this, upIntent);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public void onContentChanged() {
|
||||
onSupportContentChanged();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void onSupportContentChanged() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBarDrawerToggle.DelegateProvider
|
||||
public ActionBarDrawerToggle.Delegate getDrawerToggleDelegate() {
|
||||
return getDelegate().getDrawerToggleDelegate();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public boolean onMenuOpened(int featureId, Menu menu) {
|
||||
return super.onMenuOpened(featureId, menu);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity, android.view.Window.Callback
|
||||
public void onPanelClosed(int featureId, Menu menu) {
|
||||
super.onPanelClosed(featureId, menu);
|
||||
}
|
||||
|
||||
public AppCompatDelegate getDelegate() {
|
||||
if (this.mDelegate == null) {
|
||||
this.mDelegate = AppCompatDelegate.create(this, this);
|
||||
}
|
||||
return this.mDelegate;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ComponentActivity, android.app.Activity, android.view.Window.Callback
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
int keyCode = event.getKeyCode();
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (keyCode == 82 && actionBar != null && actionBar.onMenuKeyEvent(event)) {
|
||||
return true;
|
||||
}
|
||||
return super.dispatchKeyEvent(event);
|
||||
}
|
||||
|
||||
@Override // android.view.ContextThemeWrapper, android.content.ContextWrapper, android.content.Context
|
||||
public Resources getResources() {
|
||||
if (this.mResources == null && VectorEnabledTintResources.shouldBeUsed()) {
|
||||
this.mResources = new VectorEnabledTintResources(this, super.getResources());
|
||||
}
|
||||
Resources resources = this.mResources;
|
||||
return resources == null ? super.getResources() : resources;
|
||||
}
|
||||
|
||||
private boolean performMenuItemShortcut(KeyEvent event) {
|
||||
Window currentWindow;
|
||||
if (Build.VERSION.SDK_INT < 26 && !event.isCtrlPressed() && !KeyEvent.metaStateHasNoModifiers(event.getMetaState()) && event.getRepeatCount() == 0 && !KeyEvent.isModifierKey(event.getKeyCode()) && (currentWindow = getWindow()) != null && currentWindow.getDecorView() != null) {
|
||||
View decorView = currentWindow.getDecorView();
|
||||
if (decorView.dispatchKeyShortcutEvent(event)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (performMenuItemShortcut(event)) {
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void openOptionsMenu() {
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (getWindow().hasFeature(0)) {
|
||||
if (actionBar == null || !actionBar.openOptionsMenu()) {
|
||||
super.openOptionsMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void closeOptionsMenu() {
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (getWindow().hasFeature(0)) {
|
||||
if (actionBar == null || !actionBar.closeOptionsMenu()) {
|
||||
super.closeOptionsMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void onNightModeChanged(int mode) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface AppCompatCallback {
|
||||
void onSupportActionModeFinished(ActionMode actionMode);
|
||||
|
||||
void onSupportActionModeStarted(ActionMode actionMode);
|
||||
|
||||
ActionMode onWindowStartingSupportActionMode(ActionMode.Callback callback);
|
||||
}
|
||||
+209
@@ -0,0 +1,209 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.appcompat.widget.VectorEnabledTintResources;
|
||||
import androidx.collection.ArraySet;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class AppCompatDelegate {
|
||||
static final boolean DEBUG = false;
|
||||
public static final int FEATURE_ACTION_MODE_OVERLAY = 10;
|
||||
public static final int FEATURE_SUPPORT_ACTION_BAR = 108;
|
||||
public static final int FEATURE_SUPPORT_ACTION_BAR_OVERLAY = 109;
|
||||
|
||||
@Deprecated
|
||||
public static final int MODE_NIGHT_AUTO = 0;
|
||||
public static final int MODE_NIGHT_AUTO_BATTERY = 3;
|
||||
|
||||
@Deprecated
|
||||
public static final int MODE_NIGHT_AUTO_TIME = 0;
|
||||
public static final int MODE_NIGHT_FOLLOW_SYSTEM = -1;
|
||||
public static final int MODE_NIGHT_NO = 1;
|
||||
public static final int MODE_NIGHT_UNSPECIFIED = -100;
|
||||
public static final int MODE_NIGHT_YES = 2;
|
||||
static final String TAG = "AppCompatDelegate";
|
||||
private static int sDefaultNightMode = -100;
|
||||
private static final ArraySet<WeakReference<AppCompatDelegate>> sActivityDelegates = new ArraySet<>();
|
||||
private static final Object sActivityDelegatesLock = new Object();
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface NightMode {
|
||||
}
|
||||
|
||||
public abstract void addContentView(View view, ViewGroup.LayoutParams layoutParams);
|
||||
|
||||
public abstract boolean applyDayNight();
|
||||
|
||||
public abstract View createView(View view, String str, Context context, AttributeSet attributeSet);
|
||||
|
||||
public abstract <T extends View> T findViewById(int i);
|
||||
|
||||
public abstract ActionBarDrawerToggle.Delegate getDrawerToggleDelegate();
|
||||
|
||||
public abstract MenuInflater getMenuInflater();
|
||||
|
||||
public abstract ActionBar getSupportActionBar();
|
||||
|
||||
public abstract boolean hasWindowFeature(int i);
|
||||
|
||||
public abstract void installViewFactory();
|
||||
|
||||
public abstract void invalidateOptionsMenu();
|
||||
|
||||
public abstract boolean isHandleNativeActionModesEnabled();
|
||||
|
||||
public abstract void onConfigurationChanged(Configuration configuration);
|
||||
|
||||
public abstract void onCreate(Bundle bundle);
|
||||
|
||||
public abstract void onDestroy();
|
||||
|
||||
public abstract void onPostCreate(Bundle bundle);
|
||||
|
||||
public abstract void onPostResume();
|
||||
|
||||
public abstract void onSaveInstanceState(Bundle bundle);
|
||||
|
||||
public abstract void onStart();
|
||||
|
||||
public abstract void onStop();
|
||||
|
||||
public abstract boolean requestWindowFeature(int i);
|
||||
|
||||
public abstract void setContentView(int i);
|
||||
|
||||
public abstract void setContentView(View view);
|
||||
|
||||
public abstract void setContentView(View view, ViewGroup.LayoutParams layoutParams);
|
||||
|
||||
public abstract void setHandleNativeActionModesEnabled(boolean z);
|
||||
|
||||
public abstract void setLocalNightMode(int i);
|
||||
|
||||
public abstract void setSupportActionBar(Toolbar toolbar);
|
||||
|
||||
public abstract void setTitle(CharSequence charSequence);
|
||||
|
||||
public abstract ActionMode startSupportActionMode(ActionMode.Callback callback);
|
||||
|
||||
public static AppCompatDelegate create(Activity activity, AppCompatCallback callback) {
|
||||
return new AppCompatDelegateImpl(activity, callback);
|
||||
}
|
||||
|
||||
public static AppCompatDelegate create(Dialog dialog, AppCompatCallback callback) {
|
||||
return new AppCompatDelegateImpl(dialog, callback);
|
||||
}
|
||||
|
||||
public static AppCompatDelegate create(Context context, Window window, AppCompatCallback callback) {
|
||||
return new AppCompatDelegateImpl(context, window, callback);
|
||||
}
|
||||
|
||||
public static AppCompatDelegate create(Context context, Activity activity, AppCompatCallback callback) {
|
||||
return new AppCompatDelegateImpl(context, activity, callback);
|
||||
}
|
||||
|
||||
AppCompatDelegate() {
|
||||
}
|
||||
|
||||
public void setTheme(int themeResId) {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void attachBaseContext(Context context) {
|
||||
}
|
||||
|
||||
public Context attachBaseContext2(Context context) {
|
||||
attachBaseContext(context);
|
||||
return context;
|
||||
}
|
||||
|
||||
public int getLocalNightMode() {
|
||||
return -100;
|
||||
}
|
||||
|
||||
public static void setDefaultNightMode(int mode) {
|
||||
switch (mode) {
|
||||
case -1:
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
if (sDefaultNightMode != mode) {
|
||||
sDefaultNightMode = mode;
|
||||
applyDayNightToActiveDelegates();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Log.d(TAG, "setDefaultNightMode() called with an unknown mode");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static int getDefaultNightMode() {
|
||||
return sDefaultNightMode;
|
||||
}
|
||||
|
||||
public static void setCompatVectorFromResourcesEnabled(boolean enabled) {
|
||||
VectorEnabledTintResources.setCompatVectorFromResourcesEnabled(enabled);
|
||||
}
|
||||
|
||||
public static boolean isCompatVectorFromResourcesEnabled() {
|
||||
return VectorEnabledTintResources.isCompatVectorFromResourcesEnabled();
|
||||
}
|
||||
|
||||
static void addActiveDelegate(AppCompatDelegate delegate) {
|
||||
synchronized (sActivityDelegatesLock) {
|
||||
removeDelegateFromActives(delegate);
|
||||
sActivityDelegates.add(new WeakReference<>(delegate));
|
||||
}
|
||||
}
|
||||
|
||||
static void removeActivityDelegate(AppCompatDelegate delegate) {
|
||||
synchronized (sActivityDelegatesLock) {
|
||||
removeDelegateFromActives(delegate);
|
||||
}
|
||||
}
|
||||
|
||||
private static void removeDelegateFromActives(AppCompatDelegate toRemove) {
|
||||
synchronized (sActivityDelegatesLock) {
|
||||
Iterator<WeakReference<AppCompatDelegate>> i = sActivityDelegates.iterator();
|
||||
while (i.hasNext()) {
|
||||
AppCompatDelegate delegate = i.next().get();
|
||||
if (delegate == toRemove || delegate == null) {
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void applyDayNightToActiveDelegates() {
|
||||
synchronized (sActivityDelegatesLock) {
|
||||
Iterator<WeakReference<AppCompatDelegate>> it = sActivityDelegates.iterator();
|
||||
while (it.hasNext()) {
|
||||
WeakReference<AppCompatDelegate> activeDelegate = it.next();
|
||||
AppCompatDelegate delegate = activeDelegate.get();
|
||||
if (delegate != null) {
|
||||
delegate.applyDayNight();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+2631
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,154 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.util.TypedValue;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.appcompat.C0046R;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.core.view.KeyEventDispatcher;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatDialog extends Dialog implements AppCompatCallback {
|
||||
private AppCompatDelegate mDelegate;
|
||||
private final KeyEventDispatcher.Component mKeyDispatcher;
|
||||
|
||||
public AppCompatDialog(Context context) {
|
||||
this(context, 0);
|
||||
}
|
||||
|
||||
public AppCompatDialog(Context context, int theme) {
|
||||
super(context, getThemeResId(context, theme));
|
||||
this.mKeyDispatcher = new KeyEventDispatcher.Component() { // from class: androidx.appcompat.app.AppCompatDialog.1
|
||||
@Override // androidx.core.view.KeyEventDispatcher.Component
|
||||
public boolean superDispatchKeyEvent(KeyEvent event) {
|
||||
return AppCompatDialog.this.superDispatchKeyEvent(event);
|
||||
}
|
||||
};
|
||||
AppCompatDelegate delegate = getDelegate();
|
||||
delegate.setTheme(getThemeResId(context, theme));
|
||||
delegate.onCreate(null);
|
||||
}
|
||||
|
||||
protected AppCompatDialog(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener) {
|
||||
super(context, cancelable, cancelListener);
|
||||
this.mKeyDispatcher = new KeyEventDispatcher.Component() { // from class: androidx.appcompat.app.AppCompatDialog.1
|
||||
@Override // androidx.core.view.KeyEventDispatcher.Component
|
||||
public boolean superDispatchKeyEvent(KeyEvent event) {
|
||||
return AppCompatDialog.this.superDispatchKeyEvent(event);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
getDelegate().installViewFactory();
|
||||
super.onCreate(savedInstanceState);
|
||||
getDelegate().onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
public ActionBar getSupportActionBar() {
|
||||
return getDelegate().getSupportActionBar();
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void setContentView(int layoutResID) {
|
||||
getDelegate().setContentView(layoutResID);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void setContentView(View view) {
|
||||
getDelegate().setContentView(view);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void setContentView(View view, ViewGroup.LayoutParams params) {
|
||||
getDelegate().setContentView(view, params);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public <T extends View> T findViewById(int i) {
|
||||
return (T) getDelegate().findViewById(i);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void setTitle(CharSequence title) {
|
||||
super.setTitle(title);
|
||||
getDelegate().setTitle(title);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void setTitle(int titleId) {
|
||||
super.setTitle(titleId);
|
||||
getDelegate().setTitle(getContext().getString(titleId));
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void addContentView(View view, ViewGroup.LayoutParams params) {
|
||||
getDelegate().addContentView(view, params);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
getDelegate().onStop();
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog, android.content.DialogInterface
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
getDelegate().onDestroy();
|
||||
}
|
||||
|
||||
public boolean supportRequestWindowFeature(int featureId) {
|
||||
return getDelegate().requestWindowFeature(featureId);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void invalidateOptionsMenu() {
|
||||
getDelegate().invalidateOptionsMenu();
|
||||
}
|
||||
|
||||
public AppCompatDelegate getDelegate() {
|
||||
if (this.mDelegate == null) {
|
||||
this.mDelegate = AppCompatDelegate.create(this, this);
|
||||
}
|
||||
return this.mDelegate;
|
||||
}
|
||||
|
||||
private static int getThemeResId(Context context, int themeId) {
|
||||
if (themeId == 0) {
|
||||
TypedValue outValue = new TypedValue();
|
||||
context.getTheme().resolveAttribute(C0046R.attr.dialogTheme, outValue, true);
|
||||
return outValue.resourceId;
|
||||
}
|
||||
return themeId;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public void onSupportActionModeStarted(ActionMode mode) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public void onSupportActionModeFinished(ActionMode mode) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public ActionMode onWindowStartingSupportActionMode(ActionMode.Callback callback) {
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean superDispatchKeyEvent(KeyEvent event) {
|
||||
return super.dispatchKeyEvent(event);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog, android.view.Window.Callback
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
View decor = getWindow().getDecorView();
|
||||
return KeyEventDispatcher.dispatchKeyEvent(this.mKeyDispatcher, decor, this, event);
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatDialogFragment extends DialogFragment {
|
||||
@Override // androidx.fragment.app.DialogFragment
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
return new AppCompatDialog(getContext(), getTheme());
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.DialogFragment
|
||||
public void setupDialog(Dialog dialog, int style) {
|
||||
if (dialog instanceof AppCompatDialog) {
|
||||
AppCompatDialog acd = (AppCompatDialog) dialog;
|
||||
switch (style) {
|
||||
case 1:
|
||||
case 2:
|
||||
break;
|
||||
case 3:
|
||||
dialog.getWindow().addFlags(24);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
acd.supportRequestWindowFeature(1);
|
||||
return;
|
||||
}
|
||||
super.setupDialog(dialog, style);
|
||||
}
|
||||
}
|
||||
+330
@@ -0,0 +1,330 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.InflateException;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.C0046R;
|
||||
import androidx.appcompat.view.ContextThemeWrapper;
|
||||
import androidx.appcompat.widget.AppCompatAutoCompleteTextView;
|
||||
import androidx.appcompat.widget.AppCompatButton;
|
||||
import androidx.appcompat.widget.AppCompatCheckBox;
|
||||
import androidx.appcompat.widget.AppCompatCheckedTextView;
|
||||
import androidx.appcompat.widget.AppCompatEditText;
|
||||
import androidx.appcompat.widget.AppCompatImageButton;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView;
|
||||
import androidx.appcompat.widget.AppCompatRadioButton;
|
||||
import androidx.appcompat.widget.AppCompatRatingBar;
|
||||
import androidx.appcompat.widget.AppCompatSeekBar;
|
||||
import androidx.appcompat.widget.AppCompatSpinner;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.appcompat.widget.AppCompatToggleButton;
|
||||
import androidx.appcompat.widget.TintContextWrapper;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatViewInflater {
|
||||
private static final String LOG_TAG = "AppCompatViewInflater";
|
||||
private final Object[] mConstructorArgs = new Object[2];
|
||||
private static final Class<?>[] sConstructorSignature = {Context.class, AttributeSet.class};
|
||||
private static final int[] sOnClickAttrs = {R.attr.onClick};
|
||||
private static final String[] sClassPrefixList = {"android.widget.", "android.view.", "android.webkit."};
|
||||
private static final SimpleArrayMap<String, Constructor<? extends View>> sConstructorMap = new SimpleArrayMap<>();
|
||||
|
||||
final View createView(View parent, String name, Context context, AttributeSet attrs, boolean inheritContext, boolean readAndroidTheme, boolean readAppTheme, boolean wrapContext) {
|
||||
View view;
|
||||
if (inheritContext && parent != null) {
|
||||
context = parent.getContext();
|
||||
}
|
||||
if (readAndroidTheme || readAppTheme) {
|
||||
context = themifyContext(context, attrs, readAndroidTheme, readAppTheme);
|
||||
}
|
||||
if (wrapContext) {
|
||||
context = TintContextWrapper.wrap(context);
|
||||
}
|
||||
switch (name) {
|
||||
default:
|
||||
view = createView(context, name, attrs);
|
||||
break;
|
||||
case "TextView":
|
||||
view = createTextView(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "ImageView":
|
||||
view = createImageView(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "Button":
|
||||
view = createButton(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "EditText":
|
||||
view = createEditText(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "Spinner":
|
||||
view = createSpinner(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "ImageButton":
|
||||
view = createImageButton(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "CheckBox":
|
||||
view = createCheckBox(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "RadioButton":
|
||||
view = createRadioButton(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "CheckedTextView":
|
||||
view = createCheckedTextView(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "AutoCompleteTextView":
|
||||
view = createAutoCompleteTextView(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "MultiAutoCompleteTextView":
|
||||
view = createMultiAutoCompleteTextView(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "RatingBar":
|
||||
view = createRatingBar(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "SeekBar":
|
||||
view = createSeekBar(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
case "ToggleButton":
|
||||
view = createToggleButton(context, attrs);
|
||||
verifyNotNull(view, name);
|
||||
break;
|
||||
}
|
||||
if (view == null && context != context) {
|
||||
view = createViewFromTag(context, name, attrs);
|
||||
}
|
||||
if (view != null) {
|
||||
checkOnClickListener(view, attrs);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
protected AppCompatTextView createTextView(Context context, AttributeSet attrs) {
|
||||
return new AppCompatTextView(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatImageView createImageView(Context context, AttributeSet attrs) {
|
||||
return new AppCompatImageView(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatButton createButton(Context context, AttributeSet attrs) {
|
||||
return new AppCompatButton(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatEditText createEditText(Context context, AttributeSet attrs) {
|
||||
return new AppCompatEditText(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatSpinner createSpinner(Context context, AttributeSet attrs) {
|
||||
return new AppCompatSpinner(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatImageButton createImageButton(Context context, AttributeSet attrs) {
|
||||
return new AppCompatImageButton(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatCheckBox createCheckBox(Context context, AttributeSet attrs) {
|
||||
return new AppCompatCheckBox(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatRadioButton createRadioButton(Context context, AttributeSet attrs) {
|
||||
return new AppCompatRadioButton(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatCheckedTextView createCheckedTextView(Context context, AttributeSet attrs) {
|
||||
return new AppCompatCheckedTextView(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatAutoCompleteTextView createAutoCompleteTextView(Context context, AttributeSet attrs) {
|
||||
return new AppCompatAutoCompleteTextView(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatMultiAutoCompleteTextView createMultiAutoCompleteTextView(Context context, AttributeSet attrs) {
|
||||
return new AppCompatMultiAutoCompleteTextView(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatRatingBar createRatingBar(Context context, AttributeSet attrs) {
|
||||
return new AppCompatRatingBar(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatSeekBar createSeekBar(Context context, AttributeSet attrs) {
|
||||
return new AppCompatSeekBar(context, attrs);
|
||||
}
|
||||
|
||||
protected AppCompatToggleButton createToggleButton(Context context, AttributeSet attrs) {
|
||||
return new AppCompatToggleButton(context, attrs);
|
||||
}
|
||||
|
||||
private void verifyNotNull(View view, String name) {
|
||||
if (view == null) {
|
||||
throw new IllegalStateException(getClass().getName() + " asked to inflate view for <" + name + ">, but returned null");
|
||||
}
|
||||
}
|
||||
|
||||
protected View createView(Context context, String name, AttributeSet attrs) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private View createViewFromTag(Context context, String name, AttributeSet attrs) {
|
||||
if (name.equals("view")) {
|
||||
name = attrs.getAttributeValue(null, "class");
|
||||
}
|
||||
try {
|
||||
Object[] objArr = this.mConstructorArgs;
|
||||
objArr[0] = context;
|
||||
objArr[1] = attrs;
|
||||
if (-1 != name.indexOf(46)) {
|
||||
return createViewByPrefix(context, name, null);
|
||||
}
|
||||
int i = 0;
|
||||
while (true) {
|
||||
String[] strArr = sClassPrefixList;
|
||||
if (i >= strArr.length) {
|
||||
return null;
|
||||
}
|
||||
View view = createViewByPrefix(context, name, strArr[i]);
|
||||
if (view != null) {
|
||||
return view;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
} finally {
|
||||
Object[] objArr2 = this.mConstructorArgs;
|
||||
objArr2[0] = null;
|
||||
objArr2[1] = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void checkOnClickListener(View view, AttributeSet attrs) {
|
||||
Context context = view.getContext();
|
||||
if (context instanceof ContextWrapper) {
|
||||
if (Build.VERSION.SDK_INT >= 15 && !ViewCompat.hasOnClickListeners(view)) {
|
||||
return;
|
||||
}
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, sOnClickAttrs);
|
||||
String handlerName = a.getString(0);
|
||||
if (handlerName != null) {
|
||||
view.setOnClickListener(new DeclaredOnClickListener(view, handlerName));
|
||||
}
|
||||
a.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
private View createViewByPrefix(Context context, String name, String prefix) throws ClassNotFoundException, InflateException {
|
||||
String str;
|
||||
SimpleArrayMap<String, Constructor<? extends View>> simpleArrayMap = sConstructorMap;
|
||||
Constructor<? extends View> constructor = simpleArrayMap.get(name);
|
||||
if (constructor == null) {
|
||||
if (prefix != null) {
|
||||
try {
|
||||
str = prefix + name;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
str = name;
|
||||
}
|
||||
constructor = Class.forName(str, false, context.getClassLoader()).asSubclass(View.class).getConstructor(sConstructorSignature);
|
||||
simpleArrayMap.put(name, constructor);
|
||||
}
|
||||
constructor.setAccessible(true);
|
||||
return constructor.newInstance(this.mConstructorArgs);
|
||||
}
|
||||
|
||||
private static Context themifyContext(Context context, AttributeSet attrs, boolean useAndroidTheme, boolean useAppTheme) {
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, C0046R.styleable.View, 0, 0);
|
||||
int themeId = 0;
|
||||
if (useAndroidTheme) {
|
||||
themeId = a.getResourceId(C0046R.styleable.View_android_theme, 0);
|
||||
}
|
||||
if (useAppTheme && themeId == 0 && (themeId = a.getResourceId(C0046R.styleable.View_theme, 0)) != 0) {
|
||||
Log.i(LOG_TAG, "app:theme is now deprecated. Please move to using android:theme instead.");
|
||||
}
|
||||
a.recycle();
|
||||
if (themeId != 0) {
|
||||
if (!(context instanceof ContextThemeWrapper) || ((ContextThemeWrapper) context).getThemeResId() != themeId) {
|
||||
return new ContextThemeWrapper(context, themeId);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
private static class DeclaredOnClickListener implements View.OnClickListener {
|
||||
private final View mHostView;
|
||||
private final String mMethodName;
|
||||
private Context mResolvedContext;
|
||||
private Method mResolvedMethod;
|
||||
|
||||
public DeclaredOnClickListener(View hostView, String methodName) {
|
||||
this.mHostView = hostView;
|
||||
this.mMethodName = methodName;
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View v) {
|
||||
if (this.mResolvedMethod == null) {
|
||||
resolveMethod(this.mHostView.getContext());
|
||||
}
|
||||
try {
|
||||
this.mResolvedMethod.invoke(this.mResolvedContext, v);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new IllegalStateException("Could not execute non-public method for android:onClick", e);
|
||||
} catch (InvocationTargetException e2) {
|
||||
throw new IllegalStateException("Could not execute method for android:onClick", e2);
|
||||
}
|
||||
}
|
||||
|
||||
private void resolveMethod(Context context) {
|
||||
String idText;
|
||||
Method method;
|
||||
while (context != null) {
|
||||
try {
|
||||
if (!context.isRestricted() && (method = context.getClass().getMethod(this.mMethodName, View.class)) != null) {
|
||||
this.mResolvedMethod = method;
|
||||
this.mResolvedContext = context;
|
||||
return;
|
||||
}
|
||||
} catch (NoSuchMethodException e) {
|
||||
}
|
||||
if (context instanceof ContextWrapper) {
|
||||
context = ((ContextWrapper) context).getBaseContext();
|
||||
} else {
|
||||
context = null;
|
||||
}
|
||||
}
|
||||
int id = this.mHostView.getId();
|
||||
if (id == -1) {
|
||||
idText = "";
|
||||
} else {
|
||||
idText = " with id '" + this.mHostView.getContext().getResources().getResourceEntryName(id) + "'";
|
||||
}
|
||||
throw new IllegalStateException("Could not find method " + this.mMethodName + "(View) in a parent or ancestor Context for android:onClick attribute defined on view " + this.mHostView.getClass() + idText);
|
||||
}
|
||||
}
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.util.AttributeSet;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Deque;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class LayoutIncludeDetector {
|
||||
private final Deque<WeakReference<XmlPullParser>> mXmlParserStack = new ArrayDeque();
|
||||
|
||||
LayoutIncludeDetector() {
|
||||
}
|
||||
|
||||
boolean detect(AttributeSet attrs) {
|
||||
if (attrs instanceof XmlPullParser) {
|
||||
XmlPullParser xmlAttrs = (XmlPullParser) attrs;
|
||||
if (xmlAttrs.getDepth() == 1) {
|
||||
XmlPullParser ancestorXmlAttrs = popOutdatedAttrHolders(this.mXmlParserStack);
|
||||
this.mXmlParserStack.push(new WeakReference<>(xmlAttrs));
|
||||
return shouldInheritContext(xmlAttrs, ancestorXmlAttrs);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean shouldInheritContext(XmlPullParser parser, XmlPullParser previousParser) {
|
||||
if (previousParser != null && parser != previousParser) {
|
||||
try {
|
||||
if (previousParser.getEventType() == 2) {
|
||||
return "include".equals(previousParser.getName());
|
||||
}
|
||||
return false;
|
||||
} catch (XmlPullParserException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static XmlPullParser popOutdatedAttrHolders(Deque<WeakReference<XmlPullParser>> xmlParserStack) {
|
||||
while (!xmlParserStack.isEmpty()) {
|
||||
XmlPullParser parser = xmlParserStack.peek().get();
|
||||
if (isParserOutdated(parser)) {
|
||||
xmlParserStack.pop();
|
||||
} else {
|
||||
return parser;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isParserOutdated(XmlPullParser parser) {
|
||||
if (parser != null) {
|
||||
try {
|
||||
if (parser.getEventType() != 3) {
|
||||
return parser.getEventType() == 1;
|
||||
}
|
||||
return true;
|
||||
} catch (XmlPullParserException e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class NavItemSelectedListener implements AdapterView.OnItemSelectedListener {
|
||||
private final ActionBar.OnNavigationListener mListener;
|
||||
|
||||
public NavItemSelectedListener(ActionBar.OnNavigationListener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
@Override // android.widget.AdapterView.OnItemSelectedListener
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
ActionBar.OnNavigationListener onNavigationListener = this.mListener;
|
||||
if (onNavigationListener != null) {
|
||||
onNavigationListener.onNavigationItemSelected(position, id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.AdapterView.OnItemSelectedListener
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.util.LongSparseArray;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class ResourcesFlusher {
|
||||
private static final String TAG = "ResourcesFlusher";
|
||||
private static Field sDrawableCacheField;
|
||||
private static boolean sDrawableCacheFieldFetched;
|
||||
private static Field sResourcesImplField;
|
||||
private static boolean sResourcesImplFieldFetched;
|
||||
private static Class<?> sThemedResourceCacheClazz;
|
||||
private static boolean sThemedResourceCacheClazzFetched;
|
||||
private static Field sThemedResourceCache_mUnthemedEntriesField;
|
||||
private static boolean sThemedResourceCache_mUnthemedEntriesFieldFetched;
|
||||
|
||||
static void flush(Resources resources) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
flushNougats(resources);
|
||||
} else if (Build.VERSION.SDK_INT >= 23) {
|
||||
flushMarshmallows(resources);
|
||||
} else if (Build.VERSION.SDK_INT >= 21) {
|
||||
flushLollipops(resources);
|
||||
}
|
||||
}
|
||||
|
||||
private static void flushLollipops(Resources resources) {
|
||||
if (!sDrawableCacheFieldFetched) {
|
||||
try {
|
||||
Field declaredField = Resources.class.getDeclaredField("mDrawableCache");
|
||||
sDrawableCacheField = declaredField;
|
||||
declaredField.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
Log.e(TAG, "Could not retrieve Resources#mDrawableCache field", e);
|
||||
}
|
||||
sDrawableCacheFieldFetched = true;
|
||||
}
|
||||
Field field = sDrawableCacheField;
|
||||
if (field != null) {
|
||||
Map drawableCache = null;
|
||||
try {
|
||||
drawableCache = (Map) field.get(resources);
|
||||
} catch (IllegalAccessException e2) {
|
||||
Log.e(TAG, "Could not retrieve value from Resources#mDrawableCache", e2);
|
||||
}
|
||||
if (drawableCache != null) {
|
||||
drawableCache.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void flushMarshmallows(Resources resources) {
|
||||
if (!sDrawableCacheFieldFetched) {
|
||||
try {
|
||||
Field declaredField = Resources.class.getDeclaredField("mDrawableCache");
|
||||
sDrawableCacheField = declaredField;
|
||||
declaredField.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
Log.e(TAG, "Could not retrieve Resources#mDrawableCache field", e);
|
||||
}
|
||||
sDrawableCacheFieldFetched = true;
|
||||
}
|
||||
Object drawableCache = null;
|
||||
Field field = sDrawableCacheField;
|
||||
if (field != null) {
|
||||
try {
|
||||
drawableCache = field.get(resources);
|
||||
} catch (IllegalAccessException e2) {
|
||||
Log.e(TAG, "Could not retrieve value from Resources#mDrawableCache", e2);
|
||||
}
|
||||
}
|
||||
if (drawableCache == null) {
|
||||
return;
|
||||
}
|
||||
flushThemedResourcesCache(drawableCache);
|
||||
}
|
||||
|
||||
private static void flushNougats(Resources resources) {
|
||||
if (!sResourcesImplFieldFetched) {
|
||||
try {
|
||||
Field declaredField = Resources.class.getDeclaredField("mResourcesImpl");
|
||||
sResourcesImplField = declaredField;
|
||||
declaredField.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
Log.e(TAG, "Could not retrieve Resources#mResourcesImpl field", e);
|
||||
}
|
||||
sResourcesImplFieldFetched = true;
|
||||
}
|
||||
Field field = sResourcesImplField;
|
||||
if (field == null) {
|
||||
return;
|
||||
}
|
||||
Object resourcesImpl = null;
|
||||
try {
|
||||
resourcesImpl = field.get(resources);
|
||||
} catch (IllegalAccessException e2) {
|
||||
Log.e(TAG, "Could not retrieve value from Resources#mResourcesImpl", e2);
|
||||
}
|
||||
if (resourcesImpl == null) {
|
||||
return;
|
||||
}
|
||||
if (!sDrawableCacheFieldFetched) {
|
||||
try {
|
||||
Field declaredField2 = resourcesImpl.getClass().getDeclaredField("mDrawableCache");
|
||||
sDrawableCacheField = declaredField2;
|
||||
declaredField2.setAccessible(true);
|
||||
} catch (NoSuchFieldException e3) {
|
||||
Log.e(TAG, "Could not retrieve ResourcesImpl#mDrawableCache field", e3);
|
||||
}
|
||||
sDrawableCacheFieldFetched = true;
|
||||
}
|
||||
Object drawableCache = null;
|
||||
Field field2 = sDrawableCacheField;
|
||||
if (field2 != null) {
|
||||
try {
|
||||
drawableCache = field2.get(resourcesImpl);
|
||||
} catch (IllegalAccessException e4) {
|
||||
Log.e(TAG, "Could not retrieve value from ResourcesImpl#mDrawableCache", e4);
|
||||
}
|
||||
}
|
||||
if (drawableCache != null) {
|
||||
flushThemedResourcesCache(drawableCache);
|
||||
}
|
||||
}
|
||||
|
||||
private static void flushThemedResourcesCache(Object cache) {
|
||||
if (!sThemedResourceCacheClazzFetched) {
|
||||
try {
|
||||
sThemedResourceCacheClazz = Class.forName("android.content.res.ThemedResourceCache");
|
||||
} catch (ClassNotFoundException e) {
|
||||
Log.e(TAG, "Could not find ThemedResourceCache class", e);
|
||||
}
|
||||
sThemedResourceCacheClazzFetched = true;
|
||||
}
|
||||
Class<?> cls = sThemedResourceCacheClazz;
|
||||
if (cls == null) {
|
||||
return;
|
||||
}
|
||||
if (!sThemedResourceCache_mUnthemedEntriesFieldFetched) {
|
||||
try {
|
||||
Field declaredField = cls.getDeclaredField("mUnthemedEntries");
|
||||
sThemedResourceCache_mUnthemedEntriesField = declaredField;
|
||||
declaredField.setAccessible(true);
|
||||
} catch (NoSuchFieldException ee) {
|
||||
Log.e(TAG, "Could not retrieve ThemedResourceCache#mUnthemedEntries field", ee);
|
||||
}
|
||||
sThemedResourceCache_mUnthemedEntriesFieldFetched = true;
|
||||
}
|
||||
Field field = sThemedResourceCache_mUnthemedEntriesField;
|
||||
if (field == null) {
|
||||
return;
|
||||
}
|
||||
LongSparseArray unthemedEntries = null;
|
||||
try {
|
||||
unthemedEntries = (LongSparseArray) field.get(cache);
|
||||
} catch (IllegalAccessException e2) {
|
||||
Log.e(TAG, "Could not retrieve value from ThemedResourceCache#mUnthemedEntries", e2);
|
||||
}
|
||||
if (unthemedEntries != null) {
|
||||
unthemedEntries.clear();
|
||||
}
|
||||
}
|
||||
|
||||
private ResourcesFlusher() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,553 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.SpinnerAdapter;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.view.WindowCallbackWrapper;
|
||||
import androidx.appcompat.view.menu.MenuBuilder;
|
||||
import androidx.appcompat.view.menu.MenuPresenter;
|
||||
import androidx.appcompat.widget.DecorToolbar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.appcompat.widget.ToolbarWidgetWrapper;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class ToolbarActionBar extends ActionBar {
|
||||
DecorToolbar mDecorToolbar;
|
||||
private boolean mLastMenuVisibility;
|
||||
private boolean mMenuCallbackSet;
|
||||
private final Toolbar.OnMenuItemClickListener mMenuClicker;
|
||||
boolean mToolbarMenuPrepared;
|
||||
Window.Callback mWindowCallback;
|
||||
private ArrayList<ActionBar.OnMenuVisibilityListener> mMenuVisibilityListeners = new ArrayList<>();
|
||||
private final Runnable mMenuInvalidator = new Runnable() { // from class: androidx.appcompat.app.ToolbarActionBar.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
ToolbarActionBar.this.populateOptionsMenu();
|
||||
}
|
||||
};
|
||||
|
||||
ToolbarActionBar(Toolbar toolbar, CharSequence title, Window.Callback windowCallback) {
|
||||
Toolbar.OnMenuItemClickListener onMenuItemClickListener = new Toolbar.OnMenuItemClickListener() { // from class: androidx.appcompat.app.ToolbarActionBar.2
|
||||
@Override // androidx.appcompat.widget.Toolbar.OnMenuItemClickListener
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
return ToolbarActionBar.this.mWindowCallback.onMenuItemSelected(0, item);
|
||||
}
|
||||
};
|
||||
this.mMenuClicker = onMenuItemClickListener;
|
||||
this.mDecorToolbar = new ToolbarWidgetWrapper(toolbar, false);
|
||||
ToolbarCallbackWrapper toolbarCallbackWrapper = new ToolbarCallbackWrapper(windowCallback);
|
||||
this.mWindowCallback = toolbarCallbackWrapper;
|
||||
this.mDecorToolbar.setWindowCallback(toolbarCallbackWrapper);
|
||||
toolbar.setOnMenuItemClickListener(onMenuItemClickListener);
|
||||
this.mDecorToolbar.setWindowTitle(title);
|
||||
}
|
||||
|
||||
public Window.Callback getWrappedWindowCallback() {
|
||||
return this.mWindowCallback;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setCustomView(View view) {
|
||||
setCustomView(view, new ActionBar.LayoutParams(-2, -2));
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setCustomView(View view, ActionBar.LayoutParams layoutParams) {
|
||||
if (view != null) {
|
||||
view.setLayoutParams(layoutParams);
|
||||
}
|
||||
this.mDecorToolbar.setCustomView(view);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setCustomView(int resId) {
|
||||
LayoutInflater inflater = LayoutInflater.from(this.mDecorToolbar.getContext());
|
||||
setCustomView(inflater.inflate(resId, this.mDecorToolbar.getViewGroup(), false));
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setIcon(int resId) {
|
||||
this.mDecorToolbar.setIcon(resId);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setIcon(Drawable icon) {
|
||||
this.mDecorToolbar.setIcon(icon);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setLogo(int resId) {
|
||||
this.mDecorToolbar.setLogo(resId);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setLogo(Drawable logo) {
|
||||
this.mDecorToolbar.setLogo(logo);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setStackedBackgroundDrawable(Drawable d) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setSplitBackgroundDrawable(Drawable d) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setHomeButtonEnabled(boolean enabled) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setElevation(float elevation) {
|
||||
ViewCompat.setElevation(this.mDecorToolbar.getViewGroup(), elevation);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public float getElevation() {
|
||||
return ViewCompat.getElevation(this.mDecorToolbar.getViewGroup());
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public Context getThemedContext() {
|
||||
return this.mDecorToolbar.getContext();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean isTitleTruncated() {
|
||||
return super.isTitleTruncated();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setHomeAsUpIndicator(Drawable indicator) {
|
||||
this.mDecorToolbar.setNavigationIcon(indicator);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setHomeAsUpIndicator(int resId) {
|
||||
this.mDecorToolbar.setNavigationIcon(resId);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setHomeActionContentDescription(CharSequence description) {
|
||||
this.mDecorToolbar.setNavigationContentDescription(description);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setDefaultDisplayHomeAsUpEnabled(boolean enabled) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setHomeActionContentDescription(int resId) {
|
||||
this.mDecorToolbar.setNavigationContentDescription(resId);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setShowHideAnimationEnabled(boolean enabled) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void onConfigurationChanged(Configuration config) {
|
||||
super.onConfigurationChanged(config);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setListNavigationCallbacks(SpinnerAdapter adapter, ActionBar.OnNavigationListener callback) {
|
||||
this.mDecorToolbar.setDropdownParams(adapter, new NavItemSelectedListener(callback));
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setSelectedNavigationItem(int position) {
|
||||
switch (this.mDecorToolbar.getNavigationMode()) {
|
||||
case 1:
|
||||
this.mDecorToolbar.setDropdownSelectedPosition(position);
|
||||
return;
|
||||
default:
|
||||
throw new IllegalStateException("setSelectedNavigationIndex not valid for current navigation mode");
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public int getSelectedNavigationIndex() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public int getNavigationItemCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setTitle(CharSequence title) {
|
||||
this.mDecorToolbar.setTitle(title);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setTitle(int resId) {
|
||||
DecorToolbar decorToolbar = this.mDecorToolbar;
|
||||
decorToolbar.setTitle(resId != 0 ? decorToolbar.getContext().getText(resId) : null);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setWindowTitle(CharSequence title) {
|
||||
this.mDecorToolbar.setWindowTitle(title);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean requestFocus() {
|
||||
ViewGroup viewGroup = this.mDecorToolbar.getViewGroup();
|
||||
if (viewGroup != null && !viewGroup.hasFocus()) {
|
||||
viewGroup.requestFocus();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setSubtitle(CharSequence subtitle) {
|
||||
this.mDecorToolbar.setSubtitle(subtitle);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setSubtitle(int resId) {
|
||||
DecorToolbar decorToolbar = this.mDecorToolbar;
|
||||
decorToolbar.setSubtitle(resId != 0 ? decorToolbar.getContext().getText(resId) : null);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setDisplayOptions(int options) {
|
||||
setDisplayOptions(options, -1);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setDisplayOptions(int options, int mask) {
|
||||
int currentOptions = this.mDecorToolbar.getDisplayOptions();
|
||||
this.mDecorToolbar.setDisplayOptions((options & mask) | ((~mask) & currentOptions));
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setDisplayUseLogoEnabled(boolean z) {
|
||||
setDisplayOptions(z ? 1 : 0, 1);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setDisplayShowHomeEnabled(boolean showHome) {
|
||||
setDisplayOptions(showHome ? 2 : 0, 2);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setDisplayHomeAsUpEnabled(boolean showHomeAsUp) {
|
||||
setDisplayOptions(showHomeAsUp ? 4 : 0, 4);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setDisplayShowTitleEnabled(boolean showTitle) {
|
||||
setDisplayOptions(showTitle ? 8 : 0, 8);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setDisplayShowCustomEnabled(boolean showCustom) {
|
||||
setDisplayOptions(showCustom ? 16 : 0, 16);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setBackgroundDrawable(Drawable d) {
|
||||
this.mDecorToolbar.setBackgroundDrawable(d);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public View getCustomView() {
|
||||
return this.mDecorToolbar.getCustomView();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public CharSequence getTitle() {
|
||||
return this.mDecorToolbar.getTitle();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public CharSequence getSubtitle() {
|
||||
return this.mDecorToolbar.getSubtitle();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public int getNavigationMode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void setNavigationMode(int mode) {
|
||||
if (mode == 2) {
|
||||
throw new IllegalArgumentException("Tabs not supported in this configuration");
|
||||
}
|
||||
this.mDecorToolbar.setNavigationMode(mode);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public int getDisplayOptions() {
|
||||
return this.mDecorToolbar.getDisplayOptions();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public ActionBar.Tab newTab() {
|
||||
throw new UnsupportedOperationException("Tabs are not supported in toolbar action bars");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void addTab(ActionBar.Tab tab) {
|
||||
throw new UnsupportedOperationException("Tabs are not supported in toolbar action bars");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void addTab(ActionBar.Tab tab, boolean setSelected) {
|
||||
throw new UnsupportedOperationException("Tabs are not supported in toolbar action bars");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void addTab(ActionBar.Tab tab, int position) {
|
||||
throw new UnsupportedOperationException("Tabs are not supported in toolbar action bars");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void addTab(ActionBar.Tab tab, int position, boolean setSelected) {
|
||||
throw new UnsupportedOperationException("Tabs are not supported in toolbar action bars");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void removeTab(ActionBar.Tab tab) {
|
||||
throw new UnsupportedOperationException("Tabs are not supported in toolbar action bars");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void removeTabAt(int position) {
|
||||
throw new UnsupportedOperationException("Tabs are not supported in toolbar action bars");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void removeAllTabs() {
|
||||
throw new UnsupportedOperationException("Tabs are not supported in toolbar action bars");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void selectTab(ActionBar.Tab tab) {
|
||||
throw new UnsupportedOperationException("Tabs are not supported in toolbar action bars");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public ActionBar.Tab getSelectedTab() {
|
||||
throw new UnsupportedOperationException("Tabs are not supported in toolbar action bars");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public ActionBar.Tab getTabAt(int index) {
|
||||
throw new UnsupportedOperationException("Tabs are not supported in toolbar action bars");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public int getTabCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public int getHeight() {
|
||||
return this.mDecorToolbar.getHeight();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void show() {
|
||||
this.mDecorToolbar.setVisibility(0);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void hide() {
|
||||
this.mDecorToolbar.setVisibility(8);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean isShowing() {
|
||||
return this.mDecorToolbar.getVisibility() == 0;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean openOptionsMenu() {
|
||||
return this.mDecorToolbar.showOverflowMenu();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean closeOptionsMenu() {
|
||||
return this.mDecorToolbar.hideOverflowMenu();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean invalidateOptionsMenu() {
|
||||
this.mDecorToolbar.getViewGroup().removeCallbacks(this.mMenuInvalidator);
|
||||
ViewCompat.postOnAnimation(this.mDecorToolbar.getViewGroup(), this.mMenuInvalidator);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean collapseActionView() {
|
||||
if (this.mDecorToolbar.hasExpandedActionView()) {
|
||||
this.mDecorToolbar.collapseActionView();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void populateOptionsMenu() {
|
||||
Menu menu = getMenu();
|
||||
MenuBuilder mb = menu instanceof MenuBuilder ? (MenuBuilder) menu : null;
|
||||
if (mb != null) {
|
||||
mb.stopDispatchingItemsChanged();
|
||||
}
|
||||
try {
|
||||
menu.clear();
|
||||
if (!this.mWindowCallback.onCreatePanelMenu(0, menu) || !this.mWindowCallback.onPreparePanel(0, null, menu)) {
|
||||
menu.clear();
|
||||
}
|
||||
} finally {
|
||||
if (mb != null) {
|
||||
mb.startDispatchingItemsChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean onMenuKeyEvent(KeyEvent event) {
|
||||
if (event.getAction() == 1) {
|
||||
openOptionsMenu();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean onKeyShortcut(int keyCode, KeyEvent ev) {
|
||||
Menu menu = getMenu();
|
||||
if (menu == null) {
|
||||
return false;
|
||||
}
|
||||
KeyCharacterMap kmap = KeyCharacterMap.load(ev != null ? ev.getDeviceId() : -1);
|
||||
menu.setQwertyMode(kmap.getKeyboardType() != 1);
|
||||
return menu.performShortcut(keyCode, ev, 0);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
void onDestroy() {
|
||||
this.mDecorToolbar.getViewGroup().removeCallbacks(this.mMenuInvalidator);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void addOnMenuVisibilityListener(ActionBar.OnMenuVisibilityListener listener) {
|
||||
this.mMenuVisibilityListeners.add(listener);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void removeOnMenuVisibilityListener(ActionBar.OnMenuVisibilityListener listener) {
|
||||
this.mMenuVisibilityListeners.remove(listener);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void dispatchMenuVisibilityChanged(boolean isVisible) {
|
||||
if (isVisible == this.mLastMenuVisibility) {
|
||||
return;
|
||||
}
|
||||
this.mLastMenuVisibility = isVisible;
|
||||
int count = this.mMenuVisibilityListeners.size();
|
||||
for (int i = 0; i < count; i++) {
|
||||
this.mMenuVisibilityListeners.get(i).onMenuVisibilityChanged(isVisible);
|
||||
}
|
||||
}
|
||||
|
||||
private class ToolbarCallbackWrapper extends WindowCallbackWrapper {
|
||||
public ToolbarCallbackWrapper(Window.Callback wrapped) {
|
||||
super(wrapped);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.WindowCallbackWrapper, android.view.Window.Callback
|
||||
public boolean onPreparePanel(int featureId, View view, Menu menu) {
|
||||
boolean result = super.onPreparePanel(featureId, view, menu);
|
||||
if (result && !ToolbarActionBar.this.mToolbarMenuPrepared) {
|
||||
ToolbarActionBar.this.mDecorToolbar.setMenuPrepared();
|
||||
ToolbarActionBar.this.mToolbarMenuPrepared = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.WindowCallbackWrapper, android.view.Window.Callback
|
||||
public View onCreatePanelView(int featureId) {
|
||||
if (featureId == 0) {
|
||||
return new View(ToolbarActionBar.this.mDecorToolbar.getContext());
|
||||
}
|
||||
return super.onCreatePanelView(featureId);
|
||||
}
|
||||
}
|
||||
|
||||
private Menu getMenu() {
|
||||
if (!this.mMenuCallbackSet) {
|
||||
this.mDecorToolbar.setMenuCallbacks(new ActionMenuPresenterCallback(), new MenuBuilderCallback());
|
||||
this.mMenuCallbackSet = true;
|
||||
}
|
||||
return this.mDecorToolbar.getMenu();
|
||||
}
|
||||
|
||||
private final class ActionMenuPresenterCallback implements MenuPresenter.Callback {
|
||||
private boolean mClosingActionMenu;
|
||||
|
||||
ActionMenuPresenterCallback() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
|
||||
public boolean onOpenSubMenu(MenuBuilder subMenu) {
|
||||
if (ToolbarActionBar.this.mWindowCallback != null) {
|
||||
ToolbarActionBar.this.mWindowCallback.onMenuOpened(108, subMenu);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
|
||||
public void onCloseMenu(MenuBuilder menu, boolean allMenusAreClosing) {
|
||||
if (this.mClosingActionMenu) {
|
||||
return;
|
||||
}
|
||||
this.mClosingActionMenu = true;
|
||||
ToolbarActionBar.this.mDecorToolbar.dismissPopupMenus();
|
||||
if (ToolbarActionBar.this.mWindowCallback != null) {
|
||||
ToolbarActionBar.this.mWindowCallback.onPanelClosed(108, menu);
|
||||
}
|
||||
this.mClosingActionMenu = false;
|
||||
}
|
||||
}
|
||||
|
||||
private final class MenuBuilderCallback implements MenuBuilder.Callback {
|
||||
MenuBuilderCallback() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
|
||||
public boolean onMenuItemSelected(MenuBuilder menu, MenuItem item) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
|
||||
public void onMenuModeChange(MenuBuilder menu) {
|
||||
if (ToolbarActionBar.this.mWindowCallback != null) {
|
||||
if (ToolbarActionBar.this.mDecorToolbar.isOverflowMenuShowing()) {
|
||||
ToolbarActionBar.this.mWindowCallback.onPanelClosed(108, menu);
|
||||
} else if (ToolbarActionBar.this.mWindowCallback.onPreparePanel(0, null, menu)) {
|
||||
ToolbarActionBar.this.mWindowCallback.onMenuOpened(108, menu);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class TwilightCalculator {
|
||||
private static final float ALTIDUTE_CORRECTION_CIVIL_TWILIGHT = -0.10471976f;
|
||||
|
||||
/* renamed from: C1 */
|
||||
private static final float f8C1 = 0.0334196f;
|
||||
|
||||
/* renamed from: C2 */
|
||||
private static final float f9C2 = 3.49066E-4f;
|
||||
|
||||
/* renamed from: C3 */
|
||||
private static final float f10C3 = 5.236E-6f;
|
||||
public static final int DAY = 0;
|
||||
private static final float DEGREES_TO_RADIANS = 0.017453292f;
|
||||
|
||||
/* renamed from: J0 */
|
||||
private static final float f11J0 = 9.0E-4f;
|
||||
public static final int NIGHT = 1;
|
||||
private static final float OBLIQUITY = 0.4092797f;
|
||||
private static final long UTC_2000 = 946728000000L;
|
||||
private static TwilightCalculator sInstance;
|
||||
public int state;
|
||||
public long sunrise;
|
||||
public long sunset;
|
||||
|
||||
TwilightCalculator() {
|
||||
}
|
||||
|
||||
static TwilightCalculator getInstance() {
|
||||
if (sInstance == null) {
|
||||
sInstance = new TwilightCalculator();
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void calculateTwilight(long time, double latitude, double longitude) {
|
||||
float daysSince2000 = ((float) (time - UTC_2000)) / 8.64E7f;
|
||||
float meanAnomaly = (0.01720197f * daysSince2000) + 6.24006f;
|
||||
double trueAnomaly = meanAnomaly + (Math.sin(meanAnomaly) * 0.03341960161924362d) + (Math.sin(2.0f * meanAnomaly) * 3.4906598739326E-4d) + (Math.sin(3.0f * meanAnomaly) * 5.236000106378924E-6d);
|
||||
double solarLng = 1.796593063d + trueAnomaly + 3.141592653589793d;
|
||||
double arcLongitude = (-longitude) / 360.0d;
|
||||
float n = (float) Math.round((daysSince2000 - f11J0) - arcLongitude);
|
||||
double trueAnomaly2 = meanAnomaly;
|
||||
double solarTransitJ2000 = f11J0 + n + arcLongitude + (Math.sin(trueAnomaly2) * 0.0053d) + (Math.sin(2.0d * solarLng) * (-0.0069d));
|
||||
double solarDec = Math.asin(Math.sin(solarLng) * Math.sin(0.4092797040939331d));
|
||||
double latRad = 0.01745329238474369d * latitude;
|
||||
double cosHourAngle = (Math.sin(-0.10471975803375244d) - (Math.sin(latRad) * Math.sin(solarDec))) / (Math.cos(latRad) * Math.cos(solarDec));
|
||||
if (cosHourAngle >= 1.0d) {
|
||||
this.state = 1;
|
||||
this.sunset = -1L;
|
||||
this.sunrise = -1L;
|
||||
} else {
|
||||
if (cosHourAngle <= -1.0d) {
|
||||
this.state = 0;
|
||||
this.sunset = -1L;
|
||||
this.sunrise = -1L;
|
||||
return;
|
||||
}
|
||||
float hourAngle = (float) (Math.acos(cosHourAngle) / 6.283185307179586d);
|
||||
this.sunset = Math.round((hourAngle + solarTransitJ2000) * 8.64E7d) + UTC_2000;
|
||||
long round = Math.round((solarTransitJ2000 - hourAngle) * 8.64E7d) + UTC_2000;
|
||||
this.sunrise = round;
|
||||
if (round >= time || this.sunset <= time) {
|
||||
this.state = 1;
|
||||
} else {
|
||||
this.state = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
import android.util.Log;
|
||||
import androidx.core.content.PermissionChecker;
|
||||
import java.util.Calendar;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class TwilightManager {
|
||||
private static final int SUNRISE = 6;
|
||||
private static final int SUNSET = 22;
|
||||
private static final String TAG = "TwilightManager";
|
||||
private static TwilightManager sInstance;
|
||||
private final Context mContext;
|
||||
private final LocationManager mLocationManager;
|
||||
private final TwilightState mTwilightState = new TwilightState();
|
||||
|
||||
static TwilightManager getInstance(Context context) {
|
||||
if (sInstance == null) {
|
||||
Context context2 = context.getApplicationContext();
|
||||
sInstance = new TwilightManager(context2, (LocationManager) context2.getSystemService("location"));
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
static void setInstance(TwilightManager twilightManager) {
|
||||
sInstance = twilightManager;
|
||||
}
|
||||
|
||||
TwilightManager(Context context, LocationManager locationManager) {
|
||||
this.mContext = context;
|
||||
this.mLocationManager = locationManager;
|
||||
}
|
||||
|
||||
boolean isNight() {
|
||||
TwilightState state = this.mTwilightState;
|
||||
if (isStateValid()) {
|
||||
return state.isNight;
|
||||
}
|
||||
Location location = getLastKnownLocation();
|
||||
if (location != null) {
|
||||
updateState(location);
|
||||
return state.isNight;
|
||||
}
|
||||
Log.i(TAG, "Could not get last known location. This is probably because the app does not have any location permissions. Falling back to hardcoded sunrise/sunset values.");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int hour = calendar.get(11);
|
||||
return hour < 6 || hour >= 22;
|
||||
}
|
||||
|
||||
private Location getLastKnownLocation() {
|
||||
Location coarseLoc = null;
|
||||
Location fineLoc = null;
|
||||
int permission = PermissionChecker.checkSelfPermission(this.mContext, "android.permission.ACCESS_COARSE_LOCATION");
|
||||
if (permission == 0) {
|
||||
coarseLoc = getLastKnownLocationForProvider("network");
|
||||
}
|
||||
int permission2 = PermissionChecker.checkSelfPermission(this.mContext, "android.permission.ACCESS_FINE_LOCATION");
|
||||
if (permission2 == 0) {
|
||||
fineLoc = getLastKnownLocationForProvider("gps");
|
||||
}
|
||||
return (fineLoc == null || coarseLoc == null) ? fineLoc != null ? fineLoc : coarseLoc : fineLoc.getTime() > coarseLoc.getTime() ? fineLoc : coarseLoc;
|
||||
}
|
||||
|
||||
private Location getLastKnownLocationForProvider(String provider) {
|
||||
try {
|
||||
if (this.mLocationManager.isProviderEnabled(provider)) {
|
||||
return this.mLocationManager.getLastKnownLocation(provider);
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
Log.d(TAG, "Failed to get last known location", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isStateValid() {
|
||||
return this.mTwilightState.nextUpdate > System.currentTimeMillis();
|
||||
}
|
||||
|
||||
private void updateState(Location location) {
|
||||
long nextUpdate;
|
||||
long nextUpdate2;
|
||||
TwilightState state = this.mTwilightState;
|
||||
long now = System.currentTimeMillis();
|
||||
TwilightCalculator calculator = TwilightCalculator.getInstance();
|
||||
calculator.calculateTwilight(now - 86400000, location.getLatitude(), location.getLongitude());
|
||||
long yesterdaySunset = calculator.sunset;
|
||||
calculator.calculateTwilight(now, location.getLatitude(), location.getLongitude());
|
||||
boolean isNight = calculator.state == 1;
|
||||
long todaySunrise = calculator.sunrise;
|
||||
long todaySunset = calculator.sunset;
|
||||
calculator.calculateTwilight(86400000 + now, location.getLatitude(), location.getLongitude());
|
||||
long tomorrowSunrise = calculator.sunrise;
|
||||
if (todaySunrise == -1 || todaySunset == -1) {
|
||||
nextUpdate = now + 43200000;
|
||||
} else {
|
||||
if (now > todaySunset) {
|
||||
nextUpdate2 = 0 + tomorrowSunrise;
|
||||
} else if (now > todaySunrise) {
|
||||
nextUpdate2 = 0 + todaySunset;
|
||||
} else {
|
||||
nextUpdate2 = 0 + todaySunrise;
|
||||
}
|
||||
nextUpdate = nextUpdate2 + 60000;
|
||||
}
|
||||
state.isNight = isNight;
|
||||
state.yesterdaySunset = yesterdaySunset;
|
||||
state.todaySunrise = todaySunrise;
|
||||
state.todaySunset = todaySunset;
|
||||
state.tomorrowSunrise = tomorrowSunrise;
|
||||
state.nextUpdate = nextUpdate;
|
||||
}
|
||||
|
||||
private static class TwilightState {
|
||||
boolean isNight;
|
||||
long nextUpdate;
|
||||
long todaySunrise;
|
||||
long todaySunset;
|
||||
long tomorrowSunrise;
|
||||
long yesterdaySunset;
|
||||
|
||||
TwilightState() {
|
||||
}
|
||||
}
|
||||
}
|
||||
+1300
File diff suppressed because it is too large
Load Diff
+115
@@ -0,0 +1,115 @@
|
||||
package androidx.appcompat.content.res;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import android.util.TypedValue;
|
||||
import androidx.appcompat.widget.ResourceManagerInternal;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ColorStateListInflaterCompat;
|
||||
import java.util.WeakHashMap;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AppCompatResources {
|
||||
private static final String LOG_TAG = "AppCompatResources";
|
||||
private static final ThreadLocal<TypedValue> TL_TYPED_VALUE = new ThreadLocal<>();
|
||||
private static final WeakHashMap<Context, SparseArray<ColorStateListCacheEntry>> sColorStateCaches = new WeakHashMap<>(0);
|
||||
private static final Object sColorStateCacheLock = new Object();
|
||||
|
||||
private AppCompatResources() {
|
||||
}
|
||||
|
||||
public static ColorStateList getColorStateList(Context context, int resId) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return context.getColorStateList(resId);
|
||||
}
|
||||
ColorStateList csl = getCachedColorStateList(context, resId);
|
||||
if (csl != null) {
|
||||
return csl;
|
||||
}
|
||||
ColorStateList csl2 = inflateColorStateList(context, resId);
|
||||
if (csl2 != null) {
|
||||
addColorStateListToCache(context, resId, csl2);
|
||||
return csl2;
|
||||
}
|
||||
return ContextCompat.getColorStateList(context, resId);
|
||||
}
|
||||
|
||||
public static Drawable getDrawable(Context context, int resId) {
|
||||
return ResourceManagerInternal.get().getDrawable(context, resId);
|
||||
}
|
||||
|
||||
private static ColorStateList inflateColorStateList(Context context, int resId) {
|
||||
if (isColorInt(context, resId)) {
|
||||
return null;
|
||||
}
|
||||
Resources r = context.getResources();
|
||||
XmlPullParser xml = r.getXml(resId);
|
||||
try {
|
||||
return ColorStateListInflaterCompat.createFromXml(r, xml, context.getTheme());
|
||||
} catch (Exception e) {
|
||||
Log.e(LOG_TAG, "Failed to inflate ColorStateList, leaving it to the framework", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static ColorStateList getCachedColorStateList(Context context, int resId) {
|
||||
ColorStateListCacheEntry entry;
|
||||
synchronized (sColorStateCacheLock) {
|
||||
SparseArray<ColorStateListCacheEntry> entries = sColorStateCaches.get(context);
|
||||
if (entries != null && entries.size() > 0 && (entry = entries.get(resId)) != null) {
|
||||
if (entry.configuration.equals(context.getResources().getConfiguration())) {
|
||||
return entry.value;
|
||||
}
|
||||
entries.remove(resId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void addColorStateListToCache(Context context, int resId, ColorStateList value) {
|
||||
synchronized (sColorStateCacheLock) {
|
||||
WeakHashMap<Context, SparseArray<ColorStateListCacheEntry>> weakHashMap = sColorStateCaches;
|
||||
SparseArray<ColorStateListCacheEntry> entries = weakHashMap.get(context);
|
||||
if (entries == null) {
|
||||
entries = new SparseArray<>();
|
||||
weakHashMap.put(context, entries);
|
||||
}
|
||||
entries.append(resId, new ColorStateListCacheEntry(value, context.getResources().getConfiguration()));
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isColorInt(Context context, int resId) {
|
||||
Resources r = context.getResources();
|
||||
TypedValue value = getTypedValue();
|
||||
r.getValue(resId, value, true);
|
||||
return value.type >= 28 && value.type <= 31;
|
||||
}
|
||||
|
||||
private static TypedValue getTypedValue() {
|
||||
ThreadLocal<TypedValue> threadLocal = TL_TYPED_VALUE;
|
||||
TypedValue tv = threadLocal.get();
|
||||
if (tv == null) {
|
||||
TypedValue tv2 = new TypedValue();
|
||||
threadLocal.set(tv2);
|
||||
return tv2;
|
||||
}
|
||||
return tv;
|
||||
}
|
||||
|
||||
private static class ColorStateListCacheEntry {
|
||||
final Configuration configuration;
|
||||
final ColorStateList value;
|
||||
|
||||
ColorStateListCacheEntry(ColorStateList value, Configuration configuration) {
|
||||
this.value = value;
|
||||
this.configuration = configuration;
|
||||
}
|
||||
}
|
||||
}
|
||||
+741
@@ -0,0 +1,741 @@
|
||||
package androidx.appcompat.graphics.drawable;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Animatable;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.StateSet;
|
||||
import android.util.Xml;
|
||||
import androidx.appcompat.graphics.drawable.DrawableContainer;
|
||||
import androidx.appcompat.graphics.drawable.StateListDrawable;
|
||||
import androidx.appcompat.resources.C0077R;
|
||||
import androidx.appcompat.widget.ResourceManagerInternal;
|
||||
import androidx.collection.LongSparseArray;
|
||||
import androidx.collection.SparseArrayCompat;
|
||||
import androidx.core.content.res.TypedArrayUtils;
|
||||
import androidx.core.graphics.drawable.TintAwareDrawable;
|
||||
import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
|
||||
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
|
||||
import java.io.IOException;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AnimatedStateListDrawableCompat extends StateListDrawable implements TintAwareDrawable {
|
||||
private static final String ELEMENT_ITEM = "item";
|
||||
private static final String ELEMENT_TRANSITION = "transition";
|
||||
private static final String ITEM_MISSING_DRAWABLE_ERROR = ": <item> tag requires a 'drawable' attribute or child tag defining a drawable";
|
||||
private static final String LOGTAG = AnimatedStateListDrawableCompat.class.getSimpleName();
|
||||
private static final String TRANSITION_MISSING_DRAWABLE_ERROR = ": <transition> tag requires a 'drawable' attribute or child tag defining a drawable";
|
||||
private static final String TRANSITION_MISSING_FROM_TO_ID = ": <transition> tag requires 'fromId' & 'toId' attributes";
|
||||
private boolean mMutated;
|
||||
private AnimatedStateListState mState;
|
||||
private Transition mTransition;
|
||||
private int mTransitionFromIndex;
|
||||
private int mTransitionToIndex;
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable
|
||||
public /* bridge */ /* synthetic */ void addState(int[] iArr, Drawable drawable) {
|
||||
super.addState(iArr, drawable);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ void applyTheme(Resources.Theme theme) {
|
||||
super.applyTheme(theme);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ boolean canApplyTheme() {
|
||||
return super.canApplyTheme();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ void draw(Canvas canvas) {
|
||||
super.draw(canvas);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ int getAlpha() {
|
||||
return super.getAlpha();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ int getChangingConfigurations() {
|
||||
return super.getChangingConfigurations();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ Drawable getCurrent() {
|
||||
return super.getCurrent();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ void getHotspotBounds(Rect rect) {
|
||||
super.getHotspotBounds(rect);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ int getIntrinsicHeight() {
|
||||
return super.getIntrinsicHeight();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ int getIntrinsicWidth() {
|
||||
return super.getIntrinsicWidth();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ int getMinimumHeight() {
|
||||
return super.getMinimumHeight();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ int getMinimumWidth() {
|
||||
return super.getMinimumWidth();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ int getOpacity() {
|
||||
return super.getOpacity();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ void getOutline(Outline outline) {
|
||||
super.getOutline(outline);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ boolean getPadding(Rect rect) {
|
||||
return super.getPadding(rect);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable.Callback
|
||||
public /* bridge */ /* synthetic */ void invalidateDrawable(Drawable drawable) {
|
||||
super.invalidateDrawable(drawable);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ boolean isAutoMirrored() {
|
||||
return super.isAutoMirrored();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ boolean onLayoutDirectionChanged(int i) {
|
||||
return super.onLayoutDirectionChanged(i);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable.Callback
|
||||
public /* bridge */ /* synthetic */ void scheduleDrawable(Drawable drawable, Runnable runnable, long j) {
|
||||
super.scheduleDrawable(drawable, runnable, j);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ void setAlpha(int i) {
|
||||
super.setAlpha(i);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ void setAutoMirrored(boolean z) {
|
||||
super.setAutoMirrored(z);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ void setColorFilter(ColorFilter colorFilter) {
|
||||
super.setColorFilter(colorFilter);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ void setDither(boolean z) {
|
||||
super.setDither(z);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer
|
||||
public /* bridge */ /* synthetic */ void setEnterFadeDuration(int i) {
|
||||
super.setEnterFadeDuration(i);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer
|
||||
public /* bridge */ /* synthetic */ void setExitFadeDuration(int i) {
|
||||
super.setExitFadeDuration(i);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ void setHotspot(float f, float f2) {
|
||||
super.setHotspot(f, f2);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public /* bridge */ /* synthetic */ void setHotspotBounds(int i, int i2, int i3, int i4) {
|
||||
super.setHotspotBounds(i, i2, i3, i4);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable, androidx.core.graphics.drawable.TintAwareDrawable
|
||||
public /* bridge */ /* synthetic */ void setTintList(ColorStateList colorStateList) {
|
||||
super.setTintList(colorStateList);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable, androidx.core.graphics.drawable.TintAwareDrawable
|
||||
public /* bridge */ /* synthetic */ void setTintMode(PorterDuff.Mode mode) {
|
||||
super.setTintMode(mode);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable.Callback
|
||||
public /* bridge */ /* synthetic */ void unscheduleDrawable(Drawable drawable, Runnable runnable) {
|
||||
super.unscheduleDrawable(drawable, runnable);
|
||||
}
|
||||
|
||||
public AnimatedStateListDrawableCompat() {
|
||||
this(null, null);
|
||||
}
|
||||
|
||||
AnimatedStateListDrawableCompat(AnimatedStateListState state, Resources res) {
|
||||
super(null);
|
||||
this.mTransitionToIndex = -1;
|
||||
this.mTransitionFromIndex = -1;
|
||||
AnimatedStateListState newState = new AnimatedStateListState(state, this, res);
|
||||
setConstantState(newState);
|
||||
onStateChange(getState());
|
||||
jumpToCurrentState();
|
||||
}
|
||||
|
||||
public static AnimatedStateListDrawableCompat create(Context context, int resId, Resources.Theme theme) {
|
||||
int type;
|
||||
try {
|
||||
Resources res = context.getResources();
|
||||
XmlPullParser parser = res.getXml(resId);
|
||||
AttributeSet attrs = Xml.asAttributeSet(parser);
|
||||
do {
|
||||
type = parser.next();
|
||||
if (type == 2) {
|
||||
break;
|
||||
}
|
||||
} while (type != 1);
|
||||
if (type != 2) {
|
||||
throw new XmlPullParserException("No start tag found");
|
||||
}
|
||||
return createFromXmlInner(context, res, parser, attrs, theme);
|
||||
} catch (IOException e) {
|
||||
Log.e(LOGTAG, "parser error", e);
|
||||
return null;
|
||||
} catch (XmlPullParserException e2) {
|
||||
Log.e(LOGTAG, "parser error", e2);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static AnimatedStateListDrawableCompat createFromXmlInner(Context context, Resources resources, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws IOException, XmlPullParserException {
|
||||
String name = parser.getName();
|
||||
if (!name.equals("animated-selector")) {
|
||||
throw new XmlPullParserException(parser.getPositionDescription() + ": invalid animated-selector tag " + name);
|
||||
}
|
||||
AnimatedStateListDrawableCompat asl = new AnimatedStateListDrawableCompat();
|
||||
asl.inflate(context, resources, parser, attrs, theme);
|
||||
return asl;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable
|
||||
public void inflate(Context context, Resources resources, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
TypedArray a = TypedArrayUtils.obtainAttributes(resources, theme, attrs, C0077R.styleable.AnimatedStateListDrawableCompat);
|
||||
setVisible(a.getBoolean(C0077R.styleable.AnimatedStateListDrawableCompat_android_visible, true), true);
|
||||
updateStateFromTypedArray(a);
|
||||
updateDensity(resources);
|
||||
a.recycle();
|
||||
inflateChildElements(context, resources, parser, attrs, theme);
|
||||
init();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public boolean setVisible(boolean visible, boolean restart) {
|
||||
boolean changed = super.setVisible(visible, restart);
|
||||
Transition transition = this.mTransition;
|
||||
if (transition != null && (changed || restart)) {
|
||||
if (visible) {
|
||||
transition.start();
|
||||
} else {
|
||||
jumpToCurrentState();
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
public void addState(int[] stateSet, Drawable drawable, int id) {
|
||||
if (drawable == null) {
|
||||
throw new IllegalArgumentException("Drawable must not be null");
|
||||
}
|
||||
this.mState.addStateSet(stateSet, drawable, id);
|
||||
onStateChange(getState());
|
||||
}
|
||||
|
||||
public <T extends Drawable & Animatable> void addTransition(int fromId, int toId, T transition, boolean reversible) {
|
||||
if (transition == null) {
|
||||
throw new IllegalArgumentException("Transition drawable must not be null");
|
||||
}
|
||||
this.mState.addTransition(fromId, toId, transition, reversible);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public boolean isStateful() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public void jumpToCurrentState() {
|
||||
super.jumpToCurrentState();
|
||||
Transition transition = this.mTransition;
|
||||
if (transition != null) {
|
||||
transition.stop();
|
||||
this.mTransition = null;
|
||||
selectDrawable(this.mTransitionToIndex);
|
||||
this.mTransitionToIndex = -1;
|
||||
this.mTransitionFromIndex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
protected boolean onStateChange(int[] stateSet) {
|
||||
int targetIndex = this.mState.indexOfKeyframe(stateSet);
|
||||
boolean changed = targetIndex != getCurrentIndex() && (selectTransition(targetIndex) || selectDrawable(targetIndex));
|
||||
Drawable current = getCurrent();
|
||||
if (current != null) {
|
||||
return changed | current.setState(stateSet);
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
private boolean selectTransition(int toIndex) {
|
||||
int fromIndex;
|
||||
int transitionIndex;
|
||||
Transition transition;
|
||||
Transition currentTransition = this.mTransition;
|
||||
if (currentTransition != null) {
|
||||
if (toIndex == this.mTransitionToIndex) {
|
||||
return true;
|
||||
}
|
||||
if (toIndex == this.mTransitionFromIndex && currentTransition.canReverse()) {
|
||||
currentTransition.reverse();
|
||||
this.mTransitionToIndex = this.mTransitionFromIndex;
|
||||
this.mTransitionFromIndex = toIndex;
|
||||
return true;
|
||||
}
|
||||
fromIndex = this.mTransitionToIndex;
|
||||
currentTransition.stop();
|
||||
} else {
|
||||
fromIndex = getCurrentIndex();
|
||||
}
|
||||
this.mTransition = null;
|
||||
this.mTransitionFromIndex = -1;
|
||||
this.mTransitionToIndex = -1;
|
||||
AnimatedStateListState state = this.mState;
|
||||
int fromId = state.getKeyframeIdAt(fromIndex);
|
||||
int toId = state.getKeyframeIdAt(toIndex);
|
||||
if (toId == 0 || fromId == 0 || (transitionIndex = state.indexOfTransition(fromId, toId)) < 0) {
|
||||
return false;
|
||||
}
|
||||
boolean hasReversibleFlag = state.transitionHasReversibleFlag(fromId, toId);
|
||||
selectDrawable(transitionIndex);
|
||||
Object current = getCurrent();
|
||||
if (current instanceof AnimationDrawable) {
|
||||
boolean reversed = state.isTransitionReversed(fromId, toId);
|
||||
transition = new AnimationDrawableTransition((AnimationDrawable) current, reversed, hasReversibleFlag);
|
||||
} else if (current instanceof AnimatedVectorDrawableCompat) {
|
||||
transition = new AnimatedVectorDrawableTransition((AnimatedVectorDrawableCompat) current);
|
||||
} else {
|
||||
if (!(current instanceof Animatable)) {
|
||||
return false;
|
||||
}
|
||||
transition = new AnimatableTransition((Animatable) current);
|
||||
}
|
||||
transition.start();
|
||||
this.mTransition = transition;
|
||||
this.mTransitionFromIndex = fromIndex;
|
||||
this.mTransitionToIndex = toIndex;
|
||||
return true;
|
||||
}
|
||||
|
||||
private static abstract class Transition {
|
||||
public abstract void start();
|
||||
|
||||
public abstract void stop();
|
||||
|
||||
private Transition() {
|
||||
}
|
||||
|
||||
public void reverse() {
|
||||
}
|
||||
|
||||
public boolean canReverse() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static class AnimatableTransition extends Transition {
|
||||
|
||||
/* renamed from: mA */
|
||||
private final Animatable f12mA;
|
||||
|
||||
AnimatableTransition(Animatable a) {
|
||||
super();
|
||||
this.f12mA = a;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void start() {
|
||||
this.f12mA.start();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void stop() {
|
||||
this.f12mA.stop();
|
||||
}
|
||||
}
|
||||
|
||||
private static class AnimationDrawableTransition extends Transition {
|
||||
private final ObjectAnimator mAnim;
|
||||
private final boolean mHasReversibleFlag;
|
||||
|
||||
AnimationDrawableTransition(AnimationDrawable ad, boolean reversed, boolean hasReversibleFlag) {
|
||||
super();
|
||||
int frameCount = ad.getNumberOfFrames();
|
||||
int fromFrame = reversed ? frameCount - 1 : 0;
|
||||
int toFrame = reversed ? 0 : frameCount - 1;
|
||||
FrameInterpolator interp = new FrameInterpolator(ad, reversed);
|
||||
ObjectAnimator anim = ObjectAnimator.ofInt(ad, "currentIndex", fromFrame, toFrame);
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
anim.setAutoCancel(true);
|
||||
}
|
||||
anim.setDuration(interp.getTotalDuration());
|
||||
anim.setInterpolator(interp);
|
||||
this.mHasReversibleFlag = hasReversibleFlag;
|
||||
this.mAnim = anim;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public boolean canReverse() {
|
||||
return this.mHasReversibleFlag;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void start() {
|
||||
this.mAnim.start();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void reverse() {
|
||||
this.mAnim.reverse();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void stop() {
|
||||
this.mAnim.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
private static class AnimatedVectorDrawableTransition extends Transition {
|
||||
private final AnimatedVectorDrawableCompat mAvd;
|
||||
|
||||
AnimatedVectorDrawableTransition(AnimatedVectorDrawableCompat avd) {
|
||||
super();
|
||||
this.mAvd = avd;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void start() {
|
||||
this.mAvd.start();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void stop() {
|
||||
this.mAvd.stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateStateFromTypedArray(TypedArray a) {
|
||||
AnimatedStateListState state = this.mState;
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
state.mChangingConfigurations |= a.getChangingConfigurations();
|
||||
}
|
||||
state.setVariablePadding(a.getBoolean(C0077R.styleable.AnimatedStateListDrawableCompat_android_variablePadding, state.mVariablePadding));
|
||||
state.setConstantSize(a.getBoolean(C0077R.styleable.AnimatedStateListDrawableCompat_android_constantSize, state.mConstantSize));
|
||||
state.setEnterFadeDuration(a.getInt(C0077R.styleable.AnimatedStateListDrawableCompat_android_enterFadeDuration, state.mEnterFadeDuration));
|
||||
state.setExitFadeDuration(a.getInt(C0077R.styleable.AnimatedStateListDrawableCompat_android_exitFadeDuration, state.mExitFadeDuration));
|
||||
setDither(a.getBoolean(C0077R.styleable.AnimatedStateListDrawableCompat_android_dither, state.mDither));
|
||||
}
|
||||
|
||||
private void init() {
|
||||
onStateChange(getState());
|
||||
}
|
||||
|
||||
private void inflateChildElements(Context context, Resources resources, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
int innerDepth = parser.getDepth() + 1;
|
||||
while (true) {
|
||||
int type = parser.next();
|
||||
if (type != 1) {
|
||||
int depth = parser.getDepth();
|
||||
if (depth >= innerDepth || type != 3) {
|
||||
if (type == 2 && depth <= innerDepth) {
|
||||
if (parser.getName().equals(ELEMENT_ITEM)) {
|
||||
parseItem(context, resources, parser, attrs, theme);
|
||||
} else if (parser.getName().equals(ELEMENT_TRANSITION)) {
|
||||
parseTransition(context, resources, parser, attrs, theme);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int parseTransition(Context context, Resources resources, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
int type;
|
||||
TypedArray a = TypedArrayUtils.obtainAttributes(resources, theme, attrs, C0077R.styleable.AnimatedStateListDrawableTransition);
|
||||
int fromId = a.getResourceId(C0077R.styleable.AnimatedStateListDrawableTransition_android_fromId, -1);
|
||||
int toId = a.getResourceId(C0077R.styleable.AnimatedStateListDrawableTransition_android_toId, -1);
|
||||
Drawable dr = null;
|
||||
int drawableId = a.getResourceId(C0077R.styleable.AnimatedStateListDrawableTransition_android_drawable, -1);
|
||||
if (drawableId > 0) {
|
||||
dr = ResourceManagerInternal.get().getDrawable(context, drawableId);
|
||||
}
|
||||
boolean reversible = a.getBoolean(C0077R.styleable.AnimatedStateListDrawableTransition_android_reversible, false);
|
||||
a.recycle();
|
||||
if (dr == null) {
|
||||
do {
|
||||
type = parser.next();
|
||||
} while (type == 4);
|
||||
if (type != 2) {
|
||||
throw new XmlPullParserException(parser.getPositionDescription() + TRANSITION_MISSING_DRAWABLE_ERROR);
|
||||
}
|
||||
if (parser.getName().equals("animated-vector")) {
|
||||
dr = AnimatedVectorDrawableCompat.createFromXmlInner(context, resources, parser, attrs, theme);
|
||||
} else if (Build.VERSION.SDK_INT >= 21) {
|
||||
dr = Drawable.createFromXmlInner(resources, parser, attrs, theme);
|
||||
} else {
|
||||
dr = Drawable.createFromXmlInner(resources, parser, attrs);
|
||||
}
|
||||
}
|
||||
if (dr == null) {
|
||||
throw new XmlPullParserException(parser.getPositionDescription() + TRANSITION_MISSING_DRAWABLE_ERROR);
|
||||
}
|
||||
if (fromId == -1 || toId == -1) {
|
||||
throw new XmlPullParserException(parser.getPositionDescription() + TRANSITION_MISSING_FROM_TO_ID);
|
||||
}
|
||||
return this.mState.addTransition(fromId, toId, dr, reversible);
|
||||
}
|
||||
|
||||
private int parseItem(Context context, Resources resources, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
int type;
|
||||
TypedArray a = TypedArrayUtils.obtainAttributes(resources, theme, attrs, C0077R.styleable.AnimatedStateListDrawableItem);
|
||||
int keyframeId = a.getResourceId(C0077R.styleable.AnimatedStateListDrawableItem_android_id, 0);
|
||||
Drawable dr = null;
|
||||
int drawableId = a.getResourceId(C0077R.styleable.AnimatedStateListDrawableItem_android_drawable, -1);
|
||||
if (drawableId > 0) {
|
||||
dr = ResourceManagerInternal.get().getDrawable(context, drawableId);
|
||||
}
|
||||
a.recycle();
|
||||
int[] states = extractStateSet(attrs);
|
||||
if (dr == null) {
|
||||
do {
|
||||
type = parser.next();
|
||||
} while (type == 4);
|
||||
if (type != 2) {
|
||||
throw new XmlPullParserException(parser.getPositionDescription() + ITEM_MISSING_DRAWABLE_ERROR);
|
||||
}
|
||||
if (parser.getName().equals("vector")) {
|
||||
dr = VectorDrawableCompat.createFromXmlInner(resources, parser, attrs, theme);
|
||||
} else if (Build.VERSION.SDK_INT >= 21) {
|
||||
dr = Drawable.createFromXmlInner(resources, parser, attrs, theme);
|
||||
} else {
|
||||
dr = Drawable.createFromXmlInner(resources, parser, attrs);
|
||||
}
|
||||
}
|
||||
if (dr == null) {
|
||||
throw new XmlPullParserException(parser.getPositionDescription() + ITEM_MISSING_DRAWABLE_ERROR);
|
||||
}
|
||||
return this.mState.addStateSet(states, dr, keyframeId);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public Drawable mutate() {
|
||||
if (!this.mMutated && super.mutate() == this) {
|
||||
this.mState.mutate();
|
||||
this.mMutated = true;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, androidx.appcompat.graphics.drawable.DrawableContainer
|
||||
public AnimatedStateListState cloneConstantState() {
|
||||
return new AnimatedStateListState(this.mState, this, null);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, androidx.appcompat.graphics.drawable.DrawableContainer
|
||||
void clearMutated() {
|
||||
super.clearMutated();
|
||||
this.mMutated = false;
|
||||
}
|
||||
|
||||
static class AnimatedStateListState extends StateListDrawable.StateListState {
|
||||
private static final long REVERSED_BIT = 4294967296L;
|
||||
private static final long REVERSIBLE_FLAG_BIT = 8589934592L;
|
||||
SparseArrayCompat<Integer> mStateIds;
|
||||
LongSparseArray<Long> mTransitions;
|
||||
|
||||
AnimatedStateListState(AnimatedStateListState orig, AnimatedStateListDrawableCompat owner, Resources res) {
|
||||
super(orig, owner, res);
|
||||
if (orig != null) {
|
||||
this.mTransitions = orig.mTransitions;
|
||||
this.mStateIds = orig.mStateIds;
|
||||
} else {
|
||||
this.mTransitions = new LongSparseArray<>();
|
||||
this.mStateIds = new SparseArrayCompat<>();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable.StateListState, androidx.appcompat.graphics.drawable.DrawableContainer.DrawableContainerState
|
||||
void mutate() {
|
||||
this.mTransitions = this.mTransitions.m274clone();
|
||||
this.mStateIds = this.mStateIds.m275clone();
|
||||
}
|
||||
|
||||
int addTransition(int fromId, int toId, Drawable anim, boolean reversible) {
|
||||
int pos = super.addChild(anim);
|
||||
long keyFromTo = generateTransitionKey(fromId, toId);
|
||||
long reversibleBit = 0;
|
||||
if (reversible) {
|
||||
reversibleBit = REVERSIBLE_FLAG_BIT;
|
||||
}
|
||||
this.mTransitions.append(keyFromTo, Long.valueOf(pos | reversibleBit));
|
||||
if (reversible) {
|
||||
long keyToFrom = generateTransitionKey(toId, fromId);
|
||||
this.mTransitions.append(keyToFrom, Long.valueOf(pos | REVERSED_BIT | reversibleBit));
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
||||
int addStateSet(int[] stateSet, Drawable drawable, int id) {
|
||||
int index = super.addStateSet(stateSet, drawable);
|
||||
this.mStateIds.put(index, Integer.valueOf(id));
|
||||
return index;
|
||||
}
|
||||
|
||||
int indexOfKeyframe(int[] stateSet) {
|
||||
int index = super.indexOfStateSet(stateSet);
|
||||
if (index >= 0) {
|
||||
return index;
|
||||
}
|
||||
return super.indexOfStateSet(StateSet.WILD_CARD);
|
||||
}
|
||||
|
||||
int getKeyframeIdAt(int index) {
|
||||
if (index < 0) {
|
||||
return 0;
|
||||
}
|
||||
return this.mStateIds.get(index, 0).intValue();
|
||||
}
|
||||
|
||||
int indexOfTransition(int fromId, int toId) {
|
||||
long keyFromTo = generateTransitionKey(fromId, toId);
|
||||
return (int) this.mTransitions.get(keyFromTo, -1L).longValue();
|
||||
}
|
||||
|
||||
boolean isTransitionReversed(int fromId, int toId) {
|
||||
long keyFromTo = generateTransitionKey(fromId, toId);
|
||||
return (this.mTransitions.get(keyFromTo, -1L).longValue() & REVERSED_BIT) != 0;
|
||||
}
|
||||
|
||||
boolean transitionHasReversibleFlag(int fromId, int toId) {
|
||||
long keyFromTo = generateTransitionKey(fromId, toId);
|
||||
return (this.mTransitions.get(keyFromTo, -1L).longValue() & REVERSIBLE_FLAG_BIT) != 0;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable.StateListState, android.graphics.drawable.Drawable.ConstantState
|
||||
public Drawable newDrawable() {
|
||||
return new AnimatedStateListDrawableCompat(this, null);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable.StateListState, android.graphics.drawable.Drawable.ConstantState
|
||||
public Drawable newDrawable(Resources res) {
|
||||
return new AnimatedStateListDrawableCompat(this, res);
|
||||
}
|
||||
|
||||
private static long generateTransitionKey(int fromId, int toId) {
|
||||
return (fromId << 32) | toId;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, androidx.appcompat.graphics.drawable.DrawableContainer
|
||||
void setConstantState(DrawableContainer.DrawableContainerState state) {
|
||||
super.setConstantState(state);
|
||||
if (state instanceof AnimatedStateListState) {
|
||||
this.mState = (AnimatedStateListState) state;
|
||||
}
|
||||
}
|
||||
|
||||
private static class FrameInterpolator implements TimeInterpolator {
|
||||
private int[] mFrameTimes;
|
||||
private int mFrames;
|
||||
private int mTotalDuration;
|
||||
|
||||
FrameInterpolator(AnimationDrawable d, boolean reversed) {
|
||||
updateFrames(d, reversed);
|
||||
}
|
||||
|
||||
int updateFrames(AnimationDrawable d, boolean reversed) {
|
||||
int frameCount = d.getNumberOfFrames();
|
||||
this.mFrames = frameCount;
|
||||
int[] iArr = this.mFrameTimes;
|
||||
if (iArr == null || iArr.length < frameCount) {
|
||||
this.mFrameTimes = new int[frameCount];
|
||||
}
|
||||
int[] frameTimes = this.mFrameTimes;
|
||||
int totalDuration = 0;
|
||||
for (int i = 0; i < frameCount; i++) {
|
||||
int duration = d.getDuration(reversed ? (frameCount - i) - 1 : i);
|
||||
frameTimes[i] = duration;
|
||||
totalDuration += duration;
|
||||
}
|
||||
this.mTotalDuration = totalDuration;
|
||||
return totalDuration;
|
||||
}
|
||||
|
||||
int getTotalDuration() {
|
||||
return this.mTotalDuration;
|
||||
}
|
||||
|
||||
@Override // android.animation.TimeInterpolator
|
||||
public float getInterpolation(float input) {
|
||||
float frameElapsed;
|
||||
int elapsed = (int) ((this.mTotalDuration * input) + 0.5f);
|
||||
int frameCount = this.mFrames;
|
||||
int[] frameTimes = this.mFrameTimes;
|
||||
int remaining = elapsed;
|
||||
int i = 0;
|
||||
while (i < frameCount && remaining >= frameTimes[i]) {
|
||||
remaining -= frameTimes[i];
|
||||
i++;
|
||||
}
|
||||
if (i < frameCount) {
|
||||
frameElapsed = remaining / this.mTotalDuration;
|
||||
} else {
|
||||
frameElapsed = 0.0f;
|
||||
}
|
||||
return (i / frameCount) + frameElapsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1121
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user