Initial commit
This commit is contained in:
12
sources/androidx/annotation/Keep.java
Normal file
12
sources/androidx/annotation/Keep.java
Normal file
@@ -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 {
|
||||
}
|
||||
10
sources/androidx/annotation/RestrictTo$Scope.java
Normal file
10
sources/androidx/annotation/RestrictTo$Scope.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package androidx.annotation;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum RestrictTo$Scope {
|
||||
LIBRARY,
|
||||
LIBRARY_GROUP,
|
||||
GROUP_ID,
|
||||
TESTS,
|
||||
SUBCLASSES
|
||||
}
|
||||
277
sources/androidx/appcompat/R$attr.java
Normal file
277
sources/androidx/appcompat/R$attr.java
Normal file
@@ -0,0 +1,277 @@
|
||||
package androidx.appcompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$attr {
|
||||
public static final int actionBarDivider = 2130968576;
|
||||
public static final int actionBarItemBackground = 2130968577;
|
||||
public static final int actionBarPopupTheme = 2130968578;
|
||||
public static final int actionBarSize = 2130968579;
|
||||
public static final int actionBarSplitStyle = 2130968580;
|
||||
public static final int actionBarStyle = 2130968581;
|
||||
public static final int actionBarTabBarStyle = 2130968582;
|
||||
public static final int actionBarTabStyle = 2130968583;
|
||||
public static final int actionBarTabTextStyle = 2130968584;
|
||||
public static final int actionBarTheme = 2130968585;
|
||||
public static final int actionBarWidgetTheme = 2130968586;
|
||||
public static final int actionButtonStyle = 2130968587;
|
||||
public static final int actionDropDownStyle = 2130968589;
|
||||
public static final int actionLayout = 2130968590;
|
||||
public static final int actionMenuTextAppearance = 2130968591;
|
||||
public static final int actionMenuTextColor = 2130968592;
|
||||
public static final int actionModeBackground = 2130968593;
|
||||
public static final int actionModeCloseButtonStyle = 2130968594;
|
||||
public static final int actionModeCloseDrawable = 2130968595;
|
||||
public static final int actionModeCopyDrawable = 2130968596;
|
||||
public static final int actionModeCutDrawable = 2130968597;
|
||||
public static final int actionModeFindDrawable = 2130968598;
|
||||
public static final int actionModePasteDrawable = 2130968599;
|
||||
public static final int actionModePopupWindowStyle = 2130968600;
|
||||
public static final int actionModeSelectAllDrawable = 2130968601;
|
||||
public static final int actionModeShareDrawable = 2130968602;
|
||||
public static final int actionModeSplitBackground = 2130968603;
|
||||
public static final int actionModeStyle = 2130968604;
|
||||
public static final int actionModeWebSearchDrawable = 2130968605;
|
||||
public static final int actionOverflowButtonStyle = 2130968606;
|
||||
public static final int actionOverflowMenuStyle = 2130968607;
|
||||
public static final int actionProviderClass = 2130968608;
|
||||
public static final int actionViewClass = 2130968609;
|
||||
public static final int activityChooserViewStyle = 2130968610;
|
||||
public static final int alertDialogButtonGroupStyle = 2130968611;
|
||||
public static final int alertDialogCenterButtons = 2130968612;
|
||||
public static final int alertDialogStyle = 2130968613;
|
||||
public static final int alertDialogTheme = 2130968614;
|
||||
public static final int allowStacking = 2130968615;
|
||||
public static final int alpha = 2130968616;
|
||||
public static final int alphabeticModifiers = 2130968617;
|
||||
public static final int arrowHeadLength = 2130968618;
|
||||
public static final int arrowShaftLength = 2130968619;
|
||||
public static final int autoCompleteTextViewStyle = 2130968623;
|
||||
public static final int autoSizeMaxTextSize = 2130968624;
|
||||
public static final int autoSizeMinTextSize = 2130968625;
|
||||
public static final int autoSizePresetSizes = 2130968626;
|
||||
public static final int autoSizeStepGranularity = 2130968627;
|
||||
public static final int autoSizeTextType = 2130968628;
|
||||
public static final int background = 2130968629;
|
||||
public static final int backgroundSplit = 2130968630;
|
||||
public static final int backgroundStacked = 2130968631;
|
||||
public static final int backgroundTint = 2130968632;
|
||||
public static final int backgroundTintMode = 2130968633;
|
||||
public static final int barLength = 2130968636;
|
||||
public static final int borderlessButtonStyle = 2130968648;
|
||||
public static final int buttonBarButtonStyle = 2130968663;
|
||||
public static final int buttonBarNegativeButtonStyle = 2130968664;
|
||||
public static final int buttonBarNeutralButtonStyle = 2130968665;
|
||||
public static final int buttonBarPositiveButtonStyle = 2130968666;
|
||||
public static final int buttonBarStyle = 2130968667;
|
||||
public static final int buttonGravity = 2130968668;
|
||||
public static final int buttonIconDimen = 2130968669;
|
||||
public static final int buttonPanelSideLayout = 2130968670;
|
||||
public static final int buttonStyle = 2130968672;
|
||||
public static final int buttonStyleSmall = 2130968673;
|
||||
public static final int buttonTint = 2130968674;
|
||||
public static final int buttonTintMode = 2130968675;
|
||||
public static final int checkboxStyle = 2130968684;
|
||||
public static final int checkedTextViewStyle = 2130968689;
|
||||
public static final int closeIcon = 2130968715;
|
||||
public static final int closeItemLayout = 2130968722;
|
||||
public static final int collapseContentDescription = 2130968723;
|
||||
public static final int collapseIcon = 2130968724;
|
||||
public static final int color = 2130968727;
|
||||
public static final int colorAccent = 2130968728;
|
||||
public static final int colorBackgroundFloating = 2130968729;
|
||||
public static final int colorButtonNormal = 2130968730;
|
||||
public static final int colorControlActivated = 2130968731;
|
||||
public static final int colorControlHighlight = 2130968732;
|
||||
public static final int colorControlNormal = 2130968733;
|
||||
public static final int colorError = 2130968734;
|
||||
public static final int colorPrimary = 2130968735;
|
||||
public static final int colorPrimaryDark = 2130968736;
|
||||
public static final int colorSwitchThumbNormal = 2130968739;
|
||||
public static final int commitIcon = 2130968753;
|
||||
public static final int contentDescription = 2130968757;
|
||||
public static final int contentInsetEnd = 2130968760;
|
||||
public static final int contentInsetEndWithActions = 2130968761;
|
||||
public static final int contentInsetLeft = 2130968762;
|
||||
public static final int contentInsetRight = 2130968763;
|
||||
public static final int contentInsetStart = 2130968764;
|
||||
public static final int contentInsetStartWithNavigation = 2130968765;
|
||||
public static final int controlBackground = 2130968772;
|
||||
public static final int coordinatorLayoutStyle = 2130968773;
|
||||
public static final int customNavigationLayout = 2130968779;
|
||||
public static final int defaultQueryHint = 2130968780;
|
||||
public static final int dialogCornerRadius = 2130968783;
|
||||
public static final int dialogPreferredPadding = 2130968784;
|
||||
public static final int dialogTheme = 2130968785;
|
||||
public static final int displayOptions = 2130968786;
|
||||
public static final int divider = 2130968787;
|
||||
public static final int dividerHorizontal = 2130968788;
|
||||
public static final int dividerPadding = 2130968789;
|
||||
public static final int dividerVertical = 2130968790;
|
||||
public static final int drawableSize = 2130968792;
|
||||
public static final int drawerArrowStyle = 2130968793;
|
||||
public static final int dropDownListViewStyle = 2130968794;
|
||||
public static final int dropdownListPreferredItemHeight = 2130968795;
|
||||
public static final int editTextBackground = 2130968796;
|
||||
public static final int editTextColor = 2130968797;
|
||||
public static final int editTextStyle = 2130968798;
|
||||
public static final int elevation = 2130968799;
|
||||
public static final int expandActivityOverflowButtonDrawable = 2130968805;
|
||||
public static final int firstBaselineToTopHeight = 2130968825;
|
||||
public static final int font = 2130968827;
|
||||
public static final int fontFamily = 2130968828;
|
||||
public static final int fontProviderAuthority = 2130968829;
|
||||
public static final int fontProviderCerts = 2130968830;
|
||||
public static final int fontProviderFetchStrategy = 2130968831;
|
||||
public static final int fontProviderFetchTimeout = 2130968832;
|
||||
public static final int fontProviderPackage = 2130968833;
|
||||
public static final int fontProviderQuery = 2130968834;
|
||||
public static final int fontStyle = 2130968835;
|
||||
public static final int fontVariationSettings = 2130968836;
|
||||
public static final int fontWeight = 2130968837;
|
||||
public static final int gapBetweenBars = 2130968840;
|
||||
public static final int goIcon = 2130968842;
|
||||
public static final int height = 2130968844;
|
||||
public static final int hideOnContentScroll = 2130968850;
|
||||
public static final int homeAsUpIndicator = 2130968855;
|
||||
public static final int homeLayout = 2130968856;
|
||||
public static final int icon = 2130968858;
|
||||
public static final int iconTint = 2130968864;
|
||||
public static final int iconTintMode = 2130968865;
|
||||
public static final int iconifiedByDefault = 2130968866;
|
||||
public static final int imageButtonStyle = 2130968869;
|
||||
public static final int indeterminateProgressStyle = 2130968871;
|
||||
public static final int initialActivityCount = 2130968877;
|
||||
public static final int isLightTheme = 2130968879;
|
||||
public static final int itemPadding = 2130968888;
|
||||
public static final int keylines = 2130968894;
|
||||
public static final int lastBaselineToBottomHeight = 2130968918;
|
||||
public static final int layout = 2130968919;
|
||||
public static final int layout_anchor = 2130968921;
|
||||
public static final int layout_anchorGravity = 2130968922;
|
||||
public static final int layout_behavior = 2130968923;
|
||||
public static final int layout_dodgeInsetEdges = 2130968967;
|
||||
public static final int layout_insetEdge = 2130968976;
|
||||
public static final int layout_keyline = 2130968977;
|
||||
public static final int lineHeight = 2130968984;
|
||||
public static final int listChoiceBackgroundIndicator = 2130968986;
|
||||
public static final int listDividerAlertDialog = 2130968987;
|
||||
public static final int listItemLayout = 2130968988;
|
||||
public static final int listLayout = 2130968989;
|
||||
public static final int listMenuViewStyle = 2130968990;
|
||||
public static final int listPopupWindowStyle = 2130968991;
|
||||
public static final int listPreferredItemHeight = 2130968992;
|
||||
public static final int listPreferredItemHeightLarge = 2130968993;
|
||||
public static final int listPreferredItemHeightSmall = 2130968994;
|
||||
public static final int listPreferredItemPaddingLeft = 2130968995;
|
||||
public static final int listPreferredItemPaddingRight = 2130968996;
|
||||
public static final int logo = 2130968997;
|
||||
public static final int logoDescription = 2130968998;
|
||||
public static final int maxButtonHeight = 2130969007;
|
||||
public static final int measureWithLargestChild = 2130969010;
|
||||
public static final int multiChoiceItemLayout = 2130969012;
|
||||
public static final int navigationContentDescription = 2130969013;
|
||||
public static final int navigationIcon = 2130969014;
|
||||
public static final int navigationMode = 2130969015;
|
||||
public static final int numericModifiers = 2130969022;
|
||||
public static final int overlapAnchor = 2130969023;
|
||||
public static final int paddingBottomNoButtons = 2130969024;
|
||||
public static final int paddingEnd = 2130969025;
|
||||
public static final int paddingStart = 2130969026;
|
||||
public static final int paddingTopNoTitle = 2130969028;
|
||||
public static final int panelBackground = 2130969029;
|
||||
public static final int panelMenuListTheme = 2130969030;
|
||||
public static final int panelMenuListWidth = 2130969031;
|
||||
public static final int popupMenuStyle = 2130969037;
|
||||
public static final int popupTheme = 2130969038;
|
||||
public static final int popupWindowStyle = 2130969039;
|
||||
public static final int preserveIconSpacing = 2130969040;
|
||||
public static final int progressBarPadding = 2130969042;
|
||||
public static final int progressBarStyle = 2130969043;
|
||||
public static final int queryBackground = 2130969044;
|
||||
public static final int queryHint = 2130969045;
|
||||
public static final int radioButtonStyle = 2130969046;
|
||||
public static final int ratingBarStyle = 2130969048;
|
||||
public static final int ratingBarStyleIndicator = 2130969049;
|
||||
public static final int ratingBarStyleSmall = 2130969050;
|
||||
public static final int searchHintIcon = 2130969070;
|
||||
public static final int searchIcon = 2130969071;
|
||||
public static final int searchViewStyle = 2130969072;
|
||||
public static final int seekBarStyle = 2130969073;
|
||||
public static final int selectableItemBackground = 2130969074;
|
||||
public static final int selectableItemBackgroundBorderless = 2130969075;
|
||||
public static final int showAsAction = 2130969076;
|
||||
public static final int showDividers = 2130969077;
|
||||
public static final int showText = 2130969079;
|
||||
public static final int showTitle = 2130969080;
|
||||
public static final int singleChoiceItemLayout = 2130969082;
|
||||
public static final int spinBars = 2130969088;
|
||||
public static final int spinnerDropDownItemStyle = 2130969089;
|
||||
public static final int spinnerStyle = 2130969090;
|
||||
public static final int splitTrack = 2130969091;
|
||||
public static final int srcCompat = 2130969092;
|
||||
public static final int state_above_anchor = 2130969094;
|
||||
public static final int statusBarBackground = 2130969100;
|
||||
public static final int subMenuArrow = 2130969104;
|
||||
public static final int submitBackground = 2130969105;
|
||||
public static final int subtitle = 2130969106;
|
||||
public static final int subtitleTextAppearance = 2130969107;
|
||||
public static final int subtitleTextColor = 2130969108;
|
||||
public static final int subtitleTextStyle = 2130969109;
|
||||
public static final int suggestionRowLayout = 2130969110;
|
||||
public static final int switchMinWidth = 2130969111;
|
||||
public static final int switchPadding = 2130969112;
|
||||
public static final int switchStyle = 2130969113;
|
||||
public static final int switchTextAppearance = 2130969114;
|
||||
public static final int textAllCaps = 2130969145;
|
||||
public static final int textAppearanceLargePopupMenu = 2130969156;
|
||||
public static final int textAppearanceListItem = 2130969157;
|
||||
public static final int textAppearanceListItemSecondary = 2130969158;
|
||||
public static final int textAppearanceListItemSmall = 2130969159;
|
||||
public static final int textAppearancePopupMenuHeader = 2130969161;
|
||||
public static final int textAppearanceSearchResultSubtitle = 2130969162;
|
||||
public static final int textAppearanceSearchResultTitle = 2130969163;
|
||||
public static final int textAppearanceSmallPopupMenu = 2130969164;
|
||||
public static final int textColorAlertDialogListItem = 2130969167;
|
||||
public static final int textColorSearchUrl = 2130969168;
|
||||
public static final int theme = 2130969172;
|
||||
public static final int thickness = 2130969173;
|
||||
public static final int thumbTextPadding = 2130969174;
|
||||
public static final int thumbTint = 2130969175;
|
||||
public static final int thumbTintMode = 2130969176;
|
||||
public static final int tickMark = 2130969177;
|
||||
public static final int tickMarkTint = 2130969178;
|
||||
public static final int tickMarkTintMode = 2130969179;
|
||||
public static final int tint = 2130969180;
|
||||
public static final int tintMode = 2130969181;
|
||||
public static final int title = 2130969182;
|
||||
public static final int titleMargin = 2130969184;
|
||||
public static final int titleMarginBottom = 2130969185;
|
||||
public static final int titleMarginEnd = 2130969186;
|
||||
public static final int titleMarginStart = 2130969187;
|
||||
public static final int titleMarginTop = 2130969188;
|
||||
public static final int titleMargins = 2130969189;
|
||||
public static final int titleTextAppearance = 2130969190;
|
||||
public static final int titleTextColor = 2130969191;
|
||||
public static final int titleTextStyle = 2130969192;
|
||||
public static final int toolbarNavigationButtonStyle = 2130969199;
|
||||
public static final int toolbarStyle = 2130969200;
|
||||
public static final int tooltipForegroundColor = 2130969201;
|
||||
public static final int tooltipFrameBackground = 2130969202;
|
||||
public static final int tooltipText = 2130969203;
|
||||
public static final int track = 2130969205;
|
||||
public static final int trackTint = 2130969206;
|
||||
public static final int trackTintMode = 2130969207;
|
||||
public static final int ttcIndex = 2130969208;
|
||||
public static final int viewInflaterClass = 2130969224;
|
||||
public static final int voiceIcon = 2130969225;
|
||||
public static final int windowActionBar = 2130969250;
|
||||
public static final int windowActionBarOverlay = 2130969251;
|
||||
public static final int windowActionModeOverlay = 2130969252;
|
||||
public static final int windowFixedHeightMajor = 2130969253;
|
||||
public static final int windowFixedHeightMinor = 2130969254;
|
||||
public static final int windowFixedWidthMajor = 2130969255;
|
||||
public static final int windowFixedWidthMinor = 2130969256;
|
||||
public static final int windowMinWidthMajor = 2130969257;
|
||||
public static final int windowMinWidthMinor = 2130969258;
|
||||
public static final int windowNoTitle = 2130969259;
|
||||
}
|
||||
8
sources/androidx/appcompat/R$bool.java
Normal file
8
sources/androidx/appcompat/R$bool.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package androidx.appcompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$bool {
|
||||
public static final int abc_action_bar_embed_tabs = 2131034112;
|
||||
public static final int abc_allow_stacked_button_bar = 2131034113;
|
||||
public static final int abc_config_actionMenuItemAllCaps = 2131034114;
|
||||
}
|
||||
89
sources/androidx/appcompat/R$color.java
Normal file
89
sources/androidx/appcompat/R$color.java
Normal file
@@ -0,0 +1,89 @@
|
||||
package androidx.appcompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$color {
|
||||
public static final int abc_background_cache_hint_selector_material_dark = 2131099648;
|
||||
public static final int abc_background_cache_hint_selector_material_light = 2131099649;
|
||||
public static final int abc_btn_colored_borderless_text_material = 2131099650;
|
||||
public static final int abc_btn_colored_text_material = 2131099651;
|
||||
public static final int abc_color_highlight_material = 2131099652;
|
||||
public static final int abc_hint_foreground_material_dark = 2131099653;
|
||||
public static final int abc_hint_foreground_material_light = 2131099654;
|
||||
public static final int abc_input_method_navigation_guard = 2131099655;
|
||||
public static final int abc_primary_text_disable_only_material_dark = 2131099656;
|
||||
public static final int abc_primary_text_disable_only_material_light = 2131099657;
|
||||
public static final int abc_primary_text_material_dark = 2131099658;
|
||||
public static final int abc_primary_text_material_light = 2131099659;
|
||||
public static final int abc_search_url_text = 2131099660;
|
||||
public static final int abc_search_url_text_normal = 2131099661;
|
||||
public static final int abc_search_url_text_pressed = 2131099662;
|
||||
public static final int abc_search_url_text_selected = 2131099663;
|
||||
public static final int abc_secondary_text_material_dark = 2131099664;
|
||||
public static final int abc_secondary_text_material_light = 2131099665;
|
||||
public static final int abc_tint_btn_checkable = 2131099666;
|
||||
public static final int abc_tint_default = 2131099667;
|
||||
public static final int abc_tint_edittext = 2131099668;
|
||||
public static final int abc_tint_seek_thumb = 2131099669;
|
||||
public static final int abc_tint_spinner = 2131099670;
|
||||
public static final int abc_tint_switch_track = 2131099671;
|
||||
public static final int accent_material_dark = 2131099672;
|
||||
public static final int accent_material_light = 2131099673;
|
||||
public static final int background_floating_material_dark = 2131099675;
|
||||
public static final int background_floating_material_light = 2131099676;
|
||||
public static final int background_material_dark = 2131099677;
|
||||
public static final int background_material_light = 2131099678;
|
||||
public static final int bright_foreground_disabled_material_dark = 2131099745;
|
||||
public static final int bright_foreground_disabled_material_light = 2131099746;
|
||||
public static final int bright_foreground_inverse_material_dark = 2131099747;
|
||||
public static final int bright_foreground_inverse_material_light = 2131099748;
|
||||
public static final int bright_foreground_material_dark = 2131099749;
|
||||
public static final int bright_foreground_material_light = 2131099750;
|
||||
public static final int button_material_dark = 2131099755;
|
||||
public static final int button_material_light = 2131099756;
|
||||
public static final int dim_foreground_disabled_material_dark = 2131099851;
|
||||
public static final int dim_foreground_disabled_material_light = 2131099852;
|
||||
public static final int dim_foreground_material_dark = 2131099853;
|
||||
public static final int dim_foreground_material_light = 2131099854;
|
||||
public static final int error_color_material_dark = 2131099857;
|
||||
public static final int error_color_material_light = 2131099858;
|
||||
public static final int foreground_material_dark = 2131099859;
|
||||
public static final int foreground_material_light = 2131099860;
|
||||
public static final int highlighted_text_material_dark = 2131099863;
|
||||
public static final int highlighted_text_material_light = 2131099864;
|
||||
public static final int material_blue_grey_800 = 2131099887;
|
||||
public static final int material_blue_grey_900 = 2131099888;
|
||||
public static final int material_blue_grey_950 = 2131099889;
|
||||
public static final int material_deep_teal_200 = 2131099890;
|
||||
public static final int material_deep_teal_500 = 2131099891;
|
||||
public static final int material_grey_100 = 2131099892;
|
||||
public static final int material_grey_300 = 2131099893;
|
||||
public static final int material_grey_50 = 2131099894;
|
||||
public static final int material_grey_600 = 2131099895;
|
||||
public static final int material_grey_800 = 2131099896;
|
||||
public static final int material_grey_850 = 2131099897;
|
||||
public static final int material_grey_900 = 2131099898;
|
||||
public static final int notification_action_color_filter = 2131099926;
|
||||
public static final int notification_icon_bg_color = 2131099927;
|
||||
public static final int primary_dark_material_dark = 2131099930;
|
||||
public static final int primary_dark_material_light = 2131099931;
|
||||
public static final int primary_material_dark = 2131099932;
|
||||
public static final int primary_material_light = 2131099933;
|
||||
public static final int primary_text_default_material_dark = 2131099934;
|
||||
public static final int primary_text_default_material_light = 2131099935;
|
||||
public static final int primary_text_disabled_material_dark = 2131099936;
|
||||
public static final int primary_text_disabled_material_light = 2131099937;
|
||||
public static final int ripple_material_dark = 2131099945;
|
||||
public static final int ripple_material_light = 2131099946;
|
||||
public static final int secondary_text_default_material_dark = 2131099947;
|
||||
public static final int secondary_text_default_material_light = 2131099948;
|
||||
public static final int secondary_text_disabled_material_dark = 2131099949;
|
||||
public static final int secondary_text_disabled_material_light = 2131099950;
|
||||
public static final int switch_thumb_disabled_material_dark = 2131099958;
|
||||
public static final int switch_thumb_disabled_material_light = 2131099959;
|
||||
public static final int switch_thumb_material_dark = 2131099960;
|
||||
public static final int switch_thumb_material_light = 2131099961;
|
||||
public static final int switch_thumb_normal_material_dark = 2131099962;
|
||||
public static final int switch_thumb_normal_material_light = 2131099963;
|
||||
public static final int tooltip_background_dark = 2131099980;
|
||||
public static final int tooltip_background_light = 2131099981;
|
||||
}
|
||||
119
sources/androidx/appcompat/R$dimen.java
Normal file
119
sources/androidx/appcompat/R$dimen.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package androidx.appcompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$dimen {
|
||||
public static final int abc_action_bar_content_inset_material = 2131165184;
|
||||
public static final int abc_action_bar_content_inset_with_nav = 2131165185;
|
||||
public static final int abc_action_bar_default_height_material = 2131165186;
|
||||
public static final int abc_action_bar_default_padding_end_material = 2131165187;
|
||||
public static final int abc_action_bar_default_padding_start_material = 2131165188;
|
||||
public static final int abc_action_bar_elevation_material = 2131165189;
|
||||
public static final int abc_action_bar_icon_vertical_padding_material = 2131165190;
|
||||
public static final int abc_action_bar_overflow_padding_end_material = 2131165191;
|
||||
public static final int abc_action_bar_overflow_padding_start_material = 2131165192;
|
||||
public static final int abc_action_bar_stacked_max_height = 2131165193;
|
||||
public static final int abc_action_bar_stacked_tab_max_width = 2131165194;
|
||||
public static final int abc_action_bar_subtitle_bottom_margin_material = 2131165195;
|
||||
public static final int abc_action_bar_subtitle_top_margin_material = 2131165196;
|
||||
public static final int abc_action_button_min_height_material = 2131165197;
|
||||
public static final int abc_action_button_min_width_material = 2131165198;
|
||||
public static final int abc_action_button_min_width_overflow_material = 2131165199;
|
||||
public static final int abc_alert_dialog_button_bar_height = 2131165200;
|
||||
public static final int abc_alert_dialog_button_dimen = 2131165201;
|
||||
public static final int abc_button_inset_horizontal_material = 2131165202;
|
||||
public static final int abc_button_inset_vertical_material = 2131165203;
|
||||
public static final int abc_button_padding_horizontal_material = 2131165204;
|
||||
public static final int abc_button_padding_vertical_material = 2131165205;
|
||||
public static final int abc_cascading_menus_min_smallest_width = 2131165206;
|
||||
public static final int abc_config_prefDialogWidth = 2131165207;
|
||||
public static final int abc_control_corner_material = 2131165208;
|
||||
public static final int abc_control_inset_material = 2131165209;
|
||||
public static final int abc_control_padding_material = 2131165210;
|
||||
public static final int abc_dialog_corner_radius_material = 2131165211;
|
||||
public static final int abc_dialog_fixed_height_major = 2131165212;
|
||||
public static final int abc_dialog_fixed_height_minor = 2131165213;
|
||||
public static final int abc_dialog_fixed_width_major = 2131165214;
|
||||
public static final int abc_dialog_fixed_width_minor = 2131165215;
|
||||
public static final int abc_dialog_list_padding_bottom_no_buttons = 2131165216;
|
||||
public static final int abc_dialog_list_padding_top_no_title = 2131165217;
|
||||
public static final int abc_dialog_min_width_major = 2131165218;
|
||||
public static final int abc_dialog_min_width_minor = 2131165219;
|
||||
public static final int abc_dialog_padding_material = 2131165220;
|
||||
public static final int abc_dialog_padding_top_material = 2131165221;
|
||||
public static final int abc_dialog_title_divider_material = 2131165222;
|
||||
public static final int abc_disabled_alpha_material_dark = 2131165223;
|
||||
public static final int abc_disabled_alpha_material_light = 2131165224;
|
||||
public static final int abc_dropdownitem_icon_width = 2131165225;
|
||||
public static final int abc_dropdownitem_text_padding_left = 2131165226;
|
||||
public static final int abc_dropdownitem_text_padding_right = 2131165227;
|
||||
public static final int abc_edit_text_inset_bottom_material = 2131165228;
|
||||
public static final int abc_edit_text_inset_horizontal_material = 2131165229;
|
||||
public static final int abc_edit_text_inset_top_material = 2131165230;
|
||||
public static final int abc_floating_window_z = 2131165231;
|
||||
public static final int abc_list_item_padding_horizontal_material = 2131165232;
|
||||
public static final int abc_panel_menu_list_width = 2131165233;
|
||||
public static final int abc_progress_bar_height_material = 2131165234;
|
||||
public static final int abc_search_view_preferred_height = 2131165235;
|
||||
public static final int abc_search_view_preferred_width = 2131165236;
|
||||
public static final int abc_seekbar_track_background_height_material = 2131165237;
|
||||
public static final int abc_seekbar_track_progress_height_material = 2131165238;
|
||||
public static final int abc_select_dialog_padding_start_material = 2131165239;
|
||||
public static final int abc_switch_padding = 2131165240;
|
||||
public static final int abc_text_size_body_1_material = 2131165241;
|
||||
public static final int abc_text_size_body_2_material = 2131165242;
|
||||
public static final int abc_text_size_button_material = 2131165243;
|
||||
public static final int abc_text_size_caption_material = 2131165244;
|
||||
public static final int abc_text_size_display_1_material = 2131165245;
|
||||
public static final int abc_text_size_display_2_material = 2131165246;
|
||||
public static final int abc_text_size_display_3_material = 2131165247;
|
||||
public static final int abc_text_size_display_4_material = 2131165248;
|
||||
public static final int abc_text_size_headline_material = 2131165249;
|
||||
public static final int abc_text_size_large_material = 2131165250;
|
||||
public static final int abc_text_size_medium_material = 2131165251;
|
||||
public static final int abc_text_size_menu_header_material = 2131165252;
|
||||
public static final int abc_text_size_menu_material = 2131165253;
|
||||
public static final int abc_text_size_small_material = 2131165254;
|
||||
public static final int abc_text_size_subhead_material = 2131165255;
|
||||
public static final int abc_text_size_subtitle_material_toolbar = 2131165256;
|
||||
public static final int abc_text_size_title_material = 2131165257;
|
||||
public static final int abc_text_size_title_material_toolbar = 2131165258;
|
||||
public static final int compat_button_inset_horizontal_material = 2131165503;
|
||||
public static final int compat_button_inset_vertical_material = 2131165504;
|
||||
public static final int compat_button_padding_horizontal_material = 2131165505;
|
||||
public static final int compat_button_padding_vertical_material = 2131165506;
|
||||
public static final int compat_control_corner_material = 2131165507;
|
||||
public static final int compat_notification_large_icon_max_height = 2131165508;
|
||||
public static final int compat_notification_large_icon_max_width = 2131165509;
|
||||
public static final int disabled_alpha_material_dark = 2131165654;
|
||||
public static final int disabled_alpha_material_light = 2131165655;
|
||||
public static final int highlight_alpha_material_colored = 2131169820;
|
||||
public static final int highlight_alpha_material_dark = 2131169821;
|
||||
public static final int highlight_alpha_material_light = 2131169822;
|
||||
public static final int hint_alpha_material_dark = 2131169823;
|
||||
public static final int hint_alpha_material_light = 2131169824;
|
||||
public static final int hint_pressed_alpha_material_dark = 2131169825;
|
||||
public static final int hint_pressed_alpha_material_light = 2131169826;
|
||||
public static final int notification_action_icon_size = 2131172010;
|
||||
public static final int notification_action_text_size = 2131172011;
|
||||
public static final int notification_big_circle_margin = 2131172012;
|
||||
public static final int notification_content_margin_start = 2131172013;
|
||||
public static final int notification_large_icon_height = 2131172014;
|
||||
public static final int notification_large_icon_width = 2131172015;
|
||||
public static final int notification_main_column_padding_top = 2131172016;
|
||||
public static final int notification_media_narrow_margin = 2131172017;
|
||||
public static final int notification_right_icon_size = 2131172018;
|
||||
public static final int notification_right_side_padding_top = 2131172019;
|
||||
public static final int notification_small_icon_background_padding = 2131172020;
|
||||
public static final int notification_small_icon_size_as_large = 2131172021;
|
||||
public static final int notification_subtext_size = 2131172022;
|
||||
public static final int notification_top_pad = 2131172023;
|
||||
public static final int notification_top_pad_large_text = 2131172024;
|
||||
public static final int tooltip_corner_radius = 2131172288;
|
||||
public static final int tooltip_horizontal_padding = 2131172289;
|
||||
public static final int tooltip_margin = 2131172290;
|
||||
public static final int tooltip_precise_anchor_extra_offset = 2131172291;
|
||||
public static final int tooltip_precise_anchor_threshold = 2131172292;
|
||||
public static final int tooltip_vertical_padding = 2131172293;
|
||||
public static final int tooltip_y_offset_non_touch = 2131172294;
|
||||
public static final int tooltip_y_offset_touch = 2131172295;
|
||||
}
|
||||
103
sources/androidx/appcompat/R$drawable.java
Normal file
103
sources/androidx/appcompat/R$drawable.java
Normal file
@@ -0,0 +1,103 @@
|
||||
package androidx.appcompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$drawable {
|
||||
public static final int abc_ab_share_pack_mtrl_alpha = 2131230726;
|
||||
public static final int abc_action_bar_item_background_material = 2131230727;
|
||||
public static final int abc_btn_borderless_material = 2131230728;
|
||||
public static final int abc_btn_check_material = 2131230729;
|
||||
public static final int abc_btn_check_to_on_mtrl_000 = 2131230730;
|
||||
public static final int abc_btn_check_to_on_mtrl_015 = 2131230731;
|
||||
public static final int abc_btn_colored_material = 2131230732;
|
||||
public static final int abc_btn_default_mtrl_shape = 2131230733;
|
||||
public static final int abc_btn_radio_material = 2131230734;
|
||||
public static final int abc_btn_radio_to_on_mtrl_000 = 2131230735;
|
||||
public static final int abc_btn_radio_to_on_mtrl_015 = 2131230736;
|
||||
public static final int abc_btn_switch_to_on_mtrl_00001 = 2131230737;
|
||||
public static final int abc_btn_switch_to_on_mtrl_00012 = 2131230738;
|
||||
public static final int abc_cab_background_internal_bg = 2131230739;
|
||||
public static final int abc_cab_background_top_material = 2131230740;
|
||||
public static final int abc_cab_background_top_mtrl_alpha = 2131230741;
|
||||
public static final int abc_control_background_material = 2131230742;
|
||||
public static final int abc_dialog_material_background = 2131230743;
|
||||
public static final int abc_edit_text_material = 2131230744;
|
||||
public static final int abc_ic_ab_back_material = 2131230745;
|
||||
public static final int abc_ic_arrow_drop_right_black_24dp = 2131230746;
|
||||
public static final int abc_ic_clear_material = 2131230747;
|
||||
public static final int abc_ic_commit_search_api_mtrl_alpha = 2131230748;
|
||||
public static final int abc_ic_go_search_api_material = 2131230749;
|
||||
public static final int abc_ic_menu_copy_mtrl_am_alpha = 2131230750;
|
||||
public static final int abc_ic_menu_cut_mtrl_alpha = 2131230751;
|
||||
public static final int abc_ic_menu_overflow_material = 2131230752;
|
||||
public static final int abc_ic_menu_paste_mtrl_am_alpha = 2131230753;
|
||||
public static final int abc_ic_menu_selectall_mtrl_alpha = 2131230754;
|
||||
public static final int abc_ic_menu_share_mtrl_alpha = 2131230755;
|
||||
public static final int abc_ic_search_api_material = 2131230756;
|
||||
public static final int abc_ic_star_black_16dp = 2131230757;
|
||||
public static final int abc_ic_star_black_36dp = 2131230758;
|
||||
public static final int abc_ic_star_black_48dp = 2131230759;
|
||||
public static final int abc_ic_star_half_black_16dp = 2131230760;
|
||||
public static final int abc_ic_star_half_black_36dp = 2131230761;
|
||||
public static final int abc_ic_star_half_black_48dp = 2131230762;
|
||||
public static final int abc_ic_voice_search_api_material = 2131230763;
|
||||
public static final int abc_item_background_holo_dark = 2131230764;
|
||||
public static final int abc_item_background_holo_light = 2131230765;
|
||||
public static final int abc_list_divider_material = 2131230766;
|
||||
public static final int abc_list_divider_mtrl_alpha = 2131230767;
|
||||
public static final int abc_list_focused_holo = 2131230768;
|
||||
public static final int abc_list_longpressed_holo = 2131230769;
|
||||
public static final int abc_list_pressed_holo_dark = 2131230770;
|
||||
public static final int abc_list_pressed_holo_light = 2131230771;
|
||||
public static final int abc_list_selector_background_transition_holo_dark = 2131230772;
|
||||
public static final int abc_list_selector_background_transition_holo_light = 2131230773;
|
||||
public static final int abc_list_selector_disabled_holo_dark = 2131230774;
|
||||
public static final int abc_list_selector_disabled_holo_light = 2131230775;
|
||||
public static final int abc_list_selector_holo_dark = 2131230776;
|
||||
public static final int abc_list_selector_holo_light = 2131230777;
|
||||
public static final int abc_menu_hardkey_panel_mtrl_mult = 2131230778;
|
||||
public static final int abc_popup_background_mtrl_mult = 2131230779;
|
||||
public static final int abc_ratingbar_indicator_material = 2131230780;
|
||||
public static final int abc_ratingbar_material = 2131230781;
|
||||
public static final int abc_ratingbar_small_material = 2131230782;
|
||||
public static final int abc_scrubber_control_off_mtrl_alpha = 2131230783;
|
||||
public static final int abc_scrubber_control_to_pressed_mtrl_000 = 2131230784;
|
||||
public static final int abc_scrubber_control_to_pressed_mtrl_005 = 2131230785;
|
||||
public static final int abc_scrubber_primary_mtrl_alpha = 2131230786;
|
||||
public static final int abc_scrubber_track_mtrl_alpha = 2131230787;
|
||||
public static final int abc_seekbar_thumb_material = 2131230788;
|
||||
public static final int abc_seekbar_tick_mark_material = 2131230789;
|
||||
public static final int abc_seekbar_track_material = 2131230790;
|
||||
public static final int abc_spinner_mtrl_am_alpha = 2131230791;
|
||||
public static final int abc_spinner_textfield_background_material = 2131230792;
|
||||
public static final int abc_switch_thumb_material = 2131230793;
|
||||
public static final int abc_switch_track_mtrl_alpha = 2131230794;
|
||||
public static final int abc_tab_indicator_material = 2131230795;
|
||||
public static final int abc_tab_indicator_mtrl_alpha = 2131230796;
|
||||
public static final int abc_text_cursor_material = 2131230797;
|
||||
public static final int abc_text_select_handle_left_mtrl_dark = 2131230798;
|
||||
public static final int abc_text_select_handle_left_mtrl_light = 2131230799;
|
||||
public static final int abc_text_select_handle_middle_mtrl_dark = 2131230800;
|
||||
public static final int abc_text_select_handle_middle_mtrl_light = 2131230801;
|
||||
public static final int abc_text_select_handle_right_mtrl_dark = 2131230802;
|
||||
public static final int abc_text_select_handle_right_mtrl_light = 2131230803;
|
||||
public static final int abc_textfield_activated_mtrl_alpha = 2131230804;
|
||||
public static final int abc_textfield_default_mtrl_alpha = 2131230805;
|
||||
public static final int abc_textfield_search_activated_mtrl_alpha = 2131230806;
|
||||
public static final int abc_textfield_search_default_mtrl_alpha = 2131230807;
|
||||
public static final int abc_textfield_search_material = 2131230808;
|
||||
public static final int abc_vector_test = 2131230809;
|
||||
public static final int notification_action_background = 2131231536;
|
||||
public static final int notification_bg = 2131231537;
|
||||
public static final int notification_bg_low = 2131231538;
|
||||
public static final int notification_bg_low_normal = 2131231539;
|
||||
public static final int notification_bg_low_pressed = 2131231540;
|
||||
public static final int notification_bg_normal = 2131231541;
|
||||
public static final int notification_bg_normal_pressed = 2131231542;
|
||||
public static final int notification_icon_background = 2131231543;
|
||||
public static final int notification_template_icon_bg = 2131231544;
|
||||
public static final int notification_template_icon_low_bg = 2131231545;
|
||||
public static final int notification_tile_bg = 2131231546;
|
||||
public static final int notify_panel_notification_icon_bg = 2131231547;
|
||||
public static final int tooltip_frame_dark = 2131231823;
|
||||
public static final int tooltip_frame_light = 2131231824;
|
||||
}
|
||||
110
sources/androidx/appcompat/R$id.java
Normal file
110
sources/androidx/appcompat/R$id.java
Normal file
@@ -0,0 +1,110 @@
|
||||
package androidx.appcompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$id {
|
||||
public static final int action_bar = 2131296272;
|
||||
public static final int action_bar_activity_content = 2131296273;
|
||||
public static final int action_bar_container = 2131296274;
|
||||
public static final int action_bar_root = 2131296275;
|
||||
public static final int action_bar_spinner = 2131296276;
|
||||
public static final int action_bar_subtitle = 2131296277;
|
||||
public static final int action_bar_title = 2131296278;
|
||||
public static final int action_container = 2131296279;
|
||||
public static final int action_context_bar = 2131296280;
|
||||
public static final int action_divider = 2131296281;
|
||||
public static final int action_image = 2131296282;
|
||||
public static final int action_menu_divider = 2131296283;
|
||||
public static final int action_menu_presenter = 2131296284;
|
||||
public static final int action_mode_bar = 2131296285;
|
||||
public static final int action_mode_bar_stub = 2131296286;
|
||||
public static final int action_mode_close_button = 2131296287;
|
||||
public static final int action_text = 2131296288;
|
||||
public static final int actions = 2131296289;
|
||||
public static final int activity_chooser_view_content = 2131296290;
|
||||
public static final int add = 2131296309;
|
||||
public static final int alertTitle = 2131296315;
|
||||
public static final int async = 2131296326;
|
||||
public static final int blocking = 2131296343;
|
||||
public static final int bottom = 2131296348;
|
||||
public static final int buttonPanel = 2131296399;
|
||||
public static final int checkbox = 2131296449;
|
||||
public static final int chronometer = 2131296452;
|
||||
public static final int content = 2131296481;
|
||||
public static final int contentPanel = 2131296485;
|
||||
public static final int custom = 2131296508;
|
||||
public static final int customPanel = 2131296509;
|
||||
public static final int decor_content_parent = 2131296525;
|
||||
public static final int default_activity_button = 2131296526;
|
||||
public static final int edit_query = 2131296556;
|
||||
public static final int end = 2131296567;
|
||||
public static final int expand_activities_button = 2131296594;
|
||||
public static final int expanded_menu = 2131296595;
|
||||
public static final int forever = 2131296644;
|
||||
public static final int group_divider = 2131296671;
|
||||
public static final int home = 2131296696;
|
||||
public static final int icon = 2131296701;
|
||||
public static final int icon_group = 2131296702;
|
||||
public static final int image = 2131296817;
|
||||
public static final int info = 2131296971;
|
||||
public static final int italic = 2131296980;
|
||||
public static final int left = 2131297071;
|
||||
public static final int line1 = 2131297087;
|
||||
public static final int line3 = 2131297088;
|
||||
public static final int listMode = 2131297089;
|
||||
public static final int list_item = 2131297090;
|
||||
public static final int message = 2131297163;
|
||||
public static final int multiply = 2131297181;
|
||||
public static final int none = 2131297193;
|
||||
public static final int normal = 2131297194;
|
||||
public static final int notification_background = 2131297195;
|
||||
public static final int notification_main_column = 2131297196;
|
||||
public static final int notification_main_column_container = 2131297197;
|
||||
public static final int parentPanel = 2131297216;
|
||||
public static final int progress_circular = 2131297255;
|
||||
public static final int progress_horizontal = 2131297256;
|
||||
public static final int radio = 2131297284;
|
||||
public static final int right = 2131297305;
|
||||
public static final int right_icon = 2131297308;
|
||||
public static final int right_side = 2131297309;
|
||||
public static final int screen = 2131297445;
|
||||
public static final int scrollIndicatorDown = 2131297447;
|
||||
public static final int scrollIndicatorUp = 2131297448;
|
||||
public static final int scrollView = 2131297449;
|
||||
public static final int search_badge = 2131297451;
|
||||
public static final int search_bar = 2131297452;
|
||||
public static final int search_button = 2131297453;
|
||||
public static final int search_close_btn = 2131297454;
|
||||
public static final int search_edit_frame = 2131297455;
|
||||
public static final int search_go_btn = 2131297456;
|
||||
public static final int search_mag_icon = 2131297457;
|
||||
public static final int search_plate = 2131297458;
|
||||
public static final int search_src_text = 2131297459;
|
||||
public static final int search_voice_btn = 2131297460;
|
||||
public static final int select_dialog_listview = 2131297462;
|
||||
public static final int shortcut = 2131297475;
|
||||
public static final int spacer = 2131297490;
|
||||
public static final int split_action_bar = 2131297493;
|
||||
public static final int src_atop = 2131297496;
|
||||
public static final int src_in = 2131297497;
|
||||
public static final int src_over = 2131297498;
|
||||
public static final int start = 2131297500;
|
||||
public static final int submenuarrow = 2131297512;
|
||||
public static final int submit_area = 2131297513;
|
||||
public static final int tabMode = 2131297522;
|
||||
public static final int tag_transition_group = 2131297528;
|
||||
public static final int tag_unhandled_key_event_manager = 2131297529;
|
||||
public static final int tag_unhandled_key_listeners = 2131297530;
|
||||
public static final int text = 2131297537;
|
||||
public static final int text2 = 2131297538;
|
||||
public static final int textSpacerNoButtons = 2131297539;
|
||||
public static final int textSpacerNoTitle = 2131297540;
|
||||
public static final int time = 2131297551;
|
||||
public static final int title = 2131297555;
|
||||
public static final int titleDividerNoCustom = 2131297556;
|
||||
public static final int title_template = 2131297565;
|
||||
public static final int top = 2131297568;
|
||||
public static final int topPanel = 2131297569;
|
||||
public static final int uniform = 2131297895;
|
||||
public static final int up = 2131297898;
|
||||
public static final int wrap_content = 2131297986;
|
||||
}
|
||||
43
sources/androidx/appcompat/R$layout.java
Normal file
43
sources/androidx/appcompat/R$layout.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package androidx.appcompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$layout {
|
||||
public static final int abc_action_bar_title_item = 2131492864;
|
||||
public static final int abc_action_bar_up_container = 2131492865;
|
||||
public static final int abc_action_menu_item_layout = 2131492866;
|
||||
public static final int abc_action_menu_layout = 2131492867;
|
||||
public static final int abc_action_mode_bar = 2131492868;
|
||||
public static final int abc_action_mode_close_item_material = 2131492869;
|
||||
public static final int abc_activity_chooser_view = 2131492870;
|
||||
public static final int abc_activity_chooser_view_list_item = 2131492871;
|
||||
public static final int abc_alert_dialog_button_bar_material = 2131492872;
|
||||
public static final int abc_alert_dialog_material = 2131492873;
|
||||
public static final int abc_alert_dialog_title_material = 2131492874;
|
||||
public static final int abc_cascading_menu_item_layout = 2131492875;
|
||||
public static final int abc_dialog_title_material = 2131492876;
|
||||
public static final int abc_expanded_menu_layout = 2131492877;
|
||||
public static final int abc_list_menu_item_checkbox = 2131492878;
|
||||
public static final int abc_list_menu_item_icon = 2131492879;
|
||||
public static final int abc_list_menu_item_layout = 2131492880;
|
||||
public static final int abc_list_menu_item_radio = 2131492881;
|
||||
public static final int abc_popup_menu_header_item_layout = 2131492882;
|
||||
public static final int abc_popup_menu_item_layout = 2131492883;
|
||||
public static final int abc_screen_content_include = 2131492884;
|
||||
public static final int abc_screen_simple = 2131492885;
|
||||
public static final int abc_screen_simple_overlay_action_mode = 2131492886;
|
||||
public static final int abc_screen_toolbar = 2131492887;
|
||||
public static final int abc_search_dropdown_item_icons_2line = 2131492888;
|
||||
public static final int abc_search_view = 2131492889;
|
||||
public static final int abc_select_dialog_material = 2131492890;
|
||||
public static final int abc_tooltip = 2131492891;
|
||||
public static final int notification_action = 2131493288;
|
||||
public static final int notification_action_tombstone = 2131493289;
|
||||
public static final int notification_template_custom_big = 2131493296;
|
||||
public static final int notification_template_icon_group = 2131493297;
|
||||
public static final int notification_template_part_chronometer = 2131493301;
|
||||
public static final int notification_template_part_time = 2131493302;
|
||||
public static final int select_dialog_item_material = 2131493348;
|
||||
public static final int select_dialog_multichoice_material = 2131493349;
|
||||
public static final int select_dialog_singlechoice_material = 2131493350;
|
||||
public static final int support_simple_spinner_dropdown_item = 2131493355;
|
||||
}
|
||||
46
sources/androidx/appcompat/R$string.java
Normal file
46
sources/androidx/appcompat/R$string.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package androidx.appcompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$string {
|
||||
public static final int abc_action_bar_home_description = 2131820553;
|
||||
public static final int abc_action_bar_up_description = 2131820554;
|
||||
public static final int abc_action_menu_overflow_description = 2131820555;
|
||||
public static final int abc_action_mode_done = 2131820556;
|
||||
public static final int abc_activity_chooser_view_see_all = 2131820557;
|
||||
public static final int abc_activitychooserview_choose_application = 2131820558;
|
||||
public static final int abc_capital_off = 2131820559;
|
||||
public static final int abc_capital_on = 2131820560;
|
||||
public static final int abc_font_family_body_1_material = 2131820561;
|
||||
public static final int abc_font_family_body_2_material = 2131820562;
|
||||
public static final int abc_font_family_button_material = 2131820563;
|
||||
public static final int abc_font_family_caption_material = 2131820564;
|
||||
public static final int abc_font_family_display_1_material = 2131820565;
|
||||
public static final int abc_font_family_display_2_material = 2131820566;
|
||||
public static final int abc_font_family_display_3_material = 2131820567;
|
||||
public static final int abc_font_family_display_4_material = 2131820568;
|
||||
public static final int abc_font_family_headline_material = 2131820569;
|
||||
public static final int abc_font_family_menu_material = 2131820570;
|
||||
public static final int abc_font_family_subhead_material = 2131820571;
|
||||
public static final int abc_font_family_title_material = 2131820572;
|
||||
public static final int abc_menu_alt_shortcut_label = 2131820573;
|
||||
public static final int abc_menu_ctrl_shortcut_label = 2131820574;
|
||||
public static final int abc_menu_delete_shortcut_label = 2131820575;
|
||||
public static final int abc_menu_enter_shortcut_label = 2131820576;
|
||||
public static final int abc_menu_function_shortcut_label = 2131820577;
|
||||
public static final int abc_menu_meta_shortcut_label = 2131820578;
|
||||
public static final int abc_menu_shift_shortcut_label = 2131820579;
|
||||
public static final int abc_menu_space_shortcut_label = 2131820580;
|
||||
public static final int abc_menu_sym_shortcut_label = 2131820581;
|
||||
public static final int abc_prepend_shortcut_label = 2131820582;
|
||||
public static final int abc_search_hint = 2131820583;
|
||||
public static final int abc_searchview_description_clear = 2131820584;
|
||||
public static final int abc_searchview_description_query = 2131820585;
|
||||
public static final int abc_searchview_description_search = 2131820586;
|
||||
public static final int abc_searchview_description_submit = 2131820587;
|
||||
public static final int abc_searchview_description_voice = 2131820588;
|
||||
public static final int abc_shareactionprovider_share_with = 2131820589;
|
||||
public static final int abc_shareactionprovider_share_with_application = 2131820590;
|
||||
public static final int abc_toolbar_collapse_description = 2131820591;
|
||||
public static final int search_menu_title = 2131821508;
|
||||
public static final int status_bar_notification_info_overflow = 2131821607;
|
||||
}
|
||||
351
sources/androidx/appcompat/R$style.java
Normal file
351
sources/androidx/appcompat/R$style.java
Normal file
@@ -0,0 +1,351 @@
|
||||
package androidx.appcompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$style {
|
||||
public static final int AlertDialog_AppCompat = 2131886081;
|
||||
public static final int AlertDialog_AppCompat_Light = 2131886082;
|
||||
public static final int Animation_AppCompat_Dialog = 2131886084;
|
||||
public static final int Animation_AppCompat_DropDownUp = 2131886085;
|
||||
public static final int Animation_AppCompat_Tooltip = 2131886086;
|
||||
public static final int Base_AlertDialog_AppCompat = 2131886093;
|
||||
public static final int Base_AlertDialog_AppCompat_Light = 2131886094;
|
||||
public static final int Base_Animation_AppCompat_Dialog = 2131886095;
|
||||
public static final int Base_Animation_AppCompat_DropDownUp = 2131886096;
|
||||
public static final int Base_Animation_AppCompat_Tooltip = 2131886097;
|
||||
public static final int Base_DialogWindowTitleBackground_AppCompat = 2131886100;
|
||||
public static final int Base_DialogWindowTitle_AppCompat = 2131886099;
|
||||
public static final int Base_TextAppearance_AppCompat = 2131886101;
|
||||
public static final int Base_TextAppearance_AppCompat_Body1 = 2131886102;
|
||||
public static final int Base_TextAppearance_AppCompat_Body2 = 2131886103;
|
||||
public static final int Base_TextAppearance_AppCompat_Button = 2131886104;
|
||||
public static final int Base_TextAppearance_AppCompat_Caption = 2131886105;
|
||||
public static final int Base_TextAppearance_AppCompat_Display1 = 2131886106;
|
||||
public static final int Base_TextAppearance_AppCompat_Display2 = 2131886107;
|
||||
public static final int Base_TextAppearance_AppCompat_Display3 = 2131886108;
|
||||
public static final int Base_TextAppearance_AppCompat_Display4 = 2131886109;
|
||||
public static final int Base_TextAppearance_AppCompat_Headline = 2131886110;
|
||||
public static final int Base_TextAppearance_AppCompat_Inverse = 2131886111;
|
||||
public static final int Base_TextAppearance_AppCompat_Large = 2131886112;
|
||||
public static final int Base_TextAppearance_AppCompat_Large_Inverse = 2131886113;
|
||||
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131886114;
|
||||
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131886115;
|
||||
public static final int Base_TextAppearance_AppCompat_Medium = 2131886116;
|
||||
public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 2131886117;
|
||||
public static final int Base_TextAppearance_AppCompat_Menu = 2131886118;
|
||||
public static final int Base_TextAppearance_AppCompat_SearchResult = 2131886119;
|
||||
public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 2131886120;
|
||||
public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 2131886121;
|
||||
public static final int Base_TextAppearance_AppCompat_Small = 2131886122;
|
||||
public static final int Base_TextAppearance_AppCompat_Small_Inverse = 2131886123;
|
||||
public static final int Base_TextAppearance_AppCompat_Subhead = 2131886124;
|
||||
public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 2131886125;
|
||||
public static final int Base_TextAppearance_AppCompat_Title = 2131886126;
|
||||
public static final int Base_TextAppearance_AppCompat_Title_Inverse = 2131886127;
|
||||
public static final int Base_TextAppearance_AppCompat_Tooltip = 2131886128;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131886129;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131886130;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131886131;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 2131886132;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131886133;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131886134;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 2131886135;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_Button = 2131886136;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 2131886137;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_Button_Colored = 2131886138;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 2131886139;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 2131886140;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Header = 2131886141;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131886142;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131886143;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_Switch = 2131886144;
|
||||
public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131886145;
|
||||
public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131886146;
|
||||
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131886147;
|
||||
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 2131886148;
|
||||
public static final int Base_ThemeOverlay_AppCompat = 2131886180;
|
||||
public static final int Base_ThemeOverlay_AppCompat_ActionBar = 2131886181;
|
||||
public static final int Base_ThemeOverlay_AppCompat_Dark = 2131886182;
|
||||
public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 2131886183;
|
||||
public static final int Base_ThemeOverlay_AppCompat_Dialog = 2131886184;
|
||||
public static final int Base_ThemeOverlay_AppCompat_Dialog_Alert = 2131886185;
|
||||
public static final int Base_ThemeOverlay_AppCompat_Light = 2131886186;
|
||||
public static final int Base_Theme_AppCompat = 2131886149;
|
||||
public static final int Base_Theme_AppCompat_CompactMenu = 2131886150;
|
||||
public static final int Base_Theme_AppCompat_Dialog = 2131886151;
|
||||
public static final int Base_Theme_AppCompat_DialogWhenLarge = 2131886155;
|
||||
public static final int Base_Theme_AppCompat_Dialog_Alert = 2131886152;
|
||||
public static final int Base_Theme_AppCompat_Dialog_FixedSize = 2131886153;
|
||||
public static final int Base_Theme_AppCompat_Dialog_MinWidth = 2131886154;
|
||||
public static final int Base_Theme_AppCompat_Light = 2131886156;
|
||||
public static final int Base_Theme_AppCompat_Light_DarkActionBar = 2131886157;
|
||||
public static final int Base_Theme_AppCompat_Light_Dialog = 2131886158;
|
||||
public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 2131886162;
|
||||
public static final int Base_Theme_AppCompat_Light_Dialog_Alert = 2131886159;
|
||||
public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 2131886160;
|
||||
public static final int Base_Theme_AppCompat_Light_Dialog_MinWidth = 2131886161;
|
||||
public static final int Base_V21_ThemeOverlay_AppCompat_Dialog = 2131886202;
|
||||
public static final int Base_V21_Theme_AppCompat = 2131886198;
|
||||
public static final int Base_V21_Theme_AppCompat_Dialog = 2131886199;
|
||||
public static final int Base_V21_Theme_AppCompat_Light = 2131886200;
|
||||
public static final int Base_V21_Theme_AppCompat_Light_Dialog = 2131886201;
|
||||
public static final int Base_V22_Theme_AppCompat = 2131886203;
|
||||
public static final int Base_V22_Theme_AppCompat_Light = 2131886204;
|
||||
public static final int Base_V23_Theme_AppCompat = 2131886205;
|
||||
public static final int Base_V23_Theme_AppCompat_Light = 2131886206;
|
||||
public static final int Base_V26_Theme_AppCompat = 2131886207;
|
||||
public static final int Base_V26_Theme_AppCompat_Light = 2131886208;
|
||||
public static final int Base_V26_Widget_AppCompat_Toolbar = 2131886209;
|
||||
public static final int Base_V28_Theme_AppCompat = 2131886210;
|
||||
public static final int Base_V28_Theme_AppCompat_Light = 2131886211;
|
||||
public static final int Base_V7_ThemeOverlay_AppCompat_Dialog = 2131886216;
|
||||
public static final int Base_V7_Theme_AppCompat = 2131886212;
|
||||
public static final int Base_V7_Theme_AppCompat_Dialog = 2131886213;
|
||||
public static final int Base_V7_Theme_AppCompat_Light = 2131886214;
|
||||
public static final int Base_V7_Theme_AppCompat_Light_Dialog = 2131886215;
|
||||
public static final int Base_V7_Widget_AppCompat_AutoCompleteTextView = 2131886217;
|
||||
public static final int Base_V7_Widget_AppCompat_EditText = 2131886218;
|
||||
public static final int Base_V7_Widget_AppCompat_Toolbar = 2131886219;
|
||||
public static final int Base_Widget_AppCompat_ActionBar = 2131886220;
|
||||
public static final int Base_Widget_AppCompat_ActionBar_Solid = 2131886221;
|
||||
public static final int Base_Widget_AppCompat_ActionBar_TabBar = 2131886222;
|
||||
public static final int Base_Widget_AppCompat_ActionBar_TabText = 2131886223;
|
||||
public static final int Base_Widget_AppCompat_ActionBar_TabView = 2131886224;
|
||||
public static final int Base_Widget_AppCompat_ActionButton = 2131886225;
|
||||
public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 2131886226;
|
||||
public static final int Base_Widget_AppCompat_ActionButton_Overflow = 2131886227;
|
||||
public static final int Base_Widget_AppCompat_ActionMode = 2131886228;
|
||||
public static final int Base_Widget_AppCompat_ActivityChooserView = 2131886229;
|
||||
public static final int Base_Widget_AppCompat_AutoCompleteTextView = 2131886230;
|
||||
public static final int Base_Widget_AppCompat_Button = 2131886231;
|
||||
public static final int Base_Widget_AppCompat_ButtonBar = 2131886237;
|
||||
public static final int Base_Widget_AppCompat_ButtonBar_AlertDialog = 2131886238;
|
||||
public static final int Base_Widget_AppCompat_Button_Borderless = 2131886232;
|
||||
public static final int Base_Widget_AppCompat_Button_Borderless_Colored = 2131886233;
|
||||
public static final int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131886234;
|
||||
public static final int Base_Widget_AppCompat_Button_Colored = 2131886235;
|
||||
public static final int Base_Widget_AppCompat_Button_Small = 2131886236;
|
||||
public static final int Base_Widget_AppCompat_CompoundButton_CheckBox = 2131886239;
|
||||
public static final int Base_Widget_AppCompat_CompoundButton_RadioButton = 2131886240;
|
||||
public static final int Base_Widget_AppCompat_CompoundButton_Switch = 2131886241;
|
||||
public static final int Base_Widget_AppCompat_DrawerArrowToggle = 2131886242;
|
||||
public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 2131886243;
|
||||
public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 2131886244;
|
||||
public static final int Base_Widget_AppCompat_EditText = 2131886245;
|
||||
public static final int Base_Widget_AppCompat_ImageButton = 2131886246;
|
||||
public static final int Base_Widget_AppCompat_Light_ActionBar = 2131886247;
|
||||
public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 2131886248;
|
||||
public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 2131886249;
|
||||
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 2131886250;
|
||||
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131886251;
|
||||
public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 2131886252;
|
||||
public static final int Base_Widget_AppCompat_Light_PopupMenu = 2131886253;
|
||||
public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 2131886254;
|
||||
public static final int Base_Widget_AppCompat_ListMenuView = 2131886255;
|
||||
public static final int Base_Widget_AppCompat_ListPopupWindow = 2131886256;
|
||||
public static final int Base_Widget_AppCompat_ListView = 2131886257;
|
||||
public static final int Base_Widget_AppCompat_ListView_DropDown = 2131886258;
|
||||
public static final int Base_Widget_AppCompat_ListView_Menu = 2131886259;
|
||||
public static final int Base_Widget_AppCompat_PopupMenu = 2131886260;
|
||||
public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 2131886261;
|
||||
public static final int Base_Widget_AppCompat_PopupWindow = 2131886262;
|
||||
public static final int Base_Widget_AppCompat_ProgressBar = 2131886263;
|
||||
public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 2131886264;
|
||||
public static final int Base_Widget_AppCompat_RatingBar = 2131886265;
|
||||
public static final int Base_Widget_AppCompat_RatingBar_Indicator = 2131886266;
|
||||
public static final int Base_Widget_AppCompat_RatingBar_Small = 2131886267;
|
||||
public static final int Base_Widget_AppCompat_SearchView = 2131886268;
|
||||
public static final int Base_Widget_AppCompat_SearchView_ActionBar = 2131886269;
|
||||
public static final int Base_Widget_AppCompat_SeekBar = 2131886270;
|
||||
public static final int Base_Widget_AppCompat_SeekBar_Discrete = 2131886271;
|
||||
public static final int Base_Widget_AppCompat_Spinner = 2131886272;
|
||||
public static final int Base_Widget_AppCompat_Spinner_Underlined = 2131886273;
|
||||
public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 2131886274;
|
||||
public static final int Base_Widget_AppCompat_Toolbar = 2131886275;
|
||||
public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 2131886276;
|
||||
public static final int Platform_AppCompat = 2131886313;
|
||||
public static final int Platform_AppCompat_Light = 2131886314;
|
||||
public static final int Platform_ThemeOverlay_AppCompat = 2131886319;
|
||||
public static final int Platform_ThemeOverlay_AppCompat_Dark = 2131886320;
|
||||
public static final int Platform_ThemeOverlay_AppCompat_Light = 2131886321;
|
||||
public static final int Platform_V21_AppCompat = 2131886322;
|
||||
public static final int Platform_V21_AppCompat_Light = 2131886323;
|
||||
public static final int Platform_V25_AppCompat = 2131886324;
|
||||
public static final int Platform_V25_AppCompat_Light = 2131886325;
|
||||
public static final int Platform_Widget_AppCompat_Spinner = 2131886326;
|
||||
public static final int RtlOverlay_DialogWindowTitle_AppCompat = 2131886328;
|
||||
public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 2131886329;
|
||||
public static final int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 2131886330;
|
||||
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 2131886331;
|
||||
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 2131886332;
|
||||
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Shortcut = 2131886333;
|
||||
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_SubmenuArrow = 2131886334;
|
||||
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 2131886335;
|
||||
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Title = 2131886336;
|
||||
public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 2131886342;
|
||||
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 2131886337;
|
||||
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 2131886338;
|
||||
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 2131886339;
|
||||
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 2131886340;
|
||||
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 2131886341;
|
||||
public static final int RtlUnderlay_Widget_AppCompat_ActionButton = 2131886343;
|
||||
public static final int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 2131886344;
|
||||
public static final int TextAppearance_AppCompat = 2131886347;
|
||||
public static final int TextAppearance_AppCompat_Body1 = 2131886348;
|
||||
public static final int TextAppearance_AppCompat_Body2 = 2131886349;
|
||||
public static final int TextAppearance_AppCompat_Button = 2131886350;
|
||||
public static final int TextAppearance_AppCompat_Caption = 2131886351;
|
||||
public static final int TextAppearance_AppCompat_Display1 = 2131886352;
|
||||
public static final int TextAppearance_AppCompat_Display2 = 2131886353;
|
||||
public static final int TextAppearance_AppCompat_Display3 = 2131886354;
|
||||
public static final int TextAppearance_AppCompat_Display4 = 2131886355;
|
||||
public static final int TextAppearance_AppCompat_Headline = 2131886356;
|
||||
public static final int TextAppearance_AppCompat_Inverse = 2131886357;
|
||||
public static final int TextAppearance_AppCompat_Large = 2131886358;
|
||||
public static final int TextAppearance_AppCompat_Large_Inverse = 2131886359;
|
||||
public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 2131886360;
|
||||
public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 2131886361;
|
||||
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131886362;
|
||||
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131886363;
|
||||
public static final int TextAppearance_AppCompat_Medium = 2131886364;
|
||||
public static final int TextAppearance_AppCompat_Medium_Inverse = 2131886365;
|
||||
public static final int TextAppearance_AppCompat_Menu = 2131886366;
|
||||
public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 2131886367;
|
||||
public static final int TextAppearance_AppCompat_SearchResult_Title = 2131886368;
|
||||
public static final int TextAppearance_AppCompat_Small = 2131886369;
|
||||
public static final int TextAppearance_AppCompat_Small_Inverse = 2131886370;
|
||||
public static final int TextAppearance_AppCompat_Subhead = 2131886371;
|
||||
public static final int TextAppearance_AppCompat_Subhead_Inverse = 2131886372;
|
||||
public static final int TextAppearance_AppCompat_Title = 2131886373;
|
||||
public static final int TextAppearance_AppCompat_Title_Inverse = 2131886374;
|
||||
public static final int TextAppearance_AppCompat_Tooltip = 2131886375;
|
||||
public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131886376;
|
||||
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131886377;
|
||||
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131886378;
|
||||
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 2131886379;
|
||||
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131886380;
|
||||
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131886381;
|
||||
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 2131886382;
|
||||
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 2131886383;
|
||||
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 2131886384;
|
||||
public static final int TextAppearance_AppCompat_Widget_Button = 2131886385;
|
||||
public static final int TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 2131886386;
|
||||
public static final int TextAppearance_AppCompat_Widget_Button_Colored = 2131886387;
|
||||
public static final int TextAppearance_AppCompat_Widget_Button_Inverse = 2131886388;
|
||||
public static final int TextAppearance_AppCompat_Widget_DropDownItem = 2131886389;
|
||||
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Header = 2131886390;
|
||||
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131886391;
|
||||
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131886392;
|
||||
public static final int TextAppearance_AppCompat_Widget_Switch = 2131886393;
|
||||
public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131886394;
|
||||
public static final int TextAppearance_Compat_Notification = 2131886395;
|
||||
public static final int TextAppearance_Compat_Notification_Info = 2131886396;
|
||||
public static final int TextAppearance_Compat_Notification_Line2 = 2131886398;
|
||||
public static final int TextAppearance_Compat_Notification_Time = 2131886401;
|
||||
public static final int TextAppearance_Compat_Notification_Title = 2131886403;
|
||||
public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131886428;
|
||||
public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131886429;
|
||||
public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 2131886430;
|
||||
public static final int ThemeOverlay_AppCompat = 2131886482;
|
||||
public static final int ThemeOverlay_AppCompat_ActionBar = 2131886483;
|
||||
public static final int ThemeOverlay_AppCompat_Dark = 2131886484;
|
||||
public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 2131886485;
|
||||
public static final int ThemeOverlay_AppCompat_Dialog = 2131886486;
|
||||
public static final int ThemeOverlay_AppCompat_Dialog_Alert = 2131886487;
|
||||
public static final int ThemeOverlay_AppCompat_Light = 2131886488;
|
||||
public static final int Theme_AppCompat = 2131886433;
|
||||
public static final int Theme_AppCompat_CompactMenu = 2131886434;
|
||||
public static final int Theme_AppCompat_DayNight = 2131886435;
|
||||
public static final int Theme_AppCompat_DayNight_DarkActionBar = 2131886436;
|
||||
public static final int Theme_AppCompat_DayNight_Dialog = 2131886437;
|
||||
public static final int Theme_AppCompat_DayNight_DialogWhenLarge = 2131886440;
|
||||
public static final int Theme_AppCompat_DayNight_Dialog_Alert = 2131886438;
|
||||
public static final int Theme_AppCompat_DayNight_Dialog_MinWidth = 2131886439;
|
||||
public static final int Theme_AppCompat_DayNight_NoActionBar = 2131886441;
|
||||
public static final int Theme_AppCompat_Dialog = 2131886442;
|
||||
public static final int Theme_AppCompat_DialogWhenLarge = 2131886445;
|
||||
public static final int Theme_AppCompat_Dialog_Alert = 2131886443;
|
||||
public static final int Theme_AppCompat_Dialog_MinWidth = 2131886444;
|
||||
public static final int Theme_AppCompat_Light = 2131886446;
|
||||
public static final int Theme_AppCompat_Light_DarkActionBar = 2131886447;
|
||||
public static final int Theme_AppCompat_Light_Dialog = 2131886448;
|
||||
public static final int Theme_AppCompat_Light_DialogWhenLarge = 2131886451;
|
||||
public static final int Theme_AppCompat_Light_Dialog_Alert = 2131886449;
|
||||
public static final int Theme_AppCompat_Light_Dialog_MinWidth = 2131886450;
|
||||
public static final int Theme_AppCompat_Light_NoActionBar = 2131886452;
|
||||
public static final int Theme_AppCompat_NoActionBar = 2131886453;
|
||||
public static final int Widget_AppCompat_ActionBar = 2131886502;
|
||||
public static final int Widget_AppCompat_ActionBar_Solid = 2131886503;
|
||||
public static final int Widget_AppCompat_ActionBar_TabBar = 2131886504;
|
||||
public static final int Widget_AppCompat_ActionBar_TabText = 2131886505;
|
||||
public static final int Widget_AppCompat_ActionBar_TabView = 2131886506;
|
||||
public static final int Widget_AppCompat_ActionButton = 2131886507;
|
||||
public static final int Widget_AppCompat_ActionButton_CloseMode = 2131886508;
|
||||
public static final int Widget_AppCompat_ActionButton_Overflow = 2131886509;
|
||||
public static final int Widget_AppCompat_ActionMode = 2131886510;
|
||||
public static final int Widget_AppCompat_ActivityChooserView = 2131886511;
|
||||
public static final int Widget_AppCompat_AutoCompleteTextView = 2131886512;
|
||||
public static final int Widget_AppCompat_Button = 2131886513;
|
||||
public static final int Widget_AppCompat_ButtonBar = 2131886519;
|
||||
public static final int Widget_AppCompat_ButtonBar_AlertDialog = 2131886520;
|
||||
public static final int Widget_AppCompat_Button_Borderless = 2131886514;
|
||||
public static final int Widget_AppCompat_Button_Borderless_Colored = 2131886515;
|
||||
public static final int Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131886516;
|
||||
public static final int Widget_AppCompat_Button_Colored = 2131886517;
|
||||
public static final int Widget_AppCompat_Button_Small = 2131886518;
|
||||
public static final int Widget_AppCompat_CompoundButton_CheckBox = 2131886521;
|
||||
public static final int Widget_AppCompat_CompoundButton_RadioButton = 2131886522;
|
||||
public static final int Widget_AppCompat_CompoundButton_Switch = 2131886523;
|
||||
public static final int Widget_AppCompat_DrawerArrowToggle = 2131886524;
|
||||
public static final int Widget_AppCompat_DropDownItem_Spinner = 2131886525;
|
||||
public static final int Widget_AppCompat_EditText = 2131886526;
|
||||
public static final int Widget_AppCompat_ImageButton = 2131886527;
|
||||
public static final int Widget_AppCompat_Light_ActionBar = 2131886528;
|
||||
public static final int Widget_AppCompat_Light_ActionBar_Solid = 2131886529;
|
||||
public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 2131886530;
|
||||
public static final int Widget_AppCompat_Light_ActionBar_TabBar = 2131886531;
|
||||
public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 2131886532;
|
||||
public static final int Widget_AppCompat_Light_ActionBar_TabText = 2131886533;
|
||||
public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131886534;
|
||||
public static final int Widget_AppCompat_Light_ActionBar_TabView = 2131886535;
|
||||
public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 2131886536;
|
||||
public static final int Widget_AppCompat_Light_ActionButton = 2131886537;
|
||||
public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 2131886538;
|
||||
public static final int Widget_AppCompat_Light_ActionButton_Overflow = 2131886539;
|
||||
public static final int Widget_AppCompat_Light_ActionMode_Inverse = 2131886540;
|
||||
public static final int Widget_AppCompat_Light_ActivityChooserView = 2131886541;
|
||||
public static final int Widget_AppCompat_Light_AutoCompleteTextView = 2131886542;
|
||||
public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 2131886543;
|
||||
public static final int Widget_AppCompat_Light_ListPopupWindow = 2131886544;
|
||||
public static final int Widget_AppCompat_Light_ListView_DropDown = 2131886545;
|
||||
public static final int Widget_AppCompat_Light_PopupMenu = 2131886546;
|
||||
public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 2131886547;
|
||||
public static final int Widget_AppCompat_Light_SearchView = 2131886548;
|
||||
public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 2131886549;
|
||||
public static final int Widget_AppCompat_ListMenuView = 2131886550;
|
||||
public static final int Widget_AppCompat_ListPopupWindow = 2131886551;
|
||||
public static final int Widget_AppCompat_ListView = 2131886552;
|
||||
public static final int Widget_AppCompat_ListView_DropDown = 2131886553;
|
||||
public static final int Widget_AppCompat_ListView_Menu = 2131886554;
|
||||
public static final int Widget_AppCompat_PopupMenu = 2131886555;
|
||||
public static final int Widget_AppCompat_PopupMenu_Overflow = 2131886556;
|
||||
public static final int Widget_AppCompat_PopupWindow = 2131886557;
|
||||
public static final int Widget_AppCompat_ProgressBar = 2131886558;
|
||||
public static final int Widget_AppCompat_ProgressBar_Horizontal = 2131886559;
|
||||
public static final int Widget_AppCompat_RatingBar = 2131886560;
|
||||
public static final int Widget_AppCompat_RatingBar_Indicator = 2131886561;
|
||||
public static final int Widget_AppCompat_RatingBar_Small = 2131886562;
|
||||
public static final int Widget_AppCompat_SearchView = 2131886563;
|
||||
public static final int Widget_AppCompat_SearchView_ActionBar = 2131886564;
|
||||
public static final int Widget_AppCompat_SeekBar = 2131886565;
|
||||
public static final int Widget_AppCompat_SeekBar_Discrete = 2131886566;
|
||||
public static final int Widget_AppCompat_Spinner = 2131886567;
|
||||
public static final int Widget_AppCompat_Spinner_DropDown = 2131886568;
|
||||
public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 2131886569;
|
||||
public static final int Widget_AppCompat_Spinner_Underlined = 2131886570;
|
||||
public static final int Widget_AppCompat_TextView_SpinnerItem = 2131886571;
|
||||
public static final int Widget_AppCompat_Toolbar = 2131886572;
|
||||
public static final int Widget_AppCompat_Toolbar_Button_Navigation = 2131886573;
|
||||
public static final int Widget_Compat_NotificationActionContainer = 2131886574;
|
||||
public static final int Widget_Compat_NotificationActionText = 2131886575;
|
||||
public static final int Widget_Support_CoordinatorLayout = 2131886622;
|
||||
}
|
||||
466
sources/androidx/appcompat/R$styleable.java
Normal file
466
sources/androidx/appcompat/R$styleable.java
Normal file
@@ -0,0 +1,466 @@
|
||||
package androidx.appcompat;
|
||||
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$styleable {
|
||||
public static final int ActionBarLayout_android_layout_gravity = 0;
|
||||
public static final int ActionBar_background = 0;
|
||||
public static final int ActionBar_backgroundSplit = 1;
|
||||
public static final int ActionBar_backgroundStacked = 2;
|
||||
public static final int ActionBar_contentInsetEnd = 3;
|
||||
public static final int ActionBar_contentInsetEndWithActions = 4;
|
||||
public static final int ActionBar_contentInsetLeft = 5;
|
||||
public static final int ActionBar_contentInsetRight = 6;
|
||||
public static final int ActionBar_contentInsetStart = 7;
|
||||
public static final int ActionBar_contentInsetStartWithNavigation = 8;
|
||||
public static final int ActionBar_customNavigationLayout = 9;
|
||||
public static final int ActionBar_displayOptions = 10;
|
||||
public static final int ActionBar_divider = 11;
|
||||
public static final int ActionBar_elevation = 12;
|
||||
public static final int ActionBar_height = 13;
|
||||
public static final int ActionBar_hideOnContentScroll = 14;
|
||||
public static final int ActionBar_homeAsUpIndicator = 15;
|
||||
public static final int ActionBar_homeLayout = 16;
|
||||
public static final int ActionBar_icon = 17;
|
||||
public static final int ActionBar_indeterminateProgressStyle = 18;
|
||||
public static final int ActionBar_itemPadding = 19;
|
||||
public static final int ActionBar_logo = 20;
|
||||
public static final int ActionBar_navigationMode = 21;
|
||||
public static final int ActionBar_popupTheme = 22;
|
||||
public static final int ActionBar_progressBarPadding = 23;
|
||||
public static final int ActionBar_progressBarStyle = 24;
|
||||
public static final int ActionBar_subtitle = 25;
|
||||
public static final int ActionBar_subtitleTextStyle = 26;
|
||||
public static final int ActionBar_title = 27;
|
||||
public static final int ActionBar_titleTextStyle = 28;
|
||||
public static final int ActionMenuItemView_android_minWidth = 0;
|
||||
public static final int ActionMode_background = 0;
|
||||
public static final int ActionMode_backgroundSplit = 1;
|
||||
public static final int ActionMode_closeItemLayout = 2;
|
||||
public static final int ActionMode_height = 3;
|
||||
public static final int ActionMode_subtitleTextStyle = 4;
|
||||
public static final int ActionMode_titleTextStyle = 5;
|
||||
public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 0;
|
||||
public static final int ActivityChooserView_initialActivityCount = 1;
|
||||
public static final int AlertDialog_android_layout = 0;
|
||||
public static final int AlertDialog_buttonIconDimen = 1;
|
||||
public static final int AlertDialog_buttonPanelSideLayout = 2;
|
||||
public static final int AlertDialog_listItemLayout = 3;
|
||||
public static final int AlertDialog_listLayout = 4;
|
||||
public static final int AlertDialog_multiChoiceItemLayout = 5;
|
||||
public static final int AlertDialog_showTitle = 6;
|
||||
public static final int AlertDialog_singleChoiceItemLayout = 7;
|
||||
public static final int AnimatedStateListDrawableCompat_android_constantSize = 3;
|
||||
public static final int AnimatedStateListDrawableCompat_android_dither = 0;
|
||||
public static final int AnimatedStateListDrawableCompat_android_enterFadeDuration = 4;
|
||||
public static final int AnimatedStateListDrawableCompat_android_exitFadeDuration = 5;
|
||||
public static final int AnimatedStateListDrawableCompat_android_variablePadding = 2;
|
||||
public static final int AnimatedStateListDrawableCompat_android_visible = 1;
|
||||
public static final int AnimatedStateListDrawableItem_android_drawable = 1;
|
||||
public static final int AnimatedStateListDrawableItem_android_id = 0;
|
||||
public static final int AnimatedStateListDrawableTransition_android_drawable = 0;
|
||||
public static final int AnimatedStateListDrawableTransition_android_fromId = 2;
|
||||
public static final int AnimatedStateListDrawableTransition_android_reversible = 3;
|
||||
public static final int AnimatedStateListDrawableTransition_android_toId = 1;
|
||||
public static final int AppCompatImageView_android_src = 0;
|
||||
public static final int AppCompatImageView_srcCompat = 1;
|
||||
public static final int AppCompatImageView_tint = 2;
|
||||
public static final int AppCompatImageView_tintMode = 3;
|
||||
public static final int AppCompatSeekBar_android_thumb = 0;
|
||||
public static final int AppCompatSeekBar_tickMark = 1;
|
||||
public static final int AppCompatSeekBar_tickMarkTint = 2;
|
||||
public static final int AppCompatSeekBar_tickMarkTintMode = 3;
|
||||
public static final int AppCompatTextHelper_android_drawableBottom = 2;
|
||||
public static final int AppCompatTextHelper_android_drawableEnd = 6;
|
||||
public static final int AppCompatTextHelper_android_drawableLeft = 3;
|
||||
public static final int AppCompatTextHelper_android_drawableRight = 4;
|
||||
public static final int AppCompatTextHelper_android_drawableStart = 5;
|
||||
public static final int AppCompatTextHelper_android_drawableTop = 1;
|
||||
public static final int AppCompatTextHelper_android_textAppearance = 0;
|
||||
public static final int AppCompatTextView_android_textAppearance = 0;
|
||||
public static final int AppCompatTextView_autoSizeMaxTextSize = 1;
|
||||
public static final int AppCompatTextView_autoSizeMinTextSize = 2;
|
||||
public static final int AppCompatTextView_autoSizePresetSizes = 3;
|
||||
public static final int AppCompatTextView_autoSizeStepGranularity = 4;
|
||||
public static final int AppCompatTextView_autoSizeTextType = 5;
|
||||
public static final int AppCompatTextView_firstBaselineToTopHeight = 6;
|
||||
public static final int AppCompatTextView_fontFamily = 7;
|
||||
public static final int AppCompatTextView_lastBaselineToBottomHeight = 8;
|
||||
public static final int AppCompatTextView_lineHeight = 9;
|
||||
public static final int AppCompatTextView_textAllCaps = 10;
|
||||
public static final int AppCompatTheme_actionBarDivider = 2;
|
||||
public static final int AppCompatTheme_actionBarItemBackground = 3;
|
||||
public static final int AppCompatTheme_actionBarPopupTheme = 4;
|
||||
public static final int AppCompatTheme_actionBarSize = 5;
|
||||
public static final int AppCompatTheme_actionBarSplitStyle = 6;
|
||||
public static final int AppCompatTheme_actionBarStyle = 7;
|
||||
public static final int AppCompatTheme_actionBarTabBarStyle = 8;
|
||||
public static final int AppCompatTheme_actionBarTabStyle = 9;
|
||||
public static final int AppCompatTheme_actionBarTabTextStyle = 10;
|
||||
public static final int AppCompatTheme_actionBarTheme = 11;
|
||||
public static final int AppCompatTheme_actionBarWidgetTheme = 12;
|
||||
public static final int AppCompatTheme_actionButtonStyle = 13;
|
||||
public static final int AppCompatTheme_actionDropDownStyle = 14;
|
||||
public static final int AppCompatTheme_actionMenuTextAppearance = 15;
|
||||
public static final int AppCompatTheme_actionMenuTextColor = 16;
|
||||
public static final int AppCompatTheme_actionModeBackground = 17;
|
||||
public static final int AppCompatTheme_actionModeCloseButtonStyle = 18;
|
||||
public static final int AppCompatTheme_actionModeCloseDrawable = 19;
|
||||
public static final int AppCompatTheme_actionModeCopyDrawable = 20;
|
||||
public static final int AppCompatTheme_actionModeCutDrawable = 21;
|
||||
public static final int AppCompatTheme_actionModeFindDrawable = 22;
|
||||
public static final int AppCompatTheme_actionModePasteDrawable = 23;
|
||||
public static final int AppCompatTheme_actionModePopupWindowStyle = 24;
|
||||
public static final int AppCompatTheme_actionModeSelectAllDrawable = 25;
|
||||
public static final int AppCompatTheme_actionModeShareDrawable = 26;
|
||||
public static final int AppCompatTheme_actionModeSplitBackground = 27;
|
||||
public static final int AppCompatTheme_actionModeStyle = 28;
|
||||
public static final int AppCompatTheme_actionModeWebSearchDrawable = 29;
|
||||
public static final int AppCompatTheme_actionOverflowButtonStyle = 30;
|
||||
public static final int AppCompatTheme_actionOverflowMenuStyle = 31;
|
||||
public static final int AppCompatTheme_activityChooserViewStyle = 32;
|
||||
public static final int AppCompatTheme_alertDialogButtonGroupStyle = 33;
|
||||
public static final int AppCompatTheme_alertDialogCenterButtons = 34;
|
||||
public static final int AppCompatTheme_alertDialogStyle = 35;
|
||||
public static final int AppCompatTheme_alertDialogTheme = 36;
|
||||
public static final int AppCompatTheme_android_windowAnimationStyle = 1;
|
||||
public static final int AppCompatTheme_android_windowIsFloating = 0;
|
||||
public static final int AppCompatTheme_autoCompleteTextViewStyle = 37;
|
||||
public static final int AppCompatTheme_borderlessButtonStyle = 38;
|
||||
public static final int AppCompatTheme_buttonBarButtonStyle = 39;
|
||||
public static final int AppCompatTheme_buttonBarNegativeButtonStyle = 40;
|
||||
public static final int AppCompatTheme_buttonBarNeutralButtonStyle = 41;
|
||||
public static final int AppCompatTheme_buttonBarPositiveButtonStyle = 42;
|
||||
public static final int AppCompatTheme_buttonBarStyle = 43;
|
||||
public static final int AppCompatTheme_buttonStyle = 44;
|
||||
public static final int AppCompatTheme_buttonStyleSmall = 45;
|
||||
public static final int AppCompatTheme_checkboxStyle = 46;
|
||||
public static final int AppCompatTheme_checkedTextViewStyle = 47;
|
||||
public static final int AppCompatTheme_colorAccent = 48;
|
||||
public static final int AppCompatTheme_colorBackgroundFloating = 49;
|
||||
public static final int AppCompatTheme_colorButtonNormal = 50;
|
||||
public static final int AppCompatTheme_colorControlActivated = 51;
|
||||
public static final int AppCompatTheme_colorControlHighlight = 52;
|
||||
public static final int AppCompatTheme_colorControlNormal = 53;
|
||||
public static final int AppCompatTheme_colorError = 54;
|
||||
public static final int AppCompatTheme_colorPrimary = 55;
|
||||
public static final int AppCompatTheme_colorPrimaryDark = 56;
|
||||
public static final int AppCompatTheme_colorSwitchThumbNormal = 57;
|
||||
public static final int AppCompatTheme_controlBackground = 58;
|
||||
public static final int AppCompatTheme_dialogCornerRadius = 59;
|
||||
public static final int AppCompatTheme_dialogPreferredPadding = 60;
|
||||
public static final int AppCompatTheme_dialogTheme = 61;
|
||||
public static final int AppCompatTheme_dividerHorizontal = 62;
|
||||
public static final int AppCompatTheme_dividerVertical = 63;
|
||||
public static final int AppCompatTheme_dropDownListViewStyle = 64;
|
||||
public static final int AppCompatTheme_dropdownListPreferredItemHeight = 65;
|
||||
public static final int AppCompatTheme_editTextBackground = 66;
|
||||
public static final int AppCompatTheme_editTextColor = 67;
|
||||
public static final int AppCompatTheme_editTextStyle = 68;
|
||||
public static final int AppCompatTheme_homeAsUpIndicator = 69;
|
||||
public static final int AppCompatTheme_imageButtonStyle = 70;
|
||||
public static final int AppCompatTheme_listChoiceBackgroundIndicator = 71;
|
||||
public static final int AppCompatTheme_listDividerAlertDialog = 72;
|
||||
public static final int AppCompatTheme_listMenuViewStyle = 73;
|
||||
public static final int AppCompatTheme_listPopupWindowStyle = 74;
|
||||
public static final int AppCompatTheme_listPreferredItemHeight = 75;
|
||||
public static final int AppCompatTheme_listPreferredItemHeightLarge = 76;
|
||||
public static final int AppCompatTheme_listPreferredItemHeightSmall = 77;
|
||||
public static final int AppCompatTheme_listPreferredItemPaddingLeft = 78;
|
||||
public static final int AppCompatTheme_listPreferredItemPaddingRight = 79;
|
||||
public static final int AppCompatTheme_panelBackground = 80;
|
||||
public static final int AppCompatTheme_panelMenuListTheme = 81;
|
||||
public static final int AppCompatTheme_panelMenuListWidth = 82;
|
||||
public static final int AppCompatTheme_popupMenuStyle = 83;
|
||||
public static final int AppCompatTheme_popupWindowStyle = 84;
|
||||
public static final int AppCompatTheme_radioButtonStyle = 85;
|
||||
public static final int AppCompatTheme_ratingBarStyle = 86;
|
||||
public static final int AppCompatTheme_ratingBarStyleIndicator = 87;
|
||||
public static final int AppCompatTheme_ratingBarStyleSmall = 88;
|
||||
public static final int AppCompatTheme_searchViewStyle = 89;
|
||||
public static final int AppCompatTheme_seekBarStyle = 90;
|
||||
public static final int AppCompatTheme_selectableItemBackground = 91;
|
||||
public static final int AppCompatTheme_selectableItemBackgroundBorderless = 92;
|
||||
public static final int AppCompatTheme_spinnerDropDownItemStyle = 93;
|
||||
public static final int AppCompatTheme_spinnerStyle = 94;
|
||||
public static final int AppCompatTheme_switchStyle = 95;
|
||||
public static final int AppCompatTheme_textAppearanceLargePopupMenu = 96;
|
||||
public static final int AppCompatTheme_textAppearanceListItem = 97;
|
||||
public static final int AppCompatTheme_textAppearanceListItemSecondary = 98;
|
||||
public static final int AppCompatTheme_textAppearanceListItemSmall = 99;
|
||||
public static final int AppCompatTheme_textAppearancePopupMenuHeader = 100;
|
||||
public static final int AppCompatTheme_textAppearanceSearchResultSubtitle = 101;
|
||||
public static final int AppCompatTheme_textAppearanceSearchResultTitle = 102;
|
||||
public static final int AppCompatTheme_textAppearanceSmallPopupMenu = 103;
|
||||
public static final int AppCompatTheme_textColorAlertDialogListItem = 104;
|
||||
public static final int AppCompatTheme_textColorSearchUrl = 105;
|
||||
public static final int AppCompatTheme_toolbarNavigationButtonStyle = 106;
|
||||
public static final int AppCompatTheme_toolbarStyle = 107;
|
||||
public static final int AppCompatTheme_tooltipForegroundColor = 108;
|
||||
public static final int AppCompatTheme_tooltipFrameBackground = 109;
|
||||
public static final int AppCompatTheme_viewInflaterClass = 110;
|
||||
public static final int AppCompatTheme_windowActionBar = 111;
|
||||
public static final int AppCompatTheme_windowActionBarOverlay = 112;
|
||||
public static final int AppCompatTheme_windowActionModeOverlay = 113;
|
||||
public static final int AppCompatTheme_windowFixedHeightMajor = 114;
|
||||
public static final int AppCompatTheme_windowFixedHeightMinor = 115;
|
||||
public static final int AppCompatTheme_windowFixedWidthMajor = 116;
|
||||
public static final int AppCompatTheme_windowFixedWidthMinor = 117;
|
||||
public static final int AppCompatTheme_windowMinWidthMajor = 118;
|
||||
public static final int AppCompatTheme_windowMinWidthMinor = 119;
|
||||
public static final int AppCompatTheme_windowNoTitle = 120;
|
||||
public static final int ButtonBarLayout_allowStacking = 0;
|
||||
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 CompoundButton_android_button = 0;
|
||||
public static final int CompoundButton_buttonTint = 1;
|
||||
public static final int CompoundButton_buttonTintMode = 2;
|
||||
public static final int CoordinatorLayout_Layout_android_layout_gravity = 0;
|
||||
public static final int CoordinatorLayout_Layout_layout_anchor = 1;
|
||||
public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2;
|
||||
public static final int CoordinatorLayout_Layout_layout_behavior = 3;
|
||||
public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4;
|
||||
public static final int CoordinatorLayout_Layout_layout_insetEdge = 5;
|
||||
public static final int CoordinatorLayout_Layout_layout_keyline = 6;
|
||||
public static final int CoordinatorLayout_keylines = 0;
|
||||
public static final int CoordinatorLayout_statusBarBackground = 1;
|
||||
public static final int DrawerArrowToggle_arrowHeadLength = 0;
|
||||
public static final int DrawerArrowToggle_arrowShaftLength = 1;
|
||||
public static final int DrawerArrowToggle_barLength = 2;
|
||||
public static final int DrawerArrowToggle_color = 3;
|
||||
public static final int DrawerArrowToggle_drawableSize = 4;
|
||||
public static final int DrawerArrowToggle_gapBetweenBars = 5;
|
||||
public static final int DrawerArrowToggle_spinBars = 6;
|
||||
public static final int DrawerArrowToggle_thickness = 7;
|
||||
public static final int FontFamilyFont_android_font = 0;
|
||||
public static final int FontFamilyFont_android_fontStyle = 2;
|
||||
public static final int FontFamilyFont_android_fontVariationSettings = 4;
|
||||
public static final int FontFamilyFont_android_fontWeight = 1;
|
||||
public static final int FontFamilyFont_android_ttcIndex = 3;
|
||||
public static final int FontFamilyFont_font = 5;
|
||||
public static final int FontFamilyFont_fontStyle = 6;
|
||||
public static final int FontFamilyFont_fontVariationSettings = 7;
|
||||
public static final int FontFamilyFont_fontWeight = 8;
|
||||
public static final int FontFamilyFont_ttcIndex = 9;
|
||||
public static final int FontFamily_fontProviderAuthority = 0;
|
||||
public static final int FontFamily_fontProviderCerts = 1;
|
||||
public static final int FontFamily_fontProviderFetchStrategy = 2;
|
||||
public static final int FontFamily_fontProviderFetchTimeout = 3;
|
||||
public static final int FontFamily_fontProviderPackage = 4;
|
||||
public static final int FontFamily_fontProviderQuery = 5;
|
||||
public static final int GradientColorItem_android_color = 0;
|
||||
public static final int GradientColorItem_android_offset = 1;
|
||||
public static final int GradientColor_android_centerColor = 7;
|
||||
public static final int GradientColor_android_centerX = 3;
|
||||
public static final int GradientColor_android_centerY = 4;
|
||||
public static final int GradientColor_android_endColor = 1;
|
||||
public static final int GradientColor_android_endX = 10;
|
||||
public static final int GradientColor_android_endY = 11;
|
||||
public static final int GradientColor_android_gradientRadius = 5;
|
||||
public static final int GradientColor_android_startColor = 0;
|
||||
public static final int GradientColor_android_startX = 8;
|
||||
public static final int GradientColor_android_startY = 9;
|
||||
public static final int GradientColor_android_tileMode = 6;
|
||||
public static final int GradientColor_android_type = 2;
|
||||
public static final int LinearLayoutCompat_Layout_android_layout_gravity = 0;
|
||||
public static final int LinearLayoutCompat_Layout_android_layout_height = 2;
|
||||
public static final int LinearLayoutCompat_Layout_android_layout_weight = 3;
|
||||
public static final int LinearLayoutCompat_Layout_android_layout_width = 1;
|
||||
public static final int LinearLayoutCompat_android_baselineAligned = 2;
|
||||
public static final int LinearLayoutCompat_android_baselineAlignedChildIndex = 3;
|
||||
public static final int LinearLayoutCompat_android_gravity = 0;
|
||||
public static final int LinearLayoutCompat_android_orientation = 1;
|
||||
public static final int LinearLayoutCompat_android_weightSum = 4;
|
||||
public static final int LinearLayoutCompat_divider = 5;
|
||||
public static final int LinearLayoutCompat_dividerPadding = 6;
|
||||
public static final int LinearLayoutCompat_measureWithLargestChild = 7;
|
||||
public static final int LinearLayoutCompat_showDividers = 8;
|
||||
public static final int ListPopupWindow_android_dropDownHorizontalOffset = 0;
|
||||
public static final int ListPopupWindow_android_dropDownVerticalOffset = 1;
|
||||
public static final int MenuGroup_android_checkableBehavior = 5;
|
||||
public static final int MenuGroup_android_enabled = 0;
|
||||
public static final int MenuGroup_android_id = 1;
|
||||
public static final int MenuGroup_android_menuCategory = 3;
|
||||
public static final int MenuGroup_android_orderInCategory = 4;
|
||||
public static final int MenuGroup_android_visible = 2;
|
||||
public static final int MenuItem_actionLayout = 13;
|
||||
public static final int MenuItem_actionProviderClass = 14;
|
||||
public static final int MenuItem_actionViewClass = 15;
|
||||
public static final int MenuItem_alphabeticModifiers = 16;
|
||||
public static final int MenuItem_android_alphabeticShortcut = 9;
|
||||
public static final int MenuItem_android_checkable = 11;
|
||||
public static final int MenuItem_android_checked = 3;
|
||||
public static final int MenuItem_android_enabled = 1;
|
||||
public static final int MenuItem_android_icon = 0;
|
||||
public static final int MenuItem_android_id = 2;
|
||||
public static final int MenuItem_android_menuCategory = 5;
|
||||
public static final int MenuItem_android_numericShortcut = 10;
|
||||
public static final int MenuItem_android_onClick = 12;
|
||||
public static final int MenuItem_android_orderInCategory = 6;
|
||||
public static final int MenuItem_android_title = 7;
|
||||
public static final int MenuItem_android_titleCondensed = 8;
|
||||
public static final int MenuItem_android_visible = 4;
|
||||
public static final int MenuItem_contentDescription = 17;
|
||||
public static final int MenuItem_iconTint = 18;
|
||||
public static final int MenuItem_iconTintMode = 19;
|
||||
public static final int MenuItem_numericModifiers = 20;
|
||||
public static final int MenuItem_showAsAction = 21;
|
||||
public static final int MenuItem_tooltipText = 22;
|
||||
public static final int MenuView_android_headerBackground = 4;
|
||||
public static final int MenuView_android_horizontalDivider = 2;
|
||||
public static final int MenuView_android_itemBackground = 5;
|
||||
public static final int MenuView_android_itemIconDisabledAlpha = 6;
|
||||
public static final int MenuView_android_itemTextAppearance = 1;
|
||||
public static final int MenuView_android_verticalDivider = 3;
|
||||
public static final int MenuView_android_windowAnimationStyle = 0;
|
||||
public static final int MenuView_preserveIconSpacing = 7;
|
||||
public static final int MenuView_subMenuArrow = 8;
|
||||
public static final int PopupWindowBackgroundState_state_above_anchor = 0;
|
||||
public static final int PopupWindow_android_popupAnimationStyle = 1;
|
||||
public static final int PopupWindow_android_popupBackground = 0;
|
||||
public static final int PopupWindow_overlapAnchor = 2;
|
||||
public static final int RecycleListView_paddingBottomNoButtons = 0;
|
||||
public static final int RecycleListView_paddingTopNoTitle = 1;
|
||||
public static final int SearchView_android_focusable = 0;
|
||||
public static final int SearchView_android_imeOptions = 3;
|
||||
public static final int SearchView_android_inputType = 2;
|
||||
public static final int SearchView_android_maxWidth = 1;
|
||||
public static final int SearchView_closeIcon = 4;
|
||||
public static final int SearchView_commitIcon = 5;
|
||||
public static final int SearchView_defaultQueryHint = 6;
|
||||
public static final int SearchView_goIcon = 7;
|
||||
public static final int SearchView_iconifiedByDefault = 8;
|
||||
public static final int SearchView_layout = 9;
|
||||
public static final int SearchView_queryBackground = 10;
|
||||
public static final int SearchView_queryHint = 11;
|
||||
public static final int SearchView_searchHintIcon = 12;
|
||||
public static final int SearchView_searchIcon = 13;
|
||||
public static final int SearchView_submitBackground = 14;
|
||||
public static final int SearchView_suggestionRowLayout = 15;
|
||||
public static final int SearchView_voiceIcon = 16;
|
||||
public static final int Spinner_android_dropDownWidth = 3;
|
||||
public static final int Spinner_android_entries = 0;
|
||||
public static final int Spinner_android_popupBackground = 1;
|
||||
public static final int Spinner_android_prompt = 2;
|
||||
public static final int Spinner_popupTheme = 4;
|
||||
public static final int StateListDrawableItem_android_drawable = 0;
|
||||
public static final int StateListDrawable_android_constantSize = 3;
|
||||
public static final int StateListDrawable_android_dither = 0;
|
||||
public static final int StateListDrawable_android_enterFadeDuration = 4;
|
||||
public static final int StateListDrawable_android_exitFadeDuration = 5;
|
||||
public static final int StateListDrawable_android_variablePadding = 2;
|
||||
public static final int StateListDrawable_android_visible = 1;
|
||||
public static final int SwitchCompat_android_textOff = 1;
|
||||
public static final int SwitchCompat_android_textOn = 0;
|
||||
public static final int SwitchCompat_android_thumb = 2;
|
||||
public static final int SwitchCompat_showText = 3;
|
||||
public static final int SwitchCompat_splitTrack = 4;
|
||||
public static final int SwitchCompat_switchMinWidth = 5;
|
||||
public static final int SwitchCompat_switchPadding = 6;
|
||||
public static final int SwitchCompat_switchTextAppearance = 7;
|
||||
public static final int SwitchCompat_thumbTextPadding = 8;
|
||||
public static final int SwitchCompat_thumbTint = 9;
|
||||
public static final int SwitchCompat_thumbTintMode = 10;
|
||||
public static final int SwitchCompat_track = 11;
|
||||
public static final int SwitchCompat_trackTint = 12;
|
||||
public static final int SwitchCompat_trackTintMode = 13;
|
||||
public static final int TextAppearance_android_fontFamily = 10;
|
||||
public static final int TextAppearance_android_shadowColor = 6;
|
||||
public static final int TextAppearance_android_shadowDx = 7;
|
||||
public static final int TextAppearance_android_shadowDy = 8;
|
||||
public static final int TextAppearance_android_shadowRadius = 9;
|
||||
public static final int TextAppearance_android_textColor = 3;
|
||||
public static final int TextAppearance_android_textColorHint = 4;
|
||||
public static final int TextAppearance_android_textColorLink = 5;
|
||||
public static final int TextAppearance_android_textSize = 0;
|
||||
public static final int TextAppearance_android_textStyle = 2;
|
||||
public static final int TextAppearance_android_typeface = 1;
|
||||
public static final int TextAppearance_fontFamily = 11;
|
||||
public static final int TextAppearance_textAllCaps = 12;
|
||||
public static final int Toolbar_android_gravity = 0;
|
||||
public static final int Toolbar_android_minHeight = 1;
|
||||
public static final int Toolbar_buttonGravity = 2;
|
||||
public static final int Toolbar_collapseContentDescription = 3;
|
||||
public static final int Toolbar_collapseIcon = 4;
|
||||
public static final int Toolbar_contentInsetEnd = 5;
|
||||
public static final int Toolbar_contentInsetEndWithActions = 6;
|
||||
public static final int Toolbar_contentInsetLeft = 7;
|
||||
public static final int Toolbar_contentInsetRight = 8;
|
||||
public static final int Toolbar_contentInsetStart = 9;
|
||||
public static final int Toolbar_contentInsetStartWithNavigation = 10;
|
||||
public static final int Toolbar_logo = 11;
|
||||
public static final int Toolbar_logoDescription = 12;
|
||||
public static final int Toolbar_maxButtonHeight = 13;
|
||||
public static final int Toolbar_navigationContentDescription = 14;
|
||||
public static final int Toolbar_navigationIcon = 15;
|
||||
public static final int Toolbar_popupTheme = 16;
|
||||
public static final int Toolbar_subtitle = 17;
|
||||
public static final int Toolbar_subtitleTextAppearance = 18;
|
||||
public static final int Toolbar_subtitleTextColor = 19;
|
||||
public static final int Toolbar_title = 20;
|
||||
public static final int Toolbar_titleMargin = 21;
|
||||
public static final int Toolbar_titleMarginBottom = 22;
|
||||
public static final int Toolbar_titleMarginEnd = 23;
|
||||
public static final int Toolbar_titleMarginStart = 24;
|
||||
public static final int Toolbar_titleMarginTop = 25;
|
||||
public static final int Toolbar_titleMargins = 26;
|
||||
public static final int Toolbar_titleTextAppearance = 27;
|
||||
public static final int Toolbar_titleTextColor = 28;
|
||||
public static final int ViewBackgroundHelper_android_background = 0;
|
||||
public static final int ViewBackgroundHelper_backgroundTint = 1;
|
||||
public static final int ViewBackgroundHelper_backgroundTintMode = 2;
|
||||
public static final int ViewStubCompat_android_id = 0;
|
||||
public static final int ViewStubCompat_android_inflatedId = 2;
|
||||
public static final int ViewStubCompat_android_layout = 1;
|
||||
public static final int View_android_focusable = 1;
|
||||
public static final int View_android_theme = 0;
|
||||
public static final int View_paddingEnd = 2;
|
||||
public static final int View_paddingStart = 3;
|
||||
public static final int View_theme = 4;
|
||||
public static final int[] ActionBar = {R.attr.background, R.attr.backgroundSplit, R.attr.backgroundStacked, R.attr.contentInsetEnd, R.attr.contentInsetEndWithActions, R.attr.contentInsetLeft, R.attr.contentInsetRight, R.attr.contentInsetStart, R.attr.contentInsetStartWithNavigation, R.attr.customNavigationLayout, R.attr.displayOptions, R.attr.divider, R.attr.elevation, R.attr.height, R.attr.hideOnContentScroll, R.attr.homeAsUpIndicator, R.attr.homeLayout, R.attr.icon, R.attr.indeterminateProgressStyle, R.attr.itemPadding, R.attr.logo, R.attr.navigationMode, R.attr.popupTheme, R.attr.progressBarPadding, R.attr.progressBarStyle, R.attr.subtitle, R.attr.subtitleTextStyle, R.attr.title, R.attr.titleTextStyle};
|
||||
public static final int[] ActionBarLayout = {android.R.attr.layout_gravity};
|
||||
public static final int[] ActionMenuItemView = {android.R.attr.minWidth};
|
||||
public static final int[] ActionMenuView = new int[0];
|
||||
public static final int[] ActionMode = {R.attr.background, R.attr.backgroundSplit, R.attr.closeItemLayout, R.attr.height, R.attr.subtitleTextStyle, R.attr.titleTextStyle};
|
||||
public static final int[] ActivityChooserView = {R.attr.expandActivityOverflowButtonDrawable, R.attr.initialActivityCount};
|
||||
public static final int[] AlertDialog = {android.R.attr.layout, R.attr.buttonIconDimen, R.attr.buttonPanelSideLayout, R.attr.listItemLayout, R.attr.listLayout, R.attr.multiChoiceItemLayout, R.attr.showTitle, R.attr.singleChoiceItemLayout};
|
||||
public static final int[] AnimatedStateListDrawableCompat = {android.R.attr.dither, android.R.attr.visible, android.R.attr.variablePadding, android.R.attr.constantSize, android.R.attr.enterFadeDuration, android.R.attr.exitFadeDuration};
|
||||
public static final int[] AnimatedStateListDrawableItem = {android.R.attr.id, android.R.attr.drawable};
|
||||
public static final int[] AnimatedStateListDrawableTransition = {android.R.attr.drawable, android.R.attr.toId, android.R.attr.fromId, android.R.attr.reversible};
|
||||
public static final int[] AppCompatImageView = {android.R.attr.src, R.attr.srcCompat, R.attr.tint, R.attr.tintMode};
|
||||
public static final int[] AppCompatSeekBar = {android.R.attr.thumb, R.attr.tickMark, R.attr.tickMarkTint, R.attr.tickMarkTintMode};
|
||||
public static final int[] AppCompatTextHelper = {android.R.attr.textAppearance, android.R.attr.drawableTop, android.R.attr.drawableBottom, android.R.attr.drawableLeft, android.R.attr.drawableRight, android.R.attr.drawableStart, android.R.attr.drawableEnd};
|
||||
public static final int[] AppCompatTextView = {android.R.attr.textAppearance, R.attr.autoSizeMaxTextSize, R.attr.autoSizeMinTextSize, R.attr.autoSizePresetSizes, R.attr.autoSizeStepGranularity, R.attr.autoSizeTextType, R.attr.firstBaselineToTopHeight, R.attr.fontFamily, R.attr.lastBaselineToBottomHeight, R.attr.lineHeight, R.attr.textAllCaps};
|
||||
public static final int[] AppCompatTheme = {android.R.attr.windowIsFloating, android.R.attr.windowAnimationStyle, R.attr.actionBarDivider, R.attr.actionBarItemBackground, R.attr.actionBarPopupTheme, R.attr.actionBarSize, R.attr.actionBarSplitStyle, R.attr.actionBarStyle, R.attr.actionBarTabBarStyle, R.attr.actionBarTabStyle, R.attr.actionBarTabTextStyle, R.attr.actionBarTheme, R.attr.actionBarWidgetTheme, R.attr.actionButtonStyle, R.attr.actionDropDownStyle, R.attr.actionMenuTextAppearance, R.attr.actionMenuTextColor, R.attr.actionModeBackground, R.attr.actionModeCloseButtonStyle, R.attr.actionModeCloseDrawable, R.attr.actionModeCopyDrawable, R.attr.actionModeCutDrawable, R.attr.actionModeFindDrawable, R.attr.actionModePasteDrawable, R.attr.actionModePopupWindowStyle, R.attr.actionModeSelectAllDrawable, R.attr.actionModeShareDrawable, R.attr.actionModeSplitBackground, R.attr.actionModeStyle, R.attr.actionModeWebSearchDrawable, R.attr.actionOverflowButtonStyle, R.attr.actionOverflowMenuStyle, R.attr.activityChooserViewStyle, R.attr.alertDialogButtonGroupStyle, R.attr.alertDialogCenterButtons, R.attr.alertDialogStyle, R.attr.alertDialogTheme, R.attr.autoCompleteTextViewStyle, R.attr.borderlessButtonStyle, R.attr.buttonBarButtonStyle, R.attr.buttonBarNegativeButtonStyle, R.attr.buttonBarNeutralButtonStyle, R.attr.buttonBarPositiveButtonStyle, R.attr.buttonBarStyle, R.attr.buttonStyle, R.attr.buttonStyleSmall, R.attr.checkboxStyle, R.attr.checkedTextViewStyle, R.attr.colorAccent, R.attr.colorBackgroundFloating, R.attr.colorButtonNormal, R.attr.colorControlActivated, R.attr.colorControlHighlight, R.attr.colorControlNormal, R.attr.colorError, R.attr.colorPrimary, R.attr.colorPrimaryDark, R.attr.colorSwitchThumbNormal, R.attr.controlBackground, R.attr.dialogCornerRadius, R.attr.dialogPreferredPadding, R.attr.dialogTheme, R.attr.dividerHorizontal, R.attr.dividerVertical, R.attr.dropDownListViewStyle, R.attr.dropdownListPreferredItemHeight, R.attr.editTextBackground, R.attr.editTextColor, R.attr.editTextStyle, R.attr.homeAsUpIndicator, R.attr.imageButtonStyle, R.attr.listChoiceBackgroundIndicator, R.attr.listDividerAlertDialog, R.attr.listMenuViewStyle, R.attr.listPopupWindowStyle, R.attr.listPreferredItemHeight, R.attr.listPreferredItemHeightLarge, R.attr.listPreferredItemHeightSmall, R.attr.listPreferredItemPaddingLeft, R.attr.listPreferredItemPaddingRight, R.attr.panelBackground, R.attr.panelMenuListTheme, R.attr.panelMenuListWidth, R.attr.popupMenuStyle, R.attr.popupWindowStyle, R.attr.radioButtonStyle, R.attr.ratingBarStyle, R.attr.ratingBarStyleIndicator, R.attr.ratingBarStyleSmall, R.attr.searchViewStyle, R.attr.seekBarStyle, R.attr.selectableItemBackground, R.attr.selectableItemBackgroundBorderless, R.attr.spinnerDropDownItemStyle, R.attr.spinnerStyle, R.attr.switchStyle, R.attr.textAppearanceLargePopupMenu, R.attr.textAppearanceListItem, R.attr.textAppearanceListItemSecondary, R.attr.textAppearanceListItemSmall, R.attr.textAppearancePopupMenuHeader, R.attr.textAppearanceSearchResultSubtitle, R.attr.textAppearanceSearchResultTitle, R.attr.textAppearanceSmallPopupMenu, R.attr.textColorAlertDialogListItem, R.attr.textColorSearchUrl, R.attr.toolbarNavigationButtonStyle, R.attr.toolbarStyle, R.attr.tooltipForegroundColor, R.attr.tooltipFrameBackground, R.attr.viewInflaterClass, R.attr.windowActionBar, R.attr.windowActionBarOverlay, R.attr.windowActionModeOverlay, R.attr.windowFixedHeightMajor, R.attr.windowFixedHeightMinor, R.attr.windowFixedWidthMajor, R.attr.windowFixedWidthMinor, R.attr.windowMinWidthMajor, R.attr.windowMinWidthMinor, R.attr.windowNoTitle};
|
||||
public static final int[] ButtonBarLayout = {R.attr.allowStacking};
|
||||
public static final int[] ColorStateListItem = {android.R.attr.color, android.R.attr.alpha, R.attr.alpha};
|
||||
public static final int[] CompoundButton = {android.R.attr.button, R.attr.buttonTint, R.attr.buttonTintMode};
|
||||
public static final int[] CoordinatorLayout = {R.attr.keylines, R.attr.statusBarBackground};
|
||||
public static final int[] CoordinatorLayout_Layout = {android.R.attr.layout_gravity, R.attr.layout_anchor, R.attr.layout_anchorGravity, R.attr.layout_behavior, R.attr.layout_dodgeInsetEdges, R.attr.layout_insetEdge, R.attr.layout_keyline};
|
||||
public static final int[] DrawerArrowToggle = {R.attr.arrowHeadLength, R.attr.arrowShaftLength, R.attr.barLength, R.attr.color, R.attr.drawableSize, R.attr.gapBetweenBars, R.attr.spinBars, R.attr.thickness};
|
||||
public static final int[] FontFamily = {R.attr.fontProviderAuthority, R.attr.fontProviderCerts, R.attr.fontProviderFetchStrategy, R.attr.fontProviderFetchTimeout, R.attr.fontProviderPackage, R.attr.fontProviderQuery};
|
||||
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, R.attr.font, R.attr.fontStyle, R.attr.fontVariationSettings, R.attr.fontWeight, R.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};
|
||||
public static final int[] LinearLayoutCompat = {android.R.attr.gravity, android.R.attr.orientation, android.R.attr.baselineAligned, android.R.attr.baselineAlignedChildIndex, android.R.attr.weightSum, R.attr.divider, R.attr.dividerPadding, R.attr.measureWithLargestChild, R.attr.showDividers};
|
||||
public static final int[] LinearLayoutCompat_Layout = {android.R.attr.layout_gravity, android.R.attr.layout_width, android.R.attr.layout_height, android.R.attr.layout_weight};
|
||||
public static final int[] ListPopupWindow = {android.R.attr.dropDownHorizontalOffset, android.R.attr.dropDownVerticalOffset};
|
||||
public static final int[] MenuGroup = {android.R.attr.enabled, android.R.attr.id, android.R.attr.visible, android.R.attr.menuCategory, android.R.attr.orderInCategory, android.R.attr.checkableBehavior};
|
||||
public static final int[] MenuItem = {android.R.attr.icon, android.R.attr.enabled, android.R.attr.id, android.R.attr.checked, android.R.attr.visible, android.R.attr.menuCategory, android.R.attr.orderInCategory, android.R.attr.title, android.R.attr.titleCondensed, android.R.attr.alphabeticShortcut, android.R.attr.numericShortcut, android.R.attr.checkable, android.R.attr.onClick, R.attr.actionLayout, R.attr.actionProviderClass, R.attr.actionViewClass, R.attr.alphabeticModifiers, R.attr.contentDescription, R.attr.iconTint, R.attr.iconTintMode, R.attr.numericModifiers, R.attr.showAsAction, R.attr.tooltipText};
|
||||
public static final int[] MenuView = {android.R.attr.windowAnimationStyle, android.R.attr.itemTextAppearance, android.R.attr.horizontalDivider, android.R.attr.verticalDivider, android.R.attr.headerBackground, android.R.attr.itemBackground, android.R.attr.itemIconDisabledAlpha, R.attr.preserveIconSpacing, R.attr.subMenuArrow};
|
||||
public static final int[] PopupWindow = {android.R.attr.popupBackground, android.R.attr.popupAnimationStyle, R.attr.overlapAnchor};
|
||||
public static final int[] PopupWindowBackgroundState = {R.attr.state_above_anchor};
|
||||
public static final int[] RecycleListView = {R.attr.paddingBottomNoButtons, R.attr.paddingTopNoTitle};
|
||||
public static final int[] SearchView = {android.R.attr.focusable, android.R.attr.maxWidth, android.R.attr.inputType, android.R.attr.imeOptions, R.attr.closeIcon, R.attr.commitIcon, R.attr.defaultQueryHint, R.attr.goIcon, R.attr.iconifiedByDefault, R.attr.layout, R.attr.queryBackground, R.attr.queryHint, R.attr.searchHintIcon, R.attr.searchIcon, R.attr.submitBackground, R.attr.suggestionRowLayout, R.attr.voiceIcon};
|
||||
public static final int[] Spinner = {android.R.attr.entries, android.R.attr.popupBackground, android.R.attr.prompt, android.R.attr.dropDownWidth, R.attr.popupTheme};
|
||||
public static final int[] StateListDrawable = {android.R.attr.dither, android.R.attr.visible, android.R.attr.variablePadding, android.R.attr.constantSize, android.R.attr.enterFadeDuration, android.R.attr.exitFadeDuration};
|
||||
public static final int[] StateListDrawableItem = {android.R.attr.drawable};
|
||||
public static final int[] SwitchCompat = {android.R.attr.textOn, android.R.attr.textOff, android.R.attr.thumb, R.attr.showText, R.attr.splitTrack, R.attr.switchMinWidth, R.attr.switchPadding, R.attr.switchTextAppearance, R.attr.thumbTextPadding, R.attr.thumbTint, R.attr.thumbTintMode, R.attr.track, R.attr.trackTint, R.attr.trackTintMode};
|
||||
public static final int[] TextAppearance = {android.R.attr.textSize, android.R.attr.typeface, android.R.attr.textStyle, android.R.attr.textColor, android.R.attr.textColorHint, android.R.attr.textColorLink, android.R.attr.shadowColor, android.R.attr.shadowDx, android.R.attr.shadowDy, android.R.attr.shadowRadius, android.R.attr.fontFamily, R.attr.fontFamily, R.attr.textAllCaps};
|
||||
public static final int[] Toolbar = {android.R.attr.gravity, android.R.attr.minHeight, R.attr.buttonGravity, R.attr.collapseContentDescription, R.attr.collapseIcon, R.attr.contentInsetEnd, R.attr.contentInsetEndWithActions, R.attr.contentInsetLeft, R.attr.contentInsetRight, R.attr.contentInsetStart, R.attr.contentInsetStartWithNavigation, R.attr.logo, R.attr.logoDescription, R.attr.maxButtonHeight, R.attr.navigationContentDescription, R.attr.navigationIcon, R.attr.popupTheme, R.attr.subtitle, R.attr.subtitleTextAppearance, R.attr.subtitleTextColor, R.attr.title, R.attr.titleMargin, R.attr.titleMarginBottom, R.attr.titleMarginEnd, R.attr.titleMarginStart, R.attr.titleMarginTop, R.attr.titleMargins, R.attr.titleTextAppearance, R.attr.titleTextColor};
|
||||
public static final int[] View = {android.R.attr.theme, android.R.attr.focusable, R.attr.paddingEnd, R.attr.paddingStart, R.attr.theme};
|
||||
public static final int[] ViewBackgroundHelper = {android.R.attr.background, R.attr.backgroundTint, R.attr.backgroundTintMode};
|
||||
public static final int[] ViewStubCompat = {android.R.attr.id, android.R.attr.layout, android.R.attr.inflatedId};
|
||||
}
|
||||
104
sources/androidx/appcompat/app/ActionBar.java
Normal file
104
sources/androidx/appcompat/app/ActionBar.java
Normal file
@@ -0,0 +1,104 @@
|
||||
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 androidx.appcompat.R$styleable;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ActionBar {
|
||||
|
||||
public interface OnMenuVisibilityListener {
|
||||
void a(boolean z);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static abstract class Tab {
|
||||
public abstract CharSequence a();
|
||||
|
||||
public abstract View b();
|
||||
|
||||
public abstract Drawable c();
|
||||
|
||||
public abstract CharSequence d();
|
||||
|
||||
public abstract void e();
|
||||
}
|
||||
|
||||
public ActionMode a(ActionMode.Callback callback) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void a(Configuration configuration) {
|
||||
}
|
||||
|
||||
public abstract void a(CharSequence charSequence);
|
||||
|
||||
public abstract boolean a(int i, KeyEvent keyEvent);
|
||||
|
||||
public boolean a(KeyEvent keyEvent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract void b(boolean z);
|
||||
|
||||
public abstract void c(boolean z);
|
||||
|
||||
public abstract void d(boolean z);
|
||||
|
||||
public boolean e() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract boolean f();
|
||||
|
||||
public abstract int g();
|
||||
|
||||
public abstract Context h();
|
||||
|
||||
public boolean i() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void j() {
|
||||
}
|
||||
|
||||
public boolean k() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class LayoutParams extends ViewGroup.MarginLayoutParams {
|
||||
public int a;
|
||||
|
||||
public LayoutParams(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
this.a = 0;
|
||||
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.ActionBarLayout);
|
||||
this.a = obtainStyledAttributes.getInt(R$styleable.ActionBarLayout_android_layout_gravity, 0);
|
||||
obtainStyledAttributes.recycle();
|
||||
}
|
||||
|
||||
public LayoutParams(int i, int i2) {
|
||||
super(i, i2);
|
||||
this.a = 0;
|
||||
this.a = 8388627;
|
||||
}
|
||||
|
||||
public LayoutParams(LayoutParams layoutParams) {
|
||||
super((ViewGroup.MarginLayoutParams) layoutParams);
|
||||
this.a = 0;
|
||||
this.a = layoutParams.a;
|
||||
}
|
||||
|
||||
public LayoutParams(ViewGroup.LayoutParams layoutParams) {
|
||||
super(layoutParams);
|
||||
this.a = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ActionBarDrawerToggle$Delegate {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ActionBarDrawerToggle$DelegateProvider {
|
||||
}
|
||||
842
sources/androidx/appcompat/app/AlertController.java
Normal file
842
sources/androidx/appcompat/app/AlertController.java
Normal file
@@ -0,0 +1,842 @@
|
||||
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.R$attr;
|
||||
import androidx.appcompat.R$id;
|
||||
import androidx.appcompat.R$styleable;
|
||||
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 {
|
||||
NestedScrollView A;
|
||||
private Drawable C;
|
||||
private ImageView D;
|
||||
private TextView E;
|
||||
private TextView F;
|
||||
private View G;
|
||||
ListAdapter H;
|
||||
private int J;
|
||||
private int K;
|
||||
int L;
|
||||
int M;
|
||||
int N;
|
||||
int O;
|
||||
private boolean P;
|
||||
Handler R;
|
||||
private final Context a;
|
||||
final AppCompatDialog b;
|
||||
private final Window c;
|
||||
private final int d;
|
||||
private CharSequence e;
|
||||
private CharSequence f;
|
||||
ListView g;
|
||||
private View h;
|
||||
private int i;
|
||||
private int j;
|
||||
private int k;
|
||||
private int l;
|
||||
private int m;
|
||||
Button o;
|
||||
private CharSequence p;
|
||||
Message q;
|
||||
private Drawable r;
|
||||
Button s;
|
||||
private CharSequence t;
|
||||
Message u;
|
||||
private Drawable v;
|
||||
Button w;
|
||||
private CharSequence x;
|
||||
Message y;
|
||||
private Drawable z;
|
||||
private boolean n = false;
|
||||
private int B = 0;
|
||||
int I = -1;
|
||||
private int Q = 0;
|
||||
private final View.OnClickListener S = new View.OnClickListener() { // from class: androidx.appcompat.app.AlertController.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
Message obtain;
|
||||
Message message;
|
||||
Message message2;
|
||||
Message message3;
|
||||
AlertController alertController = AlertController.this;
|
||||
if (view != alertController.o || (message3 = alertController.q) == null) {
|
||||
AlertController alertController2 = AlertController.this;
|
||||
if (view != alertController2.s || (message2 = alertController2.u) == null) {
|
||||
AlertController alertController3 = AlertController.this;
|
||||
obtain = (view != alertController3.w || (message = alertController3.y) == null) ? null : Message.obtain(message);
|
||||
} else {
|
||||
obtain = Message.obtain(message2);
|
||||
}
|
||||
} else {
|
||||
obtain = Message.obtain(message3);
|
||||
}
|
||||
if (obtain != null) {
|
||||
obtain.sendToTarget();
|
||||
}
|
||||
AlertController alertController4 = AlertController.this;
|
||||
alertController4.R.obtainMessage(1, alertController4.b).sendToTarget();
|
||||
}
|
||||
};
|
||||
|
||||
public static class AlertParams {
|
||||
public int A;
|
||||
public int B;
|
||||
public int C;
|
||||
public int D;
|
||||
public boolean[] F;
|
||||
public boolean G;
|
||||
public boolean H;
|
||||
public DialogInterface.OnMultiChoiceClickListener J;
|
||||
public Cursor K;
|
||||
public String L;
|
||||
public String M;
|
||||
public AdapterView.OnItemSelectedListener N;
|
||||
public OnPrepareListViewListener O;
|
||||
public final Context a;
|
||||
public final LayoutInflater b;
|
||||
public Drawable d;
|
||||
public CharSequence f;
|
||||
public View g;
|
||||
public CharSequence h;
|
||||
public CharSequence i;
|
||||
public Drawable j;
|
||||
public DialogInterface.OnClickListener k;
|
||||
public CharSequence l;
|
||||
public Drawable m;
|
||||
public DialogInterface.OnClickListener n;
|
||||
public CharSequence o;
|
||||
public Drawable p;
|
||||
public DialogInterface.OnClickListener q;
|
||||
public DialogInterface.OnCancelListener s;
|
||||
public DialogInterface.OnDismissListener t;
|
||||
public DialogInterface.OnKeyListener u;
|
||||
public CharSequence[] v;
|
||||
public ListAdapter w;
|
||||
public DialogInterface.OnClickListener x;
|
||||
public int y;
|
||||
public View z;
|
||||
public int c = 0;
|
||||
public int e = 0;
|
||||
public boolean E = false;
|
||||
public int I = -1;
|
||||
public boolean r = true;
|
||||
|
||||
public interface OnPrepareListViewListener {
|
||||
void a(ListView listView);
|
||||
}
|
||||
|
||||
public AlertParams(Context context) {
|
||||
this.a = context;
|
||||
this.b = (LayoutInflater) context.getSystemService("layout_inflater");
|
||||
}
|
||||
|
||||
private void b(final AlertController alertController) {
|
||||
ListAdapter listAdapter;
|
||||
final RecycleListView recycleListView = (RecycleListView) this.b.inflate(alertController.L, (ViewGroup) null);
|
||||
if (this.G) {
|
||||
Cursor cursor = this.K;
|
||||
listAdapter = cursor == null ? new ArrayAdapter<CharSequence>(this.a, alertController.M, R.id.text1, this.v) { // from class: androidx.appcompat.app.AlertController.AlertParams.1
|
||||
@Override // android.widget.ArrayAdapter, android.widget.Adapter
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
View view2 = super.getView(i, view, viewGroup);
|
||||
boolean[] zArr = AlertParams.this.F;
|
||||
if (zArr != null && zArr[i]) {
|
||||
recycleListView.setItemChecked(i, true);
|
||||
}
|
||||
return view2;
|
||||
}
|
||||
} : new CursorAdapter(this.a, cursor, false) { // from class: androidx.appcompat.app.AlertController.AlertParams.2
|
||||
private final int a;
|
||||
private final int b;
|
||||
|
||||
{
|
||||
Cursor cursor2 = getCursor();
|
||||
this.a = cursor2.getColumnIndexOrThrow(AlertParams.this.L);
|
||||
this.b = cursor2.getColumnIndexOrThrow(AlertParams.this.M);
|
||||
}
|
||||
|
||||
@Override // android.widget.CursorAdapter
|
||||
public void bindView(View view, Context context, Cursor cursor2) {
|
||||
((CheckedTextView) view.findViewById(R.id.text1)).setText(cursor2.getString(this.a));
|
||||
recycleListView.setItemChecked(cursor2.getPosition(), cursor2.getInt(this.b) == 1);
|
||||
}
|
||||
|
||||
@Override // android.widget.CursorAdapter
|
||||
public View newView(Context context, Cursor cursor2, ViewGroup viewGroup) {
|
||||
return AlertParams.this.b.inflate(alertController.M, viewGroup, false);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
int i = this.H ? alertController.N : alertController.O;
|
||||
Cursor cursor2 = this.K;
|
||||
if (cursor2 != null) {
|
||||
listAdapter = new SimpleCursorAdapter(this.a, i, cursor2, new String[]{this.L}, new int[]{R.id.text1});
|
||||
} else {
|
||||
listAdapter = this.w;
|
||||
if (listAdapter == null) {
|
||||
listAdapter = new CheckedItemAdapter(this.a, i, R.id.text1, this.v);
|
||||
}
|
||||
}
|
||||
}
|
||||
OnPrepareListViewListener onPrepareListViewListener = this.O;
|
||||
if (onPrepareListViewListener != null) {
|
||||
onPrepareListViewListener.a(recycleListView);
|
||||
}
|
||||
alertController.H = listAdapter;
|
||||
alertController.I = this.I;
|
||||
if (this.x != null) {
|
||||
recycleListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { // from class: androidx.appcompat.app.AlertController.AlertParams.3
|
||||
@Override // android.widget.AdapterView.OnItemClickListener
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i2, long j) {
|
||||
AlertParams.this.x.onClick(alertController.b, i2);
|
||||
if (AlertParams.this.H) {
|
||||
return;
|
||||
}
|
||||
alertController.b.dismiss();
|
||||
}
|
||||
});
|
||||
} else if (this.J != null) {
|
||||
recycleListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { // from class: androidx.appcompat.app.AlertController.AlertParams.4
|
||||
@Override // android.widget.AdapterView.OnItemClickListener
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i2, long j) {
|
||||
boolean[] zArr = AlertParams.this.F;
|
||||
if (zArr != null) {
|
||||
zArr[i2] = recycleListView.isItemChecked(i2);
|
||||
}
|
||||
AlertParams.this.J.onClick(alertController.b, i2, recycleListView.isItemChecked(i2));
|
||||
}
|
||||
});
|
||||
}
|
||||
AdapterView.OnItemSelectedListener onItemSelectedListener = this.N;
|
||||
if (onItemSelectedListener != null) {
|
||||
recycleListView.setOnItemSelectedListener(onItemSelectedListener);
|
||||
}
|
||||
if (this.H) {
|
||||
recycleListView.setChoiceMode(1);
|
||||
} else if (this.G) {
|
||||
recycleListView.setChoiceMode(2);
|
||||
}
|
||||
alertController.g = recycleListView;
|
||||
}
|
||||
|
||||
public void a(AlertController alertController) {
|
||||
View view = this.g;
|
||||
if (view != null) {
|
||||
alertController.a(view);
|
||||
} else {
|
||||
CharSequence charSequence = this.f;
|
||||
if (charSequence != null) {
|
||||
alertController.b(charSequence);
|
||||
}
|
||||
Drawable drawable = this.d;
|
||||
if (drawable != null) {
|
||||
alertController.a(drawable);
|
||||
}
|
||||
int i = this.c;
|
||||
if (i != 0) {
|
||||
alertController.b(i);
|
||||
}
|
||||
int i2 = this.e;
|
||||
if (i2 != 0) {
|
||||
alertController.b(alertController.a(i2));
|
||||
}
|
||||
}
|
||||
CharSequence charSequence2 = this.h;
|
||||
if (charSequence2 != null) {
|
||||
alertController.a(charSequence2);
|
||||
}
|
||||
if (this.i != null || this.j != null) {
|
||||
alertController.a(-1, this.i, this.k, (Message) null, this.j);
|
||||
}
|
||||
if (this.l != null || this.m != null) {
|
||||
alertController.a(-2, this.l, this.n, (Message) null, this.m);
|
||||
}
|
||||
if (this.o != null || this.p != null) {
|
||||
alertController.a(-3, this.o, this.q, (Message) null, this.p);
|
||||
}
|
||||
if (this.v != null || this.K != null || this.w != null) {
|
||||
b(alertController);
|
||||
}
|
||||
View view2 = this.z;
|
||||
if (view2 != null) {
|
||||
if (this.E) {
|
||||
alertController.a(view2, this.A, this.B, this.C, this.D);
|
||||
return;
|
||||
} else {
|
||||
alertController.b(view2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
int i3 = this.y;
|
||||
if (i3 != 0) {
|
||||
alertController.c(i3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final class ButtonHandler extends Handler {
|
||||
private WeakReference<DialogInterface> a;
|
||||
|
||||
public ButtonHandler(DialogInterface dialogInterface) {
|
||||
this.a = new WeakReference<>(dialogInterface);
|
||||
}
|
||||
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message message) {
|
||||
int i = message.what;
|
||||
if (i == -3 || i == -2 || i == -1) {
|
||||
((DialogInterface.OnClickListener) message.obj).onClick(this.a.get(), message.what);
|
||||
} else {
|
||||
if (i != 1) {
|
||||
return;
|
||||
}
|
||||
((DialogInterface) message.obj).dismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class CheckedItemAdapter extends ArrayAdapter<CharSequence> {
|
||||
public CheckedItemAdapter(Context context, int i, int i2, CharSequence[] charSequenceArr) {
|
||||
super(context, i, i2, charSequenceArr);
|
||||
}
|
||||
|
||||
@Override // android.widget.ArrayAdapter, android.widget.Adapter
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override // android.widget.BaseAdapter, android.widget.Adapter
|
||||
public boolean hasStableIds() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static class RecycleListView extends ListView {
|
||||
private final int a;
|
||||
private final int b;
|
||||
|
||||
public RecycleListView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public void a(boolean z, boolean z2) {
|
||||
if (z2 && z) {
|
||||
return;
|
||||
}
|
||||
setPadding(getPaddingLeft(), z ? getPaddingTop() : this.a, getPaddingRight(), z2 ? getPaddingBottom() : this.b);
|
||||
}
|
||||
|
||||
public RecycleListView(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.RecycleListView);
|
||||
this.b = obtainStyledAttributes.getDimensionPixelOffset(R$styleable.RecycleListView_paddingBottomNoButtons, -1);
|
||||
this.a = obtainStyledAttributes.getDimensionPixelOffset(R$styleable.RecycleListView_paddingTopNoTitle, -1);
|
||||
}
|
||||
}
|
||||
|
||||
public AlertController(Context context, AppCompatDialog appCompatDialog, Window window) {
|
||||
this.a = context;
|
||||
this.b = appCompatDialog;
|
||||
this.c = window;
|
||||
this.R = new ButtonHandler(appCompatDialog);
|
||||
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(null, R$styleable.AlertDialog, R$attr.alertDialogStyle, 0);
|
||||
this.J = obtainStyledAttributes.getResourceId(R$styleable.AlertDialog_android_layout, 0);
|
||||
this.K = obtainStyledAttributes.getResourceId(R$styleable.AlertDialog_buttonPanelSideLayout, 0);
|
||||
this.L = obtainStyledAttributes.getResourceId(R$styleable.AlertDialog_listLayout, 0);
|
||||
this.M = obtainStyledAttributes.getResourceId(R$styleable.AlertDialog_multiChoiceItemLayout, 0);
|
||||
this.N = obtainStyledAttributes.getResourceId(R$styleable.AlertDialog_singleChoiceItemLayout, 0);
|
||||
this.O = obtainStyledAttributes.getResourceId(R$styleable.AlertDialog_listItemLayout, 0);
|
||||
this.P = obtainStyledAttributes.getBoolean(R$styleable.AlertDialog_showTitle, true);
|
||||
this.d = obtainStyledAttributes.getDimensionPixelSize(R$styleable.AlertDialog_buttonIconDimen, 0);
|
||||
obtainStyledAttributes.recycle();
|
||||
appCompatDialog.a(1);
|
||||
}
|
||||
|
||||
private static boolean a(Context context) {
|
||||
TypedValue typedValue = new TypedValue();
|
||||
context.getTheme().resolveAttribute(R$attr.alertDialogCenterButtons, typedValue, true);
|
||||
return typedValue.data != 0;
|
||||
}
|
||||
|
||||
private int b() {
|
||||
int i = this.K;
|
||||
return i == 0 ? this.J : this.Q == 1 ? i : this.J;
|
||||
}
|
||||
|
||||
static boolean c(View view) {
|
||||
if (view.onCheckIsTextEditor()) {
|
||||
return true;
|
||||
}
|
||||
if (!(view instanceof ViewGroup)) {
|
||||
return false;
|
||||
}
|
||||
ViewGroup viewGroup = (ViewGroup) view;
|
||||
int childCount = viewGroup.getChildCount();
|
||||
while (childCount > 0) {
|
||||
childCount--;
|
||||
if (c(viewGroup.getChildAt(childCount))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void d(ViewGroup viewGroup) {
|
||||
if (this.G != null) {
|
||||
viewGroup.addView(this.G, 0, new ViewGroup.LayoutParams(-1, -2));
|
||||
this.c.findViewById(R$id.title_template).setVisibility(8);
|
||||
return;
|
||||
}
|
||||
this.D = (ImageView) this.c.findViewById(R.id.icon);
|
||||
if (!(!TextUtils.isEmpty(this.e)) || !this.P) {
|
||||
this.c.findViewById(R$id.title_template).setVisibility(8);
|
||||
this.D.setVisibility(8);
|
||||
viewGroup.setVisibility(8);
|
||||
return;
|
||||
}
|
||||
this.E = (TextView) this.c.findViewById(R$id.alertTitle);
|
||||
this.E.setText(this.e);
|
||||
int i = this.B;
|
||||
if (i != 0) {
|
||||
this.D.setImageResource(i);
|
||||
return;
|
||||
}
|
||||
Drawable drawable = this.C;
|
||||
if (drawable != null) {
|
||||
this.D.setImageDrawable(drawable);
|
||||
} else {
|
||||
this.E.setPadding(this.D.getPaddingLeft(), this.D.getPaddingTop(), this.D.getPaddingRight(), this.D.getPaddingBottom());
|
||||
this.D.setVisibility(8);
|
||||
}
|
||||
}
|
||||
|
||||
public void a() {
|
||||
this.b.setContentView(b());
|
||||
c();
|
||||
}
|
||||
|
||||
public void b(CharSequence charSequence) {
|
||||
this.e = charSequence;
|
||||
TextView textView = this.E;
|
||||
if (textView != null) {
|
||||
textView.setText(charSequence);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(View view) {
|
||||
this.G = view;
|
||||
}
|
||||
|
||||
public void c(int i) {
|
||||
this.h = null;
|
||||
this.i = i;
|
||||
this.n = false;
|
||||
}
|
||||
|
||||
public void a(CharSequence charSequence) {
|
||||
this.f = charSequence;
|
||||
TextView textView = this.F;
|
||||
if (textView != null) {
|
||||
textView.setText(charSequence);
|
||||
}
|
||||
}
|
||||
|
||||
public void b(View view) {
|
||||
this.h = view;
|
||||
this.i = 0;
|
||||
this.n = false;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private void c() {
|
||||
View findViewById;
|
||||
ListAdapter listAdapter;
|
||||
View findViewById2;
|
||||
View findViewById3 = this.c.findViewById(R$id.parentPanel);
|
||||
View findViewById4 = findViewById3.findViewById(R$id.topPanel);
|
||||
View findViewById5 = findViewById3.findViewById(R$id.contentPanel);
|
||||
View findViewById6 = findViewById3.findViewById(R$id.buttonPanel);
|
||||
ViewGroup viewGroup = (ViewGroup) findViewById3.findViewById(R$id.customPanel);
|
||||
c(viewGroup);
|
||||
View findViewById7 = viewGroup.findViewById(R$id.topPanel);
|
||||
View findViewById8 = viewGroup.findViewById(R$id.contentPanel);
|
||||
View findViewById9 = viewGroup.findViewById(R$id.buttonPanel);
|
||||
ViewGroup a = a(findViewById7, findViewById4);
|
||||
ViewGroup a2 = a(findViewById8, findViewById5);
|
||||
ViewGroup a3 = a(findViewById9, findViewById6);
|
||||
b(a2);
|
||||
a(a3);
|
||||
d(a);
|
||||
boolean z = (viewGroup == null || viewGroup.getVisibility() == 8) ? false : true;
|
||||
boolean z2 = (a == null || a.getVisibility() == 8) ? 0 : 1;
|
||||
boolean z3 = (a3 == null || a3.getVisibility() == 8) ? false : true;
|
||||
if (!z3 && a2 != null && (findViewById2 = a2.findViewById(R$id.textSpacerNoButtons)) != null) {
|
||||
findViewById2.setVisibility(0);
|
||||
}
|
||||
if (z2 != 0) {
|
||||
NestedScrollView nestedScrollView = this.A;
|
||||
if (nestedScrollView != null) {
|
||||
nestedScrollView.setClipToPadding(true);
|
||||
}
|
||||
View findViewById10 = (this.f == null && this.g == null) ? null : a.findViewById(R$id.titleDividerNoCustom);
|
||||
if (findViewById10 != null) {
|
||||
findViewById10.setVisibility(0);
|
||||
}
|
||||
} else if (a2 != null && (findViewById = a2.findViewById(R$id.textSpacerNoTitle)) != null) {
|
||||
findViewById.setVisibility(0);
|
||||
}
|
||||
ListView listView = this.g;
|
||||
if (listView instanceof RecycleListView) {
|
||||
((RecycleListView) listView).a(z2, z3);
|
||||
}
|
||||
if (!z) {
|
||||
View view = this.g;
|
||||
if (view == null) {
|
||||
view = this.A;
|
||||
}
|
||||
if (view != null) {
|
||||
a(a2, view, z2 | (z3 ? 2 : 0), 3);
|
||||
}
|
||||
}
|
||||
ListView listView2 = this.g;
|
||||
if (listView2 == null || (listAdapter = this.H) == null) {
|
||||
return;
|
||||
}
|
||||
listView2.setAdapter(listAdapter);
|
||||
int i = this.I;
|
||||
if (i > -1) {
|
||||
listView2.setItemChecked(i, true);
|
||||
listView2.setSelection(i);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(View view, int i, int i2, int i3, int i4) {
|
||||
this.h = view;
|
||||
this.i = 0;
|
||||
this.n = true;
|
||||
this.j = i;
|
||||
this.k = i2;
|
||||
this.l = i3;
|
||||
this.m = i4;
|
||||
}
|
||||
|
||||
public void b(int i) {
|
||||
this.C = null;
|
||||
this.B = i;
|
||||
ImageView imageView = this.D;
|
||||
if (imageView != null) {
|
||||
if (i != 0) {
|
||||
imageView.setVisibility(0);
|
||||
this.D.setImageResource(this.B);
|
||||
} else {
|
||||
imageView.setVisibility(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean b(int i, KeyEvent keyEvent) {
|
||||
NestedScrollView nestedScrollView = this.A;
|
||||
return nestedScrollView != null && nestedScrollView.a(keyEvent);
|
||||
}
|
||||
|
||||
private void b(ViewGroup viewGroup) {
|
||||
this.A = (NestedScrollView) this.c.findViewById(R$id.scrollView);
|
||||
this.A.setFocusable(false);
|
||||
this.A.setNestedScrollingEnabled(false);
|
||||
this.F = (TextView) viewGroup.findViewById(R.id.message);
|
||||
TextView textView = this.F;
|
||||
if (textView == null) {
|
||||
return;
|
||||
}
|
||||
CharSequence charSequence = this.f;
|
||||
if (charSequence != null) {
|
||||
textView.setText(charSequence);
|
||||
return;
|
||||
}
|
||||
textView.setVisibility(8);
|
||||
this.A.removeView(this.F);
|
||||
if (this.g != null) {
|
||||
ViewGroup viewGroup2 = (ViewGroup) this.A.getParent();
|
||||
int indexOfChild = viewGroup2.indexOfChild(this.A);
|
||||
viewGroup2.removeViewAt(indexOfChild);
|
||||
viewGroup2.addView(this.g, indexOfChild, new ViewGroup.LayoutParams(-1, -1));
|
||||
return;
|
||||
}
|
||||
viewGroup.setVisibility(8);
|
||||
}
|
||||
|
||||
public void a(int i, CharSequence charSequence, DialogInterface.OnClickListener onClickListener, Message message, Drawable drawable) {
|
||||
if (message == null && onClickListener != null) {
|
||||
message = this.R.obtainMessage(i, onClickListener);
|
||||
}
|
||||
if (i == -3) {
|
||||
this.x = charSequence;
|
||||
this.y = message;
|
||||
this.z = drawable;
|
||||
} else if (i == -2) {
|
||||
this.t = charSequence;
|
||||
this.u = message;
|
||||
this.v = drawable;
|
||||
} else {
|
||||
if (i == -1) {
|
||||
this.p = charSequence;
|
||||
this.q = message;
|
||||
this.r = drawable;
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Button does not exist");
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Drawable drawable) {
|
||||
this.C = drawable;
|
||||
this.B = 0;
|
||||
ImageView imageView = this.D;
|
||||
if (imageView != null) {
|
||||
if (drawable != null) {
|
||||
imageView.setVisibility(0);
|
||||
this.D.setImageDrawable(drawable);
|
||||
} else {
|
||||
imageView.setVisibility(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int a(int i) {
|
||||
TypedValue typedValue = new TypedValue();
|
||||
this.a.getTheme().resolveAttribute(i, typedValue, true);
|
||||
return typedValue.resourceId;
|
||||
}
|
||||
|
||||
public boolean a(int i, KeyEvent keyEvent) {
|
||||
NestedScrollView nestedScrollView = this.A;
|
||||
return nestedScrollView != null && nestedScrollView.a(keyEvent);
|
||||
}
|
||||
|
||||
private ViewGroup a(View view, View view2) {
|
||||
if (view == null) {
|
||||
if (view2 instanceof ViewStub) {
|
||||
view2 = ((ViewStub) view2).inflate();
|
||||
}
|
||||
return (ViewGroup) view2;
|
||||
}
|
||||
if (view2 != null) {
|
||||
ViewParent parent = view2.getParent();
|
||||
if (parent instanceof ViewGroup) {
|
||||
((ViewGroup) parent).removeView(view2);
|
||||
}
|
||||
}
|
||||
if (view instanceof ViewStub) {
|
||||
view = ((ViewStub) view).inflate();
|
||||
}
|
||||
return (ViewGroup) view;
|
||||
}
|
||||
|
||||
private void c(ViewGroup viewGroup) {
|
||||
View view = this.h;
|
||||
if (view == null) {
|
||||
view = this.i != 0 ? LayoutInflater.from(this.a).inflate(this.i, viewGroup, false) : null;
|
||||
}
|
||||
boolean z = view != null;
|
||||
if (!z || !c(view)) {
|
||||
this.c.setFlags(131072, 131072);
|
||||
}
|
||||
if (z) {
|
||||
FrameLayout frameLayout = (FrameLayout) this.c.findViewById(R$id.custom);
|
||||
frameLayout.addView(view, new ViewGroup.LayoutParams(-1, -1));
|
||||
if (this.n) {
|
||||
frameLayout.setPadding(this.j, this.k, this.l, this.m);
|
||||
}
|
||||
if (this.g != null) {
|
||||
((LinearLayoutCompat.LayoutParams) viewGroup.getLayoutParams()).a = 0.0f;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
viewGroup.setVisibility(8);
|
||||
}
|
||||
|
||||
private void a(ViewGroup viewGroup, View view, int i, int i2) {
|
||||
final View findViewById = this.c.findViewById(R$id.scrollIndicatorUp);
|
||||
View findViewById2 = this.c.findViewById(R$id.scrollIndicatorDown);
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
ViewCompat.a(view, i, i2);
|
||||
if (findViewById != null) {
|
||||
viewGroup.removeView(findViewById);
|
||||
}
|
||||
if (findViewById2 != null) {
|
||||
viewGroup.removeView(findViewById2);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
final View view2 = null;
|
||||
if (findViewById != null && (i & 1) == 0) {
|
||||
viewGroup.removeView(findViewById);
|
||||
findViewById = null;
|
||||
}
|
||||
if (findViewById2 == null || (i & 2) != 0) {
|
||||
view2 = findViewById2;
|
||||
} else {
|
||||
viewGroup.removeView(findViewById2);
|
||||
}
|
||||
if (findViewById == null && view2 == null) {
|
||||
return;
|
||||
}
|
||||
if (this.f != null) {
|
||||
this.A.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener(this) { // from class: androidx.appcompat.app.AlertController.2
|
||||
@Override // androidx.core.widget.NestedScrollView.OnScrollChangeListener
|
||||
public void a(NestedScrollView nestedScrollView, int i3, int i4, int i5, int i6) {
|
||||
AlertController.a(nestedScrollView, findViewById, view2);
|
||||
}
|
||||
});
|
||||
this.A.post(new Runnable() { // from class: androidx.appcompat.app.AlertController.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
AlertController.a(AlertController.this.A, findViewById, view2);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
ListView listView = this.g;
|
||||
if (listView != null) {
|
||||
listView.setOnScrollListener(new AbsListView.OnScrollListener(this) { // from class: androidx.appcompat.app.AlertController.4
|
||||
@Override // android.widget.AbsListView.OnScrollListener
|
||||
public void onScroll(AbsListView absListView, int i3, int i4, int i5) {
|
||||
AlertController.a(absListView, findViewById, view2);
|
||||
}
|
||||
|
||||
@Override // android.widget.AbsListView.OnScrollListener
|
||||
public void onScrollStateChanged(AbsListView absListView, int i3) {
|
||||
}
|
||||
});
|
||||
this.g.post(new Runnable() { // from class: androidx.appcompat.app.AlertController.5
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
AlertController.a(AlertController.this.g, findViewById, view2);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (findViewById != null) {
|
||||
viewGroup.removeView(findViewById);
|
||||
}
|
||||
if (view2 != null) {
|
||||
viewGroup.removeView(view2);
|
||||
}
|
||||
}
|
||||
|
||||
static void a(View view, View view2, View view3) {
|
||||
if (view2 != null) {
|
||||
view2.setVisibility(view.canScrollVertically(-1) ? 0 : 4);
|
||||
}
|
||||
if (view3 != null) {
|
||||
view3.setVisibility(view.canScrollVertically(1) ? 0 : 4);
|
||||
}
|
||||
}
|
||||
|
||||
private void a(ViewGroup viewGroup) {
|
||||
int i;
|
||||
this.o = (Button) viewGroup.findViewById(R.id.button1);
|
||||
this.o.setOnClickListener(this.S);
|
||||
if (TextUtils.isEmpty(this.p) && this.r == null) {
|
||||
this.o.setVisibility(8);
|
||||
i = 0;
|
||||
} else {
|
||||
this.o.setText(this.p);
|
||||
Drawable drawable = this.r;
|
||||
if (drawable != null) {
|
||||
int i2 = this.d;
|
||||
drawable.setBounds(0, 0, i2, i2);
|
||||
this.o.setCompoundDrawables(this.r, null, null, null);
|
||||
}
|
||||
this.o.setVisibility(0);
|
||||
i = 1;
|
||||
}
|
||||
this.s = (Button) viewGroup.findViewById(R.id.button2);
|
||||
this.s.setOnClickListener(this.S);
|
||||
if (TextUtils.isEmpty(this.t) && this.v == null) {
|
||||
this.s.setVisibility(8);
|
||||
} else {
|
||||
this.s.setText(this.t);
|
||||
Drawable drawable2 = this.v;
|
||||
if (drawable2 != null) {
|
||||
int i3 = this.d;
|
||||
drawable2.setBounds(0, 0, i3, i3);
|
||||
this.s.setCompoundDrawables(this.v, null, null, null);
|
||||
}
|
||||
this.s.setVisibility(0);
|
||||
i |= 2;
|
||||
}
|
||||
this.w = (Button) viewGroup.findViewById(R.id.button3);
|
||||
this.w.setOnClickListener(this.S);
|
||||
if (TextUtils.isEmpty(this.x) && this.z == null) {
|
||||
this.w.setVisibility(8);
|
||||
} else {
|
||||
this.w.setText(this.x);
|
||||
Drawable drawable3 = this.r;
|
||||
if (drawable3 != null) {
|
||||
int i4 = this.d;
|
||||
drawable3.setBounds(0, 0, i4, i4);
|
||||
this.o.setCompoundDrawables(this.r, null, null, null);
|
||||
}
|
||||
this.w.setVisibility(0);
|
||||
i |= 4;
|
||||
}
|
||||
if (a(this.a)) {
|
||||
if (i == 1) {
|
||||
a(this.o);
|
||||
} else if (i == 2) {
|
||||
a(this.s);
|
||||
} else if (i == 4) {
|
||||
a(this.w);
|
||||
}
|
||||
}
|
||||
if (i != 0) {
|
||||
return;
|
||||
}
|
||||
viewGroup.setVisibility(8);
|
||||
}
|
||||
|
||||
private void a(Button button) {
|
||||
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) button.getLayoutParams();
|
||||
layoutParams.gravity = 1;
|
||||
layoutParams.weight = 0.5f;
|
||||
button.setLayoutParams(layoutParams);
|
||||
}
|
||||
}
|
||||
129
sources/androidx/appcompat/app/AlertDialog.java
Normal file
129
sources/androidx/appcompat/app/AlertDialog.java
Normal file
@@ -0,0 +1,129 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.TypedValue;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ListAdapter;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.app.AlertController;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AlertDialog extends AppCompatDialog implements DialogInterface {
|
||||
final AlertController c;
|
||||
|
||||
public static class Builder {
|
||||
private final AlertController.AlertParams a;
|
||||
private final int b;
|
||||
|
||||
public Builder(Context context) {
|
||||
this(context, AlertDialog.a(context, 0));
|
||||
}
|
||||
|
||||
public Builder a(CharSequence charSequence) {
|
||||
this.a.f = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Context b() {
|
||||
return this.a.a;
|
||||
}
|
||||
|
||||
public Builder(Context context, int i) {
|
||||
this.a = new AlertController.AlertParams(new ContextThemeWrapper(context, AlertDialog.a(context, i)));
|
||||
this.b = i;
|
||||
}
|
||||
|
||||
public Builder a(View view) {
|
||||
this.a.g = view;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder b(View view) {
|
||||
AlertController.AlertParams alertParams = this.a;
|
||||
alertParams.z = view;
|
||||
alertParams.y = 0;
|
||||
alertParams.E = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(Drawable drawable) {
|
||||
this.a.d = drawable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(DialogInterface.OnKeyListener onKeyListener) {
|
||||
this.a.u = onKeyListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(ListAdapter listAdapter, DialogInterface.OnClickListener onClickListener) {
|
||||
AlertController.AlertParams alertParams = this.a;
|
||||
alertParams.w = listAdapter;
|
||||
alertParams.x = onClickListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlertDialog a() {
|
||||
AlertDialog alertDialog = new AlertDialog(this.a.a, this.b);
|
||||
this.a.a(alertDialog.c);
|
||||
alertDialog.setCancelable(this.a.r);
|
||||
if (this.a.r) {
|
||||
alertDialog.setCanceledOnTouchOutside(true);
|
||||
}
|
||||
alertDialog.setOnCancelListener(this.a.s);
|
||||
alertDialog.setOnDismissListener(this.a.t);
|
||||
DialogInterface.OnKeyListener onKeyListener = this.a.u;
|
||||
if (onKeyListener != null) {
|
||||
alertDialog.setOnKeyListener(onKeyListener);
|
||||
}
|
||||
return alertDialog;
|
||||
}
|
||||
}
|
||||
|
||||
protected AlertDialog(Context context, int i) {
|
||||
super(context, a(context, i));
|
||||
this.c = new AlertController(getContext(), this, getWindow());
|
||||
}
|
||||
|
||||
static int a(Context context, int i) {
|
||||
if (((i >>> 24) & 255) >= 1) {
|
||||
return i;
|
||||
}
|
||||
TypedValue typedValue = new TypedValue();
|
||||
context.getTheme().resolveAttribute(R$attr.alertDialogTheme, typedValue, true);
|
||||
return typedValue.resourceId;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatDialog, android.app.Dialog
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
this.c.a();
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
||||
if (this.c.a(i, keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(i, keyEvent);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog, android.view.KeyEvent.Callback
|
||||
public boolean onKeyUp(int i, KeyEvent keyEvent) {
|
||||
if (this.c.b(i, keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
return super.onKeyUp(i, keyEvent);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatDialog, android.app.Dialog
|
||||
public void setTitle(CharSequence charSequence) {
|
||||
super.setTitle(charSequence);
|
||||
this.c.b(charSequence);
|
||||
}
|
||||
}
|
||||
324
sources/androidx/appcompat/app/AppCompatActivity.java
Normal file
324
sources/androidx/appcompat/app/AppCompatActivity.java
Normal file
@@ -0,0 +1,324 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.app.Activity;
|
||||
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.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.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;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatActivity extends FragmentActivity implements AppCompatCallback, TaskStackBuilder.SupportParentable, ActionBarDrawerToggle$DelegateProvider {
|
||||
private AppCompatDelegate mDelegate;
|
||||
private Resources mResources;
|
||||
private int mThemeId = 0;
|
||||
|
||||
private boolean performMenuItemShortcut(int i, KeyEvent keyEvent) {
|
||||
Window window;
|
||||
return (Build.VERSION.SDK_INT >= 26 || keyEvent.isCtrlPressed() || KeyEvent.metaStateHasNoModifiers(keyEvent.getMetaState()) || keyEvent.getRepeatCount() != 0 || KeyEvent.isModifierKey(keyEvent.getKeyCode()) || (window = getWindow()) == null || window.getDecorView() == null || !window.getDecorView().dispatchKeyShortcutEvent(keyEvent)) ? false : true;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void addContentView(View view, ViewGroup.LayoutParams layoutParams) {
|
||||
getDelegate().a(view, layoutParams);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void closeOptionsMenu() {
|
||||
ActionBar supportActionBar = getSupportActionBar();
|
||||
if (getWindow().hasFeature(0)) {
|
||||
if (supportActionBar == null || !supportActionBar.e()) {
|
||||
super.closeOptionsMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ComponentActivity, android.app.Activity, android.view.Window.Callback
|
||||
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
|
||||
int keyCode = keyEvent.getKeyCode();
|
||||
ActionBar supportActionBar = getSupportActionBar();
|
||||
if (keyCode == 82 && supportActionBar != null && supportActionBar.a(keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
return super.dispatchKeyEvent(keyEvent);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public <T extends View> T findViewById(int i) {
|
||||
return (T) getDelegate().a(i);
|
||||
}
|
||||
|
||||
public AppCompatDelegate getDelegate() {
|
||||
if (this.mDelegate == null) {
|
||||
this.mDelegate = AppCompatDelegate.a(this, this);
|
||||
}
|
||||
return this.mDelegate;
|
||||
}
|
||||
|
||||
public ActionBarDrawerToggle$Delegate getDrawerToggleDelegate() {
|
||||
return getDelegate().b();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public MenuInflater getMenuInflater() {
|
||||
return getDelegate().c();
|
||||
}
|
||||
|
||||
@Override // android.view.ContextThemeWrapper, android.content.ContextWrapper, android.content.Context
|
||||
public Resources getResources() {
|
||||
if (this.mResources == null && VectorEnabledTintResources.b()) {
|
||||
this.mResources = new VectorEnabledTintResources(this, super.getResources());
|
||||
}
|
||||
Resources resources = this.mResources;
|
||||
return resources == null ? super.getResources() : resources;
|
||||
}
|
||||
|
||||
public ActionBar getSupportActionBar() {
|
||||
return getDelegate().d();
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.TaskStackBuilder.SupportParentable
|
||||
public Intent getSupportParentActivityIntent() {
|
||||
return NavUtils.a(this);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void invalidateOptionsMenu() {
|
||||
getDelegate().f();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity, android.content.ComponentCallbacks
|
||||
public void onConfigurationChanged(Configuration configuration) {
|
||||
super.onConfigurationChanged(configuration);
|
||||
getDelegate().a(configuration);
|
||||
if (this.mResources != null) {
|
||||
this.mResources.updateConfiguration(configuration, super.getResources().getDisplayMetrics());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public void onContentChanged() {
|
||||
onSupportContentChanged();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
int i;
|
||||
AppCompatDelegate delegate = getDelegate();
|
||||
delegate.e();
|
||||
delegate.a(bundle);
|
||||
if (delegate.a() && (i = this.mThemeId) != 0) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
onApplyThemeResource(getTheme(), this.mThemeId, false);
|
||||
} else {
|
||||
setTheme(i);
|
||||
}
|
||||
}
|
||||
super.onCreate(bundle);
|
||||
}
|
||||
|
||||
public void onCreateSupportNavigateUpTaskStack(TaskStackBuilder taskStackBuilder) {
|
||||
taskStackBuilder.a((Activity) this);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
getDelegate().g();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
||||
if (performMenuItemShortcut(i, keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(i, keyEvent);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity, android.view.Window.Callback
|
||||
public final boolean onMenuItemSelected(int i, MenuItem menuItem) {
|
||||
if (super.onMenuItemSelected(i, menuItem)) {
|
||||
return true;
|
||||
}
|
||||
ActionBar supportActionBar = getSupportActionBar();
|
||||
if (menuItem.getItemId() != 16908332 || supportActionBar == null || (supportActionBar.g() & 4) == 0) {
|
||||
return false;
|
||||
}
|
||||
return onSupportNavigateUp();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public boolean onMenuOpened(int i, Menu menu) {
|
||||
return super.onMenuOpened(i, menu);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity, android.view.Window.Callback
|
||||
public void onPanelClosed(int i, Menu menu) {
|
||||
super.onPanelClosed(i, menu);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onPostCreate(Bundle bundle) {
|
||||
super.onPostCreate(bundle);
|
||||
getDelegate().b(bundle);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onPostResume() {
|
||||
super.onPostResume();
|
||||
getDelegate().h();
|
||||
}
|
||||
|
||||
public void onPrepareSupportNavigateUpTaskStack(TaskStackBuilder taskStackBuilder) {
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onSaveInstanceState(Bundle bundle) {
|
||||
super.onSaveInstanceState(bundle);
|
||||
getDelegate().c(bundle);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
getDelegate().i();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
getDelegate().j();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public void onSupportActionModeFinished(ActionMode actionMode) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public void onSupportActionModeStarted(ActionMode actionMode) {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void onSupportContentChanged() {
|
||||
}
|
||||
|
||||
public boolean onSupportNavigateUp() {
|
||||
Intent supportParentActivityIntent = getSupportParentActivityIntent();
|
||||
if (supportParentActivityIntent == null) {
|
||||
return false;
|
||||
}
|
||||
if (!supportShouldUpRecreateTask(supportParentActivityIntent)) {
|
||||
supportNavigateUpTo(supportParentActivityIntent);
|
||||
return true;
|
||||
}
|
||||
TaskStackBuilder a = TaskStackBuilder.a((Context) this);
|
||||
onCreateSupportNavigateUpTaskStack(a);
|
||||
onPrepareSupportNavigateUpTaskStack(a);
|
||||
a.a();
|
||||
try {
|
||||
ActivityCompat.a((Activity) this);
|
||||
return true;
|
||||
} catch (IllegalStateException unused) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onTitleChanged(CharSequence charSequence, int i) {
|
||||
super.onTitleChanged(charSequence, i);
|
||||
getDelegate().a(charSequence);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public ActionMode onWindowStartingSupportActionMode(ActionMode.Callback callback) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void openOptionsMenu() {
|
||||
ActionBar supportActionBar = getSupportActionBar();
|
||||
if (getWindow().hasFeature(0)) {
|
||||
if (supportActionBar == null || !supportActionBar.k()) {
|
||||
super.openOptionsMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void setContentView(int i) {
|
||||
getDelegate().c(i);
|
||||
}
|
||||
|
||||
public void setSupportActionBar(Toolbar toolbar) {
|
||||
getDelegate().a(toolbar);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setSupportProgress(int i) {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setSupportProgressBarIndeterminate(boolean z) {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setSupportProgressBarIndeterminateVisibility(boolean z) {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setSupportProgressBarVisibility(boolean z) {
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.ContextThemeWrapper, android.content.ContextWrapper, android.content.Context
|
||||
public void setTheme(int i) {
|
||||
super.setTheme(i);
|
||||
this.mThemeId = i;
|
||||
}
|
||||
|
||||
public ActionMode startSupportActionMode(ActionMode.Callback callback) {
|
||||
return getDelegate().a(callback);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity
|
||||
public void supportInvalidateOptionsMenu() {
|
||||
getDelegate().f();
|
||||
}
|
||||
|
||||
public void supportNavigateUpTo(Intent intent) {
|
||||
NavUtils.a(this, intent);
|
||||
}
|
||||
|
||||
public boolean supportRequestWindowFeature(int i) {
|
||||
return getDelegate().b(i);
|
||||
}
|
||||
|
||||
public boolean supportShouldUpRecreateTask(Intent intent) {
|
||||
return NavUtils.b(this, intent);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void setContentView(View view) {
|
||||
getDelegate().a(view);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
|
||||
getDelegate().b(view, layoutParams);
|
||||
}
|
||||
}
|
||||
12
sources/androidx/appcompat/app/AppCompatCallback.java
Normal file
12
sources/androidx/appcompat/app/AppCompatCallback.java
Normal file
@@ -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);
|
||||
}
|
||||
77
sources/androidx/appcompat/app/AppCompatDelegate.java
Normal file
77
sources/androidx/appcompat/app/AppCompatDelegate.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class AppCompatDelegate {
|
||||
private static int a = -1;
|
||||
|
||||
AppCompatDelegate() {
|
||||
}
|
||||
|
||||
public static AppCompatDelegate a(Activity activity, AppCompatCallback appCompatCallback) {
|
||||
return new AppCompatDelegateImpl(activity, activity.getWindow(), appCompatCallback);
|
||||
}
|
||||
|
||||
public static int k() {
|
||||
return a;
|
||||
}
|
||||
|
||||
public abstract <T extends View> T a(int i);
|
||||
|
||||
public abstract ActionMode a(ActionMode.Callback callback);
|
||||
|
||||
public abstract void a(Configuration configuration);
|
||||
|
||||
public abstract void a(Bundle bundle);
|
||||
|
||||
public abstract void a(View view);
|
||||
|
||||
public abstract void a(View view, ViewGroup.LayoutParams layoutParams);
|
||||
|
||||
public abstract void a(Toolbar toolbar);
|
||||
|
||||
public abstract void a(CharSequence charSequence);
|
||||
|
||||
public abstract boolean a();
|
||||
|
||||
public abstract ActionBarDrawerToggle$Delegate b();
|
||||
|
||||
public abstract void b(Bundle bundle);
|
||||
|
||||
public abstract void b(View view, ViewGroup.LayoutParams layoutParams);
|
||||
|
||||
public abstract boolean b(int i);
|
||||
|
||||
public abstract MenuInflater c();
|
||||
|
||||
public abstract void c(int i);
|
||||
|
||||
public abstract void c(Bundle bundle);
|
||||
|
||||
public abstract ActionBar d();
|
||||
|
||||
public abstract void e();
|
||||
|
||||
public abstract void f();
|
||||
|
||||
public abstract void g();
|
||||
|
||||
public abstract void h();
|
||||
|
||||
public abstract void i();
|
||||
|
||||
public abstract void j();
|
||||
|
||||
public static AppCompatDelegate a(Dialog dialog, AppCompatCallback appCompatCallback) {
|
||||
return new AppCompatDelegateImpl(dialog.getContext(), dialog.getWindow(), appCompatCallback);
|
||||
}
|
||||
}
|
||||
1906
sources/androidx/appcompat/app/AppCompatDelegateImpl.java
Normal file
1906
sources/androidx/appcompat/app/AppCompatDelegateImpl.java
Normal file
File diff suppressed because it is too large
Load Diff
131
sources/androidx/appcompat/app/AppCompatDialog.java
Normal file
131
sources/androidx/appcompat/app/AppCompatDialog.java
Normal file
@@ -0,0 +1,131 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.TypedValue;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.core.view.KeyEventDispatcher;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatDialog extends Dialog implements AppCompatCallback {
|
||||
private AppCompatDelegate a;
|
||||
private final KeyEventDispatcher.Component b;
|
||||
|
||||
public AppCompatDialog(Context context) {
|
||||
this(context, 0);
|
||||
}
|
||||
|
||||
public boolean a(int i) {
|
||||
return a().b(i);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void addContentView(View view, ViewGroup.LayoutParams layoutParams) {
|
||||
a().a(view, layoutParams);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog, android.view.Window.Callback
|
||||
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
|
||||
return KeyEventDispatcher.a(this.b, getWindow().getDecorView(), this, keyEvent);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public <T extends View> T findViewById(int i) {
|
||||
return (T) a().a(i);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void invalidateOptionsMenu() {
|
||||
a().f();
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
protected void onCreate(Bundle bundle) {
|
||||
a().e();
|
||||
super.onCreate(bundle);
|
||||
a().a(bundle);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
a().j();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public void onSupportActionModeFinished(ActionMode actionMode) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public void onSupportActionModeStarted(ActionMode actionMode) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatCallback
|
||||
public ActionMode onWindowStartingSupportActionMode(ActionMode.Callback callback) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void setContentView(int i) {
|
||||
a().c(i);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void setTitle(CharSequence charSequence) {
|
||||
super.setTitle(charSequence);
|
||||
a().a(charSequence);
|
||||
}
|
||||
|
||||
public AppCompatDialog(Context context, int i) {
|
||||
super(context, a(context, i));
|
||||
this.b = new KeyEventDispatcher.Component() { // from class: androidx.appcompat.app.AppCompatDialog.1
|
||||
@Override // androidx.core.view.KeyEventDispatcher.Component
|
||||
public boolean superDispatchKeyEvent(KeyEvent keyEvent) {
|
||||
return AppCompatDialog.this.a(keyEvent);
|
||||
}
|
||||
};
|
||||
a().a((Bundle) null);
|
||||
a().a();
|
||||
}
|
||||
|
||||
public AppCompatDelegate a() {
|
||||
if (this.a == null) {
|
||||
this.a = AppCompatDelegate.a(this, this);
|
||||
}
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void setContentView(View view) {
|
||||
a().a(view);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
|
||||
a().b(view, layoutParams);
|
||||
}
|
||||
|
||||
@Override // android.app.Dialog
|
||||
public void setTitle(int i) {
|
||||
super.setTitle(i);
|
||||
a().a(getContext().getString(i));
|
||||
}
|
||||
|
||||
private static int a(Context context, int i) {
|
||||
if (i != 0) {
|
||||
return i;
|
||||
}
|
||||
TypedValue typedValue = new TypedValue();
|
||||
context.getTheme().resolveAttribute(R$attr.dialogTheme, typedValue, true);
|
||||
return typedValue.resourceId;
|
||||
}
|
||||
|
||||
boolean a(KeyEvent keyEvent) {
|
||||
return super.dispatchKeyEvent(keyEvent);
|
||||
}
|
||||
}
|
||||
302
sources/androidx/appcompat/app/AppCompatViewInflater.java
Normal file
302
sources/androidx/appcompat/app/AppCompatViewInflater.java
Normal file
@@ -0,0 +1,302 @@
|
||||
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.R$styleable;
|
||||
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.TintContextWrapper;
|
||||
import androidx.collection.ArrayMap;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
/* 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 Map<String, Constructor<? extends View>> sConstructorMap = new ArrayMap();
|
||||
|
||||
private static class DeclaredOnClickListener implements View.OnClickListener {
|
||||
private final View a;
|
||||
private final String b;
|
||||
private Method c;
|
||||
private Context d;
|
||||
|
||||
public DeclaredOnClickListener(View view, String str) {
|
||||
this.a = view;
|
||||
this.b = str;
|
||||
}
|
||||
|
||||
private void a(Context context, String str) {
|
||||
String str2;
|
||||
Method method;
|
||||
while (context != null) {
|
||||
try {
|
||||
if (!context.isRestricted() && (method = context.getClass().getMethod(this.b, View.class)) != null) {
|
||||
this.c = method;
|
||||
this.d = context;
|
||||
return;
|
||||
}
|
||||
} catch (NoSuchMethodException unused) {
|
||||
}
|
||||
context = context instanceof ContextWrapper ? ((ContextWrapper) context).getBaseContext() : null;
|
||||
}
|
||||
int id = this.a.getId();
|
||||
if (id == -1) {
|
||||
str2 = "";
|
||||
} else {
|
||||
str2 = " with id '" + this.a.getContext().getResources().getResourceEntryName(id) + "'";
|
||||
}
|
||||
throw new IllegalStateException("Could not find method " + this.b + "(View) in a parent or ancestor Context for android:onClick attribute defined on view " + this.a.getClass() + str2);
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (this.c == null) {
|
||||
a(this.a.getContext(), this.b);
|
||||
}
|
||||
try {
|
||||
this.c.invoke(this.d, view);
|
||||
} 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 checkOnClickListener(View view, AttributeSet attributeSet) {
|
||||
Context context = view.getContext();
|
||||
if (context instanceof ContextWrapper) {
|
||||
if (Build.VERSION.SDK_INT < 15 || ViewCompat.t(view)) {
|
||||
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, sOnClickAttrs);
|
||||
String string = obtainStyledAttributes.getString(0);
|
||||
if (string != null) {
|
||||
view.setOnClickListener(new DeclaredOnClickListener(view, string));
|
||||
}
|
||||
obtainStyledAttributes.recycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private View createViewByPrefix(Context context, String str, String str2) throws ClassNotFoundException, InflateException {
|
||||
String str3;
|
||||
Constructor<? extends View> constructor = sConstructorMap.get(str);
|
||||
if (constructor == null) {
|
||||
try {
|
||||
ClassLoader classLoader = context.getClassLoader();
|
||||
if (str2 != null) {
|
||||
str3 = str2 + str;
|
||||
} else {
|
||||
str3 = str;
|
||||
}
|
||||
constructor = classLoader.loadClass(str3).asSubclass(View.class).getConstructor(sConstructorSignature);
|
||||
sConstructorMap.put(str, constructor);
|
||||
} catch (Exception unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
constructor.setAccessible(true);
|
||||
return constructor.newInstance(this.mConstructorArgs);
|
||||
}
|
||||
|
||||
private View createViewFromTag(Context context, String str, AttributeSet attributeSet) {
|
||||
if (str.equals("view")) {
|
||||
str = attributeSet.getAttributeValue(null, "class");
|
||||
}
|
||||
try {
|
||||
this.mConstructorArgs[0] = context;
|
||||
this.mConstructorArgs[1] = attributeSet;
|
||||
if (-1 != str.indexOf(46)) {
|
||||
return createViewByPrefix(context, str, null);
|
||||
}
|
||||
for (int i = 0; i < sClassPrefixList.length; i++) {
|
||||
View createViewByPrefix = createViewByPrefix(context, str, sClassPrefixList[i]);
|
||||
if (createViewByPrefix != null) {
|
||||
return createViewByPrefix;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
} catch (Exception unused) {
|
||||
return null;
|
||||
} finally {
|
||||
Object[] objArr = this.mConstructorArgs;
|
||||
objArr[0] = null;
|
||||
objArr[1] = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Context themifyContext(Context context, AttributeSet attributeSet, boolean z, boolean z2) {
|
||||
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.View, 0, 0);
|
||||
int resourceId = z ? obtainStyledAttributes.getResourceId(R$styleable.View_android_theme, 0) : 0;
|
||||
if (z2 && resourceId == 0 && (resourceId = obtainStyledAttributes.getResourceId(R$styleable.View_theme, 0)) != 0) {
|
||||
Log.i(LOG_TAG, "app:theme is now deprecated. Please move to using android:theme instead.");
|
||||
}
|
||||
obtainStyledAttributes.recycle();
|
||||
return resourceId != 0 ? ((context instanceof ContextThemeWrapper) && ((ContextThemeWrapper) context).a() == resourceId) ? context : new ContextThemeWrapper(context, resourceId) : context;
|
||||
}
|
||||
|
||||
private void verifyNotNull(View view, String str) {
|
||||
if (view != null) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException(getClass().getName() + " asked to inflate view for <" + str + ">, but returned null");
|
||||
}
|
||||
|
||||
protected AppCompatAutoCompleteTextView createAutoCompleteTextView(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatAutoCompleteTextView(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatButton createButton(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatButton(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatCheckBox createCheckBox(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatCheckBox(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatCheckedTextView createCheckedTextView(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatCheckedTextView(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatEditText createEditText(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatEditText(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatImageButton createImageButton(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatImageButton(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatImageView createImageView(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatImageView(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatMultiAutoCompleteTextView createMultiAutoCompleteTextView(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatMultiAutoCompleteTextView(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatRadioButton createRadioButton(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatRadioButton(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatRatingBar createRatingBar(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatRatingBar(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatSeekBar createSeekBar(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatSeekBar(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatSpinner createSpinner(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatSpinner(context, attributeSet);
|
||||
}
|
||||
|
||||
protected AppCompatTextView createTextView(Context context, AttributeSet attributeSet) {
|
||||
return new AppCompatTextView(context, attributeSet);
|
||||
}
|
||||
|
||||
protected View createView(Context context, String str, AttributeSet attributeSet) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final View createView(View view, String str, Context context, AttributeSet attributeSet, boolean z, boolean z2, boolean z3, boolean z4) {
|
||||
Context context2;
|
||||
View createTextView;
|
||||
context2 = (!z || view == null) ? context : view.getContext();
|
||||
if (z2 || z3) {
|
||||
context2 = themifyContext(context2, attributeSet, z2, z3);
|
||||
}
|
||||
if (z4) {
|
||||
context2 = TintContextWrapper.b(context2);
|
||||
}
|
||||
switch (str) {
|
||||
case "TextView":
|
||||
createTextView = createTextView(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "ImageView":
|
||||
createTextView = createImageView(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "Button":
|
||||
createTextView = createButton(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "EditText":
|
||||
createTextView = createEditText(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "Spinner":
|
||||
createTextView = createSpinner(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "ImageButton":
|
||||
createTextView = createImageButton(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "CheckBox":
|
||||
createTextView = createCheckBox(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "RadioButton":
|
||||
createTextView = createRadioButton(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "CheckedTextView":
|
||||
createTextView = createCheckedTextView(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "AutoCompleteTextView":
|
||||
createTextView = createAutoCompleteTextView(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "MultiAutoCompleteTextView":
|
||||
createTextView = createMultiAutoCompleteTextView(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "RatingBar":
|
||||
createTextView = createRatingBar(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
case "SeekBar":
|
||||
createTextView = createSeekBar(context2, attributeSet);
|
||||
verifyNotNull(createTextView, str);
|
||||
break;
|
||||
default:
|
||||
createTextView = createView(context2, str, attributeSet);
|
||||
break;
|
||||
}
|
||||
if (createTextView == null && context != context2) {
|
||||
createTextView = createViewFromTag(context2, str, attributeSet);
|
||||
}
|
||||
if (createTextView != null) {
|
||||
checkOnClickListener(createTextView, attributeSet);
|
||||
}
|
||||
return createTextView;
|
||||
}
|
||||
}
|
||||
169
sources/androidx/appcompat/app/ResourcesFlusher.java
Normal file
169
sources/androidx/appcompat/app/ResourcesFlusher.java
Normal file
@@ -0,0 +1,169 @@
|
||||
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 Field a;
|
||||
private static boolean b;
|
||||
private static Class c;
|
||||
private static boolean d;
|
||||
private static Field e;
|
||||
private static boolean f;
|
||||
private static Field g;
|
||||
private static boolean h;
|
||||
|
||||
static void a(Resources resources) {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 28) {
|
||||
return;
|
||||
}
|
||||
if (i >= 24) {
|
||||
d(resources);
|
||||
} else if (i >= 23) {
|
||||
c(resources);
|
||||
} else if (i >= 21) {
|
||||
b(resources);
|
||||
}
|
||||
}
|
||||
|
||||
private static void b(Resources resources) {
|
||||
Map map;
|
||||
if (!b) {
|
||||
try {
|
||||
a = Resources.class.getDeclaredField("mDrawableCache");
|
||||
a.setAccessible(true);
|
||||
} catch (NoSuchFieldException e2) {
|
||||
Log.e("ResourcesFlusher", "Could not retrieve Resources#mDrawableCache field", e2);
|
||||
}
|
||||
b = true;
|
||||
}
|
||||
Field field = a;
|
||||
if (field != null) {
|
||||
try {
|
||||
map = (Map) field.get(resources);
|
||||
} catch (IllegalAccessException e3) {
|
||||
Log.e("ResourcesFlusher", "Could not retrieve value from Resources#mDrawableCache", e3);
|
||||
map = null;
|
||||
}
|
||||
if (map != null) {
|
||||
map.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void c(Resources resources) {
|
||||
if (!b) {
|
||||
try {
|
||||
a = Resources.class.getDeclaredField("mDrawableCache");
|
||||
a.setAccessible(true);
|
||||
} catch (NoSuchFieldException e2) {
|
||||
Log.e("ResourcesFlusher", "Could not retrieve Resources#mDrawableCache field", e2);
|
||||
}
|
||||
b = true;
|
||||
}
|
||||
Object obj = null;
|
||||
Field field = a;
|
||||
if (field != null) {
|
||||
try {
|
||||
obj = field.get(resources);
|
||||
} catch (IllegalAccessException e3) {
|
||||
Log.e("ResourcesFlusher", "Could not retrieve value from Resources#mDrawableCache", e3);
|
||||
}
|
||||
}
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
a(obj);
|
||||
}
|
||||
|
||||
private static void d(Resources resources) {
|
||||
Object obj;
|
||||
if (!h) {
|
||||
try {
|
||||
g = Resources.class.getDeclaredField("mResourcesImpl");
|
||||
g.setAccessible(true);
|
||||
} catch (NoSuchFieldException e2) {
|
||||
Log.e("ResourcesFlusher", "Could not retrieve Resources#mResourcesImpl field", e2);
|
||||
}
|
||||
h = true;
|
||||
}
|
||||
Field field = g;
|
||||
if (field == null) {
|
||||
return;
|
||||
}
|
||||
Object obj2 = null;
|
||||
try {
|
||||
obj = field.get(resources);
|
||||
} catch (IllegalAccessException e3) {
|
||||
Log.e("ResourcesFlusher", "Could not retrieve value from Resources#mResourcesImpl", e3);
|
||||
obj = null;
|
||||
}
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
if (!b) {
|
||||
try {
|
||||
a = obj.getClass().getDeclaredField("mDrawableCache");
|
||||
a.setAccessible(true);
|
||||
} catch (NoSuchFieldException e4) {
|
||||
Log.e("ResourcesFlusher", "Could not retrieve ResourcesImpl#mDrawableCache field", e4);
|
||||
}
|
||||
b = true;
|
||||
}
|
||||
Field field2 = a;
|
||||
if (field2 != null) {
|
||||
try {
|
||||
obj2 = field2.get(obj);
|
||||
} catch (IllegalAccessException e5) {
|
||||
Log.e("ResourcesFlusher", "Could not retrieve value from ResourcesImpl#mDrawableCache", e5);
|
||||
}
|
||||
}
|
||||
if (obj2 != null) {
|
||||
a(obj2);
|
||||
}
|
||||
}
|
||||
|
||||
private static void a(Object obj) {
|
||||
LongSparseArray longSparseArray;
|
||||
if (!d) {
|
||||
try {
|
||||
c = Class.forName("android.content.res.ThemedResourceCache");
|
||||
} catch (ClassNotFoundException e2) {
|
||||
Log.e("ResourcesFlusher", "Could not find ThemedResourceCache class", e2);
|
||||
}
|
||||
d = true;
|
||||
}
|
||||
Class cls = c;
|
||||
if (cls == null) {
|
||||
return;
|
||||
}
|
||||
if (!f) {
|
||||
try {
|
||||
e = cls.getDeclaredField("mUnthemedEntries");
|
||||
e.setAccessible(true);
|
||||
} catch (NoSuchFieldException e3) {
|
||||
Log.e("ResourcesFlusher", "Could not retrieve ThemedResourceCache#mUnthemedEntries field", e3);
|
||||
}
|
||||
f = true;
|
||||
}
|
||||
Field field = e;
|
||||
if (field == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
longSparseArray = (LongSparseArray) field.get(obj);
|
||||
} catch (IllegalAccessException e4) {
|
||||
Log.e("ResourcesFlusher", "Could not retrieve value from ThemedResourceCache#mUnthemedEntries", e4);
|
||||
longSparseArray = null;
|
||||
}
|
||||
if (longSparseArray != null) {
|
||||
longSparseArray.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
245
sources/androidx/appcompat/app/ToolbarActionBar.java
Normal file
245
sources/androidx/appcompat/app/ToolbarActionBar.java
Normal file
@@ -0,0 +1,245 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
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 a;
|
||||
boolean b;
|
||||
Window.Callback c;
|
||||
private boolean d;
|
||||
private boolean e;
|
||||
private ArrayList<ActionBar.OnMenuVisibilityListener> f = new ArrayList<>();
|
||||
private final Runnable g = new Runnable() { // from class: androidx.appcompat.app.ToolbarActionBar.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
ToolbarActionBar.this.m();
|
||||
}
|
||||
};
|
||||
private final Toolbar.OnMenuItemClickListener h = new Toolbar.OnMenuItemClickListener() { // from class: androidx.appcompat.app.ToolbarActionBar.2
|
||||
@Override // androidx.appcompat.widget.Toolbar.OnMenuItemClickListener
|
||||
public boolean onMenuItemClick(MenuItem menuItem) {
|
||||
return ToolbarActionBar.this.c.onMenuItemSelected(0, menuItem);
|
||||
}
|
||||
};
|
||||
|
||||
private final class MenuBuilderCallback implements MenuBuilder.Callback {
|
||||
MenuBuilderCallback() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
|
||||
public void a(MenuBuilder menuBuilder) {
|
||||
ToolbarActionBar toolbarActionBar = ToolbarActionBar.this;
|
||||
if (toolbarActionBar.c != null) {
|
||||
if (toolbarActionBar.a.a()) {
|
||||
ToolbarActionBar.this.c.onPanelClosed(108, menuBuilder);
|
||||
} else if (ToolbarActionBar.this.c.onPreparePanel(0, null, menuBuilder)) {
|
||||
ToolbarActionBar.this.c.onMenuOpened(108, menuBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
|
||||
public boolean a(MenuBuilder menuBuilder, MenuItem menuItem) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private class ToolbarCallbackWrapper extends WindowCallbackWrapper {
|
||||
public ToolbarCallbackWrapper(Window.Callback callback) {
|
||||
super(callback);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.WindowCallbackWrapper, android.view.Window.Callback
|
||||
public View onCreatePanelView(int i) {
|
||||
return i == 0 ? new View(ToolbarActionBar.this.a.b()) : super.onCreatePanelView(i);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.WindowCallbackWrapper, android.view.Window.Callback
|
||||
public boolean onPreparePanel(int i, View view, Menu menu) {
|
||||
boolean onPreparePanel = super.onPreparePanel(i, view, menu);
|
||||
if (onPreparePanel) {
|
||||
ToolbarActionBar toolbarActionBar = ToolbarActionBar.this;
|
||||
if (!toolbarActionBar.b) {
|
||||
toolbarActionBar.a.c();
|
||||
ToolbarActionBar.this.b = true;
|
||||
}
|
||||
}
|
||||
return onPreparePanel;
|
||||
}
|
||||
}
|
||||
|
||||
ToolbarActionBar(Toolbar toolbar, CharSequence charSequence, Window.Callback callback) {
|
||||
this.a = new ToolbarWidgetWrapper(toolbar, false);
|
||||
this.c = new ToolbarCallbackWrapper(callback);
|
||||
this.a.setWindowCallback(this.c);
|
||||
toolbar.setOnMenuItemClickListener(this.h);
|
||||
this.a.setWindowTitle(charSequence);
|
||||
}
|
||||
|
||||
private Menu n() {
|
||||
if (!this.d) {
|
||||
this.a.a(new ActionMenuPresenterCallback(), new MenuBuilderCallback());
|
||||
this.d = true;
|
||||
}
|
||||
return this.a.j();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void a(Configuration configuration) {
|
||||
super.a(configuration);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void b(boolean z) {
|
||||
if (z == this.e) {
|
||||
return;
|
||||
}
|
||||
this.e = z;
|
||||
int size = this.f.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.f.get(i).a(z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void c(boolean z) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void d(boolean z) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean e() {
|
||||
return this.a.f();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean f() {
|
||||
if (!this.a.i()) {
|
||||
return false;
|
||||
}
|
||||
this.a.collapseActionView();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public int g() {
|
||||
return this.a.m();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public Context h() {
|
||||
return this.a.b();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean i() {
|
||||
this.a.l().removeCallbacks(this.g);
|
||||
ViewCompat.a(this.a.l(), this.g);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
void j() {
|
||||
this.a.l().removeCallbacks(this.g);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean k() {
|
||||
return this.a.g();
|
||||
}
|
||||
|
||||
public Window.Callback l() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
void m() {
|
||||
Menu n = n();
|
||||
MenuBuilder menuBuilder = n instanceof MenuBuilder ? (MenuBuilder) n : null;
|
||||
if (menuBuilder != null) {
|
||||
menuBuilder.s();
|
||||
}
|
||||
try {
|
||||
n.clear();
|
||||
if (!this.c.onCreatePanelMenu(0, n) || !this.c.onPreparePanel(0, null, n)) {
|
||||
n.clear();
|
||||
}
|
||||
} finally {
|
||||
if (menuBuilder != null) {
|
||||
menuBuilder.r();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final class ActionMenuPresenterCallback implements MenuPresenter.Callback {
|
||||
private boolean a;
|
||||
|
||||
ActionMenuPresenterCallback() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
|
||||
public boolean a(MenuBuilder menuBuilder) {
|
||||
Window.Callback callback = ToolbarActionBar.this.c;
|
||||
if (callback == null) {
|
||||
return false;
|
||||
}
|
||||
callback.onMenuOpened(108, menuBuilder);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
|
||||
public void a(MenuBuilder menuBuilder, boolean z) {
|
||||
if (this.a) {
|
||||
return;
|
||||
}
|
||||
this.a = true;
|
||||
ToolbarActionBar.this.a.h();
|
||||
Window.Callback callback = ToolbarActionBar.this.c;
|
||||
if (callback != null) {
|
||||
callback.onPanelClosed(108, menuBuilder);
|
||||
}
|
||||
this.a = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void a(CharSequence charSequence) {
|
||||
this.a.setWindowTitle(charSequence);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean a(KeyEvent keyEvent) {
|
||||
if (keyEvent.getAction() == 1) {
|
||||
k();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean a(int i, KeyEvent keyEvent) {
|
||||
Menu n = n();
|
||||
if (n == null) {
|
||||
return false;
|
||||
}
|
||||
n.setQwertyMode(KeyCharacterMap.load(keyEvent != null ? keyEvent.getDeviceId() : -1).getKeyboardType() != 1);
|
||||
return n.performShortcut(i, keyEvent, 0);
|
||||
}
|
||||
}
|
||||
48
sources/androidx/appcompat/app/TwilightCalculator.java
Normal file
48
sources/androidx/appcompat/app/TwilightCalculator.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class TwilightCalculator {
|
||||
private static TwilightCalculator d;
|
||||
public long a;
|
||||
public long b;
|
||||
public int c;
|
||||
|
||||
TwilightCalculator() {
|
||||
}
|
||||
|
||||
static TwilightCalculator a() {
|
||||
if (d == null) {
|
||||
d = new TwilightCalculator();
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
public void a(long j, double d2, double d3) {
|
||||
double d4 = (0.01720197f * ((j - 946728000000L) / 8.64E7f)) + 6.24006f;
|
||||
double sin = (Math.sin(d4) * 0.03341960161924362d) + d4 + (Math.sin(2.0f * r4) * 3.4906598739326E-4d) + (Math.sin(r4 * 3.0f) * 5.236000106378924E-6d) + 1.796593063d + 3.141592653589793d;
|
||||
double round = Math.round((r3 - 9.0E-4f) - r9) + 9.0E-4f + ((-d3) / 360.0d) + (Math.sin(d4) * 0.0053d) + (Math.sin(2.0d * sin) * (-0.0069d));
|
||||
double asin = Math.asin(Math.sin(sin) * Math.sin(0.4092797040939331d));
|
||||
double d5 = 0.01745329238474369d * d2;
|
||||
double sin2 = (Math.sin(-0.10471975803375244d) - (Math.sin(d5) * Math.sin(asin))) / (Math.cos(d5) * Math.cos(asin));
|
||||
if (sin2 >= 1.0d) {
|
||||
this.c = 1;
|
||||
this.a = -1L;
|
||||
this.b = -1L;
|
||||
} else {
|
||||
if (sin2 <= -1.0d) {
|
||||
this.c = 0;
|
||||
this.a = -1L;
|
||||
this.b = -1L;
|
||||
return;
|
||||
}
|
||||
double acos = (float) (Math.acos(sin2) / 6.283185307179586d);
|
||||
this.a = Math.round((round + acos) * 8.64E7d) + 946728000000L;
|
||||
this.b = Math.round((round - acos) * 8.64E7d) + 946728000000L;
|
||||
if (this.b < j && this.a > j) {
|
||||
this.c = 0;
|
||||
} else {
|
||||
this.c = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
107
sources/androidx/appcompat/app/TwilightManager.java
Normal file
107
sources/androidx/appcompat/app/TwilightManager.java
Normal file
@@ -0,0 +1,107 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
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 TwilightManager d;
|
||||
private final Context a;
|
||||
private final LocationManager b;
|
||||
private final TwilightState c = new TwilightState();
|
||||
|
||||
private static class TwilightState {
|
||||
boolean a;
|
||||
long b;
|
||||
long c;
|
||||
long d;
|
||||
long e;
|
||||
long f;
|
||||
|
||||
TwilightState() {
|
||||
}
|
||||
}
|
||||
|
||||
TwilightManager(Context context, LocationManager locationManager) {
|
||||
this.a = context;
|
||||
this.b = locationManager;
|
||||
}
|
||||
|
||||
static TwilightManager a(Context context) {
|
||||
if (d == null) {
|
||||
Context applicationContext = context.getApplicationContext();
|
||||
d = new TwilightManager(applicationContext, (LocationManager) applicationContext.getSystemService("location"));
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
@SuppressLint({"MissingPermission"})
|
||||
private Location b() {
|
||||
Location a = PermissionChecker.a(this.a, "android.permission.ACCESS_COARSE_LOCATION") == 0 ? a("network") : null;
|
||||
Location a2 = PermissionChecker.a(this.a, "android.permission.ACCESS_FINE_LOCATION") == 0 ? a("gps") : null;
|
||||
return (a2 == null || a == null) ? a2 != null ? a2 : a : a2.getTime() > a.getTime() ? a2 : a;
|
||||
}
|
||||
|
||||
private boolean c() {
|
||||
return this.c.f > System.currentTimeMillis();
|
||||
}
|
||||
|
||||
boolean a() {
|
||||
TwilightState twilightState = this.c;
|
||||
if (c()) {
|
||||
return twilightState.a;
|
||||
}
|
||||
Location b = b();
|
||||
if (b != null) {
|
||||
a(b);
|
||||
return twilightState.a;
|
||||
}
|
||||
Log.i("TwilightManager", "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.");
|
||||
int i = Calendar.getInstance().get(11);
|
||||
return i < 6 || i >= 22;
|
||||
}
|
||||
|
||||
private Location a(String str) {
|
||||
try {
|
||||
if (this.b.isProviderEnabled(str)) {
|
||||
return this.b.getLastKnownLocation(str);
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
Log.d("TwilightManager", "Failed to get last known location", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void a(Location location) {
|
||||
long j;
|
||||
TwilightState twilightState = this.c;
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
TwilightCalculator a = TwilightCalculator.a();
|
||||
a.a(currentTimeMillis - 86400000, location.getLatitude(), location.getLongitude());
|
||||
long j2 = a.a;
|
||||
a.a(currentTimeMillis, location.getLatitude(), location.getLongitude());
|
||||
boolean z = a.c == 1;
|
||||
long j3 = a.b;
|
||||
long j4 = a.a;
|
||||
boolean z2 = z;
|
||||
a.a(86400000 + currentTimeMillis, location.getLatitude(), location.getLongitude());
|
||||
long j5 = a.b;
|
||||
if (j3 == -1 || j4 == -1) {
|
||||
j = 43200000 + currentTimeMillis;
|
||||
} else {
|
||||
j = (currentTimeMillis > j4 ? 0 + j5 : currentTimeMillis > j3 ? 0 + j4 : 0 + j3) + 60000;
|
||||
}
|
||||
twilightState.a = z2;
|
||||
twilightState.b = j2;
|
||||
twilightState.c = j3;
|
||||
twilightState.d = j4;
|
||||
twilightState.e = j5;
|
||||
twilightState.f = j;
|
||||
}
|
||||
}
|
||||
723
sources/androidx/appcompat/app/WindowDecorActionBar.java
Normal file
723
sources/androidx/appcompat/app/WindowDecorActionBar.java
Normal file
@@ -0,0 +1,723 @@
|
||||
package androidx.appcompat.app;
|
||||
|
||||
import android.R;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.TypedValue;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.Interpolator;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.R$id;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.view.ActionBarPolicy;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.appcompat.view.SupportMenuInflater;
|
||||
import androidx.appcompat.view.ViewPropertyAnimatorCompatSet;
|
||||
import androidx.appcompat.view.menu.MenuBuilder;
|
||||
import androidx.appcompat.widget.ActionBarContainer;
|
||||
import androidx.appcompat.widget.ActionBarContextView;
|
||||
import androidx.appcompat.widget.ActionBarOverlayLayout;
|
||||
import androidx.appcompat.widget.DecorToolbar;
|
||||
import androidx.appcompat.widget.ScrollingTabContainerView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.ViewPropertyAnimatorCompat;
|
||||
import androidx.core.view.ViewPropertyAnimatorListener;
|
||||
import androidx.core.view.ViewPropertyAnimatorListenerAdapter;
|
||||
import androidx.core.view.ViewPropertyAnimatorUpdateListener;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WindowDecorActionBar extends ActionBar implements ActionBarOverlayLayout.ActionBarVisibilityCallback {
|
||||
private static final Interpolator B = new AccelerateInterpolator();
|
||||
private static final Interpolator C = new DecelerateInterpolator();
|
||||
final ViewPropertyAnimatorUpdateListener A;
|
||||
Context a;
|
||||
private Context b;
|
||||
ActionBarOverlayLayout c;
|
||||
ActionBarContainer d;
|
||||
DecorToolbar e;
|
||||
ActionBarContextView f;
|
||||
View g;
|
||||
ScrollingTabContainerView h;
|
||||
private boolean i;
|
||||
ActionModeImpl j;
|
||||
ActionMode k;
|
||||
ActionMode.Callback l;
|
||||
private boolean m;
|
||||
private ArrayList<ActionBar.OnMenuVisibilityListener> n;
|
||||
private boolean o;
|
||||
private int p;
|
||||
boolean q;
|
||||
boolean r;
|
||||
boolean s;
|
||||
private boolean t;
|
||||
private boolean u;
|
||||
ViewPropertyAnimatorCompatSet v;
|
||||
private boolean w;
|
||||
boolean x;
|
||||
final ViewPropertyAnimatorListener y;
|
||||
final ViewPropertyAnimatorListener z;
|
||||
|
||||
public class ActionModeImpl extends ActionMode implements MenuBuilder.Callback {
|
||||
private final Context c;
|
||||
private final MenuBuilder d;
|
||||
private ActionMode.Callback e;
|
||||
private WeakReference<View> f;
|
||||
|
||||
public ActionModeImpl(Context context, ActionMode.Callback callback) {
|
||||
this.c = context;
|
||||
this.e = callback;
|
||||
MenuBuilder menuBuilder = new MenuBuilder(context);
|
||||
menuBuilder.c(1);
|
||||
this.d = menuBuilder;
|
||||
this.d.a(this);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void a() {
|
||||
WindowDecorActionBar windowDecorActionBar = WindowDecorActionBar.this;
|
||||
if (windowDecorActionBar.j != this) {
|
||||
return;
|
||||
}
|
||||
if (WindowDecorActionBar.a(windowDecorActionBar.r, windowDecorActionBar.s, false)) {
|
||||
this.e.a(this);
|
||||
} else {
|
||||
WindowDecorActionBar windowDecorActionBar2 = WindowDecorActionBar.this;
|
||||
windowDecorActionBar2.k = this;
|
||||
windowDecorActionBar2.l = this.e;
|
||||
}
|
||||
this.e = null;
|
||||
WindowDecorActionBar.this.e(false);
|
||||
WindowDecorActionBar.this.f.a();
|
||||
WindowDecorActionBar.this.e.l().sendAccessibilityEvent(32);
|
||||
WindowDecorActionBar windowDecorActionBar3 = WindowDecorActionBar.this;
|
||||
windowDecorActionBar3.c.setHideOnContentScrollEnabled(windowDecorActionBar3.x);
|
||||
WindowDecorActionBar.this.j = null;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void b(CharSequence charSequence) {
|
||||
WindowDecorActionBar.this.f.setTitle(charSequence);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public Menu c() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public MenuInflater d() {
|
||||
return new SupportMenuInflater(this.c);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public CharSequence e() {
|
||||
return WindowDecorActionBar.this.f.getSubtitle();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public CharSequence g() {
|
||||
return WindowDecorActionBar.this.f.getTitle();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void i() {
|
||||
if (WindowDecorActionBar.this.j != this) {
|
||||
return;
|
||||
}
|
||||
this.d.s();
|
||||
try {
|
||||
this.e.b(this, this.d);
|
||||
} finally {
|
||||
this.d.r();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public boolean j() {
|
||||
return WindowDecorActionBar.this.f.b();
|
||||
}
|
||||
|
||||
public boolean k() {
|
||||
this.d.s();
|
||||
try {
|
||||
return this.e.a(this, this.d);
|
||||
} finally {
|
||||
this.d.r();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void b(int i) {
|
||||
b(WindowDecorActionBar.this.a.getResources().getString(i));
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public View b() {
|
||||
WeakReference<View> weakReference = this.f;
|
||||
if (weakReference != null) {
|
||||
return weakReference.get();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void a(View view) {
|
||||
WindowDecorActionBar.this.f.setCustomView(view);
|
||||
this.f = new WeakReference<>(view);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void a(CharSequence charSequence) {
|
||||
WindowDecorActionBar.this.f.setSubtitle(charSequence);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void a(int i) {
|
||||
a((CharSequence) WindowDecorActionBar.this.a.getResources().getString(i));
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void a(boolean z) {
|
||||
super.a(z);
|
||||
WindowDecorActionBar.this.f.setTitleOptional(z);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
|
||||
public boolean a(MenuBuilder menuBuilder, MenuItem menuItem) {
|
||||
ActionMode.Callback callback = this.e;
|
||||
if (callback != null) {
|
||||
return callback.a(this, menuItem);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
|
||||
public void a(MenuBuilder menuBuilder) {
|
||||
if (this.e == null) {
|
||||
return;
|
||||
}
|
||||
i();
|
||||
WindowDecorActionBar.this.f.d();
|
||||
}
|
||||
}
|
||||
|
||||
public WindowDecorActionBar(Activity activity, boolean z) {
|
||||
new ArrayList();
|
||||
this.n = new ArrayList<>();
|
||||
this.p = 0;
|
||||
this.q = true;
|
||||
this.u = true;
|
||||
this.y = new ViewPropertyAnimatorListenerAdapter() { // from class: androidx.appcompat.app.WindowDecorActionBar.1
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void b(View view) {
|
||||
View view2;
|
||||
WindowDecorActionBar windowDecorActionBar = WindowDecorActionBar.this;
|
||||
if (windowDecorActionBar.q && (view2 = windowDecorActionBar.g) != null) {
|
||||
view2.setTranslationY(0.0f);
|
||||
WindowDecorActionBar.this.d.setTranslationY(0.0f);
|
||||
}
|
||||
WindowDecorActionBar.this.d.setVisibility(8);
|
||||
WindowDecorActionBar.this.d.setTransitioning(false);
|
||||
WindowDecorActionBar windowDecorActionBar2 = WindowDecorActionBar.this;
|
||||
windowDecorActionBar2.v = null;
|
||||
windowDecorActionBar2.l();
|
||||
ActionBarOverlayLayout actionBarOverlayLayout = WindowDecorActionBar.this.c;
|
||||
if (actionBarOverlayLayout != null) {
|
||||
ViewCompat.B(actionBarOverlayLayout);
|
||||
}
|
||||
}
|
||||
};
|
||||
this.z = new ViewPropertyAnimatorListenerAdapter() { // from class: androidx.appcompat.app.WindowDecorActionBar.2
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void b(View view) {
|
||||
WindowDecorActionBar windowDecorActionBar = WindowDecorActionBar.this;
|
||||
windowDecorActionBar.v = null;
|
||||
windowDecorActionBar.d.requestLayout();
|
||||
}
|
||||
};
|
||||
this.A = new ViewPropertyAnimatorUpdateListener() { // from class: androidx.appcompat.app.WindowDecorActionBar.3
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorUpdateListener
|
||||
public void a(View view) {
|
||||
((View) WindowDecorActionBar.this.d.getParent()).invalidate();
|
||||
}
|
||||
};
|
||||
View decorView = activity.getWindow().getDecorView();
|
||||
b(decorView);
|
||||
if (z) {
|
||||
return;
|
||||
}
|
||||
this.g = decorView.findViewById(R.id.content);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private DecorToolbar a(View view) {
|
||||
if (view instanceof DecorToolbar) {
|
||||
return (DecorToolbar) view;
|
||||
}
|
||||
if (view instanceof Toolbar) {
|
||||
return ((Toolbar) view).getWrapper();
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Can't make a decor toolbar out of ");
|
||||
sb.append(view != 0 ? view.getClass().getSimpleName() : "null");
|
||||
throw new IllegalStateException(sb.toString());
|
||||
}
|
||||
|
||||
static boolean a(boolean z, boolean z2, boolean z3) {
|
||||
if (z3) {
|
||||
return true;
|
||||
}
|
||||
return (z || z2) ? false : true;
|
||||
}
|
||||
|
||||
private void b(View view) {
|
||||
this.c = (ActionBarOverlayLayout) view.findViewById(R$id.decor_content_parent);
|
||||
ActionBarOverlayLayout actionBarOverlayLayout = this.c;
|
||||
if (actionBarOverlayLayout != null) {
|
||||
actionBarOverlayLayout.setActionBarVisibilityCallback(this);
|
||||
}
|
||||
this.e = a(view.findViewById(R$id.action_bar));
|
||||
this.f = (ActionBarContextView) view.findViewById(R$id.action_context_bar);
|
||||
this.d = (ActionBarContainer) view.findViewById(R$id.action_bar_container);
|
||||
DecorToolbar decorToolbar = this.e;
|
||||
if (decorToolbar == null || this.f == null || this.d == null) {
|
||||
throw new IllegalStateException(WindowDecorActionBar.class.getSimpleName() + " can only be used with a compatible window decor layout");
|
||||
}
|
||||
this.a = decorToolbar.b();
|
||||
boolean z = (this.e.m() & 4) != 0;
|
||||
if (z) {
|
||||
this.i = true;
|
||||
}
|
||||
ActionBarPolicy a = ActionBarPolicy.a(this.a);
|
||||
j(a.a() || z);
|
||||
k(a.f());
|
||||
TypedArray obtainStyledAttributes = this.a.obtainStyledAttributes(null, R$styleable.ActionBar, R$attr.actionBarStyle, 0);
|
||||
if (obtainStyledAttributes.getBoolean(R$styleable.ActionBar_hideOnContentScroll, false)) {
|
||||
i(true);
|
||||
}
|
||||
int dimensionPixelSize = obtainStyledAttributes.getDimensionPixelSize(R$styleable.ActionBar_elevation, 0);
|
||||
if (dimensionPixelSize != 0) {
|
||||
a(dimensionPixelSize);
|
||||
}
|
||||
obtainStyledAttributes.recycle();
|
||||
}
|
||||
|
||||
private void k(boolean z) {
|
||||
this.o = z;
|
||||
if (this.o) {
|
||||
this.d.setTabContainer(null);
|
||||
this.e.a(this.h);
|
||||
} else {
|
||||
this.e.a((ScrollingTabContainerView) null);
|
||||
this.d.setTabContainer(this.h);
|
||||
}
|
||||
boolean z2 = m() == 2;
|
||||
ScrollingTabContainerView scrollingTabContainerView = this.h;
|
||||
if (scrollingTabContainerView != null) {
|
||||
if (z2) {
|
||||
scrollingTabContainerView.setVisibility(0);
|
||||
ActionBarOverlayLayout actionBarOverlayLayout = this.c;
|
||||
if (actionBarOverlayLayout != null) {
|
||||
ViewCompat.B(actionBarOverlayLayout);
|
||||
}
|
||||
} else {
|
||||
scrollingTabContainerView.setVisibility(8);
|
||||
}
|
||||
}
|
||||
this.e.b(!this.o && z2);
|
||||
this.c.setHasNonEmbeddedTabs(!this.o && z2);
|
||||
}
|
||||
|
||||
private void n() {
|
||||
if (this.t) {
|
||||
this.t = false;
|
||||
ActionBarOverlayLayout actionBarOverlayLayout = this.c;
|
||||
if (actionBarOverlayLayout != null) {
|
||||
actionBarOverlayLayout.setShowingForActionMode(false);
|
||||
}
|
||||
l(false);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean o() {
|
||||
return ViewCompat.x(this.d);
|
||||
}
|
||||
|
||||
private void p() {
|
||||
if (this.t) {
|
||||
return;
|
||||
}
|
||||
this.t = true;
|
||||
ActionBarOverlayLayout actionBarOverlayLayout = this.c;
|
||||
if (actionBarOverlayLayout != null) {
|
||||
actionBarOverlayLayout.setShowingForActionMode(true);
|
||||
}
|
||||
l(false);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ActionBarOverlayLayout.ActionBarVisibilityCallback
|
||||
public void b() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ActionBarOverlayLayout.ActionBarVisibilityCallback
|
||||
public void c() {
|
||||
if (this.s) {
|
||||
return;
|
||||
}
|
||||
this.s = true;
|
||||
l(true);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void d(boolean z) {
|
||||
ViewPropertyAnimatorCompatSet viewPropertyAnimatorCompatSet;
|
||||
this.w = z;
|
||||
if (z || (viewPropertyAnimatorCompatSet = this.v) == null) {
|
||||
return;
|
||||
}
|
||||
viewPropertyAnimatorCompatSet.a();
|
||||
}
|
||||
|
||||
public void e(boolean z) {
|
||||
ViewPropertyAnimatorCompat a;
|
||||
ViewPropertyAnimatorCompat a2;
|
||||
if (z) {
|
||||
p();
|
||||
} else {
|
||||
n();
|
||||
}
|
||||
if (!o()) {
|
||||
if (z) {
|
||||
this.e.c(4);
|
||||
this.f.setVisibility(0);
|
||||
return;
|
||||
} else {
|
||||
this.e.c(0);
|
||||
this.f.setVisibility(8);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (z) {
|
||||
a2 = this.e.a(4, 100L);
|
||||
a = this.f.a(0, 200L);
|
||||
} else {
|
||||
a = this.e.a(0, 200L);
|
||||
a2 = this.f.a(8, 100L);
|
||||
}
|
||||
ViewPropertyAnimatorCompatSet viewPropertyAnimatorCompatSet = new ViewPropertyAnimatorCompatSet();
|
||||
viewPropertyAnimatorCompatSet.a(a2, a);
|
||||
viewPropertyAnimatorCompatSet.c();
|
||||
}
|
||||
|
||||
public void f(boolean z) {
|
||||
View view;
|
||||
ViewPropertyAnimatorCompatSet viewPropertyAnimatorCompatSet = this.v;
|
||||
if (viewPropertyAnimatorCompatSet != null) {
|
||||
viewPropertyAnimatorCompatSet.a();
|
||||
}
|
||||
if (this.p != 0 || (!this.w && !z)) {
|
||||
this.y.b(null);
|
||||
return;
|
||||
}
|
||||
this.d.setAlpha(1.0f);
|
||||
this.d.setTransitioning(true);
|
||||
ViewPropertyAnimatorCompatSet viewPropertyAnimatorCompatSet2 = new ViewPropertyAnimatorCompatSet();
|
||||
float f = -this.d.getHeight();
|
||||
if (z) {
|
||||
this.d.getLocationInWindow(new int[]{0, 0});
|
||||
f -= r5[1];
|
||||
}
|
||||
ViewPropertyAnimatorCompat a = ViewCompat.a(this.d);
|
||||
a.b(f);
|
||||
a.a(this.A);
|
||||
viewPropertyAnimatorCompatSet2.a(a);
|
||||
if (this.q && (view = this.g) != null) {
|
||||
ViewPropertyAnimatorCompat a2 = ViewCompat.a(view);
|
||||
a2.b(f);
|
||||
viewPropertyAnimatorCompatSet2.a(a2);
|
||||
}
|
||||
viewPropertyAnimatorCompatSet2.a(B);
|
||||
viewPropertyAnimatorCompatSet2.a(250L);
|
||||
viewPropertyAnimatorCompatSet2.a(this.y);
|
||||
this.v = viewPropertyAnimatorCompatSet2;
|
||||
viewPropertyAnimatorCompatSet2.c();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public int g() {
|
||||
return this.e.m();
|
||||
}
|
||||
|
||||
public void h(boolean z) {
|
||||
a(z ? 4 : 0, 4);
|
||||
}
|
||||
|
||||
public void i(boolean z) {
|
||||
if (z && !this.c.i()) {
|
||||
throw new IllegalStateException("Action bar must be in overlay mode (Window.FEATURE_OVERLAY_ACTION_BAR) to enable hide on content scroll");
|
||||
}
|
||||
this.x = z;
|
||||
this.c.setHideOnContentScrollEnabled(z);
|
||||
}
|
||||
|
||||
public void j(boolean z) {
|
||||
this.e.a(z);
|
||||
}
|
||||
|
||||
void l() {
|
||||
ActionMode.Callback callback = this.l;
|
||||
if (callback != null) {
|
||||
callback.a(this.k);
|
||||
this.k = null;
|
||||
this.l = null;
|
||||
}
|
||||
}
|
||||
|
||||
public int m() {
|
||||
return this.e.k();
|
||||
}
|
||||
|
||||
public void g(boolean z) {
|
||||
View view;
|
||||
View view2;
|
||||
ViewPropertyAnimatorCompatSet viewPropertyAnimatorCompatSet = this.v;
|
||||
if (viewPropertyAnimatorCompatSet != null) {
|
||||
viewPropertyAnimatorCompatSet.a();
|
||||
}
|
||||
this.d.setVisibility(0);
|
||||
if (this.p == 0 && (this.w || z)) {
|
||||
this.d.setTranslationY(0.0f);
|
||||
float f = -this.d.getHeight();
|
||||
if (z) {
|
||||
this.d.getLocationInWindow(new int[]{0, 0});
|
||||
f -= r5[1];
|
||||
}
|
||||
this.d.setTranslationY(f);
|
||||
ViewPropertyAnimatorCompatSet viewPropertyAnimatorCompatSet2 = new ViewPropertyAnimatorCompatSet();
|
||||
ViewPropertyAnimatorCompat a = ViewCompat.a(this.d);
|
||||
a.b(0.0f);
|
||||
a.a(this.A);
|
||||
viewPropertyAnimatorCompatSet2.a(a);
|
||||
if (this.q && (view2 = this.g) != null) {
|
||||
view2.setTranslationY(f);
|
||||
ViewPropertyAnimatorCompat a2 = ViewCompat.a(this.g);
|
||||
a2.b(0.0f);
|
||||
viewPropertyAnimatorCompatSet2.a(a2);
|
||||
}
|
||||
viewPropertyAnimatorCompatSet2.a(C);
|
||||
viewPropertyAnimatorCompatSet2.a(250L);
|
||||
viewPropertyAnimatorCompatSet2.a(this.z);
|
||||
this.v = viewPropertyAnimatorCompatSet2;
|
||||
viewPropertyAnimatorCompatSet2.c();
|
||||
} else {
|
||||
this.d.setAlpha(1.0f);
|
||||
this.d.setTranslationY(0.0f);
|
||||
if (this.q && (view = this.g) != null) {
|
||||
view.setTranslationY(0.0f);
|
||||
}
|
||||
this.z.b(null);
|
||||
}
|
||||
ActionBarOverlayLayout actionBarOverlayLayout = this.c;
|
||||
if (actionBarOverlayLayout != null) {
|
||||
ViewCompat.B(actionBarOverlayLayout);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public Context h() {
|
||||
if (this.b == null) {
|
||||
TypedValue typedValue = new TypedValue();
|
||||
this.a.getTheme().resolveAttribute(R$attr.actionBarWidgetTheme, typedValue, true);
|
||||
int i = typedValue.resourceId;
|
||||
if (i != 0) {
|
||||
this.b = new ContextThemeWrapper(this.a, i);
|
||||
} else {
|
||||
this.b = this.a;
|
||||
}
|
||||
}
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void c(boolean z) {
|
||||
if (this.i) {
|
||||
return;
|
||||
}
|
||||
h(z);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ActionBarOverlayLayout.ActionBarVisibilityCallback
|
||||
public void d() {
|
||||
ViewPropertyAnimatorCompatSet viewPropertyAnimatorCompatSet = this.v;
|
||||
if (viewPropertyAnimatorCompatSet != null) {
|
||||
viewPropertyAnimatorCompatSet.a();
|
||||
this.v = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void l(boolean z) {
|
||||
if (a(this.r, this.s, this.t)) {
|
||||
if (this.u) {
|
||||
return;
|
||||
}
|
||||
this.u = true;
|
||||
g(z);
|
||||
return;
|
||||
}
|
||||
if (this.u) {
|
||||
this.u = false;
|
||||
f(z);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(float f) {
|
||||
ViewCompat.b(this.d, f);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void a(Configuration configuration) {
|
||||
k(ActionBarPolicy.a(this.a).f());
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ActionBarOverlayLayout.ActionBarVisibilityCallback
|
||||
public void a(int i) {
|
||||
this.p = i;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void a(CharSequence charSequence) {
|
||||
this.e.setWindowTitle(charSequence);
|
||||
}
|
||||
|
||||
public void a(int i, int i2) {
|
||||
int m = this.e.m();
|
||||
if ((i2 & 4) != 0) {
|
||||
this.i = true;
|
||||
}
|
||||
this.e.a((i & i2) | ((~i2) & m));
|
||||
}
|
||||
|
||||
public WindowDecorActionBar(Dialog dialog) {
|
||||
new ArrayList();
|
||||
this.n = new ArrayList<>();
|
||||
this.p = 0;
|
||||
this.q = true;
|
||||
this.u = true;
|
||||
this.y = new ViewPropertyAnimatorListenerAdapter() { // from class: androidx.appcompat.app.WindowDecorActionBar.1
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void b(View view) {
|
||||
View view2;
|
||||
WindowDecorActionBar windowDecorActionBar = WindowDecorActionBar.this;
|
||||
if (windowDecorActionBar.q && (view2 = windowDecorActionBar.g) != null) {
|
||||
view2.setTranslationY(0.0f);
|
||||
WindowDecorActionBar.this.d.setTranslationY(0.0f);
|
||||
}
|
||||
WindowDecorActionBar.this.d.setVisibility(8);
|
||||
WindowDecorActionBar.this.d.setTransitioning(false);
|
||||
WindowDecorActionBar windowDecorActionBar2 = WindowDecorActionBar.this;
|
||||
windowDecorActionBar2.v = null;
|
||||
windowDecorActionBar2.l();
|
||||
ActionBarOverlayLayout actionBarOverlayLayout = WindowDecorActionBar.this.c;
|
||||
if (actionBarOverlayLayout != null) {
|
||||
ViewCompat.B(actionBarOverlayLayout);
|
||||
}
|
||||
}
|
||||
};
|
||||
this.z = new ViewPropertyAnimatorListenerAdapter() { // from class: androidx.appcompat.app.WindowDecorActionBar.2
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void b(View view) {
|
||||
WindowDecorActionBar windowDecorActionBar = WindowDecorActionBar.this;
|
||||
windowDecorActionBar.v = null;
|
||||
windowDecorActionBar.d.requestLayout();
|
||||
}
|
||||
};
|
||||
this.A = new ViewPropertyAnimatorUpdateListener() { // from class: androidx.appcompat.app.WindowDecorActionBar.3
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorUpdateListener
|
||||
public void a(View view) {
|
||||
((View) WindowDecorActionBar.this.d.getParent()).invalidate();
|
||||
}
|
||||
};
|
||||
b(dialog.getWindow().getDecorView());
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public ActionMode a(ActionMode.Callback callback) {
|
||||
ActionModeImpl actionModeImpl = this.j;
|
||||
if (actionModeImpl != null) {
|
||||
actionModeImpl.a();
|
||||
}
|
||||
this.c.setHideOnContentScrollEnabled(false);
|
||||
this.f.c();
|
||||
ActionModeImpl actionModeImpl2 = new ActionModeImpl(this.f.getContext(), callback);
|
||||
if (!actionModeImpl2.k()) {
|
||||
return null;
|
||||
}
|
||||
this.j = actionModeImpl2;
|
||||
actionModeImpl2.i();
|
||||
this.f.a(actionModeImpl2);
|
||||
e(true);
|
||||
this.f.sendAccessibilityEvent(32);
|
||||
return actionModeImpl2;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public void b(boolean z) {
|
||||
if (z == this.m) {
|
||||
return;
|
||||
}
|
||||
this.m = z;
|
||||
int size = this.n.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.n.get(i).a(z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean f() {
|
||||
DecorToolbar decorToolbar = this.e;
|
||||
if (decorToolbar == null || !decorToolbar.i()) {
|
||||
return false;
|
||||
}
|
||||
this.e.collapseActionView();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ActionBarOverlayLayout.ActionBarVisibilityCallback
|
||||
public void a(boolean z) {
|
||||
this.q = z;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ActionBarOverlayLayout.ActionBarVisibilityCallback
|
||||
public void a() {
|
||||
if (this.s) {
|
||||
this.s = false;
|
||||
l(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.ActionBar
|
||||
public boolean a(int i, KeyEvent keyEvent) {
|
||||
Menu c;
|
||||
ActionModeImpl actionModeImpl = this.j;
|
||||
if (actionModeImpl == null || (c = actionModeImpl.c()) == null) {
|
||||
return false;
|
||||
}
|
||||
c.setQwertyMode(KeyCharacterMap.load(keyEvent != null ? keyEvent.getDeviceId() : -1).getKeyboardType() != 1);
|
||||
return c.performShortcut(i, keyEvent, 0);
|
||||
}
|
||||
}
|
||||
108
sources/androidx/appcompat/content/res/AppCompatResources.java
Normal file
108
sources/androidx/appcompat/content/res/AppCompatResources.java
Normal file
@@ -0,0 +1,108 @@
|
||||
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.AppCompatDrawableManager;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ColorStateListInflaterCompat;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AppCompatResources {
|
||||
private static final ThreadLocal<TypedValue> a = new ThreadLocal<>();
|
||||
private static final WeakHashMap<Context, SparseArray<ColorStateListCacheEntry>> b = new WeakHashMap<>(0);
|
||||
private static final Object c = new Object();
|
||||
|
||||
private static class ColorStateListCacheEntry {
|
||||
final ColorStateList a;
|
||||
final Configuration b;
|
||||
|
||||
ColorStateListCacheEntry(ColorStateList colorStateList, Configuration configuration) {
|
||||
this.a = colorStateList;
|
||||
this.b = configuration;
|
||||
}
|
||||
}
|
||||
|
||||
private static ColorStateList a(Context context, int i) {
|
||||
ColorStateListCacheEntry colorStateListCacheEntry;
|
||||
synchronized (c) {
|
||||
SparseArray<ColorStateListCacheEntry> sparseArray = b.get(context);
|
||||
if (sparseArray != null && sparseArray.size() > 0 && (colorStateListCacheEntry = sparseArray.get(i)) != null) {
|
||||
if (colorStateListCacheEntry.b.equals(context.getResources().getConfiguration())) {
|
||||
return colorStateListCacheEntry.a;
|
||||
}
|
||||
sparseArray.remove(i);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static ColorStateList b(Context context, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return context.getColorStateList(i);
|
||||
}
|
||||
ColorStateList a2 = a(context, i);
|
||||
if (a2 != null) {
|
||||
return a2;
|
||||
}
|
||||
ColorStateList d = d(context, i);
|
||||
if (d == null) {
|
||||
return ContextCompat.b(context, i);
|
||||
}
|
||||
a(context, i, d);
|
||||
return d;
|
||||
}
|
||||
|
||||
public static Drawable c(Context context, int i) {
|
||||
return AppCompatDrawableManager.a().a(context, i);
|
||||
}
|
||||
|
||||
private static ColorStateList d(Context context, int i) {
|
||||
if (e(context, i)) {
|
||||
return null;
|
||||
}
|
||||
Resources resources = context.getResources();
|
||||
try {
|
||||
return ColorStateListInflaterCompat.a(resources, resources.getXml(i), context.getTheme());
|
||||
} catch (Exception e) {
|
||||
Log.e("AppCompatResources", "Failed to inflate ColorStateList, leaving it to the framework", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean e(Context context, int i) {
|
||||
Resources resources = context.getResources();
|
||||
TypedValue a2 = a();
|
||||
resources.getValue(i, a2, true);
|
||||
int i2 = a2.type;
|
||||
return i2 >= 28 && i2 <= 31;
|
||||
}
|
||||
|
||||
private static void a(Context context, int i, ColorStateList colorStateList) {
|
||||
synchronized (c) {
|
||||
SparseArray<ColorStateListCacheEntry> sparseArray = b.get(context);
|
||||
if (sparseArray == null) {
|
||||
sparseArray = new SparseArray<>();
|
||||
b.put(context, sparseArray);
|
||||
}
|
||||
sparseArray.append(i, new ColorStateListCacheEntry(colorStateList, context.getResources().getConfiguration()));
|
||||
}
|
||||
}
|
||||
|
||||
private static TypedValue a() {
|
||||
TypedValue typedValue = a.get();
|
||||
if (typedValue != null) {
|
||||
return typedValue;
|
||||
}
|
||||
TypedValue typedValue2 = new TypedValue();
|
||||
a.set(typedValue2);
|
||||
return typedValue2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,486 @@
|
||||
package androidx.appcompat.graphics.drawable;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
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.StateSet;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.appcompat.graphics.drawable.DrawableContainer;
|
||||
import androidx.appcompat.graphics.drawable.StateListDrawable;
|
||||
import androidx.collection.LongSparseArray;
|
||||
import androidx.collection.SparseArrayCompat;
|
||||
import androidx.core.content.res.TypedArrayUtils;
|
||||
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 {
|
||||
private AnimatedStateListState o;
|
||||
private Transition p;
|
||||
private int q;
|
||||
private int r;
|
||||
private boolean s;
|
||||
|
||||
private static class AnimatableTransition extends Transition {
|
||||
private final Animatable a;
|
||||
|
||||
AnimatableTransition(Animatable animatable) {
|
||||
super();
|
||||
this.a = animatable;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void c() {
|
||||
this.a.start();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void d() {
|
||||
this.a.stop();
|
||||
}
|
||||
}
|
||||
|
||||
static class AnimatedStateListState extends StateListDrawable.StateListState {
|
||||
LongSparseArray<Long> K;
|
||||
SparseArrayCompat<Integer> L;
|
||||
|
||||
AnimatedStateListState(AnimatedStateListState animatedStateListState, AnimatedStateListDrawableCompat animatedStateListDrawableCompat, Resources resources) {
|
||||
super(animatedStateListState, animatedStateListDrawableCompat, resources);
|
||||
if (animatedStateListState != null) {
|
||||
this.K = animatedStateListState.K;
|
||||
this.L = animatedStateListState.L;
|
||||
} else {
|
||||
this.K = new LongSparseArray<>();
|
||||
this.L = new SparseArrayCompat<>();
|
||||
}
|
||||
}
|
||||
|
||||
private static long f(int i, int i2) {
|
||||
return i2 | (i << 32);
|
||||
}
|
||||
|
||||
int a(int i, int i2, Drawable drawable, boolean z) {
|
||||
int a = super.a(drawable);
|
||||
long f = f(i, i2);
|
||||
long j = z ? 8589934592L : 0L;
|
||||
long j2 = a;
|
||||
this.K.a(f, Long.valueOf(j2 | j));
|
||||
if (z) {
|
||||
this.K.a(f(i2, i), Long.valueOf(4294967296L | j2 | j));
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
int b(int[] iArr) {
|
||||
int a = super.a(iArr);
|
||||
return a >= 0 ? a : super.a(StateSet.WILD_CARD);
|
||||
}
|
||||
|
||||
int c(int i, int i2) {
|
||||
return (int) this.K.b(f(i, i2), -1L).longValue();
|
||||
}
|
||||
|
||||
int d(int i) {
|
||||
if (i < 0) {
|
||||
return 0;
|
||||
}
|
||||
return this.L.b(i, 0).intValue();
|
||||
}
|
||||
|
||||
boolean e(int i, int i2) {
|
||||
return (this.K.b(f(i, i2), -1L).longValue() & 8589934592L) != 0;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable.StateListState, androidx.appcompat.graphics.drawable.DrawableContainer.DrawableContainerState
|
||||
void m() {
|
||||
this.K = this.K.m0clone();
|
||||
this.L = this.L.m1clone();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable.StateListState, android.graphics.drawable.Drawable.ConstantState
|
||||
public Drawable newDrawable() {
|
||||
return new AnimatedStateListDrawableCompat(this, null);
|
||||
}
|
||||
|
||||
boolean d(int i, int i2) {
|
||||
return (this.K.b(f(i, i2), -1L).longValue() & 4294967296L) != 0;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable.StateListState, android.graphics.drawable.Drawable.ConstantState
|
||||
public Drawable newDrawable(Resources resources) {
|
||||
return new AnimatedStateListDrawableCompat(this, resources);
|
||||
}
|
||||
|
||||
int a(int[] iArr, Drawable drawable, int i) {
|
||||
int a = super.a(iArr, drawable);
|
||||
this.L.c(a, Integer.valueOf(i));
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
private static class AnimatedVectorDrawableTransition extends Transition {
|
||||
private final AnimatedVectorDrawableCompat a;
|
||||
|
||||
AnimatedVectorDrawableTransition(AnimatedVectorDrawableCompat animatedVectorDrawableCompat) {
|
||||
super();
|
||||
this.a = animatedVectorDrawableCompat;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void c() {
|
||||
this.a.start();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void d() {
|
||||
this.a.stop();
|
||||
}
|
||||
}
|
||||
|
||||
private static class AnimationDrawableTransition extends Transition {
|
||||
private final ObjectAnimator a;
|
||||
private final boolean b;
|
||||
|
||||
AnimationDrawableTransition(AnimationDrawable animationDrawable, boolean z, boolean z2) {
|
||||
super();
|
||||
int numberOfFrames = animationDrawable.getNumberOfFrames();
|
||||
int i = z ? numberOfFrames - 1 : 0;
|
||||
int i2 = z ? 0 : numberOfFrames - 1;
|
||||
FrameInterpolator frameInterpolator = new FrameInterpolator(animationDrawable, z);
|
||||
ObjectAnimator ofInt = ObjectAnimator.ofInt(animationDrawable, "currentIndex", i, i2);
|
||||
if (Build.VERSION.SDK_INT >= 18) {
|
||||
ofInt.setAutoCancel(true);
|
||||
}
|
||||
ofInt.setDuration(frameInterpolator.a());
|
||||
ofInt.setInterpolator(frameInterpolator);
|
||||
this.b = z2;
|
||||
this.a = ofInt;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public boolean a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void b() {
|
||||
this.a.reverse();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void c() {
|
||||
this.a.start();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat.Transition
|
||||
public void d() {
|
||||
this.a.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class Transition {
|
||||
private Transition() {
|
||||
}
|
||||
|
||||
public boolean a() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void b() {
|
||||
}
|
||||
|
||||
public abstract void c();
|
||||
|
||||
public abstract void d();
|
||||
}
|
||||
|
||||
public AnimatedStateListDrawableCompat() {
|
||||
this(null, null);
|
||||
}
|
||||
|
||||
public static AnimatedStateListDrawableCompat b(Context context, Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws IOException, XmlPullParserException {
|
||||
String name = xmlPullParser.getName();
|
||||
if (name.equals("animated-selector")) {
|
||||
AnimatedStateListDrawableCompat animatedStateListDrawableCompat = new AnimatedStateListDrawableCompat();
|
||||
animatedStateListDrawableCompat.a(context, resources, xmlPullParser, attributeSet, theme);
|
||||
return animatedStateListDrawableCompat;
|
||||
}
|
||||
throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": invalid animated-selector tag " + name);
|
||||
}
|
||||
|
||||
private void c() {
|
||||
onStateChange(getState());
|
||||
}
|
||||
|
||||
private int d(Context context, Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
int next;
|
||||
TypedArray a = TypedArrayUtils.a(resources, theme, attributeSet, R$styleable.AnimatedStateListDrawableItem);
|
||||
int resourceId = a.getResourceId(R$styleable.AnimatedStateListDrawableItem_android_id, 0);
|
||||
int resourceId2 = a.getResourceId(R$styleable.AnimatedStateListDrawableItem_android_drawable, -1);
|
||||
Drawable c = resourceId2 > 0 ? AppCompatResources.c(context, resourceId2) : null;
|
||||
a.recycle();
|
||||
int[] a2 = a(attributeSet);
|
||||
if (c == null) {
|
||||
do {
|
||||
next = xmlPullParser.next();
|
||||
} while (next == 4);
|
||||
if (next != 2) {
|
||||
throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": <item> tag requires a 'drawable' attribute or child tag defining a drawable");
|
||||
}
|
||||
c = xmlPullParser.getName().equals("vector") ? VectorDrawableCompat.createFromXmlInner(resources, xmlPullParser, attributeSet, theme) : Build.VERSION.SDK_INT >= 21 ? Drawable.createFromXmlInner(resources, xmlPullParser, attributeSet, theme) : Drawable.createFromXmlInner(resources, xmlPullParser, attributeSet);
|
||||
}
|
||||
if (c != null) {
|
||||
return this.o.a(a2, c, resourceId);
|
||||
}
|
||||
throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": <item> tag requires a 'drawable' attribute or child tag defining a drawable");
|
||||
}
|
||||
|
||||
private int e(Context context, Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
int next;
|
||||
TypedArray a = TypedArrayUtils.a(resources, theme, attributeSet, R$styleable.AnimatedStateListDrawableTransition);
|
||||
int resourceId = a.getResourceId(R$styleable.AnimatedStateListDrawableTransition_android_fromId, -1);
|
||||
int resourceId2 = a.getResourceId(R$styleable.AnimatedStateListDrawableTransition_android_toId, -1);
|
||||
int resourceId3 = a.getResourceId(R$styleable.AnimatedStateListDrawableTransition_android_drawable, -1);
|
||||
Drawable c = resourceId3 > 0 ? AppCompatResources.c(context, resourceId3) : null;
|
||||
boolean z = a.getBoolean(R$styleable.AnimatedStateListDrawableTransition_android_reversible, false);
|
||||
a.recycle();
|
||||
if (c == null) {
|
||||
do {
|
||||
next = xmlPullParser.next();
|
||||
} while (next == 4);
|
||||
if (next != 2) {
|
||||
throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": <transition> tag requires a 'drawable' attribute or child tag defining a drawable");
|
||||
}
|
||||
c = xmlPullParser.getName().equals("animated-vector") ? AnimatedVectorDrawableCompat.a(context, resources, xmlPullParser, attributeSet, theme) : Build.VERSION.SDK_INT >= 21 ? Drawable.createFromXmlInner(resources, xmlPullParser, attributeSet, theme) : Drawable.createFromXmlInner(resources, xmlPullParser, attributeSet);
|
||||
}
|
||||
if (c == null) {
|
||||
throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": <transition> tag requires a 'drawable' attribute or child tag defining a drawable");
|
||||
}
|
||||
if (resourceId != -1 && resourceId2 != -1) {
|
||||
return this.o.a(resourceId, resourceId2, c, z);
|
||||
}
|
||||
throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": <transition> tag requires 'fromId' & 'toId' attributes");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, 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.p;
|
||||
if (transition != null) {
|
||||
transition.d();
|
||||
this.p = null;
|
||||
a(this.q);
|
||||
this.q = -1;
|
||||
this.r = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public Drawable mutate() {
|
||||
if (!this.s) {
|
||||
super.mutate();
|
||||
if (this == this) {
|
||||
this.o.m();
|
||||
this.s = true;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
protected boolean onStateChange(int[] iArr) {
|
||||
int b = this.o.b(iArr);
|
||||
boolean z = b != b() && (b(b) || a(b));
|
||||
Drawable current = getCurrent();
|
||||
return current != null ? z | current.setState(iArr) : z;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public boolean setVisible(boolean z, boolean z2) {
|
||||
boolean visible = super.setVisible(z, z2);
|
||||
if (this.p != null && (visible || z2)) {
|
||||
if (z) {
|
||||
this.p.c();
|
||||
} else {
|
||||
jumpToCurrentState();
|
||||
}
|
||||
}
|
||||
return visible;
|
||||
}
|
||||
|
||||
AnimatedStateListDrawableCompat(AnimatedStateListState animatedStateListState, Resources resources) {
|
||||
super(null);
|
||||
this.q = -1;
|
||||
this.r = -1;
|
||||
a(new AnimatedStateListState(animatedStateListState, this, resources));
|
||||
onStateChange(getState());
|
||||
jumpToCurrentState();
|
||||
}
|
||||
|
||||
private void c(Context context, Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
int depth = xmlPullParser.getDepth() + 1;
|
||||
while (true) {
|
||||
int next = xmlPullParser.next();
|
||||
if (next == 1) {
|
||||
return;
|
||||
}
|
||||
int depth2 = xmlPullParser.getDepth();
|
||||
if (depth2 < depth && next == 3) {
|
||||
return;
|
||||
}
|
||||
if (next == 2 && depth2 <= depth) {
|
||||
if (xmlPullParser.getName().equals("item")) {
|
||||
d(context, resources, xmlPullParser, attributeSet, theme);
|
||||
} else if (xmlPullParser.getName().equals("transition")) {
|
||||
e(context, resources, xmlPullParser, attributeSet, theme);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Context context, Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
TypedArray a = TypedArrayUtils.a(resources, theme, attributeSet, R$styleable.AnimatedStateListDrawableCompat);
|
||||
setVisible(a.getBoolean(R$styleable.AnimatedStateListDrawableCompat_android_visible, true), true);
|
||||
a(a);
|
||||
a(resources);
|
||||
a.recycle();
|
||||
c(context, resources, xmlPullParser, attributeSet, theme);
|
||||
c();
|
||||
}
|
||||
|
||||
private boolean b(int i) {
|
||||
int b;
|
||||
int c;
|
||||
Transition animatableTransition;
|
||||
Transition transition = this.p;
|
||||
if (transition != null) {
|
||||
if (i == this.q) {
|
||||
return true;
|
||||
}
|
||||
if (i == this.r && transition.a()) {
|
||||
transition.b();
|
||||
this.q = this.r;
|
||||
this.r = i;
|
||||
return true;
|
||||
}
|
||||
b = this.q;
|
||||
transition.d();
|
||||
} else {
|
||||
b = b();
|
||||
}
|
||||
this.p = null;
|
||||
this.r = -1;
|
||||
this.q = -1;
|
||||
AnimatedStateListState animatedStateListState = this.o;
|
||||
int d = animatedStateListState.d(b);
|
||||
int d2 = animatedStateListState.d(i);
|
||||
if (d2 == 0 || d == 0 || (c = animatedStateListState.c(d, d2)) < 0) {
|
||||
return false;
|
||||
}
|
||||
boolean e = animatedStateListState.e(d, d2);
|
||||
a(c);
|
||||
Object current = getCurrent();
|
||||
if (current instanceof AnimationDrawable) {
|
||||
animatableTransition = new AnimationDrawableTransition((AnimationDrawable) current, animatedStateListState.d(d, d2), e);
|
||||
} else if (current instanceof AnimatedVectorDrawableCompat) {
|
||||
animatableTransition = new AnimatedVectorDrawableTransition((AnimatedVectorDrawableCompat) current);
|
||||
} else {
|
||||
if (current instanceof Animatable) {
|
||||
animatableTransition = new AnimatableTransition((Animatable) current);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
animatableTransition.c();
|
||||
this.p = animatableTransition;
|
||||
this.r = b;
|
||||
this.q = i;
|
||||
return true;
|
||||
}
|
||||
|
||||
private static class FrameInterpolator implements TimeInterpolator {
|
||||
private int[] a;
|
||||
private int b;
|
||||
private int c;
|
||||
|
||||
FrameInterpolator(AnimationDrawable animationDrawable, boolean z) {
|
||||
a(animationDrawable, z);
|
||||
}
|
||||
|
||||
int a(AnimationDrawable animationDrawable, boolean z) {
|
||||
int numberOfFrames = animationDrawable.getNumberOfFrames();
|
||||
this.b = numberOfFrames;
|
||||
int[] iArr = this.a;
|
||||
if (iArr == null || iArr.length < numberOfFrames) {
|
||||
this.a = new int[numberOfFrames];
|
||||
}
|
||||
int[] iArr2 = this.a;
|
||||
int i = 0;
|
||||
for (int i2 = 0; i2 < numberOfFrames; i2++) {
|
||||
int duration = animationDrawable.getDuration(z ? (numberOfFrames - i2) - 1 : i2);
|
||||
iArr2[i2] = duration;
|
||||
i += duration;
|
||||
}
|
||||
this.c = i;
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override // android.animation.TimeInterpolator
|
||||
public float getInterpolation(float f) {
|
||||
int i = (int) ((f * this.c) + 0.5f);
|
||||
int i2 = this.b;
|
||||
int[] iArr = this.a;
|
||||
int i3 = 0;
|
||||
while (i3 < i2 && i >= iArr[i3]) {
|
||||
i -= iArr[i3];
|
||||
i3++;
|
||||
}
|
||||
return (i3 / i2) + (i3 < i2 ? i / this.c : 0.0f);
|
||||
}
|
||||
|
||||
int a() {
|
||||
return this.c;
|
||||
}
|
||||
}
|
||||
|
||||
private void a(TypedArray typedArray) {
|
||||
AnimatedStateListState animatedStateListState = this.o;
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
animatedStateListState.d |= typedArray.getChangingConfigurations();
|
||||
}
|
||||
animatedStateListState.b(typedArray.getBoolean(R$styleable.AnimatedStateListDrawableCompat_android_variablePadding, animatedStateListState.i));
|
||||
animatedStateListState.a(typedArray.getBoolean(R$styleable.AnimatedStateListDrawableCompat_android_constantSize, animatedStateListState.l));
|
||||
animatedStateListState.b(typedArray.getInt(R$styleable.AnimatedStateListDrawableCompat_android_enterFadeDuration, animatedStateListState.A));
|
||||
animatedStateListState.c(typedArray.getInt(R$styleable.AnimatedStateListDrawableCompat_android_exitFadeDuration, animatedStateListState.B));
|
||||
setDither(typedArray.getBoolean(R$styleable.AnimatedStateListDrawableCompat_android_dither, animatedStateListState.x));
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, androidx.appcompat.graphics.drawable.DrawableContainer
|
||||
public AnimatedStateListState a() {
|
||||
return new AnimatedStateListState(this.o, this, null);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.StateListDrawable, androidx.appcompat.graphics.drawable.DrawableContainer
|
||||
protected void a(DrawableContainer.DrawableContainerState drawableContainerState) {
|
||||
super.a(drawableContainerState);
|
||||
if (drawableContainerState instanceof AnimatedStateListState) {
|
||||
this.o = (AnimatedStateListState) drawableContainerState;
|
||||
}
|
||||
}
|
||||
}
|
||||
1111
sources/androidx/appcompat/graphics/drawable/DrawableContainer.java
Normal file
1111
sources/androidx/appcompat/graphics/drawable/DrawableContainer.java
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,194 @@
|
||||
package androidx.appcompat.graphics.drawable;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Region;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DrawableWrapper extends Drawable implements Drawable.Callback {
|
||||
private Drawable a;
|
||||
|
||||
public DrawableWrapper(Drawable drawable) {
|
||||
a(drawable);
|
||||
}
|
||||
|
||||
public Drawable a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void draw(Canvas canvas) {
|
||||
this.a.draw(canvas);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getChangingConfigurations() {
|
||||
return this.a.getChangingConfigurations();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public Drawable getCurrent() {
|
||||
return this.a.getCurrent();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getIntrinsicHeight() {
|
||||
return this.a.getIntrinsicHeight();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getIntrinsicWidth() {
|
||||
return this.a.getIntrinsicWidth();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getMinimumHeight() {
|
||||
return this.a.getMinimumHeight();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getMinimumWidth() {
|
||||
return this.a.getMinimumWidth();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getOpacity() {
|
||||
return this.a.getOpacity();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean getPadding(Rect rect) {
|
||||
return this.a.getPadding(rect);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int[] getState() {
|
||||
return this.a.getState();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public Region getTransparentRegion() {
|
||||
return this.a.getTransparentRegion();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable.Callback
|
||||
public void invalidateDrawable(Drawable drawable) {
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean isAutoMirrored() {
|
||||
return DrawableCompat.f(this.a);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean isStateful() {
|
||||
return this.a.isStateful();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void jumpToCurrentState() {
|
||||
DrawableCompat.g(this.a);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
protected void onBoundsChange(Rect rect) {
|
||||
this.a.setBounds(rect);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
protected boolean onLevelChange(int i) {
|
||||
return this.a.setLevel(i);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable.Callback
|
||||
public void scheduleDrawable(Drawable drawable, Runnable runnable, long j) {
|
||||
scheduleSelf(runnable, j);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setAlpha(int i) {
|
||||
this.a.setAlpha(i);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setAutoMirrored(boolean z) {
|
||||
DrawableCompat.a(this.a, z);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setChangingConfigurations(int i) {
|
||||
this.a.setChangingConfigurations(i);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setColorFilter(ColorFilter colorFilter) {
|
||||
this.a.setColorFilter(colorFilter);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setDither(boolean z) {
|
||||
this.a.setDither(z);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setFilterBitmap(boolean z) {
|
||||
this.a.setFilterBitmap(z);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setHotspot(float f, float f2) {
|
||||
DrawableCompat.a(this.a, f, f2);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setHotspotBounds(int i, int i2, int i3, int i4) {
|
||||
DrawableCompat.a(this.a, i, i2, i3, i4);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean setState(int[] iArr) {
|
||||
return this.a.setState(iArr);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setTint(int i) {
|
||||
DrawableCompat.b(this.a, i);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setTintList(ColorStateList colorStateList) {
|
||||
DrawableCompat.a(this.a, colorStateList);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setTintMode(PorterDuff.Mode mode) {
|
||||
DrawableCompat.a(this.a, mode);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean setVisible(boolean z, boolean z2) {
|
||||
return super.setVisible(z, z2) || this.a.setVisible(z, z2);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable.Callback
|
||||
public void unscheduleDrawable(Drawable drawable, Runnable runnable) {
|
||||
unscheduleSelf(runnable);
|
||||
}
|
||||
|
||||
public void a(Drawable drawable) {
|
||||
Drawable drawable2 = this.a;
|
||||
if (drawable2 != null) {
|
||||
drawable2.setCallback(null);
|
||||
}
|
||||
this.a = drawable;
|
||||
if (drawable != null) {
|
||||
drawable.setCallback(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package androidx.appcompat.graphics.drawable;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.StateSet;
|
||||
import androidx.appcompat.graphics.drawable.DrawableContainer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class StateListDrawable extends DrawableContainer {
|
||||
private StateListState m;
|
||||
private boolean n;
|
||||
|
||||
static class StateListState extends DrawableContainer.DrawableContainerState {
|
||||
int[][] J;
|
||||
|
||||
StateListState(StateListState stateListState, StateListDrawable stateListDrawable, Resources resources) {
|
||||
super(stateListState, stateListDrawable, resources);
|
||||
if (stateListState != null) {
|
||||
this.J = stateListState.J;
|
||||
} else {
|
||||
this.J = new int[c()][];
|
||||
}
|
||||
}
|
||||
|
||||
int a(int[] iArr, Drawable drawable) {
|
||||
int a = a(drawable);
|
||||
this.J[a] = iArr;
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer.DrawableContainerState
|
||||
void m() {
|
||||
int[][] iArr = this.J;
|
||||
int[][] iArr2 = new int[iArr.length][];
|
||||
for (int length = iArr.length - 1; length >= 0; length--) {
|
||||
int[][] iArr3 = this.J;
|
||||
iArr2[length] = iArr3[length] != null ? (int[]) iArr3[length].clone() : null;
|
||||
}
|
||||
this.J = iArr2;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable.ConstantState
|
||||
public Drawable newDrawable() {
|
||||
return new StateListDrawable(this, null);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable.ConstantState
|
||||
public Drawable newDrawable(Resources resources) {
|
||||
return new StateListDrawable(this, resources);
|
||||
}
|
||||
|
||||
int a(int[] iArr) {
|
||||
int[][] iArr2 = this.J;
|
||||
int d = d();
|
||||
for (int i = 0; i < d; i++) {
|
||||
if (StateSet.stateSetMatches(iArr2[i], iArr)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer.DrawableContainerState
|
||||
public void a(int i, int i2) {
|
||||
super.a(i, i2);
|
||||
int[][] iArr = new int[i2][];
|
||||
System.arraycopy(this.J, 0, iArr, 0, i);
|
||||
this.J = iArr;
|
||||
}
|
||||
}
|
||||
|
||||
StateListDrawable(StateListState stateListState, Resources resources) {
|
||||
a(new StateListState(stateListState, this, resources));
|
||||
onStateChange(getState());
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public void applyTheme(Resources.Theme theme) {
|
||||
super.applyTheme(theme);
|
||||
onStateChange(getState());
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean isStateful() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
public Drawable mutate() {
|
||||
if (!this.n) {
|
||||
super.mutate();
|
||||
if (this == this) {
|
||||
this.m.m();
|
||||
this.n = true;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer, android.graphics.drawable.Drawable
|
||||
protected boolean onStateChange(int[] iArr) {
|
||||
boolean onStateChange = super.onStateChange(iArr);
|
||||
int a = this.m.a(iArr);
|
||||
if (a < 0) {
|
||||
a = this.m.a(StateSet.WILD_CARD);
|
||||
}
|
||||
return a(a) || onStateChange;
|
||||
}
|
||||
|
||||
int[] a(AttributeSet attributeSet) {
|
||||
int attributeCount = attributeSet.getAttributeCount();
|
||||
int[] iArr = new int[attributeCount];
|
||||
int i = 0;
|
||||
for (int i2 = 0; i2 < attributeCount; i2++) {
|
||||
int attributeNameResource = attributeSet.getAttributeNameResource(i2);
|
||||
if (attributeNameResource != 0 && attributeNameResource != 16842960 && attributeNameResource != 16843161) {
|
||||
int i3 = i + 1;
|
||||
if (!attributeSet.getAttributeBooleanValue(i2, false)) {
|
||||
attributeNameResource = -attributeNameResource;
|
||||
}
|
||||
iArr[i] = attributeNameResource;
|
||||
i = i3;
|
||||
}
|
||||
}
|
||||
return StateSet.trimStateSet(iArr, i);
|
||||
}
|
||||
|
||||
StateListDrawable(StateListState stateListState) {
|
||||
if (stateListState != null) {
|
||||
a(stateListState);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer
|
||||
public StateListState a() {
|
||||
return new StateListState(this.m, this, null);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.graphics.drawable.DrawableContainer
|
||||
protected void a(DrawableContainer.DrawableContainerState drawableContainerState) {
|
||||
super.a(drawableContainerState);
|
||||
if (drawableContainerState instanceof StateListState) {
|
||||
this.m = (StateListState) drawableContainerState;
|
||||
}
|
||||
}
|
||||
}
|
||||
84
sources/androidx/appcompat/view/ActionBarPolicy.java
Normal file
84
sources/androidx/appcompat/view/ActionBarPolicy.java
Normal file
@@ -0,0 +1,84 @@
|
||||
package androidx.appcompat.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Build;
|
||||
import android.view.ViewConfiguration;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.R$bool;
|
||||
import androidx.appcompat.R$dimen;
|
||||
import androidx.appcompat.R$styleable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActionBarPolicy {
|
||||
private Context a;
|
||||
|
||||
private ActionBarPolicy(Context context) {
|
||||
this.a = context;
|
||||
}
|
||||
|
||||
public static ActionBarPolicy a(Context context) {
|
||||
return new ActionBarPolicy(context);
|
||||
}
|
||||
|
||||
public int b() {
|
||||
return this.a.getResources().getDisplayMetrics().widthPixels / 2;
|
||||
}
|
||||
|
||||
public int c() {
|
||||
Configuration configuration = this.a.getResources().getConfiguration();
|
||||
int i = configuration.screenWidthDp;
|
||||
int i2 = configuration.screenHeightDp;
|
||||
if (configuration.smallestScreenWidthDp > 600 || i > 600) {
|
||||
return 5;
|
||||
}
|
||||
if (i > 960 && i2 > 720) {
|
||||
return 5;
|
||||
}
|
||||
if (i > 720 && i2 > 960) {
|
||||
return 5;
|
||||
}
|
||||
if (i >= 500) {
|
||||
return 4;
|
||||
}
|
||||
if (i > 640 && i2 > 480) {
|
||||
return 4;
|
||||
}
|
||||
if (i <= 480 || i2 <= 640) {
|
||||
return i >= 360 ? 3 : 2;
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
|
||||
public int d() {
|
||||
return this.a.getResources().getDimensionPixelSize(R$dimen.abc_action_bar_stacked_tab_max_width);
|
||||
}
|
||||
|
||||
public int e() {
|
||||
TypedArray obtainStyledAttributes = this.a.obtainStyledAttributes(null, R$styleable.ActionBar, R$attr.actionBarStyle, 0);
|
||||
int layoutDimension = obtainStyledAttributes.getLayoutDimension(R$styleable.ActionBar_height, 0);
|
||||
Resources resources = this.a.getResources();
|
||||
if (!f()) {
|
||||
layoutDimension = Math.min(layoutDimension, resources.getDimensionPixelSize(R$dimen.abc_action_bar_stacked_max_height));
|
||||
}
|
||||
obtainStyledAttributes.recycle();
|
||||
return layoutDimension;
|
||||
}
|
||||
|
||||
public boolean f() {
|
||||
return this.a.getResources().getBoolean(R$bool.abc_action_bar_embed_tabs);
|
||||
}
|
||||
|
||||
public boolean g() {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
return true;
|
||||
}
|
||||
return !ViewConfiguration.get(this.a).hasPermanentMenuKey();
|
||||
}
|
||||
|
||||
public boolean a() {
|
||||
return this.a.getApplicationInfo().targetSdkVersion < 14;
|
||||
}
|
||||
}
|
||||
64
sources/androidx/appcompat/view/ActionMode.java
Normal file
64
sources/androidx/appcompat/view/ActionMode.java
Normal file
@@ -0,0 +1,64 @@
|
||||
package androidx.appcompat.view;
|
||||
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ActionMode {
|
||||
private Object a;
|
||||
private boolean b;
|
||||
|
||||
public interface Callback {
|
||||
void a(ActionMode actionMode);
|
||||
|
||||
boolean a(ActionMode actionMode, Menu menu);
|
||||
|
||||
boolean a(ActionMode actionMode, MenuItem menuItem);
|
||||
|
||||
boolean b(ActionMode actionMode, Menu menu);
|
||||
}
|
||||
|
||||
public abstract void a();
|
||||
|
||||
public abstract void a(int i);
|
||||
|
||||
public abstract void a(View view);
|
||||
|
||||
public abstract void a(CharSequence charSequence);
|
||||
|
||||
public void a(Object obj) {
|
||||
this.a = obj;
|
||||
}
|
||||
|
||||
public abstract View b();
|
||||
|
||||
public abstract void b(int i);
|
||||
|
||||
public abstract void b(CharSequence charSequence);
|
||||
|
||||
public abstract Menu c();
|
||||
|
||||
public abstract MenuInflater d();
|
||||
|
||||
public abstract CharSequence e();
|
||||
|
||||
public Object f() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public abstract CharSequence g();
|
||||
|
||||
public boolean h() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public abstract void i();
|
||||
|
||||
public abstract boolean j();
|
||||
|
||||
public void a(boolean z) {
|
||||
this.b = z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package androidx.appcompat.view;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface CollapsibleActionView {
|
||||
void b();
|
||||
|
||||
void c();
|
||||
}
|
||||
112
sources/androidx/appcompat/view/ContextThemeWrapper.java
Normal file
112
sources/androidx/appcompat/view/ContextThemeWrapper.java
Normal file
@@ -0,0 +1,112 @@
|
||||
package androidx.appcompat.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.res.AssetManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.view.LayoutInflater;
|
||||
import androidx.appcompat.R$style;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ContextThemeWrapper extends ContextWrapper {
|
||||
private int a;
|
||||
private Resources.Theme b;
|
||||
private LayoutInflater c;
|
||||
private Configuration d;
|
||||
private Resources e;
|
||||
|
||||
public ContextThemeWrapper() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
private Resources b() {
|
||||
if (this.e == null) {
|
||||
Configuration configuration = this.d;
|
||||
if (configuration == null) {
|
||||
this.e = super.getResources();
|
||||
} else if (Build.VERSION.SDK_INT >= 17) {
|
||||
this.e = createConfigurationContext(configuration).getResources();
|
||||
}
|
||||
}
|
||||
return this.e;
|
||||
}
|
||||
|
||||
private void c() {
|
||||
boolean z = this.b == null;
|
||||
if (z) {
|
||||
this.b = getResources().newTheme();
|
||||
Resources.Theme theme = getBaseContext().getTheme();
|
||||
if (theme != null) {
|
||||
this.b.setTo(theme);
|
||||
}
|
||||
}
|
||||
a(this.b, this.a, z);
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.content.ContextWrapper
|
||||
protected void attachBaseContext(Context context) {
|
||||
super.attachBaseContext(context);
|
||||
}
|
||||
|
||||
@Override // android.content.ContextWrapper, android.content.Context
|
||||
public AssetManager getAssets() {
|
||||
return getResources().getAssets();
|
||||
}
|
||||
|
||||
@Override // android.content.ContextWrapper, android.content.Context
|
||||
public Resources getResources() {
|
||||
return b();
|
||||
}
|
||||
|
||||
@Override // android.content.ContextWrapper, android.content.Context
|
||||
public Object getSystemService(String str) {
|
||||
if (!"layout_inflater".equals(str)) {
|
||||
return getBaseContext().getSystemService(str);
|
||||
}
|
||||
if (this.c == null) {
|
||||
this.c = LayoutInflater.from(getBaseContext()).cloneInContext(this);
|
||||
}
|
||||
return this.c;
|
||||
}
|
||||
|
||||
@Override // android.content.ContextWrapper, android.content.Context
|
||||
public Resources.Theme getTheme() {
|
||||
Resources.Theme theme = this.b;
|
||||
if (theme != null) {
|
||||
return theme;
|
||||
}
|
||||
if (this.a == 0) {
|
||||
this.a = R$style.Theme_AppCompat_Light;
|
||||
}
|
||||
c();
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // android.content.ContextWrapper, android.content.Context
|
||||
public void setTheme(int i) {
|
||||
if (this.a != i) {
|
||||
this.a = i;
|
||||
c();
|
||||
}
|
||||
}
|
||||
|
||||
public ContextThemeWrapper(Context context, int i) {
|
||||
super(context);
|
||||
this.a = i;
|
||||
}
|
||||
|
||||
protected void a(Resources.Theme theme, int i, boolean z) {
|
||||
theme.applyStyle(i, true);
|
||||
}
|
||||
|
||||
public ContextThemeWrapper(Context context, Resources.Theme theme) {
|
||||
super(context);
|
||||
this.b = theme;
|
||||
}
|
||||
}
|
||||
123
sources/androidx/appcompat/view/StandaloneActionMode.java
Normal file
123
sources/androidx/appcompat/view/StandaloneActionMode.java
Normal file
@@ -0,0 +1,123 @@
|
||||
package androidx.appcompat.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.appcompat.view.menu.MenuBuilder;
|
||||
import androidx.appcompat.widget.ActionBarContextView;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class StandaloneActionMode extends ActionMode implements MenuBuilder.Callback {
|
||||
private Context c;
|
||||
private ActionBarContextView d;
|
||||
private ActionMode.Callback e;
|
||||
private WeakReference<View> f;
|
||||
private boolean g;
|
||||
private MenuBuilder h;
|
||||
|
||||
public StandaloneActionMode(Context context, ActionBarContextView actionBarContextView, ActionMode.Callback callback, boolean z) {
|
||||
this.c = context;
|
||||
this.d = actionBarContextView;
|
||||
this.e = callback;
|
||||
MenuBuilder menuBuilder = new MenuBuilder(actionBarContextView.getContext());
|
||||
menuBuilder.c(1);
|
||||
this.h = menuBuilder;
|
||||
this.h.a(this);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void a(CharSequence charSequence) {
|
||||
this.d.setSubtitle(charSequence);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void b(CharSequence charSequence) {
|
||||
this.d.setTitle(charSequence);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public Menu c() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public MenuInflater d() {
|
||||
return new SupportMenuInflater(this.d.getContext());
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public CharSequence e() {
|
||||
return this.d.getSubtitle();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public CharSequence g() {
|
||||
return this.d.getTitle();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void i() {
|
||||
this.e.b(this, this.h);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public boolean j() {
|
||||
return this.d.b();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void a(int i) {
|
||||
a((CharSequence) this.c.getString(i));
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void b(int i) {
|
||||
b(this.c.getString(i));
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void a(boolean z) {
|
||||
super.a(z);
|
||||
this.d.setTitleOptional(z);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public View b() {
|
||||
WeakReference<View> weakReference = this.f;
|
||||
if (weakReference != null) {
|
||||
return weakReference.get();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void a(View view) {
|
||||
this.d.setCustomView(view);
|
||||
this.f = view != null ? new WeakReference<>(view) : null;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode
|
||||
public void a() {
|
||||
if (this.g) {
|
||||
return;
|
||||
}
|
||||
this.g = true;
|
||||
this.d.sendAccessibilityEvent(32);
|
||||
this.e.a(this);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
|
||||
public boolean a(MenuBuilder menuBuilder, MenuItem menuItem) {
|
||||
return this.e.a(this, menuItem);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
|
||||
public void a(MenuBuilder menuBuilder) {
|
||||
i();
|
||||
this.d.d();
|
||||
}
|
||||
}
|
||||
165
sources/androidx/appcompat/view/SupportActionModeWrapper.java
Normal file
165
sources/androidx/appcompat/view/SupportActionModeWrapper.java
Normal file
@@ -0,0 +1,165 @@
|
||||
package androidx.appcompat.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.ActionMode;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.appcompat.view.menu.MenuWrapperFactory;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
import androidx.core.internal.view.SupportMenu;
|
||||
import androidx.core.internal.view.SupportMenuItem;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SupportActionModeWrapper extends android.view.ActionMode {
|
||||
final Context a;
|
||||
final ActionMode b;
|
||||
|
||||
public SupportActionModeWrapper(Context context, ActionMode actionMode) {
|
||||
this.a = context;
|
||||
this.b = actionMode;
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public void finish() {
|
||||
this.b.a();
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public View getCustomView() {
|
||||
return this.b.b();
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public Menu getMenu() {
|
||||
return MenuWrapperFactory.a(this.a, (SupportMenu) this.b.c());
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public MenuInflater getMenuInflater() {
|
||||
return this.b.d();
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public CharSequence getSubtitle() {
|
||||
return this.b.e();
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public Object getTag() {
|
||||
return this.b.f();
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public CharSequence getTitle() {
|
||||
return this.b.g();
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public boolean getTitleOptionalHint() {
|
||||
return this.b.h();
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public void invalidate() {
|
||||
this.b.i();
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public boolean isTitleOptional() {
|
||||
return this.b.j();
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public void setCustomView(View view) {
|
||||
this.b.a(view);
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public void setSubtitle(CharSequence charSequence) {
|
||||
this.b.a(charSequence);
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public void setTag(Object obj) {
|
||||
this.b.a(obj);
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public void setTitle(CharSequence charSequence) {
|
||||
this.b.b(charSequence);
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public void setTitleOptionalHint(boolean z) {
|
||||
this.b.a(z);
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public void setSubtitle(int i) {
|
||||
this.b.a(i);
|
||||
}
|
||||
|
||||
@Override // android.view.ActionMode
|
||||
public void setTitle(int i) {
|
||||
this.b.b(i);
|
||||
}
|
||||
|
||||
public static class CallbackWrapper implements ActionMode.Callback {
|
||||
final ActionMode.Callback a;
|
||||
final Context b;
|
||||
final ArrayList<SupportActionModeWrapper> c = new ArrayList<>();
|
||||
final SimpleArrayMap<Menu, Menu> d = new SimpleArrayMap<>();
|
||||
|
||||
public CallbackWrapper(Context context, ActionMode.Callback callback) {
|
||||
this.b = context;
|
||||
this.a = callback;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode.Callback
|
||||
public boolean a(ActionMode actionMode, Menu menu) {
|
||||
return this.a.onCreateActionMode(b(actionMode), a(menu));
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode.Callback
|
||||
public boolean b(ActionMode actionMode, Menu menu) {
|
||||
return this.a.onPrepareActionMode(b(actionMode), a(menu));
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode.Callback
|
||||
public boolean a(ActionMode actionMode, MenuItem menuItem) {
|
||||
return this.a.onActionItemClicked(b(actionMode), MenuWrapperFactory.a(this.b, (SupportMenuItem) menuItem));
|
||||
}
|
||||
|
||||
public android.view.ActionMode b(ActionMode actionMode) {
|
||||
int size = this.c.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
SupportActionModeWrapper supportActionModeWrapper = this.c.get(i);
|
||||
if (supportActionModeWrapper != null && supportActionModeWrapper.b == actionMode) {
|
||||
return supportActionModeWrapper;
|
||||
}
|
||||
}
|
||||
SupportActionModeWrapper supportActionModeWrapper2 = new SupportActionModeWrapper(this.b, actionMode);
|
||||
this.c.add(supportActionModeWrapper2);
|
||||
return supportActionModeWrapper2;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.ActionMode.Callback
|
||||
public void a(ActionMode actionMode) {
|
||||
this.a.onDestroyActionMode(b(actionMode));
|
||||
}
|
||||
|
||||
private Menu a(Menu menu) {
|
||||
Menu menu2 = this.d.get(menu);
|
||||
if (menu2 != null) {
|
||||
return menu2;
|
||||
}
|
||||
Menu a = MenuWrapperFactory.a(this.b, (SupportMenu) menu);
|
||||
this.d.put(menu, a);
|
||||
return a;
|
||||
}
|
||||
}
|
||||
}
|
||||
562
sources/androidx/appcompat/view/SupportMenuInflater.java
Normal file
562
sources/androidx/appcompat/view/SupportMenuInflater.java
Normal file
@@ -0,0 +1,562 @@
|
||||
package androidx.appcompat.view;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.TypedArray;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.Xml;
|
||||
import android.view.InflateException;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.appcompat.view.menu.MenuItemImpl;
|
||||
import androidx.appcompat.view.menu.MenuItemWrapperICS;
|
||||
import androidx.appcompat.widget.DrawableUtils;
|
||||
import androidx.core.internal.view.SupportMenu;
|
||||
import androidx.core.view.ActionProvider;
|
||||
import androidx.core.view.MenuItemCompat;
|
||||
import com.ubt.jimu.base.util.FileUtil;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SupportMenuInflater extends MenuInflater {
|
||||
static final Class<?>[] e = {Context.class};
|
||||
static final Class<?>[] f = e;
|
||||
final Object[] a;
|
||||
final Object[] b;
|
||||
Context c;
|
||||
private Object d;
|
||||
|
||||
private static class InflatedOnMenuItemClickListener implements MenuItem.OnMenuItemClickListener {
|
||||
private static final Class<?>[] c = {MenuItem.class};
|
||||
private Object a;
|
||||
private Method b;
|
||||
|
||||
public InflatedOnMenuItemClickListener(Object obj, String str) {
|
||||
this.a = obj;
|
||||
Class<?> cls = obj.getClass();
|
||||
try {
|
||||
this.b = cls.getMethod(str, c);
|
||||
} catch (Exception e) {
|
||||
InflateException inflateException = new InflateException("Couldn't resolve menu item onClick handler " + str + " in class " + cls.getName());
|
||||
inflateException.initCause(e);
|
||||
throw inflateException;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem.OnMenuItemClickListener
|
||||
public boolean onMenuItemClick(MenuItem menuItem) {
|
||||
try {
|
||||
if (this.b.getReturnType() == Boolean.TYPE) {
|
||||
return ((Boolean) this.b.invoke(this.a, menuItem)).booleanValue();
|
||||
}
|
||||
this.b.invoke(this.a, menuItem);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public SupportMenuInflater(Context context) {
|
||||
super(context);
|
||||
this.c = context;
|
||||
this.a = new Object[]{context};
|
||||
this.b = this.a;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:11:0x0049, code lost:
|
||||
|
||||
if (r6 == 2) goto L41;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:13:0x004c, code lost:
|
||||
|
||||
if (r6 == 3) goto L20;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:14:0x0050, code lost:
|
||||
|
||||
r6 = r13.getName();
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:15:0x0054, code lost:
|
||||
|
||||
if (r7 == false) goto L25;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:17:0x005a, code lost:
|
||||
|
||||
if (r6.equals(r8) == false) goto L25;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:18:0x005c, code lost:
|
||||
|
||||
r8 = null;
|
||||
r7 = false;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:20:0x00ba, code lost:
|
||||
|
||||
r6 = r13.next();
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:22:0x0063, code lost:
|
||||
|
||||
if (r6.equals("group") == false) goto L28;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:23:0x0065, code lost:
|
||||
|
||||
r0.d();
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:26:0x006d, code lost:
|
||||
|
||||
if (r6.equals("item") == false) goto L38;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:28:0x0073, code lost:
|
||||
|
||||
if (r0.c() != false) goto L65;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:29:0x0075, code lost:
|
||||
|
||||
r6 = r0.A;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:30:0x0077, code lost:
|
||||
|
||||
if (r6 == null) goto L37;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:32:0x007d, code lost:
|
||||
|
||||
if (r6.a() == false) goto L37;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:33:0x007f, code lost:
|
||||
|
||||
r0.b();
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:35:0x0083, code lost:
|
||||
|
||||
r0.a();
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:39:0x008b, code lost:
|
||||
|
||||
if (r6.equals("menu") == false) goto L68;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:40:0x008d, code lost:
|
||||
|
||||
r15 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:44:0x008f, code lost:
|
||||
|
||||
if (r7 == false) goto L43;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:45:0x0092, code lost:
|
||||
|
||||
r6 = r13.getName();
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:46:0x009a, code lost:
|
||||
|
||||
if (r6.equals("group") == false) goto L46;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:47:0x009c, code lost:
|
||||
|
||||
r0.a(r14);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:50:0x00a4, code lost:
|
||||
|
||||
if (r6.equals("item") == false) goto L49;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:51:0x00a6, code lost:
|
||||
|
||||
r0.b(r14);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:54:0x00ae, code lost:
|
||||
|
||||
if (r6.equals("menu") == false) goto L52;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:55:0x00b0, code lost:
|
||||
|
||||
a(r13, r14, r0.b());
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:57:0x00b8, code lost:
|
||||
|
||||
r8 = r6;
|
||||
r7 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:62:0x00c6, code lost:
|
||||
|
||||
throw new java.lang.RuntimeException("Unexpected end of document");
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:65:0x00c7, code lost:
|
||||
|
||||
return;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:7:0x003b, code lost:
|
||||
|
||||
r6 = r15;
|
||||
r8 = null;
|
||||
r15 = false;
|
||||
r7 = false;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:8:0x0041, code lost:
|
||||
|
||||
if (r15 != false) goto L60;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:9:0x0043, code lost:
|
||||
|
||||
if (r6 == 1) goto L61;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private void a(org.xmlpull.v1.XmlPullParser r13, android.util.AttributeSet r14, android.view.Menu r15) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {
|
||||
/*
|
||||
r12 = this;
|
||||
androidx.appcompat.view.SupportMenuInflater$MenuState r0 = new androidx.appcompat.view.SupportMenuInflater$MenuState
|
||||
r0.<init>(r15)
|
||||
int r15 = r13.getEventType()
|
||||
L9:
|
||||
r1 = 2
|
||||
java.lang.String r2 = "menu"
|
||||
r3 = 1
|
||||
if (r15 != r1) goto L35
|
||||
java.lang.String r15 = r13.getName()
|
||||
boolean r4 = r15.equals(r2)
|
||||
if (r4 == 0) goto L1e
|
||||
int r15 = r13.next()
|
||||
goto L3b
|
||||
L1e:
|
||||
java.lang.RuntimeException r13 = new java.lang.RuntimeException
|
||||
java.lang.StringBuilder r14 = new java.lang.StringBuilder
|
||||
r14.<init>()
|
||||
java.lang.String r0 = "Expecting menu, got "
|
||||
r14.append(r0)
|
||||
r14.append(r15)
|
||||
java.lang.String r14 = r14.toString()
|
||||
r13.<init>(r14)
|
||||
throw r13
|
||||
L35:
|
||||
int r15 = r13.next()
|
||||
if (r15 != r3) goto L9
|
||||
L3b:
|
||||
r4 = 0
|
||||
r5 = 0
|
||||
r6 = r15
|
||||
r8 = r4
|
||||
r15 = 0
|
||||
r7 = 0
|
||||
L41:
|
||||
if (r15 != 0) goto Lc7
|
||||
if (r6 == r3) goto Lbf
|
||||
java.lang.String r9 = "item"
|
||||
java.lang.String r10 = "group"
|
||||
if (r6 == r1) goto L8f
|
||||
r11 = 3
|
||||
if (r6 == r11) goto L50
|
||||
goto Lba
|
||||
L50:
|
||||
java.lang.String r6 = r13.getName()
|
||||
if (r7 == 0) goto L5f
|
||||
boolean r11 = r6.equals(r8)
|
||||
if (r11 == 0) goto L5f
|
||||
r8 = r4
|
||||
r7 = 0
|
||||
goto Lba
|
||||
L5f:
|
||||
boolean r10 = r6.equals(r10)
|
||||
if (r10 == 0) goto L69
|
||||
r0.d()
|
||||
goto Lba
|
||||
L69:
|
||||
boolean r9 = r6.equals(r9)
|
||||
if (r9 == 0) goto L87
|
||||
boolean r6 = r0.c()
|
||||
if (r6 != 0) goto Lba
|
||||
androidx.core.view.ActionProvider r6 = r0.A
|
||||
if (r6 == 0) goto L83
|
||||
boolean r6 = r6.a()
|
||||
if (r6 == 0) goto L83
|
||||
r0.b()
|
||||
goto Lba
|
||||
L83:
|
||||
r0.a()
|
||||
goto Lba
|
||||
L87:
|
||||
boolean r6 = r6.equals(r2)
|
||||
if (r6 == 0) goto Lba
|
||||
r15 = 1
|
||||
goto Lba
|
||||
L8f:
|
||||
if (r7 == 0) goto L92
|
||||
goto Lba
|
||||
L92:
|
||||
java.lang.String r6 = r13.getName()
|
||||
boolean r10 = r6.equals(r10)
|
||||
if (r10 == 0) goto La0
|
||||
r0.a(r14)
|
||||
goto Lba
|
||||
La0:
|
||||
boolean r9 = r6.equals(r9)
|
||||
if (r9 == 0) goto Laa
|
||||
r0.b(r14)
|
||||
goto Lba
|
||||
Laa:
|
||||
boolean r9 = r6.equals(r2)
|
||||
if (r9 == 0) goto Lb8
|
||||
android.view.SubMenu r6 = r0.b()
|
||||
r12.a(r13, r14, r6)
|
||||
goto Lba
|
||||
Lb8:
|
||||
r8 = r6
|
||||
r7 = 1
|
||||
Lba:
|
||||
int r6 = r13.next()
|
||||
goto L41
|
||||
Lbf:
|
||||
java.lang.RuntimeException r13 = new java.lang.RuntimeException
|
||||
java.lang.String r14 = "Unexpected end of document"
|
||||
r13.<init>(r14)
|
||||
throw r13
|
||||
Lc7:
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.view.SupportMenuInflater.a(org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.view.Menu):void");
|
||||
}
|
||||
|
||||
@Override // android.view.MenuInflater
|
||||
public void inflate(int i, Menu menu) {
|
||||
if (!(menu instanceof SupportMenu)) {
|
||||
super.inflate(i, menu);
|
||||
return;
|
||||
}
|
||||
XmlResourceParser xmlResourceParser = null;
|
||||
try {
|
||||
try {
|
||||
try {
|
||||
xmlResourceParser = this.c.getResources().getLayout(i);
|
||||
a(xmlResourceParser, Xml.asAttributeSet(xmlResourceParser), menu);
|
||||
} catch (IOException e2) {
|
||||
throw new InflateException("Error inflating menu XML", e2);
|
||||
}
|
||||
} catch (XmlPullParserException e3) {
|
||||
throw new InflateException("Error inflating menu XML", e3);
|
||||
}
|
||||
} finally {
|
||||
if (xmlResourceParser != null) {
|
||||
xmlResourceParser.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class MenuState {
|
||||
ActionProvider A;
|
||||
private CharSequence B;
|
||||
private CharSequence C;
|
||||
private ColorStateList D = null;
|
||||
private PorterDuff.Mode E = null;
|
||||
private Menu a;
|
||||
private int b;
|
||||
private int c;
|
||||
private int d;
|
||||
private int e;
|
||||
private boolean f;
|
||||
private boolean g;
|
||||
private boolean h;
|
||||
private int i;
|
||||
private int j;
|
||||
private CharSequence k;
|
||||
private CharSequence l;
|
||||
private int m;
|
||||
private char n;
|
||||
private int o;
|
||||
private char p;
|
||||
private int q;
|
||||
private int r;
|
||||
private boolean s;
|
||||
private boolean t;
|
||||
private boolean u;
|
||||
private int v;
|
||||
private int w;
|
||||
private String x;
|
||||
private String y;
|
||||
private String z;
|
||||
|
||||
public MenuState(Menu menu) {
|
||||
this.a = menu;
|
||||
d();
|
||||
}
|
||||
|
||||
public void a(AttributeSet attributeSet) {
|
||||
TypedArray obtainStyledAttributes = SupportMenuInflater.this.c.obtainStyledAttributes(attributeSet, R$styleable.MenuGroup);
|
||||
this.b = obtainStyledAttributes.getResourceId(R$styleable.MenuGroup_android_id, 0);
|
||||
this.c = obtainStyledAttributes.getInt(R$styleable.MenuGroup_android_menuCategory, 0);
|
||||
this.d = obtainStyledAttributes.getInt(R$styleable.MenuGroup_android_orderInCategory, 0);
|
||||
this.e = obtainStyledAttributes.getInt(R$styleable.MenuGroup_android_checkableBehavior, 0);
|
||||
this.f = obtainStyledAttributes.getBoolean(R$styleable.MenuGroup_android_visible, true);
|
||||
this.g = obtainStyledAttributes.getBoolean(R$styleable.MenuGroup_android_enabled, true);
|
||||
obtainStyledAttributes.recycle();
|
||||
}
|
||||
|
||||
public void b(AttributeSet attributeSet) {
|
||||
TypedArray obtainStyledAttributes = SupportMenuInflater.this.c.obtainStyledAttributes(attributeSet, R$styleable.MenuItem);
|
||||
this.i = obtainStyledAttributes.getResourceId(R$styleable.MenuItem_android_id, 0);
|
||||
this.j = (obtainStyledAttributes.getInt(R$styleable.MenuItem_android_menuCategory, this.c) & (-65536)) | (obtainStyledAttributes.getInt(R$styleable.MenuItem_android_orderInCategory, this.d) & 65535);
|
||||
this.k = obtainStyledAttributes.getText(R$styleable.MenuItem_android_title);
|
||||
this.l = obtainStyledAttributes.getText(R$styleable.MenuItem_android_titleCondensed);
|
||||
this.m = obtainStyledAttributes.getResourceId(R$styleable.MenuItem_android_icon, 0);
|
||||
this.n = a(obtainStyledAttributes.getString(R$styleable.MenuItem_android_alphabeticShortcut));
|
||||
this.o = obtainStyledAttributes.getInt(R$styleable.MenuItem_alphabeticModifiers, FileUtil.ZIP_BUFFER_SIZE);
|
||||
this.p = a(obtainStyledAttributes.getString(R$styleable.MenuItem_android_numericShortcut));
|
||||
this.q = obtainStyledAttributes.getInt(R$styleable.MenuItem_numericModifiers, FileUtil.ZIP_BUFFER_SIZE);
|
||||
if (obtainStyledAttributes.hasValue(R$styleable.MenuItem_android_checkable)) {
|
||||
this.r = obtainStyledAttributes.getBoolean(R$styleable.MenuItem_android_checkable, false) ? 1 : 0;
|
||||
} else {
|
||||
this.r = this.e;
|
||||
}
|
||||
this.s = obtainStyledAttributes.getBoolean(R$styleable.MenuItem_android_checked, false);
|
||||
this.t = obtainStyledAttributes.getBoolean(R$styleable.MenuItem_android_visible, this.f);
|
||||
this.u = obtainStyledAttributes.getBoolean(R$styleable.MenuItem_android_enabled, this.g);
|
||||
this.v = obtainStyledAttributes.getInt(R$styleable.MenuItem_showAsAction, -1);
|
||||
this.z = obtainStyledAttributes.getString(R$styleable.MenuItem_android_onClick);
|
||||
this.w = obtainStyledAttributes.getResourceId(R$styleable.MenuItem_actionLayout, 0);
|
||||
this.x = obtainStyledAttributes.getString(R$styleable.MenuItem_actionViewClass);
|
||||
this.y = obtainStyledAttributes.getString(R$styleable.MenuItem_actionProviderClass);
|
||||
boolean z = this.y != null;
|
||||
if (z && this.w == 0 && this.x == null) {
|
||||
this.A = (ActionProvider) a(this.y, SupportMenuInflater.f, SupportMenuInflater.this.b);
|
||||
} else {
|
||||
if (z) {
|
||||
Log.w("SupportMenuInflater", "Ignoring attribute 'actionProviderClass'. Action view already specified.");
|
||||
}
|
||||
this.A = null;
|
||||
}
|
||||
this.B = obtainStyledAttributes.getText(R$styleable.MenuItem_contentDescription);
|
||||
this.C = obtainStyledAttributes.getText(R$styleable.MenuItem_tooltipText);
|
||||
if (obtainStyledAttributes.hasValue(R$styleable.MenuItem_iconTintMode)) {
|
||||
this.E = DrawableUtils.a(obtainStyledAttributes.getInt(R$styleable.MenuItem_iconTintMode, -1), this.E);
|
||||
} else {
|
||||
this.E = null;
|
||||
}
|
||||
if (obtainStyledAttributes.hasValue(R$styleable.MenuItem_iconTint)) {
|
||||
this.D = obtainStyledAttributes.getColorStateList(R$styleable.MenuItem_iconTint);
|
||||
} else {
|
||||
this.D = null;
|
||||
}
|
||||
obtainStyledAttributes.recycle();
|
||||
this.h = false;
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
public void d() {
|
||||
this.b = 0;
|
||||
this.c = 0;
|
||||
this.d = 0;
|
||||
this.e = 0;
|
||||
this.f = true;
|
||||
this.g = true;
|
||||
}
|
||||
|
||||
private char a(String str) {
|
||||
if (str == null) {
|
||||
return (char) 0;
|
||||
}
|
||||
return str.charAt(0);
|
||||
}
|
||||
|
||||
private void a(MenuItem menuItem) {
|
||||
boolean z = false;
|
||||
menuItem.setChecked(this.s).setVisible(this.t).setEnabled(this.u).setCheckable(this.r >= 1).setTitleCondensed(this.l).setIcon(this.m);
|
||||
int i = this.v;
|
||||
if (i >= 0) {
|
||||
menuItem.setShowAsAction(i);
|
||||
}
|
||||
if (this.z != null) {
|
||||
if (!SupportMenuInflater.this.c.isRestricted()) {
|
||||
menuItem.setOnMenuItemClickListener(new InflatedOnMenuItemClickListener(SupportMenuInflater.this.a(), this.z));
|
||||
} else {
|
||||
throw new IllegalStateException("The android:onClick attribute cannot be used within a restricted context");
|
||||
}
|
||||
}
|
||||
boolean z2 = menuItem instanceof MenuItemImpl;
|
||||
if (z2) {
|
||||
}
|
||||
if (this.r >= 2) {
|
||||
if (z2) {
|
||||
((MenuItemImpl) menuItem).c(true);
|
||||
} else if (menuItem instanceof MenuItemWrapperICS) {
|
||||
((MenuItemWrapperICS) menuItem).a(true);
|
||||
}
|
||||
}
|
||||
String str = this.x;
|
||||
if (str != null) {
|
||||
menuItem.setActionView((View) a(str, SupportMenuInflater.e, SupportMenuInflater.this.a));
|
||||
z = true;
|
||||
}
|
||||
int i2 = this.w;
|
||||
if (i2 > 0) {
|
||||
if (!z) {
|
||||
menuItem.setActionView(i2);
|
||||
} else {
|
||||
Log.w("SupportMenuInflater", "Ignoring attribute 'itemActionViewLayout'. Action view already specified.");
|
||||
}
|
||||
}
|
||||
ActionProvider actionProvider = this.A;
|
||||
if (actionProvider != null) {
|
||||
MenuItemCompat.a(menuItem, actionProvider);
|
||||
}
|
||||
MenuItemCompat.a(menuItem, this.B);
|
||||
MenuItemCompat.b(menuItem, this.C);
|
||||
MenuItemCompat.a(menuItem, this.n, this.o);
|
||||
MenuItemCompat.b(menuItem, this.p, this.q);
|
||||
PorterDuff.Mode mode = this.E;
|
||||
if (mode != null) {
|
||||
MenuItemCompat.a(menuItem, mode);
|
||||
}
|
||||
ColorStateList colorStateList = this.D;
|
||||
if (colorStateList != null) {
|
||||
MenuItemCompat.a(menuItem, colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
public SubMenu b() {
|
||||
this.h = true;
|
||||
SubMenu addSubMenu = this.a.addSubMenu(this.b, this.i, this.j, this.k);
|
||||
a(addSubMenu.getItem());
|
||||
return addSubMenu;
|
||||
}
|
||||
|
||||
public void a() {
|
||||
this.h = true;
|
||||
a(this.a.add(this.b, this.i, this.j, this.k));
|
||||
}
|
||||
|
||||
private <T> T a(String str, Class<?>[] clsArr, Object[] objArr) {
|
||||
try {
|
||||
Constructor<?> constructor = SupportMenuInflater.this.c.getClassLoader().loadClass(str).getConstructor(clsArr);
|
||||
constructor.setAccessible(true);
|
||||
return (T) constructor.newInstance(objArr);
|
||||
} catch (Exception e) {
|
||||
Log.w("SupportMenuInflater", "Cannot instantiate class: " + str, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Object a() {
|
||||
if (this.d == null) {
|
||||
this.d = a(this.c);
|
||||
}
|
||||
return this.d;
|
||||
}
|
||||
|
||||
private Object a(Object obj) {
|
||||
return (!(obj instanceof Activity) && (obj instanceof ContextWrapper)) ? a(((ContextWrapper) obj).getBaseContext()) : obj;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package androidx.appcompat.view;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.animation.Interpolator;
|
||||
import androidx.core.view.ViewPropertyAnimatorCompat;
|
||||
import androidx.core.view.ViewPropertyAnimatorListener;
|
||||
import androidx.core.view.ViewPropertyAnimatorListenerAdapter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ViewPropertyAnimatorCompatSet {
|
||||
private Interpolator c;
|
||||
ViewPropertyAnimatorListener d;
|
||||
private boolean e;
|
||||
private long b = -1;
|
||||
private final ViewPropertyAnimatorListenerAdapter f = new ViewPropertyAnimatorListenerAdapter() { // from class: androidx.appcompat.view.ViewPropertyAnimatorCompatSet.1
|
||||
private boolean a = false;
|
||||
private int b = 0;
|
||||
|
||||
void a() {
|
||||
this.b = 0;
|
||||
this.a = false;
|
||||
ViewPropertyAnimatorCompatSet.this.b();
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void b(View view) {
|
||||
int i = this.b + 1;
|
||||
this.b = i;
|
||||
if (i == ViewPropertyAnimatorCompatSet.this.a.size()) {
|
||||
ViewPropertyAnimatorListener viewPropertyAnimatorListener = ViewPropertyAnimatorCompatSet.this.d;
|
||||
if (viewPropertyAnimatorListener != null) {
|
||||
viewPropertyAnimatorListener.b(null);
|
||||
}
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListenerAdapter, androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void c(View view) {
|
||||
if (this.a) {
|
||||
return;
|
||||
}
|
||||
this.a = true;
|
||||
ViewPropertyAnimatorListener viewPropertyAnimatorListener = ViewPropertyAnimatorCompatSet.this.d;
|
||||
if (viewPropertyAnimatorListener != null) {
|
||||
viewPropertyAnimatorListener.c(null);
|
||||
}
|
||||
}
|
||||
};
|
||||
final ArrayList<ViewPropertyAnimatorCompat> a = new ArrayList<>();
|
||||
|
||||
public ViewPropertyAnimatorCompatSet a(ViewPropertyAnimatorCompat viewPropertyAnimatorCompat) {
|
||||
if (!this.e) {
|
||||
this.a.add(viewPropertyAnimatorCompat);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
void b() {
|
||||
this.e = false;
|
||||
}
|
||||
|
||||
public void c() {
|
||||
if (this.e) {
|
||||
return;
|
||||
}
|
||||
Iterator<ViewPropertyAnimatorCompat> it = this.a.iterator();
|
||||
while (it.hasNext()) {
|
||||
ViewPropertyAnimatorCompat next = it.next();
|
||||
long j = this.b;
|
||||
if (j >= 0) {
|
||||
next.a(j);
|
||||
}
|
||||
Interpolator interpolator = this.c;
|
||||
if (interpolator != null) {
|
||||
next.a(interpolator);
|
||||
}
|
||||
if (this.d != null) {
|
||||
next.a(this.f);
|
||||
}
|
||||
next.c();
|
||||
}
|
||||
this.e = true;
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompatSet a(ViewPropertyAnimatorCompat viewPropertyAnimatorCompat, ViewPropertyAnimatorCompat viewPropertyAnimatorCompat2) {
|
||||
this.a.add(viewPropertyAnimatorCompat);
|
||||
viewPropertyAnimatorCompat2.b(viewPropertyAnimatorCompat.b());
|
||||
this.a.add(viewPropertyAnimatorCompat2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void a() {
|
||||
if (this.e) {
|
||||
Iterator<ViewPropertyAnimatorCompat> it = this.a.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a();
|
||||
}
|
||||
this.e = false;
|
||||
}
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompatSet a(long j) {
|
||||
if (!this.e) {
|
||||
this.b = j;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompatSet a(Interpolator interpolator) {
|
||||
if (!this.e) {
|
||||
this.c = interpolator;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompatSet a(ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
|
||||
if (!this.e) {
|
||||
this.d = viewPropertyAnimatorListener;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
151
sources/androidx/appcompat/view/WindowCallbackWrapper.java
Normal file
151
sources/androidx/appcompat/view/WindowCallbackWrapper.java
Normal file
@@ -0,0 +1,151 @@
|
||||
package androidx.appcompat.view;
|
||||
|
||||
import android.view.ActionMode;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.KeyboardShortcutGroup;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SearchEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WindowCallbackWrapper implements Window.Callback {
|
||||
final Window.Callback a;
|
||||
|
||||
public WindowCallbackWrapper(Window.Callback callback) {
|
||||
if (callback == null) {
|
||||
throw new IllegalArgumentException("Window callback may not be null");
|
||||
}
|
||||
this.a = callback;
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean dispatchGenericMotionEvent(MotionEvent motionEvent) {
|
||||
return this.a.dispatchGenericMotionEvent(motionEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
|
||||
return this.a.dispatchKeyEvent(keyEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean dispatchKeyShortcutEvent(KeyEvent keyEvent) {
|
||||
return this.a.dispatchKeyShortcutEvent(keyEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
|
||||
return this.a.dispatchPopulateAccessibilityEvent(accessibilityEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean dispatchTouchEvent(MotionEvent motionEvent) {
|
||||
return this.a.dispatchTouchEvent(motionEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean dispatchTrackballEvent(MotionEvent motionEvent) {
|
||||
return this.a.dispatchTrackballEvent(motionEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public void onActionModeFinished(android.view.ActionMode actionMode) {
|
||||
this.a.onActionModeFinished(actionMode);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public void onActionModeStarted(android.view.ActionMode actionMode) {
|
||||
this.a.onActionModeStarted(actionMode);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public void onAttachedToWindow() {
|
||||
this.a.onAttachedToWindow();
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public void onContentChanged() {
|
||||
this.a.onContentChanged();
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean onCreatePanelMenu(int i, Menu menu) {
|
||||
return this.a.onCreatePanelMenu(i, menu);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public View onCreatePanelView(int i) {
|
||||
return this.a.onCreatePanelView(i);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public void onDetachedFromWindow() {
|
||||
this.a.onDetachedFromWindow();
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean onMenuItemSelected(int i, MenuItem menuItem) {
|
||||
return this.a.onMenuItemSelected(i, menuItem);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean onMenuOpened(int i, Menu menu) {
|
||||
return this.a.onMenuOpened(i, menu);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public void onPanelClosed(int i, Menu menu) {
|
||||
this.a.onPanelClosed(i, menu);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public void onPointerCaptureChanged(boolean z) {
|
||||
this.a.onPointerCaptureChanged(z);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean onPreparePanel(int i, View view, Menu menu) {
|
||||
return this.a.onPreparePanel(i, view, menu);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public void onProvideKeyboardShortcuts(List<KeyboardShortcutGroup> list, Menu menu, int i) {
|
||||
this.a.onProvideKeyboardShortcuts(list, menu, i);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean onSearchRequested(SearchEvent searchEvent) {
|
||||
return this.a.onSearchRequested(searchEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public void onWindowAttributesChanged(WindowManager.LayoutParams layoutParams) {
|
||||
this.a.onWindowAttributesChanged(layoutParams);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public void onWindowFocusChanged(boolean z) {
|
||||
this.a.onWindowFocusChanged(z);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public android.view.ActionMode onWindowStartingActionMode(ActionMode.Callback callback) {
|
||||
return this.a.onWindowStartingActionMode(callback);
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public boolean onSearchRequested() {
|
||||
return this.a.onSearchRequested();
|
||||
}
|
||||
|
||||
@Override // android.view.Window.Callback
|
||||
public android.view.ActionMode onWindowStartingActionMode(ActionMode.Callback callback, int i) {
|
||||
return this.a.onWindowStartingActionMode(callback, i);
|
||||
}
|
||||
}
|
||||
406
sources/androidx/appcompat/view/menu/ActionMenuItem.java
Normal file
406
sources/androidx/appcompat/view/menu/ActionMenuItem.java
Normal file
@@ -0,0 +1,406 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.core.internal.view.SupportMenuItem;
|
||||
import androidx.core.view.ActionProvider;
|
||||
import com.ubt.jimu.base.util.FileUtil;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActionMenuItem implements SupportMenuItem {
|
||||
private final int a;
|
||||
private final int b;
|
||||
private final int c;
|
||||
private CharSequence d;
|
||||
private CharSequence e;
|
||||
private Intent f;
|
||||
private char g;
|
||||
private char i;
|
||||
private Drawable k;
|
||||
private Context l;
|
||||
private CharSequence m;
|
||||
private CharSequence n;
|
||||
private int h = FileUtil.ZIP_BUFFER_SIZE;
|
||||
private int j = FileUtil.ZIP_BUFFER_SIZE;
|
||||
private ColorStateList o = null;
|
||||
private PorterDuff.Mode p = null;
|
||||
private boolean q = false;
|
||||
private boolean r = false;
|
||||
private int s = 16;
|
||||
|
||||
public ActionMenuItem(Context context, int i, int i2, int i3, int i4, CharSequence charSequence) {
|
||||
this.l = context;
|
||||
this.a = i2;
|
||||
this.b = i;
|
||||
this.c = i4;
|
||||
this.d = charSequence;
|
||||
}
|
||||
|
||||
private void b() {
|
||||
if (this.k != null) {
|
||||
if (this.q || this.r) {
|
||||
this.k = DrawableCompat.h(this.k);
|
||||
this.k = this.k.mutate();
|
||||
if (this.q) {
|
||||
DrawableCompat.a(this.k, this.o);
|
||||
}
|
||||
if (this.r) {
|
||||
DrawableCompat.a(this.k, this.p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem
|
||||
public SupportMenuItem a(ActionProvider actionProvider) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem
|
||||
public ActionProvider a() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public boolean collapseActionView() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public boolean expandActionView() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public android.view.ActionProvider getActionProvider() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public View getActionView() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public int getAlphabeticModifiers() {
|
||||
return this.j;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public char getAlphabeticShortcut() {
|
||||
return this.i;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public CharSequence getContentDescription() {
|
||||
return this.m;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public int getGroupId() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public Drawable getIcon() {
|
||||
return this.k;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public ColorStateList getIconTintList() {
|
||||
return this.o;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public PorterDuff.Mode getIconTintMode() {
|
||||
return this.p;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public Intent getIntent() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public int getItemId() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public ContextMenu.ContextMenuInfo getMenuInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public int getNumericModifiers() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public char getNumericShortcut() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public int getOrder() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public SubMenu getSubMenu() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public CharSequence getTitle() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public CharSequence getTitleCondensed() {
|
||||
CharSequence charSequence = this.e;
|
||||
return charSequence != null ? charSequence : this.d;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public CharSequence getTooltipText() {
|
||||
return this.n;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean hasSubMenu() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public boolean isActionViewExpanded() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isCheckable() {
|
||||
return (this.s & 1) != 0;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isChecked() {
|
||||
return (this.s & 2) != 0;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isEnabled() {
|
||||
return (this.s & 16) != 0;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isVisible() {
|
||||
return (this.s & 8) == 0;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setActionProvider(android.view.ActionProvider actionProvider) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public /* bridge */ /* synthetic */ MenuItem setActionView(int i) {
|
||||
setActionView(i);
|
||||
throw null;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setAlphabeticShortcut(char c) {
|
||||
this.i = Character.toLowerCase(c);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setCheckable(boolean z) {
|
||||
this.s = (z ? 1 : 0) | (this.s & (-2));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setChecked(boolean z) {
|
||||
this.s = (z ? 2 : 0) | (this.s & (-3));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public /* bridge */ /* synthetic */ MenuItem setContentDescription(CharSequence charSequence) {
|
||||
setContentDescription(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setEnabled(boolean z) {
|
||||
this.s = (z ? 16 : 0) | (this.s & (-17));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setIcon(Drawable drawable) {
|
||||
this.k = drawable;
|
||||
b();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public MenuItem setIconTintList(ColorStateList colorStateList) {
|
||||
this.o = colorStateList;
|
||||
this.q = true;
|
||||
b();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public MenuItem setIconTintMode(PorterDuff.Mode mode) {
|
||||
this.p = mode;
|
||||
this.r = true;
|
||||
b();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setIntent(Intent intent) {
|
||||
this.f = intent;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setNumericShortcut(char c) {
|
||||
this.g = c;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setOnActionExpandListener(MenuItem.OnActionExpandListener onActionExpandListener) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setOnMenuItemClickListener(MenuItem.OnMenuItemClickListener onMenuItemClickListener) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setShortcut(char c, char c2) {
|
||||
this.g = c;
|
||||
this.i = Character.toLowerCase(c2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public void setShowAsAction(int i) {
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public /* bridge */ /* synthetic */ MenuItem setShowAsActionFlags(int i) {
|
||||
setShowAsActionFlags(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setTitle(CharSequence charSequence) {
|
||||
this.d = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setTitleCondensed(CharSequence charSequence) {
|
||||
this.e = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public /* bridge */ /* synthetic */ MenuItem setTooltipText(CharSequence charSequence) {
|
||||
setTooltipText(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setVisible(boolean z) {
|
||||
this.s = (this.s & 8) | (z ? 0 : 8);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public /* bridge */ /* synthetic */ MenuItem setActionView(View view) {
|
||||
setActionView(view);
|
||||
throw null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public MenuItem setAlphabeticShortcut(char c, int i) {
|
||||
this.i = Character.toLowerCase(c);
|
||||
this.j = KeyEvent.normalizeMetaState(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public SupportMenuItem setContentDescription(CharSequence charSequence) {
|
||||
this.m = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public MenuItem setNumericShortcut(char c, int i) {
|
||||
this.g = c;
|
||||
this.h = KeyEvent.normalizeMetaState(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public SupportMenuItem setShowAsActionFlags(int i) {
|
||||
setShowAsAction(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setTitle(int i) {
|
||||
this.d = this.l.getResources().getString(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public SupportMenuItem setTooltipText(CharSequence charSequence) {
|
||||
this.n = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public SupportMenuItem setActionView(View view) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setIcon(int i) {
|
||||
this.k = ContextCompat.c(this.l, i);
|
||||
b();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public MenuItem setShortcut(char c, char c2, int i, int i2) {
|
||||
this.g = c;
|
||||
this.h = KeyEvent.normalizeMetaState(i);
|
||||
this.i = Character.toLowerCase(c2);
|
||||
this.j = KeyEvent.normalizeMetaState(i2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public SupportMenuItem setActionView(int i) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
253
sources/androidx/appcompat/view/menu/ActionMenuItemView.java
Normal file
253
sources/androidx/appcompat/view/menu/ActionMenuItemView.java
Normal file
@@ -0,0 +1,253 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.appcompat.view.menu.MenuBuilder;
|
||||
import androidx.appcompat.view.menu.MenuView;
|
||||
import androidx.appcompat.widget.ActionMenuView;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.appcompat.widget.ForwardingListener;
|
||||
import androidx.appcompat.widget.TooltipCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActionMenuItemView extends AppCompatTextView implements MenuView.ItemView, View.OnClickListener, ActionMenuView.ActionMenuChildView {
|
||||
MenuItemImpl d;
|
||||
private CharSequence e;
|
||||
private Drawable f;
|
||||
MenuBuilder.ItemInvoker g;
|
||||
private ForwardingListener h;
|
||||
PopupCallback i;
|
||||
private boolean j;
|
||||
private boolean k;
|
||||
private int l;
|
||||
private int m;
|
||||
private int n;
|
||||
|
||||
private class ActionMenuItemForwardingListener extends ForwardingListener {
|
||||
public ActionMenuItemForwardingListener() {
|
||||
super(ActionMenuItemView.this);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ForwardingListener
|
||||
public ShowableListMenu a() {
|
||||
PopupCallback popupCallback = ActionMenuItemView.this.i;
|
||||
if (popupCallback != null) {
|
||||
return popupCallback.a();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ForwardingListener
|
||||
protected boolean b() {
|
||||
ShowableListMenu a;
|
||||
ActionMenuItemView actionMenuItemView = ActionMenuItemView.this;
|
||||
MenuBuilder.ItemInvoker itemInvoker = actionMenuItemView.g;
|
||||
return itemInvoker != null && itemInvoker.a(actionMenuItemView.d) && (a = a()) != null && a.c();
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class PopupCallback {
|
||||
public abstract ShowableListMenu a();
|
||||
}
|
||||
|
||||
public ActionMenuItemView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
private boolean e() {
|
||||
Configuration configuration = getContext().getResources().getConfiguration();
|
||||
int i = configuration.screenWidthDp;
|
||||
return i >= 480 || (i >= 640 && configuration.screenHeightDp >= 480) || configuration.orientation == 2;
|
||||
}
|
||||
|
||||
private void f() {
|
||||
boolean z = true;
|
||||
boolean z2 = !TextUtils.isEmpty(this.e);
|
||||
if (this.f != null && (!this.d.n() || (!this.j && !this.k))) {
|
||||
z = false;
|
||||
}
|
||||
boolean z3 = z2 & z;
|
||||
setText(z3 ? this.e : null);
|
||||
CharSequence contentDescription = this.d.getContentDescription();
|
||||
if (TextUtils.isEmpty(contentDescription)) {
|
||||
setContentDescription(z3 ? null : this.d.getTitle());
|
||||
} else {
|
||||
setContentDescription(contentDescription);
|
||||
}
|
||||
CharSequence tooltipText = this.d.getTooltipText();
|
||||
if (TextUtils.isEmpty(tooltipText)) {
|
||||
TooltipCompat.a(this, z3 ? null : this.d.getTitle());
|
||||
} else {
|
||||
TooltipCompat.a(this, tooltipText);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuView.ItemView
|
||||
public void a(MenuItemImpl menuItemImpl, int i) {
|
||||
this.d = menuItemImpl;
|
||||
setIcon(menuItemImpl.getIcon());
|
||||
setTitle(menuItemImpl.a(this));
|
||||
setId(menuItemImpl.getItemId());
|
||||
setVisibility(menuItemImpl.isVisible() ? 0 : 8);
|
||||
setEnabled(menuItemImpl.isEnabled());
|
||||
if (menuItemImpl.hasSubMenu() && this.h == null) {
|
||||
this.h = new ActionMenuItemForwardingListener();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuView.ItemView
|
||||
public boolean a() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ActionMenuView.ActionMenuChildView
|
||||
public boolean b() {
|
||||
return d();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ActionMenuView.ActionMenuChildView
|
||||
public boolean c() {
|
||||
return d() && this.d.getIcon() == null;
|
||||
}
|
||||
|
||||
public boolean d() {
|
||||
return !TextUtils.isEmpty(getText());
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuView.ItemView
|
||||
public MenuItemImpl getItemData() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
MenuBuilder.ItemInvoker itemInvoker = this.g;
|
||||
if (itemInvoker != null) {
|
||||
itemInvoker.a(this.d);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
public void onConfigurationChanged(Configuration configuration) {
|
||||
super.onConfigurationChanged(configuration);
|
||||
this.j = e();
|
||||
f();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.AppCompatTextView, android.widget.TextView, android.view.View
|
||||
protected void onMeasure(int i, int i2) {
|
||||
int i3;
|
||||
boolean d = d();
|
||||
if (d && (i3 = this.m) >= 0) {
|
||||
super.setPadding(i3, getPaddingTop(), getPaddingRight(), getPaddingBottom());
|
||||
}
|
||||
super.onMeasure(i, i2);
|
||||
int mode = View.MeasureSpec.getMode(i);
|
||||
int size = View.MeasureSpec.getSize(i);
|
||||
int measuredWidth = getMeasuredWidth();
|
||||
int min = mode == Integer.MIN_VALUE ? Math.min(size, this.l) : this.l;
|
||||
if (mode != 1073741824 && this.l > 0 && measuredWidth < min) {
|
||||
super.onMeasure(View.MeasureSpec.makeMeasureSpec(min, 1073741824), i2);
|
||||
}
|
||||
if (d || this.f == null) {
|
||||
return;
|
||||
}
|
||||
super.setPadding((getMeasuredWidth() - this.f.getBounds().width()) / 2, getPaddingTop(), getPaddingRight(), getPaddingBottom());
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
public void onRestoreInstanceState(Parcelable parcelable) {
|
||||
super.onRestoreInstanceState(null);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
public boolean onTouchEvent(MotionEvent motionEvent) {
|
||||
ForwardingListener forwardingListener;
|
||||
if (this.d.hasSubMenu() && (forwardingListener = this.h) != null && forwardingListener.onTouch(this, motionEvent)) {
|
||||
return true;
|
||||
}
|
||||
return super.onTouchEvent(motionEvent);
|
||||
}
|
||||
|
||||
public void setCheckable(boolean z) {
|
||||
}
|
||||
|
||||
public void setChecked(boolean z) {
|
||||
}
|
||||
|
||||
public void setExpandedFormat(boolean z) {
|
||||
if (this.k != z) {
|
||||
this.k = z;
|
||||
MenuItemImpl menuItemImpl = this.d;
|
||||
if (menuItemImpl != null) {
|
||||
menuItemImpl.b();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setIcon(Drawable drawable) {
|
||||
this.f = drawable;
|
||||
if (drawable != null) {
|
||||
int intrinsicWidth = drawable.getIntrinsicWidth();
|
||||
int intrinsicHeight = drawable.getIntrinsicHeight();
|
||||
int i = this.n;
|
||||
if (intrinsicWidth > i) {
|
||||
intrinsicHeight = (int) (intrinsicHeight * (i / intrinsicWidth));
|
||||
intrinsicWidth = i;
|
||||
}
|
||||
int i2 = this.n;
|
||||
if (intrinsicHeight > i2) {
|
||||
intrinsicWidth = (int) (intrinsicWidth * (i2 / intrinsicHeight));
|
||||
intrinsicHeight = i2;
|
||||
}
|
||||
drawable.setBounds(0, 0, intrinsicWidth, intrinsicHeight);
|
||||
}
|
||||
setCompoundDrawables(drawable, null, null, null);
|
||||
f();
|
||||
}
|
||||
|
||||
public void setItemInvoker(MenuBuilder.ItemInvoker itemInvoker) {
|
||||
this.g = itemInvoker;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
public void setPadding(int i, int i2, int i3, int i4) {
|
||||
this.m = i;
|
||||
super.setPadding(i, i2, i3, i4);
|
||||
}
|
||||
|
||||
public void setPopupCallback(PopupCallback popupCallback) {
|
||||
this.i = popupCallback;
|
||||
}
|
||||
|
||||
public void setTitle(CharSequence charSequence) {
|
||||
this.e = charSequence;
|
||||
f();
|
||||
}
|
||||
|
||||
public ActionMenuItemView(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, 0);
|
||||
}
|
||||
|
||||
public ActionMenuItemView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet, i);
|
||||
Resources resources = context.getResources();
|
||||
this.j = e();
|
||||
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.ActionMenuItemView, i, 0);
|
||||
this.l = obtainStyledAttributes.getDimensionPixelSize(R$styleable.ActionMenuItemView_android_minWidth, 0);
|
||||
obtainStyledAttributes.recycle();
|
||||
this.n = (int) ((resources.getDisplayMetrics().density * 32.0f) + 0.5f);
|
||||
setOnClickListener(this);
|
||||
this.m = -1;
|
||||
setSaveEnabled(false);
|
||||
}
|
||||
}
|
||||
155
sources/androidx/appcompat/view/menu/BaseMenuPresenter.java
Normal file
155
sources/androidx/appcompat/view/menu/BaseMenuPresenter.java
Normal file
@@ -0,0 +1,155 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.appcompat.view.menu.MenuPresenter;
|
||||
import androidx.appcompat.view.menu.MenuView;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class BaseMenuPresenter implements MenuPresenter {
|
||||
protected Context a;
|
||||
protected Context b;
|
||||
protected MenuBuilder c;
|
||||
protected LayoutInflater d;
|
||||
private MenuPresenter.Callback e;
|
||||
private int f;
|
||||
private int g;
|
||||
protected MenuView h;
|
||||
|
||||
public BaseMenuPresenter(Context context, int i, int i2) {
|
||||
this.a = context;
|
||||
this.d = LayoutInflater.from(context);
|
||||
this.f = i;
|
||||
this.g = i2;
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(Context context, MenuBuilder menuBuilder) {
|
||||
this.b = context;
|
||||
LayoutInflater.from(this.b);
|
||||
this.c = menuBuilder;
|
||||
}
|
||||
|
||||
public abstract void a(MenuItemImpl menuItemImpl, MenuView.ItemView itemView);
|
||||
|
||||
public abstract boolean a(int i, MenuItemImpl menuItemImpl);
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean a(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public MenuView b(ViewGroup viewGroup) {
|
||||
if (this.h == null) {
|
||||
this.h = (MenuView) this.d.inflate(this.f, viewGroup, false);
|
||||
this.h.a(this.c);
|
||||
a(true);
|
||||
}
|
||||
return this.h;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean b(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(boolean z) {
|
||||
ViewGroup viewGroup = (ViewGroup) this.h;
|
||||
if (viewGroup == null) {
|
||||
return;
|
||||
}
|
||||
MenuBuilder menuBuilder = this.c;
|
||||
int i = 0;
|
||||
if (menuBuilder != null) {
|
||||
menuBuilder.b();
|
||||
ArrayList<MenuItemImpl> n = this.c.n();
|
||||
int size = n.size();
|
||||
int i2 = 0;
|
||||
for (int i3 = 0; i3 < size; i3++) {
|
||||
MenuItemImpl menuItemImpl = n.get(i3);
|
||||
if (a(i2, menuItemImpl)) {
|
||||
View childAt = viewGroup.getChildAt(i2);
|
||||
MenuItemImpl itemData = childAt instanceof MenuView.ItemView ? ((MenuView.ItemView) childAt).getItemData() : null;
|
||||
View a = a(menuItemImpl, childAt, viewGroup);
|
||||
if (menuItemImpl != itemData) {
|
||||
a.setPressed(false);
|
||||
a.jumpDrawablesToCurrentState();
|
||||
}
|
||||
if (a != childAt) {
|
||||
a(a, i2);
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i = i2;
|
||||
}
|
||||
while (i < viewGroup.getChildCount()) {
|
||||
if (!a(viewGroup, i)) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(View view, int i) {
|
||||
ViewGroup viewGroup = (ViewGroup) view.getParent();
|
||||
if (viewGroup != null) {
|
||||
viewGroup.removeView(view);
|
||||
}
|
||||
((ViewGroup) this.h).addView(view, i);
|
||||
}
|
||||
|
||||
protected boolean a(ViewGroup viewGroup, int i) {
|
||||
viewGroup.removeViewAt(i);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(MenuPresenter.Callback callback) {
|
||||
this.e = callback;
|
||||
}
|
||||
|
||||
public MenuPresenter.Callback a() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public MenuView.ItemView a(ViewGroup viewGroup) {
|
||||
return (MenuView.ItemView) this.d.inflate(this.g, viewGroup, false);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public View a(MenuItemImpl menuItemImpl, View view, ViewGroup viewGroup) {
|
||||
MenuView.ItemView itemView;
|
||||
if (view instanceof MenuView.ItemView) {
|
||||
itemView = (MenuView.ItemView) view;
|
||||
} else {
|
||||
itemView = a(viewGroup);
|
||||
}
|
||||
a(menuItemImpl, itemView);
|
||||
return (View) itemView;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(MenuBuilder menuBuilder, boolean z) {
|
||||
MenuPresenter.Callback callback = this.e;
|
||||
if (callback != null) {
|
||||
callback.a(menuBuilder, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean a(SubMenuBuilder subMenuBuilder) {
|
||||
MenuPresenter.Callback callback = this.e;
|
||||
if (callback != null) {
|
||||
return callback.a(subMenuBuilder);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
94
sources/androidx/appcompat/view/menu/BaseMenuWrapper.java
Normal file
94
sources/androidx/appcompat/view/menu/BaseMenuWrapper.java
Normal file
@@ -0,0 +1,94 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import androidx.collection.ArrayMap;
|
||||
import androidx.core.internal.view.SupportMenuItem;
|
||||
import androidx.core.internal.view.SupportSubMenu;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class BaseMenuWrapper<T> extends BaseWrapper<T> {
|
||||
final Context b;
|
||||
private Map<SupportMenuItem, MenuItem> c;
|
||||
private Map<SupportSubMenu, SubMenu> d;
|
||||
|
||||
BaseMenuWrapper(Context context, T t) {
|
||||
super(t);
|
||||
this.b = context;
|
||||
}
|
||||
|
||||
final MenuItem a(MenuItem menuItem) {
|
||||
if (!(menuItem instanceof SupportMenuItem)) {
|
||||
return menuItem;
|
||||
}
|
||||
SupportMenuItem supportMenuItem = (SupportMenuItem) menuItem;
|
||||
if (this.c == null) {
|
||||
this.c = new ArrayMap();
|
||||
}
|
||||
MenuItem menuItem2 = this.c.get(menuItem);
|
||||
if (menuItem2 != null) {
|
||||
return menuItem2;
|
||||
}
|
||||
MenuItem a = MenuWrapperFactory.a(this.b, supportMenuItem);
|
||||
this.c.put(supportMenuItem, a);
|
||||
return a;
|
||||
}
|
||||
|
||||
final void b() {
|
||||
Map<SupportMenuItem, MenuItem> map = this.c;
|
||||
if (map != null) {
|
||||
map.clear();
|
||||
}
|
||||
Map<SupportSubMenu, SubMenu> map2 = this.d;
|
||||
if (map2 != null) {
|
||||
map2.clear();
|
||||
}
|
||||
}
|
||||
|
||||
final void b(int i) {
|
||||
Map<SupportMenuItem, MenuItem> map = this.c;
|
||||
if (map == null) {
|
||||
return;
|
||||
}
|
||||
Iterator<SupportMenuItem> it = map.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
if (i == it.next().getItemId()) {
|
||||
it.remove();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final SubMenu a(SubMenu subMenu) {
|
||||
if (!(subMenu instanceof SupportSubMenu)) {
|
||||
return subMenu;
|
||||
}
|
||||
SupportSubMenu supportSubMenu = (SupportSubMenu) subMenu;
|
||||
if (this.d == null) {
|
||||
this.d = new ArrayMap();
|
||||
}
|
||||
SubMenu subMenu2 = this.d.get(supportSubMenu);
|
||||
if (subMenu2 != null) {
|
||||
return subMenu2;
|
||||
}
|
||||
SubMenu a = MenuWrapperFactory.a(this.b, supportSubMenu);
|
||||
this.d.put(supportSubMenu, a);
|
||||
return a;
|
||||
}
|
||||
|
||||
final void a(int i) {
|
||||
Map<SupportMenuItem, MenuItem> map = this.c;
|
||||
if (map == null) {
|
||||
return;
|
||||
}
|
||||
Iterator<SupportMenuItem> it = map.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
if (i == it.next().getGroupId()) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
sources/androidx/appcompat/view/menu/BaseWrapper.java
Normal file
13
sources/androidx/appcompat/view/menu/BaseWrapper.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class BaseWrapper<T> {
|
||||
final T a;
|
||||
|
||||
BaseWrapper(T t) {
|
||||
if (t == null) {
|
||||
throw new IllegalArgumentException("Wrapped Object can not be null.");
|
||||
}
|
||||
this.a = t;
|
||||
}
|
||||
}
|
||||
554
sources/androidx/appcompat/view/menu/CascadingMenuPopup.java
Normal file
554
sources/androidx/appcompat/view/menu/CascadingMenuPopup.java
Normal file
@@ -0,0 +1,554 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.SystemClock;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.HeaderViewListAdapter;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.ListView;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.R$dimen;
|
||||
import androidx.appcompat.R$layout;
|
||||
import androidx.appcompat.view.menu.MenuPresenter;
|
||||
import androidx.appcompat.widget.MenuItemHoverListener;
|
||||
import androidx.appcompat.widget.MenuPopupWindow;
|
||||
import androidx.core.view.GravityCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class CascadingMenuPopup extends MenuPopup implements MenuPresenter, View.OnKeyListener, PopupWindow.OnDismissListener {
|
||||
private static final int C = R$layout.abc_cascading_menu_item_layout;
|
||||
private PopupWindow.OnDismissListener A;
|
||||
boolean B;
|
||||
private final Context b;
|
||||
private final int c;
|
||||
private final int d;
|
||||
private final int e;
|
||||
private final boolean f;
|
||||
final Handler g;
|
||||
private View o;
|
||||
View p;
|
||||
private boolean r;
|
||||
private boolean s;
|
||||
private int t;
|
||||
private int u;
|
||||
private boolean x;
|
||||
private MenuPresenter.Callback y;
|
||||
ViewTreeObserver z;
|
||||
private final List<MenuBuilder> h = new ArrayList();
|
||||
final List<CascadingMenuInfo> i = new ArrayList();
|
||||
final ViewTreeObserver.OnGlobalLayoutListener j = new ViewTreeObserver.OnGlobalLayoutListener() { // from class: androidx.appcompat.view.menu.CascadingMenuPopup.1
|
||||
@Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
|
||||
public void onGlobalLayout() {
|
||||
if (!CascadingMenuPopup.this.c() || CascadingMenuPopup.this.i.size() <= 0 || CascadingMenuPopup.this.i.get(0).a.k()) {
|
||||
return;
|
||||
}
|
||||
View view = CascadingMenuPopup.this.p;
|
||||
if (view == null || !view.isShown()) {
|
||||
CascadingMenuPopup.this.dismiss();
|
||||
return;
|
||||
}
|
||||
Iterator<CascadingMenuInfo> it = CascadingMenuPopup.this.i.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a.a();
|
||||
}
|
||||
}
|
||||
};
|
||||
private final View.OnAttachStateChangeListener k = new View.OnAttachStateChangeListener() { // from class: androidx.appcompat.view.menu.CascadingMenuPopup.2
|
||||
@Override // android.view.View.OnAttachStateChangeListener
|
||||
public void onViewAttachedToWindow(View view) {
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnAttachStateChangeListener
|
||||
public void onViewDetachedFromWindow(View view) {
|
||||
ViewTreeObserver viewTreeObserver = CascadingMenuPopup.this.z;
|
||||
if (viewTreeObserver != null) {
|
||||
if (!viewTreeObserver.isAlive()) {
|
||||
CascadingMenuPopup.this.z = view.getViewTreeObserver();
|
||||
}
|
||||
CascadingMenuPopup cascadingMenuPopup = CascadingMenuPopup.this;
|
||||
cascadingMenuPopup.z.removeGlobalOnLayoutListener(cascadingMenuPopup.j);
|
||||
}
|
||||
view.removeOnAttachStateChangeListener(this);
|
||||
}
|
||||
};
|
||||
private final MenuItemHoverListener l = new MenuItemHoverListener() { // from class: androidx.appcompat.view.menu.CascadingMenuPopup.3
|
||||
@Override // androidx.appcompat.widget.MenuItemHoverListener
|
||||
public void a(final MenuBuilder menuBuilder, final MenuItem menuItem) {
|
||||
CascadingMenuPopup.this.g.removeCallbacksAndMessages(null);
|
||||
int size = CascadingMenuPopup.this.i.size();
|
||||
int i = 0;
|
||||
while (true) {
|
||||
if (i >= size) {
|
||||
i = -1;
|
||||
break;
|
||||
} else if (menuBuilder == CascadingMenuPopup.this.i.get(i).b) {
|
||||
break;
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (i == -1) {
|
||||
return;
|
||||
}
|
||||
int i2 = i + 1;
|
||||
final CascadingMenuInfo cascadingMenuInfo = i2 < CascadingMenuPopup.this.i.size() ? CascadingMenuPopup.this.i.get(i2) : null;
|
||||
CascadingMenuPopup.this.g.postAtTime(new Runnable() { // from class: androidx.appcompat.view.menu.CascadingMenuPopup.3.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
CascadingMenuInfo cascadingMenuInfo2 = cascadingMenuInfo;
|
||||
if (cascadingMenuInfo2 != null) {
|
||||
CascadingMenuPopup.this.B = true;
|
||||
cascadingMenuInfo2.b.a(false);
|
||||
CascadingMenuPopup.this.B = false;
|
||||
}
|
||||
if (menuItem.isEnabled() && menuItem.hasSubMenu()) {
|
||||
menuBuilder.a(menuItem, 4);
|
||||
}
|
||||
}
|
||||
}, menuBuilder, SystemClock.uptimeMillis() + 200);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.MenuItemHoverListener
|
||||
public void b(MenuBuilder menuBuilder, MenuItem menuItem) {
|
||||
CascadingMenuPopup.this.g.removeCallbacksAndMessages(menuBuilder);
|
||||
}
|
||||
};
|
||||
private int m = 0;
|
||||
private int n = 0;
|
||||
private boolean v = false;
|
||||
private int q = h();
|
||||
|
||||
private static class CascadingMenuInfo {
|
||||
public final MenuPopupWindow a;
|
||||
public final MenuBuilder b;
|
||||
public final int c;
|
||||
|
||||
public CascadingMenuInfo(MenuPopupWindow menuPopupWindow, MenuBuilder menuBuilder, int i) {
|
||||
this.a = menuPopupWindow;
|
||||
this.b = menuBuilder;
|
||||
this.c = i;
|
||||
}
|
||||
|
||||
public ListView a() {
|
||||
return this.a.d();
|
||||
}
|
||||
}
|
||||
|
||||
public CascadingMenuPopup(Context context, View view, int i, int i2, boolean z) {
|
||||
this.b = context;
|
||||
this.o = view;
|
||||
this.d = i;
|
||||
this.e = i2;
|
||||
this.f = z;
|
||||
Resources resources = context.getResources();
|
||||
this.c = Math.max(resources.getDisplayMetrics().widthPixels / 2, resources.getDimensionPixelSize(R$dimen.abc_config_prefDialogWidth));
|
||||
this.g = new Handler();
|
||||
}
|
||||
|
||||
private int d(int i) {
|
||||
List<CascadingMenuInfo> list = this.i;
|
||||
ListView a = list.get(list.size() - 1).a();
|
||||
int[] iArr = new int[2];
|
||||
a.getLocationOnScreen(iArr);
|
||||
Rect rect = new Rect();
|
||||
this.p.getWindowVisibleDisplayFrame(rect);
|
||||
return this.q == 1 ? (iArr[0] + a.getWidth()) + i > rect.right ? 0 : 1 : iArr[0] - i < 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
private MenuPopupWindow g() {
|
||||
MenuPopupWindow menuPopupWindow = new MenuPopupWindow(this.b, null, this.d, this.e);
|
||||
menuPopupWindow.a(this.l);
|
||||
menuPopupWindow.a((AdapterView.OnItemClickListener) this);
|
||||
menuPopupWindow.a((PopupWindow.OnDismissListener) this);
|
||||
menuPopupWindow.a(this.o);
|
||||
menuPopupWindow.c(this.n);
|
||||
menuPopupWindow.a(true);
|
||||
menuPopupWindow.e(2);
|
||||
return menuPopupWindow;
|
||||
}
|
||||
|
||||
private int h() {
|
||||
return ViewCompat.k(this.o) == 1 ? 0 : 1;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.ShowableListMenu
|
||||
public void a() {
|
||||
if (c()) {
|
||||
return;
|
||||
}
|
||||
Iterator<MenuBuilder> it = this.h.iterator();
|
||||
while (it.hasNext()) {
|
||||
d(it.next());
|
||||
}
|
||||
this.h.clear();
|
||||
this.p = this.o;
|
||||
if (this.p != null) {
|
||||
boolean z = this.z == null;
|
||||
this.z = this.p.getViewTreeObserver();
|
||||
if (z) {
|
||||
this.z.addOnGlobalLayoutListener(this.j);
|
||||
}
|
||||
this.p.addOnAttachStateChangeListener(this.k);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void b(boolean z) {
|
||||
this.v = z;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean b() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.ShowableListMenu
|
||||
public boolean c() {
|
||||
return this.i.size() > 0 && this.i.get(0).a.c();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.ShowableListMenu
|
||||
public void dismiss() {
|
||||
int size = this.i.size();
|
||||
if (size > 0) {
|
||||
CascadingMenuInfo[] cascadingMenuInfoArr = (CascadingMenuInfo[]) this.i.toArray(new CascadingMenuInfo[size]);
|
||||
for (int i = size - 1; i >= 0; i--) {
|
||||
CascadingMenuInfo cascadingMenuInfo = cascadingMenuInfoArr[i];
|
||||
if (cascadingMenuInfo.a.c()) {
|
||||
cascadingMenuInfo.a.dismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
protected boolean e() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.widget.PopupWindow.OnDismissListener
|
||||
public void onDismiss() {
|
||||
CascadingMenuInfo cascadingMenuInfo;
|
||||
int size = this.i.size();
|
||||
int i = 0;
|
||||
while (true) {
|
||||
if (i >= size) {
|
||||
cascadingMenuInfo = null;
|
||||
break;
|
||||
}
|
||||
cascadingMenuInfo = this.i.get(i);
|
||||
if (!cascadingMenuInfo.a.c()) {
|
||||
break;
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (cascadingMenuInfo != null) {
|
||||
cascadingMenuInfo.b.a(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnKeyListener
|
||||
public boolean onKey(View view, int i, KeyEvent keyEvent) {
|
||||
if (keyEvent.getAction() != 1 || i != 82) {
|
||||
return false;
|
||||
}
|
||||
dismiss();
|
||||
return true;
|
||||
}
|
||||
|
||||
private int c(MenuBuilder menuBuilder) {
|
||||
int size = this.i.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (menuBuilder == this.i.get(i).b) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void b(int i) {
|
||||
this.r = true;
|
||||
this.t = i;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void c(int i) {
|
||||
this.s = true;
|
||||
this.u = i;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void c(boolean z) {
|
||||
this.x = z;
|
||||
}
|
||||
|
||||
private void d(MenuBuilder menuBuilder) {
|
||||
CascadingMenuInfo cascadingMenuInfo;
|
||||
View view;
|
||||
int i;
|
||||
int i2;
|
||||
int i3;
|
||||
LayoutInflater from = LayoutInflater.from(this.b);
|
||||
MenuAdapter menuAdapter = new MenuAdapter(menuBuilder, from, this.f, C);
|
||||
if (!c() && this.v) {
|
||||
menuAdapter.a(true);
|
||||
} else if (c()) {
|
||||
menuAdapter.a(MenuPopup.b(menuBuilder));
|
||||
}
|
||||
int a = MenuPopup.a(menuAdapter, null, this.b, this.c);
|
||||
MenuPopupWindow g = g();
|
||||
g.a((ListAdapter) menuAdapter);
|
||||
g.b(a);
|
||||
g.c(this.n);
|
||||
if (this.i.size() > 0) {
|
||||
List<CascadingMenuInfo> list = this.i;
|
||||
cascadingMenuInfo = list.get(list.size() - 1);
|
||||
view = a(cascadingMenuInfo, menuBuilder);
|
||||
} else {
|
||||
cascadingMenuInfo = null;
|
||||
view = null;
|
||||
}
|
||||
if (view != null) {
|
||||
g.c(false);
|
||||
g.a((Object) null);
|
||||
int d = d(a);
|
||||
boolean z = d == 1;
|
||||
this.q = d;
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
g.a(view);
|
||||
i2 = 0;
|
||||
i = 0;
|
||||
} else {
|
||||
int[] iArr = new int[2];
|
||||
this.o.getLocationOnScreen(iArr);
|
||||
int[] iArr2 = new int[2];
|
||||
view.getLocationOnScreen(iArr2);
|
||||
if ((this.n & 7) == 5) {
|
||||
iArr[0] = iArr[0] + this.o.getWidth();
|
||||
iArr2[0] = iArr2[0] + view.getWidth();
|
||||
}
|
||||
i = iArr2[0] - iArr[0];
|
||||
i2 = iArr2[1] - iArr[1];
|
||||
}
|
||||
if ((this.n & 5) == 5) {
|
||||
if (!z) {
|
||||
a = view.getWidth();
|
||||
i3 = i - a;
|
||||
}
|
||||
i3 = i + a;
|
||||
} else {
|
||||
if (z) {
|
||||
a = view.getWidth();
|
||||
i3 = i + a;
|
||||
}
|
||||
i3 = i - a;
|
||||
}
|
||||
g.d(i3);
|
||||
g.b(true);
|
||||
g.h(i2);
|
||||
} else {
|
||||
if (this.r) {
|
||||
g.d(this.t);
|
||||
}
|
||||
if (this.s) {
|
||||
g.h(this.u);
|
||||
}
|
||||
g.a(f());
|
||||
}
|
||||
this.i.add(new CascadingMenuInfo(g, menuBuilder, this.q));
|
||||
g.a();
|
||||
ListView d2 = g.d();
|
||||
d2.setOnKeyListener(this);
|
||||
if (cascadingMenuInfo == null && this.x && menuBuilder.h() != null) {
|
||||
FrameLayout frameLayout = (FrameLayout) from.inflate(R$layout.abc_popup_menu_header_item_layout, (ViewGroup) d2, false);
|
||||
TextView textView = (TextView) frameLayout.findViewById(R.id.title);
|
||||
frameLayout.setEnabled(false);
|
||||
textView.setText(menuBuilder.h());
|
||||
d2.addHeaderView(frameLayout, null, false);
|
||||
g.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void a(MenuBuilder menuBuilder) {
|
||||
menuBuilder.a(this, this.b);
|
||||
if (c()) {
|
||||
d(menuBuilder);
|
||||
} else {
|
||||
this.h.add(menuBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
private MenuItem a(MenuBuilder menuBuilder, MenuBuilder menuBuilder2) {
|
||||
int size = menuBuilder.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
MenuItem item = menuBuilder.getItem(i);
|
||||
if (item.hasSubMenu() && menuBuilder2 == item.getSubMenu()) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private View a(CascadingMenuInfo cascadingMenuInfo, MenuBuilder menuBuilder) {
|
||||
MenuAdapter menuAdapter;
|
||||
int i;
|
||||
int firstVisiblePosition;
|
||||
MenuItem a = a(cascadingMenuInfo.b, menuBuilder);
|
||||
if (a == null) {
|
||||
return null;
|
||||
}
|
||||
ListView a2 = cascadingMenuInfo.a();
|
||||
ListAdapter adapter = a2.getAdapter();
|
||||
int i2 = 0;
|
||||
if (adapter instanceof HeaderViewListAdapter) {
|
||||
HeaderViewListAdapter headerViewListAdapter = (HeaderViewListAdapter) adapter;
|
||||
i = headerViewListAdapter.getHeadersCount();
|
||||
menuAdapter = (MenuAdapter) headerViewListAdapter.getWrappedAdapter();
|
||||
} else {
|
||||
menuAdapter = (MenuAdapter) adapter;
|
||||
i = 0;
|
||||
}
|
||||
int count = menuAdapter.getCount();
|
||||
while (true) {
|
||||
if (i2 >= count) {
|
||||
i2 = -1;
|
||||
break;
|
||||
}
|
||||
if (a == menuAdapter.getItem(i2)) {
|
||||
break;
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
if (i2 != -1 && (firstVisiblePosition = (i2 + i) - a2.getFirstVisiblePosition()) >= 0 && firstVisiblePosition < a2.getChildCount()) {
|
||||
return a2.getChildAt(firstVisiblePosition);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(boolean z) {
|
||||
Iterator<CascadingMenuInfo> it = this.i.iterator();
|
||||
while (it.hasNext()) {
|
||||
MenuPopup.a(it.next().a().getAdapter()).notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(MenuPresenter.Callback callback) {
|
||||
this.y = callback;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean a(SubMenuBuilder subMenuBuilder) {
|
||||
for (CascadingMenuInfo cascadingMenuInfo : this.i) {
|
||||
if (subMenuBuilder == cascadingMenuInfo.b) {
|
||||
cascadingMenuInfo.a().requestFocus();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (!subMenuBuilder.hasVisibleItems()) {
|
||||
return false;
|
||||
}
|
||||
a((MenuBuilder) subMenuBuilder);
|
||||
MenuPresenter.Callback callback = this.y;
|
||||
if (callback != null) {
|
||||
callback.a(subMenuBuilder);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(MenuBuilder menuBuilder, boolean z) {
|
||||
int c = c(menuBuilder);
|
||||
if (c < 0) {
|
||||
return;
|
||||
}
|
||||
int i = c + 1;
|
||||
if (i < this.i.size()) {
|
||||
this.i.get(i).b.a(false);
|
||||
}
|
||||
CascadingMenuInfo remove = this.i.remove(c);
|
||||
remove.b.b(this);
|
||||
if (this.B) {
|
||||
remove.a.b((Object) null);
|
||||
remove.a.a(0);
|
||||
}
|
||||
remove.a.dismiss();
|
||||
int size = this.i.size();
|
||||
if (size > 0) {
|
||||
this.q = this.i.get(size - 1).c;
|
||||
} else {
|
||||
this.q = h();
|
||||
}
|
||||
if (size != 0) {
|
||||
if (z) {
|
||||
this.i.get(0).b.a(false);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
dismiss();
|
||||
MenuPresenter.Callback callback = this.y;
|
||||
if (callback != null) {
|
||||
callback.a(menuBuilder, true);
|
||||
}
|
||||
ViewTreeObserver viewTreeObserver = this.z;
|
||||
if (viewTreeObserver != null) {
|
||||
if (viewTreeObserver.isAlive()) {
|
||||
this.z.removeGlobalOnLayoutListener(this.j);
|
||||
}
|
||||
this.z = null;
|
||||
}
|
||||
this.p.removeOnAttachStateChangeListener(this.k);
|
||||
this.A.onDismiss();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.ShowableListMenu
|
||||
public ListView d() {
|
||||
if (this.i.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return this.i.get(r0.size() - 1).a();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void a(int i) {
|
||||
if (this.m != i) {
|
||||
this.m = i;
|
||||
this.n = GravityCompat.a(i, ViewCompat.k(this.o));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void a(View view) {
|
||||
if (this.o != view) {
|
||||
this.o = view;
|
||||
this.n = GravityCompat.a(this.m, ViewCompat.k(this.o));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void a(PopupWindow.OnDismissListener onDismissListener) {
|
||||
this.A = onDismissListener;
|
||||
}
|
||||
}
|
||||
59
sources/androidx/appcompat/view/menu/ExpandedMenuView.java
Normal file
59
sources/androidx/appcompat/view/menu/ExpandedMenuView.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
import androidx.appcompat.view.menu.MenuBuilder;
|
||||
import androidx.appcompat.widget.TintTypedArray;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ExpandedMenuView extends ListView implements MenuBuilder.ItemInvoker, MenuView, AdapterView.OnItemClickListener {
|
||||
private static final int[] c = {R.attr.background, R.attr.divider};
|
||||
private MenuBuilder a;
|
||||
private int b;
|
||||
|
||||
public ExpandedMenuView(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R.attr.listViewStyle);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuView
|
||||
public void a(MenuBuilder menuBuilder) {
|
||||
this.a = menuBuilder;
|
||||
}
|
||||
|
||||
public int getWindowAnimations() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // android.widget.ListView, android.widget.AbsListView, android.widget.AdapterView, android.view.ViewGroup, android.view.View
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
setChildrenDrawingCacheEnabled(false);
|
||||
}
|
||||
|
||||
@Override // android.widget.AdapterView.OnItemClickListener
|
||||
public void onItemClick(AdapterView adapterView, View view, int i, long j) {
|
||||
a((MenuItemImpl) getAdapter().getItem(i));
|
||||
}
|
||||
|
||||
public ExpandedMenuView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet);
|
||||
setOnItemClickListener(this);
|
||||
TintTypedArray a = TintTypedArray.a(context, attributeSet, c, i, 0);
|
||||
if (a.g(0)) {
|
||||
setBackgroundDrawable(a.b(0));
|
||||
}
|
||||
if (a.g(1)) {
|
||||
setDivider(a.b(1));
|
||||
}
|
||||
a.a();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.ItemInvoker
|
||||
public boolean a(MenuItemImpl menuItemImpl) {
|
||||
return this.a.a(menuItemImpl, 0);
|
||||
}
|
||||
}
|
||||
285
sources/androidx/appcompat/view/menu/ListMenuItemView.java
Normal file
285
sources/androidx/appcompat/view/menu/ListMenuItemView.java
Normal file
@@ -0,0 +1,285 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.R$id;
|
||||
import androidx.appcompat.R$layout;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.appcompat.view.menu.MenuView;
|
||||
import androidx.appcompat.widget.TintTypedArray;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ListMenuItemView extends LinearLayout implements MenuView.ItemView, AbsListView.SelectionBoundsAdjuster {
|
||||
private MenuItemImpl a;
|
||||
private ImageView b;
|
||||
private RadioButton c;
|
||||
private TextView d;
|
||||
private CheckBox e;
|
||||
private TextView f;
|
||||
private ImageView g;
|
||||
private ImageView h;
|
||||
private LinearLayout i;
|
||||
private Drawable j;
|
||||
private int k;
|
||||
private Context l;
|
||||
private boolean m;
|
||||
private Drawable n;
|
||||
private boolean o;
|
||||
private LayoutInflater p;
|
||||
private boolean q;
|
||||
|
||||
public ListMenuItemView(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.listMenuViewStyle);
|
||||
}
|
||||
|
||||
private void b() {
|
||||
this.e = (CheckBox) getInflater().inflate(R$layout.abc_list_menu_item_checkbox, (ViewGroup) this, false);
|
||||
a(this.e);
|
||||
}
|
||||
|
||||
private void c() {
|
||||
this.b = (ImageView) getInflater().inflate(R$layout.abc_list_menu_item_icon, (ViewGroup) this, false);
|
||||
a(this.b, 0);
|
||||
}
|
||||
|
||||
private void d() {
|
||||
this.c = (RadioButton) getInflater().inflate(R$layout.abc_list_menu_item_radio, (ViewGroup) this, false);
|
||||
a(this.c);
|
||||
}
|
||||
|
||||
private LayoutInflater getInflater() {
|
||||
if (this.p == null) {
|
||||
this.p = LayoutInflater.from(getContext());
|
||||
}
|
||||
return this.p;
|
||||
}
|
||||
|
||||
private void setSubMenuArrowVisible(boolean z) {
|
||||
ImageView imageView = this.g;
|
||||
if (imageView != null) {
|
||||
imageView.setVisibility(z ? 0 : 8);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuView.ItemView
|
||||
public void a(MenuItemImpl menuItemImpl, int i) {
|
||||
this.a = menuItemImpl;
|
||||
setVisibility(menuItemImpl.isVisible() ? 0 : 8);
|
||||
setTitle(menuItemImpl.a(this));
|
||||
setCheckable(menuItemImpl.isCheckable());
|
||||
a(menuItemImpl.m(), menuItemImpl.d());
|
||||
setIcon(menuItemImpl.getIcon());
|
||||
setEnabled(menuItemImpl.isEnabled());
|
||||
setSubMenuArrowVisible(menuItemImpl.hasSubMenu());
|
||||
setContentDescription(menuItemImpl.getContentDescription());
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuView.ItemView
|
||||
public boolean a() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.widget.AbsListView.SelectionBoundsAdjuster
|
||||
public void adjustListItemSelectionBounds(Rect rect) {
|
||||
ImageView imageView = this.h;
|
||||
if (imageView == null || imageView.getVisibility() != 0) {
|
||||
return;
|
||||
}
|
||||
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) this.h.getLayoutParams();
|
||||
rect.top += this.h.getHeight() + layoutParams.topMargin + layoutParams.bottomMargin;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuView.ItemView
|
||||
public MenuItemImpl getItemData() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
ViewCompat.a(this, this.j);
|
||||
this.d = (TextView) findViewById(R$id.title);
|
||||
int i = this.k;
|
||||
if (i != -1) {
|
||||
this.d.setTextAppearance(this.l, i);
|
||||
}
|
||||
this.f = (TextView) findViewById(R$id.shortcut);
|
||||
this.g = (ImageView) findViewById(R$id.submenuarrow);
|
||||
ImageView imageView = this.g;
|
||||
if (imageView != null) {
|
||||
imageView.setImageDrawable(this.n);
|
||||
}
|
||||
this.h = (ImageView) findViewById(R$id.group_divider);
|
||||
this.i = (LinearLayout) findViewById(R$id.content);
|
||||
}
|
||||
|
||||
@Override // android.widget.LinearLayout, android.view.View
|
||||
protected void onMeasure(int i, int i2) {
|
||||
if (this.b != null && this.m) {
|
||||
ViewGroup.LayoutParams layoutParams = getLayoutParams();
|
||||
LinearLayout.LayoutParams layoutParams2 = (LinearLayout.LayoutParams) this.b.getLayoutParams();
|
||||
if (layoutParams.height > 0 && layoutParams2.width <= 0) {
|
||||
layoutParams2.width = layoutParams.height;
|
||||
}
|
||||
}
|
||||
super.onMeasure(i, i2);
|
||||
}
|
||||
|
||||
public void setCheckable(boolean z) {
|
||||
CompoundButton compoundButton;
|
||||
CompoundButton compoundButton2;
|
||||
if (!z && this.c == null && this.e == null) {
|
||||
return;
|
||||
}
|
||||
if (this.a.i()) {
|
||||
if (this.c == null) {
|
||||
d();
|
||||
}
|
||||
compoundButton = this.c;
|
||||
compoundButton2 = this.e;
|
||||
} else {
|
||||
if (this.e == null) {
|
||||
b();
|
||||
}
|
||||
compoundButton = this.e;
|
||||
compoundButton2 = this.c;
|
||||
}
|
||||
if (z) {
|
||||
compoundButton.setChecked(this.a.isChecked());
|
||||
if (compoundButton.getVisibility() != 0) {
|
||||
compoundButton.setVisibility(0);
|
||||
}
|
||||
if (compoundButton2 == null || compoundButton2.getVisibility() == 8) {
|
||||
return;
|
||||
}
|
||||
compoundButton2.setVisibility(8);
|
||||
return;
|
||||
}
|
||||
CheckBox checkBox = this.e;
|
||||
if (checkBox != null) {
|
||||
checkBox.setVisibility(8);
|
||||
}
|
||||
RadioButton radioButton = this.c;
|
||||
if (radioButton != null) {
|
||||
radioButton.setVisibility(8);
|
||||
}
|
||||
}
|
||||
|
||||
public void setChecked(boolean z) {
|
||||
CompoundButton compoundButton;
|
||||
if (this.a.i()) {
|
||||
if (this.c == null) {
|
||||
d();
|
||||
}
|
||||
compoundButton = this.c;
|
||||
} else {
|
||||
if (this.e == null) {
|
||||
b();
|
||||
}
|
||||
compoundButton = this.e;
|
||||
}
|
||||
compoundButton.setChecked(z);
|
||||
}
|
||||
|
||||
public void setForceShowIcon(boolean z) {
|
||||
this.q = z;
|
||||
this.m = z;
|
||||
}
|
||||
|
||||
public void setGroupDividerEnabled(boolean z) {
|
||||
ImageView imageView = this.h;
|
||||
if (imageView != null) {
|
||||
imageView.setVisibility((this.o || !z) ? 8 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void setIcon(Drawable drawable) {
|
||||
boolean z = this.a.l() || this.q;
|
||||
if (z || this.m) {
|
||||
if (this.b == null && drawable == null && !this.m) {
|
||||
return;
|
||||
}
|
||||
if (this.b == null) {
|
||||
c();
|
||||
}
|
||||
if (drawable == null && !this.m) {
|
||||
this.b.setVisibility(8);
|
||||
return;
|
||||
}
|
||||
ImageView imageView = this.b;
|
||||
if (!z) {
|
||||
drawable = null;
|
||||
}
|
||||
imageView.setImageDrawable(drawable);
|
||||
if (this.b.getVisibility() != 0) {
|
||||
this.b.setVisibility(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setTitle(CharSequence charSequence) {
|
||||
if (charSequence == null) {
|
||||
if (this.d.getVisibility() != 8) {
|
||||
this.d.setVisibility(8);
|
||||
}
|
||||
} else {
|
||||
this.d.setText(charSequence);
|
||||
if (this.d.getVisibility() != 0) {
|
||||
this.d.setVisibility(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ListMenuItemView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet);
|
||||
TintTypedArray a = TintTypedArray.a(getContext(), attributeSet, R$styleable.MenuView, i, 0);
|
||||
this.j = a.b(R$styleable.MenuView_android_itemBackground);
|
||||
this.k = a.g(R$styleable.MenuView_android_itemTextAppearance, -1);
|
||||
this.m = a.a(R$styleable.MenuView_preserveIconSpacing, false);
|
||||
this.l = context;
|
||||
this.n = a.b(R$styleable.MenuView_subMenuArrow);
|
||||
TypedArray obtainStyledAttributes = context.getTheme().obtainStyledAttributes(null, new int[]{R.attr.divider}, R$attr.dropDownListViewStyle, 0);
|
||||
this.o = obtainStyledAttributes.hasValue(0);
|
||||
a.a();
|
||||
obtainStyledAttributes.recycle();
|
||||
}
|
||||
|
||||
private void a(View view) {
|
||||
a(view, -1);
|
||||
}
|
||||
|
||||
private void a(View view, int i) {
|
||||
LinearLayout linearLayout = this.i;
|
||||
if (linearLayout != null) {
|
||||
linearLayout.addView(view, i);
|
||||
} else {
|
||||
addView(view, i);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(boolean z, char c) {
|
||||
int i = (z && this.a.m()) ? 0 : 8;
|
||||
if (i == 0) {
|
||||
this.f.setText(this.a.e());
|
||||
}
|
||||
if (this.f.getVisibility() != i) {
|
||||
this.f.setVisibility(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
193
sources/androidx/appcompat/view/menu/ListMenuPresenter.java
Normal file
193
sources/androidx/appcompat/view/menu/ListMenuPresenter.java
Normal file
@@ -0,0 +1,193 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.IBinder;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ListAdapter;
|
||||
import androidx.appcompat.R$layout;
|
||||
import androidx.appcompat.view.menu.MenuPresenter;
|
||||
import androidx.appcompat.view.menu.MenuView;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ListMenuPresenter implements MenuPresenter, AdapterView.OnItemClickListener {
|
||||
Context a;
|
||||
LayoutInflater b;
|
||||
MenuBuilder c;
|
||||
ExpandedMenuView d;
|
||||
int e;
|
||||
int f;
|
||||
int g;
|
||||
private MenuPresenter.Callback h;
|
||||
MenuAdapter i;
|
||||
|
||||
private class MenuAdapter extends BaseAdapter {
|
||||
private int a = -1;
|
||||
|
||||
public MenuAdapter() {
|
||||
a();
|
||||
}
|
||||
|
||||
void a() {
|
||||
MenuItemImpl f = ListMenuPresenter.this.c.f();
|
||||
if (f != null) {
|
||||
ArrayList<MenuItemImpl> j = ListMenuPresenter.this.c.j();
|
||||
int size = j.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (j.get(i) == f) {
|
||||
this.a = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.a = -1;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public int getCount() {
|
||||
int size = ListMenuPresenter.this.c.j().size() - ListMenuPresenter.this.e;
|
||||
return this.a < 0 ? size : size - 1;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
if (view == null) {
|
||||
ListMenuPresenter listMenuPresenter = ListMenuPresenter.this;
|
||||
view = listMenuPresenter.b.inflate(listMenuPresenter.g, viewGroup, false);
|
||||
}
|
||||
((MenuView.ItemView) view).a(getItem(i), 0);
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override // android.widget.BaseAdapter
|
||||
public void notifyDataSetChanged() {
|
||||
a();
|
||||
super.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public MenuItemImpl getItem(int i) {
|
||||
ArrayList<MenuItemImpl> j = ListMenuPresenter.this.c.j();
|
||||
int i2 = i + ListMenuPresenter.this.e;
|
||||
int i3 = this.a;
|
||||
if (i3 >= 0 && i2 >= i3) {
|
||||
i2++;
|
||||
}
|
||||
return j.get(i2);
|
||||
}
|
||||
}
|
||||
|
||||
public ListMenuPresenter(Context context, int i) {
|
||||
this(i, 0);
|
||||
this.a = context;
|
||||
this.b = LayoutInflater.from(this.a);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(Context context, MenuBuilder menuBuilder) {
|
||||
int i = this.f;
|
||||
if (i != 0) {
|
||||
this.a = new ContextThemeWrapper(context, i);
|
||||
this.b = LayoutInflater.from(this.a);
|
||||
} else if (this.a != null) {
|
||||
this.a = context;
|
||||
if (this.b == null) {
|
||||
this.b = LayoutInflater.from(this.a);
|
||||
}
|
||||
}
|
||||
this.c = menuBuilder;
|
||||
MenuAdapter menuAdapter = this.i;
|
||||
if (menuAdapter != null) {
|
||||
menuAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean a(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean b() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean b(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.widget.AdapterView.OnItemClickListener
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
|
||||
this.c.a(this.i.getItem(i), this, 0);
|
||||
}
|
||||
|
||||
public ListMenuPresenter(int i, int i2) {
|
||||
this.g = i;
|
||||
this.f = i2;
|
||||
}
|
||||
|
||||
public MenuView a(ViewGroup viewGroup) {
|
||||
if (this.d == null) {
|
||||
this.d = (ExpandedMenuView) this.b.inflate(R$layout.abc_expanded_menu_layout, viewGroup, false);
|
||||
if (this.i == null) {
|
||||
this.i = new MenuAdapter();
|
||||
}
|
||||
this.d.setAdapter((ListAdapter) this.i);
|
||||
this.d.setOnItemClickListener(this);
|
||||
}
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public ListAdapter a() {
|
||||
if (this.i == null) {
|
||||
this.i = new MenuAdapter();
|
||||
}
|
||||
return this.i;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(boolean z) {
|
||||
MenuAdapter menuAdapter = this.i;
|
||||
if (menuAdapter != null) {
|
||||
menuAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(MenuPresenter.Callback callback) {
|
||||
this.h = callback;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean a(SubMenuBuilder subMenuBuilder) {
|
||||
if (!subMenuBuilder.hasVisibleItems()) {
|
||||
return false;
|
||||
}
|
||||
new MenuDialogHelper(subMenuBuilder).a((IBinder) null);
|
||||
MenuPresenter.Callback callback = this.h;
|
||||
if (callback == null) {
|
||||
return true;
|
||||
}
|
||||
callback.a(subMenuBuilder);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(MenuBuilder menuBuilder, boolean z) {
|
||||
MenuPresenter.Callback callback = this.h;
|
||||
if (callback != null) {
|
||||
callback.a(menuBuilder, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
92
sources/androidx/appcompat/view/menu/MenuAdapter.java
Normal file
92
sources/androidx/appcompat/view/menu/MenuAdapter.java
Normal file
@@ -0,0 +1,92 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import androidx.appcompat.view.menu.MenuView;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MenuAdapter extends BaseAdapter {
|
||||
MenuBuilder a;
|
||||
private int b = -1;
|
||||
private boolean c;
|
||||
private final boolean d;
|
||||
private final LayoutInflater e;
|
||||
private final int f;
|
||||
|
||||
public MenuAdapter(MenuBuilder menuBuilder, LayoutInflater layoutInflater, boolean z, int i) {
|
||||
this.d = z;
|
||||
this.e = layoutInflater;
|
||||
this.a = menuBuilder;
|
||||
this.f = i;
|
||||
a();
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
this.c = z;
|
||||
}
|
||||
|
||||
public MenuBuilder b() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public int getCount() {
|
||||
return this.b < 0 ? (this.d ? this.a.j() : this.a.n()).size() : r0.size() - 1;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
if (view == null) {
|
||||
view = this.e.inflate(this.f, viewGroup, false);
|
||||
}
|
||||
int groupId = getItem(i).getGroupId();
|
||||
int i2 = i - 1;
|
||||
ListMenuItemView listMenuItemView = (ListMenuItemView) view;
|
||||
listMenuItemView.setGroupDividerEnabled(this.a.o() && groupId != (i2 >= 0 ? getItem(i2).getGroupId() : groupId));
|
||||
MenuView.ItemView itemView = (MenuView.ItemView) view;
|
||||
if (this.c) {
|
||||
listMenuItemView.setForceShowIcon(true);
|
||||
}
|
||||
itemView.a(getItem(i), 0);
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override // android.widget.BaseAdapter
|
||||
public void notifyDataSetChanged() {
|
||||
a();
|
||||
super.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
void a() {
|
||||
MenuItemImpl f = this.a.f();
|
||||
if (f != null) {
|
||||
ArrayList<MenuItemImpl> j = this.a.j();
|
||||
int size = j.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (j.get(i) == f) {
|
||||
this.b = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.b = -1;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public MenuItemImpl getItem(int i) {
|
||||
ArrayList<MenuItemImpl> j = this.d ? this.a.j() : this.a.n();
|
||||
int i2 = this.b;
|
||||
if (i2 >= 0 && i >= i2) {
|
||||
i++;
|
||||
}
|
||||
return j.get(i);
|
||||
}
|
||||
}
|
||||
874
sources/androidx/appcompat/view/menu/MenuBuilder.java
Normal file
874
sources/androidx/appcompat/view/menu/MenuBuilder.java
Normal file
@@ -0,0 +1,874 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.util.SparseArray;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.internal.view.SupportMenu;
|
||||
import androidx.core.view.ActionProvider;
|
||||
import androidx.core.view.ViewConfigurationCompat;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MenuBuilder implements SupportMenu {
|
||||
private static final int[] A = {1, 4, 5, 3, 2, 0};
|
||||
private final Context a;
|
||||
private final Resources b;
|
||||
private boolean c;
|
||||
private boolean d;
|
||||
private Callback e;
|
||||
private ContextMenu.ContextMenuInfo m;
|
||||
CharSequence n;
|
||||
Drawable o;
|
||||
View p;
|
||||
private MenuItemImpl x;
|
||||
private boolean z;
|
||||
private int l = 0;
|
||||
private boolean q = false;
|
||||
private boolean r = false;
|
||||
private boolean s = false;
|
||||
private boolean t = false;
|
||||
private boolean u = false;
|
||||
private ArrayList<MenuItemImpl> v = new ArrayList<>();
|
||||
private CopyOnWriteArrayList<WeakReference<MenuPresenter>> w = new CopyOnWriteArrayList<>();
|
||||
private boolean y = false;
|
||||
private ArrayList<MenuItemImpl> f = new ArrayList<>();
|
||||
private ArrayList<MenuItemImpl> g = new ArrayList<>();
|
||||
private boolean h = true;
|
||||
private ArrayList<MenuItemImpl> i = new ArrayList<>();
|
||||
private ArrayList<MenuItemImpl> j = new ArrayList<>();
|
||||
private boolean k = true;
|
||||
|
||||
public interface Callback {
|
||||
void a(MenuBuilder menuBuilder);
|
||||
|
||||
boolean a(MenuBuilder menuBuilder, MenuItem menuItem);
|
||||
}
|
||||
|
||||
public interface ItemInvoker {
|
||||
boolean a(MenuItemImpl menuItemImpl);
|
||||
}
|
||||
|
||||
public MenuBuilder(Context context) {
|
||||
this.a = context;
|
||||
this.b = context.getResources();
|
||||
e(true);
|
||||
}
|
||||
|
||||
private void d(boolean z) {
|
||||
if (this.w.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
s();
|
||||
Iterator<WeakReference<MenuPresenter>> it = this.w.iterator();
|
||||
while (it.hasNext()) {
|
||||
WeakReference<MenuPresenter> next = it.next();
|
||||
MenuPresenter menuPresenter = next.get();
|
||||
if (menuPresenter == null) {
|
||||
this.w.remove(next);
|
||||
} else {
|
||||
menuPresenter.a(z);
|
||||
}
|
||||
}
|
||||
r();
|
||||
}
|
||||
|
||||
private void e(boolean z) {
|
||||
this.d = z && this.b.getConfiguration().keyboard != 1 && ViewConfigurationCompat.d(ViewConfiguration.get(this.a), this.a);
|
||||
}
|
||||
|
||||
private static int f(int i) {
|
||||
int i2 = ((-65536) & i) >> 16;
|
||||
if (i2 >= 0) {
|
||||
int[] iArr = A;
|
||||
if (i2 < iArr.length) {
|
||||
return (i & 65535) | (iArr[i2] << 16);
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("order does not contain a valid category.");
|
||||
}
|
||||
|
||||
public void a(MenuPresenter menuPresenter) {
|
||||
a(menuPresenter, this.a);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem add(CharSequence charSequence) {
|
||||
return a(0, 0, 0, charSequence);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public int addIntentOptions(int i, int i2, int i3, ComponentName componentName, Intent[] intentArr, Intent intent, int i4, MenuItem[] menuItemArr) {
|
||||
int i5;
|
||||
PackageManager packageManager = this.a.getPackageManager();
|
||||
List<ResolveInfo> queryIntentActivityOptions = packageManager.queryIntentActivityOptions(componentName, intentArr, intent, 0);
|
||||
int size = queryIntentActivityOptions != null ? queryIntentActivityOptions.size() : 0;
|
||||
if ((i4 & 1) == 0) {
|
||||
removeGroup(i);
|
||||
}
|
||||
for (int i6 = 0; i6 < size; i6++) {
|
||||
ResolveInfo resolveInfo = queryIntentActivityOptions.get(i6);
|
||||
int i7 = resolveInfo.specificIndex;
|
||||
Intent intent2 = new Intent(i7 < 0 ? intent : intentArr[i7]);
|
||||
intent2.setComponent(new ComponentName(resolveInfo.activityInfo.applicationInfo.packageName, resolveInfo.activityInfo.name));
|
||||
MenuItem intent3 = add(i, i2, i3, resolveInfo.loadLabel(packageManager)).setIcon(resolveInfo.loadIcon(packageManager)).setIntent(intent2);
|
||||
if (menuItemArr != null && (i5 = resolveInfo.specificIndex) >= 0) {
|
||||
menuItemArr[i5] = intent3;
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public SubMenu addSubMenu(CharSequence charSequence) {
|
||||
return addSubMenu(0, 0, 0, charSequence);
|
||||
}
|
||||
|
||||
public void b(MenuPresenter menuPresenter) {
|
||||
Iterator<WeakReference<MenuPresenter>> it = this.w.iterator();
|
||||
while (it.hasNext()) {
|
||||
WeakReference<MenuPresenter> next = it.next();
|
||||
MenuPresenter menuPresenter2 = next.get();
|
||||
if (menuPresenter2 == null || menuPresenter2 == menuPresenter) {
|
||||
this.w.remove(next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MenuBuilder c(int i) {
|
||||
this.l = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void clear() {
|
||||
MenuItemImpl menuItemImpl = this.x;
|
||||
if (menuItemImpl != null) {
|
||||
a(menuItemImpl);
|
||||
}
|
||||
this.f.clear();
|
||||
b(true);
|
||||
}
|
||||
|
||||
public void clearHeader() {
|
||||
this.o = null;
|
||||
this.n = null;
|
||||
this.p = null;
|
||||
b(false);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void close() {
|
||||
a(true);
|
||||
}
|
||||
|
||||
protected String d() {
|
||||
return "android:menu:actionviewstates";
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem findItem(int i) {
|
||||
MenuItem findItem;
|
||||
int size = size();
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
MenuItemImpl menuItemImpl = this.f.get(i2);
|
||||
if (menuItemImpl.getItemId() == i) {
|
||||
return menuItemImpl;
|
||||
}
|
||||
if (menuItemImpl.hasSubMenu() && (findItem = menuItemImpl.getSubMenu().findItem(i)) != null) {
|
||||
return findItem;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Drawable g() {
|
||||
return this.o;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem getItem(int i) {
|
||||
return this.f.get(i);
|
||||
}
|
||||
|
||||
public CharSequence h() {
|
||||
return this.n;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public boolean hasVisibleItems() {
|
||||
if (this.z) {
|
||||
return true;
|
||||
}
|
||||
int size = size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (this.f.get(i).isVisible()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public View i() {
|
||||
return this.p;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public boolean isShortcutKey(int i, KeyEvent keyEvent) {
|
||||
return a(i, keyEvent) != null;
|
||||
}
|
||||
|
||||
public ArrayList<MenuItemImpl> j() {
|
||||
b();
|
||||
return this.j;
|
||||
}
|
||||
|
||||
boolean k() {
|
||||
return this.t;
|
||||
}
|
||||
|
||||
Resources l() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public MenuBuilder m() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayList<MenuItemImpl> n() {
|
||||
if (!this.h) {
|
||||
return this.g;
|
||||
}
|
||||
this.g.clear();
|
||||
int size = this.f.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
MenuItemImpl menuItemImpl = this.f.get(i);
|
||||
if (menuItemImpl.isVisible()) {
|
||||
this.g.add(menuItemImpl);
|
||||
}
|
||||
}
|
||||
this.h = false;
|
||||
this.k = true;
|
||||
return this.g;
|
||||
}
|
||||
|
||||
public boolean o() {
|
||||
return this.y;
|
||||
}
|
||||
|
||||
boolean p() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public boolean performIdentifierAction(int i, int i2) {
|
||||
return a(findItem(i), i2);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public boolean performShortcut(int i, KeyEvent keyEvent, int i2) {
|
||||
MenuItemImpl a = a(i, keyEvent);
|
||||
boolean a2 = a != null ? a(a, i2) : false;
|
||||
if ((i2 & 2) != 0) {
|
||||
a(true);
|
||||
}
|
||||
return a2;
|
||||
}
|
||||
|
||||
public boolean q() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public void r() {
|
||||
this.q = false;
|
||||
if (this.r) {
|
||||
this.r = false;
|
||||
b(this.s);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void removeGroup(int i) {
|
||||
int a = a(i);
|
||||
if (a >= 0) {
|
||||
int size = this.f.size() - a;
|
||||
int i2 = 0;
|
||||
while (true) {
|
||||
int i3 = i2 + 1;
|
||||
if (i2 >= size || this.f.get(a).getGroupId() != i) {
|
||||
break;
|
||||
}
|
||||
a(a, false);
|
||||
i2 = i3;
|
||||
}
|
||||
b(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void removeItem(int i) {
|
||||
a(b(i), true);
|
||||
}
|
||||
|
||||
public void s() {
|
||||
if (this.q) {
|
||||
return;
|
||||
}
|
||||
this.q = true;
|
||||
this.r = false;
|
||||
this.s = false;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void setGroupCheckable(int i, boolean z, boolean z2) {
|
||||
int size = this.f.size();
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
MenuItemImpl menuItemImpl = this.f.get(i2);
|
||||
if (menuItemImpl.getGroupId() == i) {
|
||||
menuItemImpl.c(z2);
|
||||
menuItemImpl.setCheckable(z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void setGroupDividerEnabled(boolean z) {
|
||||
this.y = z;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void setGroupEnabled(int i, boolean z) {
|
||||
int size = this.f.size();
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
MenuItemImpl menuItemImpl = this.f.get(i2);
|
||||
if (menuItemImpl.getGroupId() == i) {
|
||||
menuItemImpl.setEnabled(z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void setGroupVisible(int i, boolean z) {
|
||||
int size = this.f.size();
|
||||
boolean z2 = false;
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
MenuItemImpl menuItemImpl = this.f.get(i2);
|
||||
if (menuItemImpl.getGroupId() == i && menuItemImpl.e(z)) {
|
||||
z2 = true;
|
||||
}
|
||||
}
|
||||
if (z2) {
|
||||
b(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void setQwertyMode(boolean z) {
|
||||
this.c = z;
|
||||
b(false);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public int size() {
|
||||
return this.f.size();
|
||||
}
|
||||
|
||||
public void a(MenuPresenter menuPresenter, Context context) {
|
||||
this.w.add(new WeakReference<>(menuPresenter));
|
||||
menuPresenter.a(context, this);
|
||||
this.k = true;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem add(int i) {
|
||||
return a(0, 0, 0, this.b.getString(i));
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public SubMenu addSubMenu(int i) {
|
||||
return addSubMenu(0, 0, 0, this.b.getString(i));
|
||||
}
|
||||
|
||||
void c(MenuItemImpl menuItemImpl) {
|
||||
this.k = true;
|
||||
b(true);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem add(int i, int i2, int i3, CharSequence charSequence) {
|
||||
return a(i, i2, i3, charSequence);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public SubMenu addSubMenu(int i, int i2, int i3, CharSequence charSequence) {
|
||||
MenuItemImpl menuItemImpl = (MenuItemImpl) a(i, i2, i3, charSequence);
|
||||
SubMenuBuilder subMenuBuilder = new SubMenuBuilder(this.a, this, menuItemImpl);
|
||||
menuItemImpl.a(subMenuBuilder);
|
||||
return subMenuBuilder;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem add(int i, int i2, int i3, int i4) {
|
||||
return a(i, i2, i3, this.b.getString(i4));
|
||||
}
|
||||
|
||||
public void b(Bundle bundle) {
|
||||
int size = size();
|
||||
SparseArray<? extends Parcelable> sparseArray = null;
|
||||
for (int i = 0; i < size; i++) {
|
||||
MenuItem item = getItem(i);
|
||||
View actionView = item.getActionView();
|
||||
if (actionView != null && actionView.getId() != -1) {
|
||||
if (sparseArray == null) {
|
||||
sparseArray = new SparseArray<>();
|
||||
}
|
||||
actionView.saveHierarchyState(sparseArray);
|
||||
if (item.isActionViewExpanded()) {
|
||||
bundle.putInt("android:menu:expandedactionview", item.getItemId());
|
||||
}
|
||||
}
|
||||
if (item.hasSubMenu()) {
|
||||
((SubMenuBuilder) item.getSubMenu()).b(bundle);
|
||||
}
|
||||
}
|
||||
if (sparseArray != null) {
|
||||
bundle.putSparseParcelableArray(d(), sparseArray);
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<MenuItemImpl> c() {
|
||||
b();
|
||||
return this.i;
|
||||
}
|
||||
|
||||
public MenuItemImpl f() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
private boolean a(SubMenuBuilder subMenuBuilder, MenuPresenter menuPresenter) {
|
||||
if (this.w.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
boolean a = menuPresenter != null ? menuPresenter.a(subMenuBuilder) : false;
|
||||
Iterator<WeakReference<MenuPresenter>> it = this.w.iterator();
|
||||
while (it.hasNext()) {
|
||||
WeakReference<MenuPresenter> next = it.next();
|
||||
MenuPresenter menuPresenter2 = next.get();
|
||||
if (menuPresenter2 == null) {
|
||||
this.w.remove(next);
|
||||
} else if (!a) {
|
||||
a = menuPresenter2.a(subMenuBuilder);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
public Context e() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public SubMenu addSubMenu(int i, int i2, int i3, int i4) {
|
||||
return addSubMenu(i, i2, i3, this.b.getString(i4));
|
||||
}
|
||||
|
||||
public void c(boolean z) {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
protected MenuBuilder e(int i) {
|
||||
a(i, null, 0, null, null);
|
||||
return this;
|
||||
}
|
||||
|
||||
void d(MenuItemImpl menuItemImpl) {
|
||||
this.h = true;
|
||||
b(true);
|
||||
}
|
||||
|
||||
protected MenuBuilder d(int i) {
|
||||
a(0, null, i, null, null);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void a(Bundle bundle) {
|
||||
MenuItem findItem;
|
||||
if (bundle == null) {
|
||||
return;
|
||||
}
|
||||
SparseArray<Parcelable> sparseParcelableArray = bundle.getSparseParcelableArray(d());
|
||||
int size = size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
MenuItem item = getItem(i);
|
||||
View actionView = item.getActionView();
|
||||
if (actionView != null && actionView.getId() != -1) {
|
||||
actionView.restoreHierarchyState(sparseParcelableArray);
|
||||
}
|
||||
if (item.hasSubMenu()) {
|
||||
((SubMenuBuilder) item.getSubMenu()).a(bundle);
|
||||
}
|
||||
}
|
||||
int i2 = bundle.getInt("android:menu:expandedactionview");
|
||||
if (i2 <= 0 || (findItem = findItem(i2)) == null) {
|
||||
return;
|
||||
}
|
||||
findItem.expandActionView();
|
||||
}
|
||||
|
||||
public int b(int i) {
|
||||
int size = size();
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
if (this.f.get(i2).getItemId() == i) {
|
||||
return i2;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void b(boolean z) {
|
||||
if (!this.q) {
|
||||
if (z) {
|
||||
this.h = true;
|
||||
this.k = true;
|
||||
}
|
||||
d(z);
|
||||
return;
|
||||
}
|
||||
this.r = true;
|
||||
if (z) {
|
||||
this.s = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Callback callback) {
|
||||
this.e = callback;
|
||||
}
|
||||
|
||||
protected MenuItem a(int i, int i2, int i3, CharSequence charSequence) {
|
||||
int f = f(i3);
|
||||
MenuItemImpl a = a(i, i2, i3, f, charSequence, this.l);
|
||||
ContextMenu.ContextMenuInfo contextMenuInfo = this.m;
|
||||
if (contextMenuInfo != null) {
|
||||
a.a(contextMenuInfo);
|
||||
}
|
||||
ArrayList<MenuItemImpl> arrayList = this.f;
|
||||
arrayList.add(a(arrayList, f), a);
|
||||
b(true);
|
||||
return a;
|
||||
}
|
||||
|
||||
public void b() {
|
||||
ArrayList<MenuItemImpl> n = n();
|
||||
if (this.k) {
|
||||
Iterator<WeakReference<MenuPresenter>> it = this.w.iterator();
|
||||
boolean z = false;
|
||||
while (it.hasNext()) {
|
||||
WeakReference<MenuPresenter> next = it.next();
|
||||
MenuPresenter menuPresenter = next.get();
|
||||
if (menuPresenter == null) {
|
||||
this.w.remove(next);
|
||||
} else {
|
||||
z |= menuPresenter.b();
|
||||
}
|
||||
}
|
||||
if (z) {
|
||||
this.i.clear();
|
||||
this.j.clear();
|
||||
int size = n.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
MenuItemImpl menuItemImpl = n.get(i);
|
||||
if (menuItemImpl.h()) {
|
||||
this.i.add(menuItemImpl);
|
||||
} else {
|
||||
this.j.add(menuItemImpl);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.i.clear();
|
||||
this.j.clear();
|
||||
this.j.addAll(n());
|
||||
}
|
||||
this.k = false;
|
||||
}
|
||||
}
|
||||
|
||||
private MenuItemImpl a(int i, int i2, int i3, int i4, CharSequence charSequence, int i5) {
|
||||
return new MenuItemImpl(this, i, i2, i3, i4, charSequence, i5);
|
||||
}
|
||||
|
||||
private void a(int i, boolean z) {
|
||||
if (i < 0 || i >= this.f.size()) {
|
||||
return;
|
||||
}
|
||||
this.f.remove(i);
|
||||
if (z) {
|
||||
b(true);
|
||||
}
|
||||
}
|
||||
|
||||
void a(MenuItem menuItem) {
|
||||
int groupId = menuItem.getGroupId();
|
||||
int size = this.f.size();
|
||||
s();
|
||||
for (int i = 0; i < size; i++) {
|
||||
MenuItemImpl menuItemImpl = this.f.get(i);
|
||||
if (menuItemImpl.getGroupId() == groupId && menuItemImpl.i() && menuItemImpl.isCheckable()) {
|
||||
menuItemImpl.b(menuItemImpl == menuItem);
|
||||
}
|
||||
}
|
||||
r();
|
||||
}
|
||||
|
||||
public boolean b(MenuItemImpl menuItemImpl) {
|
||||
boolean z = false;
|
||||
if (this.w.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
s();
|
||||
Iterator<WeakReference<MenuPresenter>> it = this.w.iterator();
|
||||
while (it.hasNext()) {
|
||||
WeakReference<MenuPresenter> next = it.next();
|
||||
MenuPresenter menuPresenter = next.get();
|
||||
if (menuPresenter == null) {
|
||||
this.w.remove(next);
|
||||
} else {
|
||||
z = menuPresenter.b(this, menuItemImpl);
|
||||
if (z) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
r();
|
||||
if (z) {
|
||||
this.x = menuItemImpl;
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
public int a(int i) {
|
||||
return a(i, 0);
|
||||
}
|
||||
|
||||
public int a(int i, int i2) {
|
||||
int size = size();
|
||||
if (i2 < 0) {
|
||||
i2 = 0;
|
||||
}
|
||||
while (i2 < size) {
|
||||
if (this.f.get(i2).getGroupId() == i) {
|
||||
return i2;
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
boolean a(MenuBuilder menuBuilder, MenuItem menuItem) {
|
||||
Callback callback = this.e;
|
||||
return callback != null && callback.a(menuBuilder, menuItem);
|
||||
}
|
||||
|
||||
public void a() {
|
||||
Callback callback = this.e;
|
||||
if (callback != null) {
|
||||
callback.a(this);
|
||||
}
|
||||
}
|
||||
|
||||
private static int a(ArrayList<MenuItemImpl> arrayList, int i) {
|
||||
for (int size = arrayList.size() - 1; size >= 0; size--) {
|
||||
if (arrayList.get(size).c() <= i) {
|
||||
return size + 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void a(List<MenuItemImpl> list, int i, KeyEvent keyEvent) {
|
||||
boolean p = p();
|
||||
int modifiers = keyEvent.getModifiers();
|
||||
KeyCharacterMap.KeyData keyData = new KeyCharacterMap.KeyData();
|
||||
if (keyEvent.getKeyData(keyData) || i == 67) {
|
||||
int size = this.f.size();
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
MenuItemImpl menuItemImpl = this.f.get(i2);
|
||||
if (menuItemImpl.hasSubMenu()) {
|
||||
((MenuBuilder) menuItemImpl.getSubMenu()).a(list, i, keyEvent);
|
||||
}
|
||||
char alphabeticShortcut = p ? menuItemImpl.getAlphabeticShortcut() : menuItemImpl.getNumericShortcut();
|
||||
if (((modifiers & 69647) == ((p ? menuItemImpl.getAlphabeticModifiers() : menuItemImpl.getNumericModifiers()) & 69647)) && alphabeticShortcut != 0) {
|
||||
char[] cArr = keyData.meta;
|
||||
if ((alphabeticShortcut == cArr[0] || alphabeticShortcut == cArr[2] || (p && alphabeticShortcut == '\b' && i == 67)) && menuItemImpl.isEnabled()) {
|
||||
list.add(menuItemImpl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MenuItemImpl a(int i, KeyEvent keyEvent) {
|
||||
char numericShortcut;
|
||||
ArrayList<MenuItemImpl> arrayList = this.v;
|
||||
arrayList.clear();
|
||||
a(arrayList, i, keyEvent);
|
||||
if (arrayList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
int metaState = keyEvent.getMetaState();
|
||||
KeyCharacterMap.KeyData keyData = new KeyCharacterMap.KeyData();
|
||||
keyEvent.getKeyData(keyData);
|
||||
int size = arrayList.size();
|
||||
if (size == 1) {
|
||||
return arrayList.get(0);
|
||||
}
|
||||
boolean p = p();
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
MenuItemImpl menuItemImpl = arrayList.get(i2);
|
||||
if (p) {
|
||||
numericShortcut = menuItemImpl.getAlphabeticShortcut();
|
||||
} else {
|
||||
numericShortcut = menuItemImpl.getNumericShortcut();
|
||||
}
|
||||
if ((numericShortcut == keyData.meta[0] && (metaState & 2) == 0) || ((numericShortcut == keyData.meta[2] && (metaState & 2) != 0) || (p && numericShortcut == '\b' && i == 67))) {
|
||||
return menuItemImpl;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean a(MenuItem menuItem, int i) {
|
||||
return a(menuItem, (MenuPresenter) null, i);
|
||||
}
|
||||
|
||||
public boolean a(MenuItem menuItem, MenuPresenter menuPresenter, int i) {
|
||||
MenuItemImpl menuItemImpl = (MenuItemImpl) menuItem;
|
||||
if (menuItemImpl == null || !menuItemImpl.isEnabled()) {
|
||||
return false;
|
||||
}
|
||||
boolean g = menuItemImpl.g();
|
||||
ActionProvider a = menuItemImpl.a();
|
||||
boolean z = a != null && a.a();
|
||||
if (menuItemImpl.f()) {
|
||||
g |= menuItemImpl.expandActionView();
|
||||
if (g) {
|
||||
a(true);
|
||||
}
|
||||
} else if (menuItemImpl.hasSubMenu() || z) {
|
||||
if ((i & 4) == 0) {
|
||||
a(false);
|
||||
}
|
||||
if (!menuItemImpl.hasSubMenu()) {
|
||||
menuItemImpl.a(new SubMenuBuilder(e(), this, menuItemImpl));
|
||||
}
|
||||
SubMenuBuilder subMenuBuilder = (SubMenuBuilder) menuItemImpl.getSubMenu();
|
||||
if (z) {
|
||||
a.a(subMenuBuilder);
|
||||
}
|
||||
g |= a(subMenuBuilder, menuPresenter);
|
||||
if (!g) {
|
||||
a(true);
|
||||
}
|
||||
} else if ((i & 1) == 0) {
|
||||
a(true);
|
||||
}
|
||||
return g;
|
||||
}
|
||||
|
||||
public final void a(boolean z) {
|
||||
if (this.u) {
|
||||
return;
|
||||
}
|
||||
this.u = true;
|
||||
Iterator<WeakReference<MenuPresenter>> it = this.w.iterator();
|
||||
while (it.hasNext()) {
|
||||
WeakReference<MenuPresenter> next = it.next();
|
||||
MenuPresenter menuPresenter = next.get();
|
||||
if (menuPresenter == null) {
|
||||
this.w.remove(next);
|
||||
} else {
|
||||
menuPresenter.a(this, z);
|
||||
}
|
||||
}
|
||||
this.u = false;
|
||||
}
|
||||
|
||||
private void a(int i, CharSequence charSequence, int i2, Drawable drawable, View view) {
|
||||
Resources l = l();
|
||||
if (view != null) {
|
||||
this.p = view;
|
||||
this.n = null;
|
||||
this.o = null;
|
||||
} else {
|
||||
if (i > 0) {
|
||||
this.n = l.getText(i);
|
||||
} else if (charSequence != null) {
|
||||
this.n = charSequence;
|
||||
}
|
||||
if (i2 > 0) {
|
||||
this.o = ContextCompat.c(e(), i2);
|
||||
} else if (drawable != null) {
|
||||
this.o = drawable;
|
||||
}
|
||||
this.p = null;
|
||||
}
|
||||
b(false);
|
||||
}
|
||||
|
||||
protected MenuBuilder a(CharSequence charSequence) {
|
||||
a(0, charSequence, 0, null, null);
|
||||
return this;
|
||||
}
|
||||
|
||||
protected MenuBuilder a(Drawable drawable) {
|
||||
a(0, null, 0, drawable, null);
|
||||
return this;
|
||||
}
|
||||
|
||||
protected MenuBuilder a(View view) {
|
||||
a(0, null, 0, null, view);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean a(MenuItemImpl menuItemImpl) {
|
||||
boolean z = false;
|
||||
if (!this.w.isEmpty() && this.x == menuItemImpl) {
|
||||
s();
|
||||
Iterator<WeakReference<MenuPresenter>> it = this.w.iterator();
|
||||
while (it.hasNext()) {
|
||||
WeakReference<MenuPresenter> next = it.next();
|
||||
MenuPresenter menuPresenter = next.get();
|
||||
if (menuPresenter == null) {
|
||||
this.w.remove(next);
|
||||
} else {
|
||||
z = menuPresenter.a(this, menuItemImpl);
|
||||
if (z) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
r();
|
||||
if (z) {
|
||||
this.x = null;
|
||||
}
|
||||
}
|
||||
return z;
|
||||
}
|
||||
}
|
||||
109
sources/androidx/appcompat/view/menu/MenuDialogHelper.java
Normal file
109
sources/androidx/appcompat/view/menu/MenuDialogHelper.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.os.IBinder;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import androidx.appcompat.R$layout;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.view.menu.MenuPresenter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MenuDialogHelper implements DialogInterface.OnKeyListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, MenuPresenter.Callback {
|
||||
private MenuBuilder a;
|
||||
private AlertDialog b;
|
||||
ListMenuPresenter c;
|
||||
private MenuPresenter.Callback d;
|
||||
|
||||
public MenuDialogHelper(MenuBuilder menuBuilder) {
|
||||
this.a = menuBuilder;
|
||||
}
|
||||
|
||||
public void a(IBinder iBinder) {
|
||||
MenuBuilder menuBuilder = this.a;
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(menuBuilder.e());
|
||||
this.c = new ListMenuPresenter(builder.b(), R$layout.abc_list_menu_item_layout);
|
||||
this.c.a(this);
|
||||
this.a.a(this.c);
|
||||
builder.a(this.c.a(), this);
|
||||
View i = menuBuilder.i();
|
||||
if (i != null) {
|
||||
builder.a(i);
|
||||
} else {
|
||||
builder.a(menuBuilder.g());
|
||||
builder.a(menuBuilder.h());
|
||||
}
|
||||
builder.a(this);
|
||||
this.b = builder.a();
|
||||
this.b.setOnDismissListener(this);
|
||||
WindowManager.LayoutParams attributes = this.b.getWindow().getAttributes();
|
||||
attributes.type = 1003;
|
||||
if (iBinder != null) {
|
||||
attributes.token = iBinder;
|
||||
}
|
||||
attributes.flags |= 131072;
|
||||
this.b.show();
|
||||
}
|
||||
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
this.a.a((MenuItemImpl) this.c.a().getItem(i), 0);
|
||||
}
|
||||
|
||||
@Override // android.content.DialogInterface.OnDismissListener
|
||||
public void onDismiss(DialogInterface dialogInterface) {
|
||||
this.c.a(this.a, true);
|
||||
}
|
||||
|
||||
@Override // android.content.DialogInterface.OnKeyListener
|
||||
public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
|
||||
Window window;
|
||||
View decorView;
|
||||
KeyEvent.DispatcherState keyDispatcherState;
|
||||
View decorView2;
|
||||
KeyEvent.DispatcherState keyDispatcherState2;
|
||||
if (i == 82 || i == 4) {
|
||||
if (keyEvent.getAction() == 0 && keyEvent.getRepeatCount() == 0) {
|
||||
Window window2 = this.b.getWindow();
|
||||
if (window2 != null && (decorView2 = window2.getDecorView()) != null && (keyDispatcherState2 = decorView2.getKeyDispatcherState()) != null) {
|
||||
keyDispatcherState2.startTracking(keyEvent, this);
|
||||
return true;
|
||||
}
|
||||
} else if (keyEvent.getAction() == 1 && !keyEvent.isCanceled() && (window = this.b.getWindow()) != null && (decorView = window.getDecorView()) != null && (keyDispatcherState = decorView.getKeyDispatcherState()) != null && keyDispatcherState.isTracking(keyEvent)) {
|
||||
this.a.a(true);
|
||||
dialogInterface.dismiss();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return this.a.performShortcut(i, keyEvent, 0);
|
||||
}
|
||||
|
||||
public void a() {
|
||||
AlertDialog alertDialog = this.b;
|
||||
if (alertDialog != null) {
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
|
||||
public void a(MenuBuilder menuBuilder, boolean z) {
|
||||
if (z || menuBuilder == this.a) {
|
||||
a();
|
||||
}
|
||||
MenuPresenter.Callback callback = this.d;
|
||||
if (callback != null) {
|
||||
callback.a(menuBuilder, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
|
||||
public boolean a(MenuBuilder menuBuilder) {
|
||||
MenuPresenter.Callback callback = this.d;
|
||||
if (callback != null) {
|
||||
return callback.a(menuBuilder);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
5
sources/androidx/appcompat/view/menu/MenuHelper.java
Normal file
5
sources/androidx/appcompat/view/menu/MenuHelper.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
interface MenuHelper {
|
||||
}
|
||||
721
sources/androidx/appcompat/view/menu/MenuItemImpl.java
Normal file
721
sources/androidx/appcompat/view/menu/MenuItemImpl.java
Normal file
@@ -0,0 +1,721 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewDebug;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import androidx.appcompat.R$string;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.appcompat.view.menu.MenuView;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.core.internal.view.SupportMenuItem;
|
||||
import androidx.core.view.ActionProvider;
|
||||
import com.ubt.jimu.base.util.FileUtil;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MenuItemImpl implements SupportMenuItem {
|
||||
private View A;
|
||||
private ActionProvider B;
|
||||
private MenuItem.OnActionExpandListener C;
|
||||
private ContextMenu.ContextMenuInfo E;
|
||||
private final int a;
|
||||
private final int b;
|
||||
private final int c;
|
||||
private final int d;
|
||||
private CharSequence e;
|
||||
private CharSequence f;
|
||||
private Intent g;
|
||||
private char h;
|
||||
private char j;
|
||||
private Drawable l;
|
||||
MenuBuilder n;
|
||||
private SubMenuBuilder o;
|
||||
private Runnable p;
|
||||
private MenuItem.OnMenuItemClickListener q;
|
||||
private CharSequence r;
|
||||
private CharSequence s;
|
||||
private int z;
|
||||
private int i = FileUtil.ZIP_BUFFER_SIZE;
|
||||
private int k = FileUtil.ZIP_BUFFER_SIZE;
|
||||
private int m = 0;
|
||||
private ColorStateList t = null;
|
||||
private PorterDuff.Mode u = null;
|
||||
private boolean v = false;
|
||||
private boolean w = false;
|
||||
private boolean x = false;
|
||||
private int y = 16;
|
||||
private boolean D = false;
|
||||
|
||||
MenuItemImpl(MenuBuilder menuBuilder, int i, int i2, int i3, int i4, CharSequence charSequence, int i5) {
|
||||
this.z = 0;
|
||||
this.n = menuBuilder;
|
||||
this.a = i2;
|
||||
this.b = i;
|
||||
this.c = i3;
|
||||
this.d = i4;
|
||||
this.e = charSequence;
|
||||
this.z = i5;
|
||||
}
|
||||
|
||||
private static void a(StringBuilder sb, int i, int i2, String str) {
|
||||
if ((i & i2) == i2) {
|
||||
sb.append(str);
|
||||
}
|
||||
}
|
||||
|
||||
void b(boolean z) {
|
||||
int i = this.y;
|
||||
this.y = (z ? 2 : 0) | (i & (-3));
|
||||
if (i != this.y) {
|
||||
this.n.b(false);
|
||||
}
|
||||
}
|
||||
|
||||
public int c() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public boolean collapseActionView() {
|
||||
if ((this.z & 8) == 0) {
|
||||
return false;
|
||||
}
|
||||
if (this.A == null) {
|
||||
return true;
|
||||
}
|
||||
MenuItem.OnActionExpandListener onActionExpandListener = this.C;
|
||||
if (onActionExpandListener == null || onActionExpandListener.onMenuItemActionCollapse(this)) {
|
||||
return this.n.a(this);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
char d() {
|
||||
return this.n.p() ? this.j : this.h;
|
||||
}
|
||||
|
||||
String e() {
|
||||
char d = d();
|
||||
if (d == 0) {
|
||||
return "";
|
||||
}
|
||||
Resources resources = this.n.e().getResources();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (ViewConfiguration.get(this.n.e()).hasPermanentMenuKey()) {
|
||||
sb.append(resources.getString(R$string.abc_prepend_shortcut_label));
|
||||
}
|
||||
int i = this.n.p() ? this.k : this.i;
|
||||
a(sb, i, 65536, resources.getString(R$string.abc_menu_meta_shortcut_label));
|
||||
a(sb, i, FileUtil.ZIP_BUFFER_SIZE, resources.getString(R$string.abc_menu_ctrl_shortcut_label));
|
||||
a(sb, i, 2, resources.getString(R$string.abc_menu_alt_shortcut_label));
|
||||
a(sb, i, 1, resources.getString(R$string.abc_menu_shift_shortcut_label));
|
||||
a(sb, i, 4, resources.getString(R$string.abc_menu_sym_shortcut_label));
|
||||
a(sb, i, 8, resources.getString(R$string.abc_menu_function_shortcut_label));
|
||||
if (d == '\b') {
|
||||
sb.append(resources.getString(R$string.abc_menu_delete_shortcut_label));
|
||||
} else if (d == '\n') {
|
||||
sb.append(resources.getString(R$string.abc_menu_enter_shortcut_label));
|
||||
} else if (d != ' ') {
|
||||
sb.append(d);
|
||||
} else {
|
||||
sb.append(resources.getString(R$string.abc_menu_space_shortcut_label));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public boolean expandActionView() {
|
||||
if (!f()) {
|
||||
return false;
|
||||
}
|
||||
MenuItem.OnActionExpandListener onActionExpandListener = this.C;
|
||||
if (onActionExpandListener == null || onActionExpandListener.onMenuItemActionExpand(this)) {
|
||||
return this.n.b(this);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean f() {
|
||||
ActionProvider actionProvider;
|
||||
if ((this.z & 8) == 0) {
|
||||
return false;
|
||||
}
|
||||
if (this.A == null && (actionProvider = this.B) != null) {
|
||||
this.A = actionProvider.a(this);
|
||||
}
|
||||
return this.A != null;
|
||||
}
|
||||
|
||||
public boolean g() {
|
||||
MenuItem.OnMenuItemClickListener onMenuItemClickListener = this.q;
|
||||
if (onMenuItemClickListener != null && onMenuItemClickListener.onMenuItemClick(this)) {
|
||||
return true;
|
||||
}
|
||||
MenuBuilder menuBuilder = this.n;
|
||||
if (menuBuilder.a(menuBuilder, this)) {
|
||||
return true;
|
||||
}
|
||||
Runnable runnable = this.p;
|
||||
if (runnable != null) {
|
||||
runnable.run();
|
||||
return true;
|
||||
}
|
||||
if (this.g != null) {
|
||||
try {
|
||||
this.n.e().startActivity(this.g);
|
||||
return true;
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Log.e("MenuItemImpl", "Can't find activity to handle intent; ignoring", e);
|
||||
}
|
||||
}
|
||||
ActionProvider actionProvider = this.B;
|
||||
return actionProvider != null && actionProvider.d();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public android.view.ActionProvider getActionProvider() {
|
||||
throw new UnsupportedOperationException("This is not supported, use MenuItemCompat.getActionProvider()");
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public View getActionView() {
|
||||
View view = this.A;
|
||||
if (view != null) {
|
||||
return view;
|
||||
}
|
||||
ActionProvider actionProvider = this.B;
|
||||
if (actionProvider == null) {
|
||||
return null;
|
||||
}
|
||||
this.A = actionProvider.a(this);
|
||||
return this.A;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public int getAlphabeticModifiers() {
|
||||
return this.k;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public char getAlphabeticShortcut() {
|
||||
return this.j;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public CharSequence getContentDescription() {
|
||||
return this.r;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public int getGroupId() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public Drawable getIcon() {
|
||||
Drawable drawable = this.l;
|
||||
if (drawable != null) {
|
||||
return a(drawable);
|
||||
}
|
||||
if (this.m == 0) {
|
||||
return null;
|
||||
}
|
||||
Drawable c = AppCompatResources.c(this.n.e(), this.m);
|
||||
this.m = 0;
|
||||
this.l = c;
|
||||
return a(c);
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public ColorStateList getIconTintList() {
|
||||
return this.t;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public PorterDuff.Mode getIconTintMode() {
|
||||
return this.u;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public Intent getIntent() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
@ViewDebug.CapturedViewProperty
|
||||
public int getItemId() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public ContextMenu.ContextMenuInfo getMenuInfo() {
|
||||
return this.E;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public int getNumericModifiers() {
|
||||
return this.i;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public char getNumericShortcut() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public int getOrder() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public SubMenu getSubMenu() {
|
||||
return this.o;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
@ViewDebug.CapturedViewProperty
|
||||
public CharSequence getTitle() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public CharSequence getTitleCondensed() {
|
||||
CharSequence charSequence = this.f;
|
||||
if (charSequence == null) {
|
||||
charSequence = this.e;
|
||||
}
|
||||
return (Build.VERSION.SDK_INT >= 18 || charSequence == null || (charSequence instanceof String)) ? charSequence : charSequence.toString();
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public CharSequence getTooltipText() {
|
||||
return this.s;
|
||||
}
|
||||
|
||||
public boolean h() {
|
||||
return (this.y & 32) == 32;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean hasSubMenu() {
|
||||
return this.o != null;
|
||||
}
|
||||
|
||||
public boolean i() {
|
||||
return (this.y & 4) != 0;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public boolean isActionViewExpanded() {
|
||||
return this.D;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isCheckable() {
|
||||
return (this.y & 1) == 1;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isChecked() {
|
||||
return (this.y & 2) == 2;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isEnabled() {
|
||||
return (this.y & 16) != 0;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isVisible() {
|
||||
ActionProvider actionProvider = this.B;
|
||||
return (actionProvider == null || !actionProvider.e()) ? (this.y & 8) == 0 : (this.y & 8) == 0 && this.B.b();
|
||||
}
|
||||
|
||||
public boolean j() {
|
||||
return (this.z & 1) == 1;
|
||||
}
|
||||
|
||||
public boolean k() {
|
||||
return (this.z & 2) == 2;
|
||||
}
|
||||
|
||||
public boolean l() {
|
||||
return this.n.k();
|
||||
}
|
||||
|
||||
boolean m() {
|
||||
return this.n.q() && d() != 0;
|
||||
}
|
||||
|
||||
public boolean n() {
|
||||
return (this.z & 4) == 4;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setActionProvider(android.view.ActionProvider actionProvider) {
|
||||
throw new UnsupportedOperationException("This is not supported, use MenuItemCompat.setActionProvider()");
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public /* bridge */ /* synthetic */ MenuItem setActionView(int i) {
|
||||
setActionView(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setAlphabeticShortcut(char c) {
|
||||
if (this.j == c) {
|
||||
return this;
|
||||
}
|
||||
this.j = Character.toLowerCase(c);
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setCheckable(boolean z) {
|
||||
int i = this.y;
|
||||
this.y = (z ? 1 : 0) | (i & (-2));
|
||||
if (i != this.y) {
|
||||
this.n.b(false);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setChecked(boolean z) {
|
||||
if ((this.y & 4) != 0) {
|
||||
this.n.a((MenuItem) this);
|
||||
} else {
|
||||
b(z);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public /* bridge */ /* synthetic */ MenuItem setContentDescription(CharSequence charSequence) {
|
||||
setContentDescription(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setEnabled(boolean z) {
|
||||
if (z) {
|
||||
this.y |= 16;
|
||||
} else {
|
||||
this.y &= -17;
|
||||
}
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setIcon(Drawable drawable) {
|
||||
this.m = 0;
|
||||
this.l = drawable;
|
||||
this.x = true;
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public MenuItem setIconTintList(ColorStateList colorStateList) {
|
||||
this.t = colorStateList;
|
||||
this.v = true;
|
||||
this.x = true;
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public MenuItem setIconTintMode(PorterDuff.Mode mode) {
|
||||
this.u = mode;
|
||||
this.w = true;
|
||||
this.x = true;
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setIntent(Intent intent) {
|
||||
this.g = intent;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setNumericShortcut(char c) {
|
||||
if (this.h == c) {
|
||||
return this;
|
||||
}
|
||||
this.h = c;
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setOnActionExpandListener(MenuItem.OnActionExpandListener onActionExpandListener) {
|
||||
this.C = onActionExpandListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setOnMenuItemClickListener(MenuItem.OnMenuItemClickListener onMenuItemClickListener) {
|
||||
this.q = onMenuItemClickListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setShortcut(char c, char c2) {
|
||||
this.h = c;
|
||||
this.j = Character.toLowerCase(c2);
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public void setShowAsAction(int i) {
|
||||
int i2 = i & 3;
|
||||
if (i2 != 0 && i2 != 1 && i2 != 2) {
|
||||
throw new IllegalArgumentException("SHOW_AS_ACTION_ALWAYS, SHOW_AS_ACTION_IF_ROOM, and SHOW_AS_ACTION_NEVER are mutually exclusive.");
|
||||
}
|
||||
this.z = i;
|
||||
this.n.c(this);
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public /* bridge */ /* synthetic */ MenuItem setShowAsActionFlags(int i) {
|
||||
setShowAsActionFlags(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setTitle(CharSequence charSequence) {
|
||||
this.e = charSequence;
|
||||
this.n.b(false);
|
||||
SubMenuBuilder subMenuBuilder = this.o;
|
||||
if (subMenuBuilder != null) {
|
||||
subMenuBuilder.setHeaderTitle(charSequence);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setTitleCondensed(CharSequence charSequence) {
|
||||
this.f = charSequence;
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public /* bridge */ /* synthetic */ MenuItem setTooltipText(CharSequence charSequence) {
|
||||
setTooltipText(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setVisible(boolean z) {
|
||||
if (e(z)) {
|
||||
this.n.d(this);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
CharSequence charSequence = this.e;
|
||||
if (charSequence != null) {
|
||||
return charSequence.toString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void a(SubMenuBuilder subMenuBuilder) {
|
||||
this.o = subMenuBuilder;
|
||||
subMenuBuilder.setHeaderTitle(getTitle());
|
||||
}
|
||||
|
||||
public void c(boolean z) {
|
||||
this.y = (z ? 4 : 0) | (this.y & (-5));
|
||||
}
|
||||
|
||||
public void d(boolean z) {
|
||||
if (z) {
|
||||
this.y |= 32;
|
||||
} else {
|
||||
this.y &= -33;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public /* bridge */ /* synthetic */ MenuItem setActionView(View view) {
|
||||
setActionView(view);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public SupportMenuItem setContentDescription(CharSequence charSequence) {
|
||||
this.r = charSequence;
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public SupportMenuItem setShowAsActionFlags(int i) {
|
||||
setShowAsAction(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public SupportMenuItem setTooltipText(CharSequence charSequence) {
|
||||
this.s = charSequence;
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public SupportMenuItem setActionView(View view) {
|
||||
int i;
|
||||
this.A = view;
|
||||
this.B = null;
|
||||
if (view != null && view.getId() == -1 && (i = this.a) > 0) {
|
||||
view.setId(i);
|
||||
}
|
||||
this.n.c(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
CharSequence a(MenuView.ItemView itemView) {
|
||||
if (itemView != null && itemView.a()) {
|
||||
return getTitleCondensed();
|
||||
}
|
||||
return getTitle();
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public MenuItem setAlphabeticShortcut(char c, int i) {
|
||||
if (this.j == c && this.k == i) {
|
||||
return this;
|
||||
}
|
||||
this.j = Character.toLowerCase(c);
|
||||
this.k = KeyEvent.normalizeMetaState(i);
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public MenuItem setNumericShortcut(char c, int i) {
|
||||
if (this.h == c && this.i == i) {
|
||||
return this;
|
||||
}
|
||||
this.h = c;
|
||||
this.i = KeyEvent.normalizeMetaState(i);
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public MenuItem setShortcut(char c, char c2, int i, int i2) {
|
||||
this.h = c;
|
||||
this.i = KeyEvent.normalizeMetaState(i);
|
||||
this.j = Character.toLowerCase(c2);
|
||||
this.k = KeyEvent.normalizeMetaState(i2);
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void b() {
|
||||
this.n.c(this);
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setIcon(int i) {
|
||||
this.l = null;
|
||||
this.m = i;
|
||||
this.x = true;
|
||||
this.n.b(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setTitle(int i) {
|
||||
setTitle(this.n.e().getString(i));
|
||||
return this;
|
||||
}
|
||||
|
||||
private Drawable a(Drawable drawable) {
|
||||
if (drawable != null && this.x && (this.v || this.w)) {
|
||||
drawable = DrawableCompat.h(drawable).mutate();
|
||||
if (this.v) {
|
||||
DrawableCompat.a(drawable, this.t);
|
||||
}
|
||||
if (this.w) {
|
||||
DrawableCompat.a(drawable, this.u);
|
||||
}
|
||||
this.x = false;
|
||||
}
|
||||
return drawable;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem, android.view.MenuItem
|
||||
public SupportMenuItem setActionView(int i) {
|
||||
Context e = this.n.e();
|
||||
setActionView(LayoutInflater.from(e).inflate(i, (ViewGroup) new LinearLayout(e), false));
|
||||
return this;
|
||||
}
|
||||
|
||||
void a(ContextMenu.ContextMenuInfo contextMenuInfo) {
|
||||
this.E = contextMenuInfo;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem
|
||||
public ActionProvider a() {
|
||||
return this.B;
|
||||
}
|
||||
|
||||
@Override // androidx.core.internal.view.SupportMenuItem
|
||||
public SupportMenuItem a(ActionProvider actionProvider) {
|
||||
ActionProvider actionProvider2 = this.B;
|
||||
if (actionProvider2 != null) {
|
||||
actionProvider2.f();
|
||||
}
|
||||
this.A = null;
|
||||
this.B = actionProvider;
|
||||
this.n.b(true);
|
||||
ActionProvider actionProvider3 = this.B;
|
||||
if (actionProvider3 != null) {
|
||||
actionProvider3.a(new ActionProvider.VisibilityListener() { // from class: androidx.appcompat.view.menu.MenuItemImpl.1
|
||||
@Override // androidx.core.view.ActionProvider.VisibilityListener
|
||||
public void onActionProviderVisibilityChanged(boolean z) {
|
||||
MenuItemImpl menuItemImpl = MenuItemImpl.this;
|
||||
menuItemImpl.n.d(menuItemImpl);
|
||||
}
|
||||
});
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
this.D = z;
|
||||
this.n.b(false);
|
||||
}
|
||||
|
||||
boolean e(boolean z) {
|
||||
int i = this.y;
|
||||
this.y = (z ? 0 : 8) | (i & (-9));
|
||||
return i != this.y;
|
||||
}
|
||||
}
|
||||
429
sources/androidx/appcompat/view/menu/MenuItemWrapperICS.java
Normal file
429
sources/androidx/appcompat/view/menu/MenuItemWrapperICS.java
Normal file
@@ -0,0 +1,429 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.Log;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import androidx.appcompat.view.CollapsibleActionView;
|
||||
import androidx.core.internal.view.SupportMenuItem;
|
||||
import androidx.core.view.ActionProvider;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MenuItemWrapperICS extends BaseMenuWrapper<SupportMenuItem> implements MenuItem {
|
||||
private Method e;
|
||||
|
||||
class ActionProviderWrapper extends ActionProvider {
|
||||
final android.view.ActionProvider b;
|
||||
|
||||
public ActionProviderWrapper(Context context, android.view.ActionProvider actionProvider) {
|
||||
super(context);
|
||||
this.b = actionProvider;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ActionProvider
|
||||
public boolean a() {
|
||||
return this.b.hasSubMenu();
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ActionProvider
|
||||
public View c() {
|
||||
return this.b.onCreateActionView();
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ActionProvider
|
||||
public boolean d() {
|
||||
return this.b.onPerformDefaultAction();
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ActionProvider
|
||||
public void a(SubMenu subMenu) {
|
||||
this.b.onPrepareSubMenu(MenuItemWrapperICS.this.a(subMenu));
|
||||
}
|
||||
}
|
||||
|
||||
static class CollapsibleActionViewWrapper extends FrameLayout implements CollapsibleActionView {
|
||||
final android.view.CollapsibleActionView a;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
CollapsibleActionViewWrapper(View view) {
|
||||
super(view.getContext());
|
||||
this.a = (android.view.CollapsibleActionView) view;
|
||||
addView(view);
|
||||
}
|
||||
|
||||
View a() {
|
||||
return (View) this.a;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.CollapsibleActionView
|
||||
public void b() {
|
||||
this.a.onActionViewExpanded();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.CollapsibleActionView
|
||||
public void c() {
|
||||
this.a.onActionViewCollapsed();
|
||||
}
|
||||
}
|
||||
|
||||
private class OnActionExpandListenerWrapper extends BaseWrapper<MenuItem.OnActionExpandListener> implements MenuItem.OnActionExpandListener {
|
||||
OnActionExpandListenerWrapper(MenuItem.OnActionExpandListener onActionExpandListener) {
|
||||
super(onActionExpandListener);
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem.OnActionExpandListener
|
||||
public boolean onMenuItemActionCollapse(MenuItem menuItem) {
|
||||
return ((MenuItem.OnActionExpandListener) this.a).onMenuItemActionCollapse(MenuItemWrapperICS.this.a(menuItem));
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem.OnActionExpandListener
|
||||
public boolean onMenuItemActionExpand(MenuItem menuItem) {
|
||||
return ((MenuItem.OnActionExpandListener) this.a).onMenuItemActionExpand(MenuItemWrapperICS.this.a(menuItem));
|
||||
}
|
||||
}
|
||||
|
||||
private class OnMenuItemClickListenerWrapper extends BaseWrapper<MenuItem.OnMenuItemClickListener> implements MenuItem.OnMenuItemClickListener {
|
||||
OnMenuItemClickListenerWrapper(MenuItem.OnMenuItemClickListener onMenuItemClickListener) {
|
||||
super(onMenuItemClickListener);
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem.OnMenuItemClickListener
|
||||
public boolean onMenuItemClick(MenuItem menuItem) {
|
||||
return ((MenuItem.OnMenuItemClickListener) this.a).onMenuItemClick(MenuItemWrapperICS.this.a(menuItem));
|
||||
}
|
||||
}
|
||||
|
||||
MenuItemWrapperICS(Context context, SupportMenuItem supportMenuItem) {
|
||||
super(context, supportMenuItem);
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
try {
|
||||
if (this.e == null) {
|
||||
this.e = ((SupportMenuItem) this.a).getClass().getDeclaredMethod("setExclusiveCheckable", Boolean.TYPE);
|
||||
}
|
||||
this.e.invoke(this.a, Boolean.valueOf(z));
|
||||
} catch (Exception e) {
|
||||
Log.w("MenuItemWrapper", "Error while calling setExclusiveCheckable", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean collapseActionView() {
|
||||
return ((SupportMenuItem) this.a).collapseActionView();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean expandActionView() {
|
||||
return ((SupportMenuItem) this.a).expandActionView();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public android.view.ActionProvider getActionProvider() {
|
||||
ActionProvider a = ((SupportMenuItem) this.a).a();
|
||||
if (a instanceof ActionProviderWrapper) {
|
||||
return ((ActionProviderWrapper) a).b;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public View getActionView() {
|
||||
View actionView = ((SupportMenuItem) this.a).getActionView();
|
||||
return actionView instanceof CollapsibleActionViewWrapper ? ((CollapsibleActionViewWrapper) actionView).a() : actionView;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public int getAlphabeticModifiers() {
|
||||
return ((SupportMenuItem) this.a).getAlphabeticModifiers();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public char getAlphabeticShortcut() {
|
||||
return ((SupportMenuItem) this.a).getAlphabeticShortcut();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public CharSequence getContentDescription() {
|
||||
return ((SupportMenuItem) this.a).getContentDescription();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public int getGroupId() {
|
||||
return ((SupportMenuItem) this.a).getGroupId();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public Drawable getIcon() {
|
||||
return ((SupportMenuItem) this.a).getIcon();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public ColorStateList getIconTintList() {
|
||||
return ((SupportMenuItem) this.a).getIconTintList();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public PorterDuff.Mode getIconTintMode() {
|
||||
return ((SupportMenuItem) this.a).getIconTintMode();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public Intent getIntent() {
|
||||
return ((SupportMenuItem) this.a).getIntent();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public int getItemId() {
|
||||
return ((SupportMenuItem) this.a).getItemId();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public ContextMenu.ContextMenuInfo getMenuInfo() {
|
||||
return ((SupportMenuItem) this.a).getMenuInfo();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public int getNumericModifiers() {
|
||||
return ((SupportMenuItem) this.a).getNumericModifiers();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public char getNumericShortcut() {
|
||||
return ((SupportMenuItem) this.a).getNumericShortcut();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public int getOrder() {
|
||||
return ((SupportMenuItem) this.a).getOrder();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public SubMenu getSubMenu() {
|
||||
return a(((SupportMenuItem) this.a).getSubMenu());
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public CharSequence getTitle() {
|
||||
return ((SupportMenuItem) this.a).getTitle();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public CharSequence getTitleCondensed() {
|
||||
return ((SupportMenuItem) this.a).getTitleCondensed();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public CharSequence getTooltipText() {
|
||||
return ((SupportMenuItem) this.a).getTooltipText();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean hasSubMenu() {
|
||||
return ((SupportMenuItem) this.a).hasSubMenu();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isActionViewExpanded() {
|
||||
return ((SupportMenuItem) this.a).isActionViewExpanded();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isCheckable() {
|
||||
return ((SupportMenuItem) this.a).isCheckable();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isChecked() {
|
||||
return ((SupportMenuItem) this.a).isChecked();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isEnabled() {
|
||||
return ((SupportMenuItem) this.a).isEnabled();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public boolean isVisible() {
|
||||
return ((SupportMenuItem) this.a).isVisible();
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setActionProvider(android.view.ActionProvider actionProvider) {
|
||||
((SupportMenuItem) this.a).a(actionProvider != null ? a(actionProvider) : null);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setActionView(View view) {
|
||||
if (view instanceof android.view.CollapsibleActionView) {
|
||||
view = new CollapsibleActionViewWrapper(view);
|
||||
}
|
||||
((SupportMenuItem) this.a).setActionView(view);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setAlphabeticShortcut(char c) {
|
||||
((SupportMenuItem) this.a).setAlphabeticShortcut(c);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setCheckable(boolean z) {
|
||||
((SupportMenuItem) this.a).setCheckable(z);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setChecked(boolean z) {
|
||||
((SupportMenuItem) this.a).setChecked(z);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setContentDescription(CharSequence charSequence) {
|
||||
((SupportMenuItem) this.a).setContentDescription(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setEnabled(boolean z) {
|
||||
((SupportMenuItem) this.a).setEnabled(z);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setIcon(Drawable drawable) {
|
||||
((SupportMenuItem) this.a).setIcon(drawable);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setIconTintList(ColorStateList colorStateList) {
|
||||
((SupportMenuItem) this.a).setIconTintList(colorStateList);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setIconTintMode(PorterDuff.Mode mode) {
|
||||
((SupportMenuItem) this.a).setIconTintMode(mode);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setIntent(Intent intent) {
|
||||
((SupportMenuItem) this.a).setIntent(intent);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setNumericShortcut(char c) {
|
||||
((SupportMenuItem) this.a).setNumericShortcut(c);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setOnActionExpandListener(MenuItem.OnActionExpandListener onActionExpandListener) {
|
||||
((SupportMenuItem) this.a).setOnActionExpandListener(onActionExpandListener != null ? new OnActionExpandListenerWrapper(onActionExpandListener) : null);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setOnMenuItemClickListener(MenuItem.OnMenuItemClickListener onMenuItemClickListener) {
|
||||
((SupportMenuItem) this.a).setOnMenuItemClickListener(onMenuItemClickListener != null ? new OnMenuItemClickListenerWrapper(onMenuItemClickListener) : null);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setShortcut(char c, char c2) {
|
||||
((SupportMenuItem) this.a).setShortcut(c, c2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public void setShowAsAction(int i) {
|
||||
((SupportMenuItem) this.a).setShowAsAction(i);
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setShowAsActionFlags(int i) {
|
||||
((SupportMenuItem) this.a).setShowAsActionFlags(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setTitle(CharSequence charSequence) {
|
||||
((SupportMenuItem) this.a).setTitle(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setTitleCondensed(CharSequence charSequence) {
|
||||
((SupportMenuItem) this.a).setTitleCondensed(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setTooltipText(CharSequence charSequence) {
|
||||
((SupportMenuItem) this.a).setTooltipText(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setVisible(boolean z) {
|
||||
return ((SupportMenuItem) this.a).setVisible(z);
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setAlphabeticShortcut(char c, int i) {
|
||||
((SupportMenuItem) this.a).setAlphabeticShortcut(c, i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setIcon(int i) {
|
||||
((SupportMenuItem) this.a).setIcon(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setNumericShortcut(char c, int i) {
|
||||
((SupportMenuItem) this.a).setNumericShortcut(c, i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setShortcut(char c, char c2, int i, int i2) {
|
||||
((SupportMenuItem) this.a).setShortcut(c, c2, i, i2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setTitle(int i) {
|
||||
((SupportMenuItem) this.a).setTitle(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
public MenuItem setActionView(int i) {
|
||||
((SupportMenuItem) this.a).setActionView(i);
|
||||
View actionView = ((SupportMenuItem) this.a).getActionView();
|
||||
if (actionView instanceof android.view.CollapsibleActionView) {
|
||||
((SupportMenuItem) this.a).setActionView(new CollapsibleActionViewWrapper(actionView));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
ActionProviderWrapper a(android.view.ActionProvider actionProvider) {
|
||||
return new ActionProviderWrapper(this.b, actionProvider);
|
||||
}
|
||||
}
|
||||
59
sources/androidx/appcompat/view/menu/MenuItemWrapperJB.java
Normal file
59
sources/androidx/appcompat/view/menu/MenuItemWrapperJB.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.ActionProvider;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.view.menu.MenuItemWrapperICS;
|
||||
import androidx.core.internal.view.SupportMenuItem;
|
||||
import androidx.core.view.ActionProvider;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MenuItemWrapperJB extends MenuItemWrapperICS {
|
||||
|
||||
class ActionProviderWrapperJB extends MenuItemWrapperICS.ActionProviderWrapper implements ActionProvider.VisibilityListener {
|
||||
ActionProvider.VisibilityListener d;
|
||||
|
||||
public ActionProviderWrapperJB(MenuItemWrapperJB menuItemWrapperJB, Context context, android.view.ActionProvider actionProvider) {
|
||||
super(context, actionProvider);
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ActionProvider
|
||||
public View a(MenuItem menuItem) {
|
||||
return this.b.onCreateActionView(menuItem);
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ActionProvider
|
||||
public boolean b() {
|
||||
return this.b.isVisible();
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ActionProvider
|
||||
public boolean e() {
|
||||
return this.b.overridesItemVisibility();
|
||||
}
|
||||
|
||||
@Override // android.view.ActionProvider.VisibilityListener
|
||||
public void onActionProviderVisibilityChanged(boolean z) {
|
||||
ActionProvider.VisibilityListener visibilityListener = this.d;
|
||||
if (visibilityListener != null) {
|
||||
visibilityListener.onActionProviderVisibilityChanged(z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ActionProvider
|
||||
public void a(ActionProvider.VisibilityListener visibilityListener) {
|
||||
this.d = visibilityListener;
|
||||
this.b.setVisibilityListener(visibilityListener != null ? this : null);
|
||||
}
|
||||
}
|
||||
|
||||
MenuItemWrapperJB(Context context, SupportMenuItem supportMenuItem) {
|
||||
super(context, supportMenuItem);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuItemWrapperICS
|
||||
MenuItemWrapperICS.ActionProviderWrapper a(android.view.ActionProvider actionProvider) {
|
||||
return new ActionProviderWrapperJB(this, this.b, actionProvider);
|
||||
}
|
||||
}
|
||||
117
sources/androidx/appcompat/view/menu/MenuPopup.java
Normal file
117
sources/androidx/appcompat/view/menu/MenuPopup.java
Normal file
@@ -0,0 +1,117 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.HeaderViewListAdapter;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.PopupWindow;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class MenuPopup implements ShowableListMenu, MenuPresenter, AdapterView.OnItemClickListener {
|
||||
private Rect a;
|
||||
|
||||
MenuPopup() {
|
||||
}
|
||||
|
||||
protected static boolean b(MenuBuilder menuBuilder) {
|
||||
int size = menuBuilder.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
MenuItem item = menuBuilder.getItem(i);
|
||||
if (item.isVisible() && item.getIcon() != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract void a(int i);
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(Context context, MenuBuilder menuBuilder) {
|
||||
}
|
||||
|
||||
public void a(Rect rect) {
|
||||
this.a = rect;
|
||||
}
|
||||
|
||||
public abstract void a(View view);
|
||||
|
||||
public abstract void a(PopupWindow.OnDismissListener onDismissListener);
|
||||
|
||||
public abstract void a(MenuBuilder menuBuilder);
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean a(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract void b(int i);
|
||||
|
||||
public abstract void b(boolean z);
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean b(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract void c(int i);
|
||||
|
||||
public abstract void c(boolean z);
|
||||
|
||||
protected boolean e() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public Rect f() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.widget.AdapterView.OnItemClickListener
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
|
||||
ListAdapter listAdapter = (ListAdapter) adapterView.getAdapter();
|
||||
a(listAdapter).a.a((MenuItem) listAdapter.getItem(i), this, e() ? 0 : 4);
|
||||
}
|
||||
|
||||
protected static int a(ListAdapter listAdapter, ViewGroup viewGroup, Context context, int i) {
|
||||
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
|
||||
int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(0, 0);
|
||||
int count = listAdapter.getCount();
|
||||
ViewGroup viewGroup2 = viewGroup;
|
||||
View view = null;
|
||||
int i2 = 0;
|
||||
int i3 = 0;
|
||||
for (int i4 = 0; i4 < count; i4++) {
|
||||
int itemViewType = listAdapter.getItemViewType(i4);
|
||||
if (itemViewType != i3) {
|
||||
view = null;
|
||||
i3 = itemViewType;
|
||||
}
|
||||
if (viewGroup2 == null) {
|
||||
viewGroup2 = new FrameLayout(context);
|
||||
}
|
||||
view = listAdapter.getView(i4, view, viewGroup2);
|
||||
view.measure(makeMeasureSpec, makeMeasureSpec2);
|
||||
int measuredWidth = view.getMeasuredWidth();
|
||||
if (measuredWidth >= i) {
|
||||
return i;
|
||||
}
|
||||
if (measuredWidth > i2) {
|
||||
i2 = measuredWidth;
|
||||
}
|
||||
}
|
||||
return i2;
|
||||
}
|
||||
|
||||
protected static MenuAdapter a(ListAdapter listAdapter) {
|
||||
if (listAdapter instanceof HeaderViewListAdapter) {
|
||||
return (MenuAdapter) ((HeaderViewListAdapter) listAdapter).getWrappedAdapter();
|
||||
}
|
||||
return (MenuAdapter) listAdapter;
|
||||
}
|
||||
}
|
||||
165
sources/androidx/appcompat/view/menu/MenuPopupHelper.java
Normal file
165
sources/androidx/appcompat/view/menu/MenuPopupHelper.java
Normal file
@@ -0,0 +1,165 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.view.Display;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.PopupWindow;
|
||||
import androidx.appcompat.R$dimen;
|
||||
import androidx.appcompat.view.menu.MenuPresenter;
|
||||
import androidx.core.view.GravityCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MenuPopupHelper implements MenuHelper {
|
||||
private final Context a;
|
||||
private final MenuBuilder b;
|
||||
private final boolean c;
|
||||
private final int d;
|
||||
private final int e;
|
||||
private View f;
|
||||
private int g;
|
||||
private boolean h;
|
||||
private MenuPresenter.Callback i;
|
||||
private MenuPopup j;
|
||||
private PopupWindow.OnDismissListener k;
|
||||
private final PopupWindow.OnDismissListener l;
|
||||
|
||||
public MenuPopupHelper(Context context, MenuBuilder menuBuilder, View view, boolean z, int i) {
|
||||
this(context, menuBuilder, view, z, i, 0);
|
||||
}
|
||||
|
||||
private MenuPopup g() {
|
||||
Display defaultDisplay = ((WindowManager) this.a.getSystemService("window")).getDefaultDisplay();
|
||||
Point point = new Point();
|
||||
if (Build.VERSION.SDK_INT >= 17) {
|
||||
defaultDisplay.getRealSize(point);
|
||||
} else {
|
||||
defaultDisplay.getSize(point);
|
||||
}
|
||||
MenuPopup cascadingMenuPopup = Math.min(point.x, point.y) >= this.a.getResources().getDimensionPixelSize(R$dimen.abc_cascading_menus_min_smallest_width) ? new CascadingMenuPopup(this.a, this.f, this.d, this.e, this.c) : new StandardMenuPopup(this.a, this.b, this.f, this.d, this.e, this.c);
|
||||
cascadingMenuPopup.a(this.b);
|
||||
cascadingMenuPopup.a(this.l);
|
||||
cascadingMenuPopup.a(this.f);
|
||||
cascadingMenuPopup.a(this.i);
|
||||
cascadingMenuPopup.b(this.h);
|
||||
cascadingMenuPopup.a(this.g);
|
||||
return cascadingMenuPopup;
|
||||
}
|
||||
|
||||
public void a(PopupWindow.OnDismissListener onDismissListener) {
|
||||
this.k = onDismissListener;
|
||||
}
|
||||
|
||||
public MenuPopup b() {
|
||||
if (this.j == null) {
|
||||
this.j = g();
|
||||
}
|
||||
return this.j;
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
MenuPopup menuPopup = this.j;
|
||||
return menuPopup != null && menuPopup.c();
|
||||
}
|
||||
|
||||
protected void d() {
|
||||
this.j = null;
|
||||
PopupWindow.OnDismissListener onDismissListener = this.k;
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
public void e() {
|
||||
if (!f()) {
|
||||
throw new IllegalStateException("MenuPopupHelper cannot be used without an anchor");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean f() {
|
||||
if (c()) {
|
||||
return true;
|
||||
}
|
||||
if (this.f == null) {
|
||||
return false;
|
||||
}
|
||||
a(0, 0, false, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
public MenuPopupHelper(Context context, MenuBuilder menuBuilder, View view, boolean z, int i, int i2) {
|
||||
this.g = 8388611;
|
||||
this.l = new PopupWindow.OnDismissListener() { // from class: androidx.appcompat.view.menu.MenuPopupHelper.1
|
||||
@Override // android.widget.PopupWindow.OnDismissListener
|
||||
public void onDismiss() {
|
||||
MenuPopupHelper.this.d();
|
||||
}
|
||||
};
|
||||
this.a = context;
|
||||
this.b = menuBuilder;
|
||||
this.f = view;
|
||||
this.c = z;
|
||||
this.d = i;
|
||||
this.e = i2;
|
||||
}
|
||||
|
||||
public void a(View view) {
|
||||
this.f = view;
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
this.h = z;
|
||||
MenuPopup menuPopup = this.j;
|
||||
if (menuPopup != null) {
|
||||
menuPopup.b(z);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.g = i;
|
||||
}
|
||||
|
||||
public boolean a(int i, int i2) {
|
||||
if (c()) {
|
||||
return true;
|
||||
}
|
||||
if (this.f == null) {
|
||||
return false;
|
||||
}
|
||||
a(i, i2, true, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void a(int i, int i2, boolean z, boolean z2) {
|
||||
MenuPopup b = b();
|
||||
b.c(z2);
|
||||
if (z) {
|
||||
if ((GravityCompat.a(this.g, ViewCompat.k(this.f)) & 7) == 5) {
|
||||
i -= this.f.getWidth();
|
||||
}
|
||||
b.b(i);
|
||||
b.c(i2);
|
||||
int i3 = (int) ((this.a.getResources().getDisplayMetrics().density * 48.0f) / 2.0f);
|
||||
b.a(new Rect(i - i3, i2 - i3, i + i3, i2 + i3));
|
||||
}
|
||||
b.a();
|
||||
}
|
||||
|
||||
public void a() {
|
||||
if (c()) {
|
||||
this.j.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
public void a(MenuPresenter.Callback callback) {
|
||||
this.i = callback;
|
||||
MenuPopup menuPopup = this.j;
|
||||
if (menuPopup != null) {
|
||||
menuPopup.a(callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
29
sources/androidx/appcompat/view/menu/MenuPresenter.java
Normal file
29
sources/androidx/appcompat/view/menu/MenuPresenter.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface MenuPresenter {
|
||||
|
||||
public interface Callback {
|
||||
void a(MenuBuilder menuBuilder, boolean z);
|
||||
|
||||
boolean a(MenuBuilder menuBuilder);
|
||||
}
|
||||
|
||||
void a(Context context, MenuBuilder menuBuilder);
|
||||
|
||||
void a(MenuBuilder menuBuilder, boolean z);
|
||||
|
||||
void a(Callback callback);
|
||||
|
||||
void a(boolean z);
|
||||
|
||||
boolean a(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl);
|
||||
|
||||
boolean a(SubMenuBuilder subMenuBuilder);
|
||||
|
||||
boolean b();
|
||||
|
||||
boolean b(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl);
|
||||
}
|
||||
15
sources/androidx/appcompat/view/menu/MenuView.java
Normal file
15
sources/androidx/appcompat/view/menu/MenuView.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface MenuView {
|
||||
|
||||
public interface ItemView {
|
||||
void a(MenuItemImpl menuItemImpl, int i);
|
||||
|
||||
boolean a();
|
||||
|
||||
MenuItemImpl getItemData();
|
||||
}
|
||||
|
||||
void a(MenuBuilder menuBuilder);
|
||||
}
|
||||
25
sources/androidx/appcompat/view/menu/MenuWrapperFactory.java
Normal file
25
sources/androidx/appcompat/view/menu/MenuWrapperFactory.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import androidx.core.internal.view.SupportMenu;
|
||||
import androidx.core.internal.view.SupportMenuItem;
|
||||
import androidx.core.internal.view.SupportSubMenu;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MenuWrapperFactory {
|
||||
public static Menu a(Context context, SupportMenu supportMenu) {
|
||||
return new MenuWrapperICS(context, supportMenu);
|
||||
}
|
||||
|
||||
public static MenuItem a(Context context, SupportMenuItem supportMenuItem) {
|
||||
return Build.VERSION.SDK_INT >= 16 ? new MenuItemWrapperJB(context, supportMenuItem) : new MenuItemWrapperICS(context, supportMenuItem);
|
||||
}
|
||||
|
||||
public static SubMenu a(Context context, SupportSubMenu supportSubMenu) {
|
||||
return new SubMenuWrapperICS(context, supportSubMenu);
|
||||
}
|
||||
}
|
||||
148
sources/androidx/appcompat/view/menu/MenuWrapperICS.java
Normal file
148
sources/androidx/appcompat/view/menu/MenuWrapperICS.java
Normal file
@@ -0,0 +1,148 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import androidx.core.internal.view.SupportMenu;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MenuWrapperICS extends BaseMenuWrapper<SupportMenu> implements Menu {
|
||||
MenuWrapperICS(Context context, SupportMenu supportMenu) {
|
||||
super(context, supportMenu);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem add(CharSequence charSequence) {
|
||||
return a(((SupportMenu) this.a).add(charSequence));
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public int addIntentOptions(int i, int i2, int i3, ComponentName componentName, Intent[] intentArr, Intent intent, int i4, MenuItem[] menuItemArr) {
|
||||
MenuItem[] menuItemArr2 = menuItemArr != null ? new MenuItem[menuItemArr.length] : null;
|
||||
int addIntentOptions = ((SupportMenu) this.a).addIntentOptions(i, i2, i3, componentName, intentArr, intent, i4, menuItemArr2);
|
||||
if (menuItemArr2 != null) {
|
||||
int length = menuItemArr2.length;
|
||||
for (int i5 = 0; i5 < length; i5++) {
|
||||
menuItemArr[i5] = a(menuItemArr2[i5]);
|
||||
}
|
||||
}
|
||||
return addIntentOptions;
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public SubMenu addSubMenu(CharSequence charSequence) {
|
||||
return a(((SupportMenu) this.a).addSubMenu(charSequence));
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void clear() {
|
||||
b();
|
||||
((SupportMenu) this.a).clear();
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void close() {
|
||||
((SupportMenu) this.a).close();
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem findItem(int i) {
|
||||
return a(((SupportMenu) this.a).findItem(i));
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem getItem(int i) {
|
||||
return a(((SupportMenu) this.a).getItem(i));
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public boolean hasVisibleItems() {
|
||||
return ((SupportMenu) this.a).hasVisibleItems();
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public boolean isShortcutKey(int i, KeyEvent keyEvent) {
|
||||
return ((SupportMenu) this.a).isShortcutKey(i, keyEvent);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public boolean performIdentifierAction(int i, int i2) {
|
||||
return ((SupportMenu) this.a).performIdentifierAction(i, i2);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public boolean performShortcut(int i, KeyEvent keyEvent, int i2) {
|
||||
return ((SupportMenu) this.a).performShortcut(i, keyEvent, i2);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void removeGroup(int i) {
|
||||
a(i);
|
||||
((SupportMenu) this.a).removeGroup(i);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void removeItem(int i) {
|
||||
b(i);
|
||||
((SupportMenu) this.a).removeItem(i);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void setGroupCheckable(int i, boolean z, boolean z2) {
|
||||
((SupportMenu) this.a).setGroupCheckable(i, z, z2);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void setGroupEnabled(int i, boolean z) {
|
||||
((SupportMenu) this.a).setGroupEnabled(i, z);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void setGroupVisible(int i, boolean z) {
|
||||
((SupportMenu) this.a).setGroupVisible(i, z);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public void setQwertyMode(boolean z) {
|
||||
((SupportMenu) this.a).setQwertyMode(z);
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public int size() {
|
||||
return ((SupportMenu) this.a).size();
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem add(int i) {
|
||||
return a(((SupportMenu) this.a).add(i));
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public SubMenu addSubMenu(int i) {
|
||||
return a(((SupportMenu) this.a).addSubMenu(i));
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem add(int i, int i2, int i3, CharSequence charSequence) {
|
||||
return a(((SupportMenu) this.a).add(i, i2, i3, charSequence));
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public SubMenu addSubMenu(int i, int i2, int i3, CharSequence charSequence) {
|
||||
return a(((SupportMenu) this.a).addSubMenu(i, i2, i3, charSequence));
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public MenuItem add(int i, int i2, int i3, int i4) {
|
||||
return a(((SupportMenu) this.a).add(i, i2, i3, i4));
|
||||
}
|
||||
|
||||
@Override // android.view.Menu
|
||||
public SubMenu addSubMenu(int i, int i2, int i3, int i4) {
|
||||
return a(((SupportMenu) this.a).addSubMenu(i, i2, i3, i4));
|
||||
}
|
||||
}
|
||||
14
sources/androidx/appcompat/view/menu/ShowableListMenu.java
Normal file
14
sources/androidx/appcompat/view/menu/ShowableListMenu.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.widget.ListView;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ShowableListMenu {
|
||||
void a();
|
||||
|
||||
boolean c();
|
||||
|
||||
ListView d();
|
||||
|
||||
void dismiss();
|
||||
}
|
||||
284
sources/androidx/appcompat/view/menu/StandardMenuPopup.java
Normal file
284
sources/androidx/appcompat/view/menu/StandardMenuPopup.java
Normal file
@@ -0,0 +1,284 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.ListView;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.R$dimen;
|
||||
import androidx.appcompat.R$layout;
|
||||
import androidx.appcompat.view.menu.MenuPresenter;
|
||||
import androidx.appcompat.widget.MenuPopupWindow;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class StandardMenuPopup extends MenuPopup implements PopupWindow.OnDismissListener, AdapterView.OnItemClickListener, MenuPresenter, View.OnKeyListener {
|
||||
private static final int v = R$layout.abc_popup_menu_item_layout;
|
||||
private final Context b;
|
||||
private final MenuBuilder c;
|
||||
private final MenuAdapter d;
|
||||
private final boolean e;
|
||||
private final int f;
|
||||
private final int g;
|
||||
private final int h;
|
||||
final MenuPopupWindow i;
|
||||
private PopupWindow.OnDismissListener l;
|
||||
private View m;
|
||||
View n;
|
||||
private MenuPresenter.Callback o;
|
||||
ViewTreeObserver p;
|
||||
private boolean q;
|
||||
private boolean r;
|
||||
private int s;
|
||||
private boolean u;
|
||||
final ViewTreeObserver.OnGlobalLayoutListener j = new ViewTreeObserver.OnGlobalLayoutListener() { // from class: androidx.appcompat.view.menu.StandardMenuPopup.1
|
||||
@Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
|
||||
public void onGlobalLayout() {
|
||||
if (!StandardMenuPopup.this.c() || StandardMenuPopup.this.i.k()) {
|
||||
return;
|
||||
}
|
||||
View view = StandardMenuPopup.this.n;
|
||||
if (view == null || !view.isShown()) {
|
||||
StandardMenuPopup.this.dismiss();
|
||||
} else {
|
||||
StandardMenuPopup.this.i.a();
|
||||
}
|
||||
}
|
||||
};
|
||||
private final View.OnAttachStateChangeListener k = new View.OnAttachStateChangeListener() { // from class: androidx.appcompat.view.menu.StandardMenuPopup.2
|
||||
@Override // android.view.View.OnAttachStateChangeListener
|
||||
public void onViewAttachedToWindow(View view) {
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnAttachStateChangeListener
|
||||
public void onViewDetachedFromWindow(View view) {
|
||||
ViewTreeObserver viewTreeObserver = StandardMenuPopup.this.p;
|
||||
if (viewTreeObserver != null) {
|
||||
if (!viewTreeObserver.isAlive()) {
|
||||
StandardMenuPopup.this.p = view.getViewTreeObserver();
|
||||
}
|
||||
StandardMenuPopup standardMenuPopup = StandardMenuPopup.this;
|
||||
standardMenuPopup.p.removeGlobalOnLayoutListener(standardMenuPopup.j);
|
||||
}
|
||||
view.removeOnAttachStateChangeListener(this);
|
||||
}
|
||||
};
|
||||
private int t = 0;
|
||||
|
||||
public StandardMenuPopup(Context context, MenuBuilder menuBuilder, View view, int i, int i2, boolean z) {
|
||||
this.b = context;
|
||||
this.c = menuBuilder;
|
||||
this.e = z;
|
||||
this.d = new MenuAdapter(menuBuilder, LayoutInflater.from(context), this.e, v);
|
||||
this.g = i;
|
||||
this.h = i2;
|
||||
Resources resources = context.getResources();
|
||||
this.f = Math.max(resources.getDisplayMetrics().widthPixels / 2, resources.getDimensionPixelSize(R$dimen.abc_config_prefDialogWidth));
|
||||
this.m = view;
|
||||
this.i = new MenuPopupWindow(this.b, null, this.g, this.h);
|
||||
menuBuilder.a(this, context);
|
||||
}
|
||||
|
||||
private boolean g() {
|
||||
View view;
|
||||
if (c()) {
|
||||
return true;
|
||||
}
|
||||
if (this.q || (view = this.m) == null) {
|
||||
return false;
|
||||
}
|
||||
this.n = view;
|
||||
this.i.a((PopupWindow.OnDismissListener) this);
|
||||
this.i.a((AdapterView.OnItemClickListener) this);
|
||||
this.i.a(true);
|
||||
View view2 = this.n;
|
||||
boolean z = this.p == null;
|
||||
this.p = view2.getViewTreeObserver();
|
||||
if (z) {
|
||||
this.p.addOnGlobalLayoutListener(this.j);
|
||||
}
|
||||
view2.addOnAttachStateChangeListener(this.k);
|
||||
this.i.a(view2);
|
||||
this.i.c(this.t);
|
||||
if (!this.r) {
|
||||
this.s = MenuPopup.a(this.d, null, this.b, this.f);
|
||||
this.r = true;
|
||||
}
|
||||
this.i.b(this.s);
|
||||
this.i.e(2);
|
||||
this.i.a(f());
|
||||
this.i.a();
|
||||
ListView d = this.i.d();
|
||||
d.setOnKeyListener(this);
|
||||
if (this.u && this.c.h() != null) {
|
||||
FrameLayout frameLayout = (FrameLayout) LayoutInflater.from(this.b).inflate(R$layout.abc_popup_menu_header_item_layout, (ViewGroup) d, false);
|
||||
TextView textView = (TextView) frameLayout.findViewById(R.id.title);
|
||||
if (textView != null) {
|
||||
textView.setText(this.c.h());
|
||||
}
|
||||
frameLayout.setEnabled(false);
|
||||
d.addHeaderView(frameLayout, null, false);
|
||||
}
|
||||
this.i.a((ListAdapter) this.d);
|
||||
this.i.a();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void a(int i) {
|
||||
this.t = i;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void a(MenuBuilder menuBuilder) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void b(boolean z) {
|
||||
this.d.a(z);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean b() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.ShowableListMenu
|
||||
public boolean c() {
|
||||
return !this.q && this.i.c();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.ShowableListMenu
|
||||
public ListView d() {
|
||||
return this.i.d();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.ShowableListMenu
|
||||
public void dismiss() {
|
||||
if (c()) {
|
||||
this.i.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.PopupWindow.OnDismissListener
|
||||
public void onDismiss() {
|
||||
this.q = true;
|
||||
this.c.close();
|
||||
ViewTreeObserver viewTreeObserver = this.p;
|
||||
if (viewTreeObserver != null) {
|
||||
if (!viewTreeObserver.isAlive()) {
|
||||
this.p = this.n.getViewTreeObserver();
|
||||
}
|
||||
this.p.removeGlobalOnLayoutListener(this.j);
|
||||
this.p = null;
|
||||
}
|
||||
this.n.removeOnAttachStateChangeListener(this.k);
|
||||
PopupWindow.OnDismissListener onDismissListener = this.l;
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnKeyListener
|
||||
public boolean onKey(View view, int i, KeyEvent keyEvent) {
|
||||
if (keyEvent.getAction() != 1 || i != 82) {
|
||||
return false;
|
||||
}
|
||||
dismiss();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.ShowableListMenu
|
||||
public void a() {
|
||||
if (!g()) {
|
||||
throw new IllegalStateException("StandardMenuPopup cannot be used without an anchor");
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void b(int i) {
|
||||
this.i.d(i);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void c(int i) {
|
||||
this.i.h(i);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void c(boolean z) {
|
||||
this.u = z;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(boolean z) {
|
||||
this.r = false;
|
||||
MenuAdapter menuAdapter = this.d;
|
||||
if (menuAdapter != null) {
|
||||
menuAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(MenuPresenter.Callback callback) {
|
||||
this.o = callback;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean a(SubMenuBuilder subMenuBuilder) {
|
||||
if (subMenuBuilder.hasVisibleItems()) {
|
||||
MenuPopupHelper menuPopupHelper = new MenuPopupHelper(this.b, subMenuBuilder, this.n, this.e, this.g, this.h);
|
||||
menuPopupHelper.a(this.o);
|
||||
menuPopupHelper.a(MenuPopup.b(subMenuBuilder));
|
||||
menuPopupHelper.a(this.l);
|
||||
this.l = null;
|
||||
this.c.a(false);
|
||||
int g = this.i.g();
|
||||
int h = this.i.h();
|
||||
if ((Gravity.getAbsoluteGravity(this.t, ViewCompat.k(this.m)) & 7) == 5) {
|
||||
g += this.m.getWidth();
|
||||
}
|
||||
if (menuPopupHelper.a(g, h)) {
|
||||
MenuPresenter.Callback callback = this.o;
|
||||
if (callback == null) {
|
||||
return true;
|
||||
}
|
||||
callback.a(subMenuBuilder);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(MenuBuilder menuBuilder, boolean z) {
|
||||
if (menuBuilder != this.c) {
|
||||
return;
|
||||
}
|
||||
dismiss();
|
||||
MenuPresenter.Callback callback = this.o;
|
||||
if (callback != null) {
|
||||
callback.a(menuBuilder, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void a(View view) {
|
||||
this.m = view;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopup
|
||||
public void a(PopupWindow.OnDismissListener onDismissListener) {
|
||||
this.l = onDismissListener;
|
||||
}
|
||||
}
|
||||
132
sources/androidx/appcompat/view/menu/SubMenuBuilder.java
Normal file
132
sources/androidx/appcompat/view/menu/SubMenuBuilder.java
Normal file
@@ -0,0 +1,132 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.view.menu.MenuBuilder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SubMenuBuilder extends MenuBuilder implements SubMenu {
|
||||
private MenuBuilder B;
|
||||
private MenuItemImpl C;
|
||||
|
||||
public SubMenuBuilder(Context context, MenuBuilder menuBuilder, MenuItemImpl menuItemImpl) {
|
||||
super(context);
|
||||
this.B = menuBuilder;
|
||||
this.C = menuItemImpl;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder
|
||||
public void a(MenuBuilder.Callback callback) {
|
||||
this.B.a(callback);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder
|
||||
public boolean b(MenuItemImpl menuItemImpl) {
|
||||
return this.B.b(menuItemImpl);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder
|
||||
public String d() {
|
||||
MenuItemImpl menuItemImpl = this.C;
|
||||
int itemId = menuItemImpl != null ? menuItemImpl.getItemId() : 0;
|
||||
if (itemId == 0) {
|
||||
return null;
|
||||
}
|
||||
return super.d() + ":" + itemId;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public MenuItem getItem() {
|
||||
return this.C;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder
|
||||
public MenuBuilder m() {
|
||||
return this.B.m();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder
|
||||
public boolean o() {
|
||||
return this.B.o();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder
|
||||
public boolean p() {
|
||||
return this.B.p();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder
|
||||
public boolean q() {
|
||||
return this.B.q();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder, android.view.Menu
|
||||
public void setGroupDividerEnabled(boolean z) {
|
||||
this.B.setGroupDividerEnabled(z);
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setHeaderIcon(Drawable drawable) {
|
||||
super.a(drawable);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setHeaderTitle(CharSequence charSequence) {
|
||||
super.a(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setHeaderView(View view) {
|
||||
super.a(view);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setIcon(Drawable drawable) {
|
||||
this.C.setIcon(drawable);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder, android.view.Menu
|
||||
public void setQwertyMode(boolean z) {
|
||||
this.B.setQwertyMode(z);
|
||||
}
|
||||
|
||||
public Menu t() {
|
||||
return this.B;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder
|
||||
boolean a(MenuBuilder menuBuilder, MenuItem menuItem) {
|
||||
return super.a(menuBuilder, menuItem) || this.B.a(menuBuilder, menuItem);
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setHeaderIcon(int i) {
|
||||
super.d(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setHeaderTitle(int i) {
|
||||
super.e(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setIcon(int i) {
|
||||
this.C.setIcon(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder
|
||||
public boolean a(MenuItemImpl menuItemImpl) {
|
||||
return this.B.a(menuItemImpl);
|
||||
}
|
||||
}
|
||||
71
sources/androidx/appcompat/view/menu/SubMenuWrapperICS.java
Normal file
71
sources/androidx/appcompat/view/menu/SubMenuWrapperICS.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package androidx.appcompat.view.menu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.MenuItem;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import androidx.core.internal.view.SupportSubMenu;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class SubMenuWrapperICS extends MenuWrapperICS implements SubMenu {
|
||||
SubMenuWrapperICS(Context context, SupportSubMenu supportSubMenu) {
|
||||
super(context, supportSubMenu);
|
||||
}
|
||||
|
||||
public SupportSubMenu c() {
|
||||
return (SupportSubMenu) this.a;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public void clearHeader() {
|
||||
c().clearHeader();
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public MenuItem getItem() {
|
||||
return a(c().getItem());
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setHeaderIcon(int i) {
|
||||
c().setHeaderIcon(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setHeaderTitle(int i) {
|
||||
c().setHeaderTitle(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setHeaderView(View view) {
|
||||
c().setHeaderView(view);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setIcon(int i) {
|
||||
c().setIcon(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setHeaderIcon(Drawable drawable) {
|
||||
c().setHeaderIcon(drawable);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setHeaderTitle(CharSequence charSequence) {
|
||||
c().setHeaderTitle(charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.view.SubMenu
|
||||
public SubMenu setIcon(Drawable drawable) {
|
||||
c().setIcon(drawable);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
200
sources/androidx/appcompat/widget/AbsActionBarView.java
Normal file
200
sources/androidx/appcompat/widget/AbsActionBarView.java
Normal file
@@ -0,0 +1,200 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.ViewPropertyAnimatorCompat;
|
||||
import androidx.core.view.ViewPropertyAnimatorListener;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class AbsActionBarView extends ViewGroup {
|
||||
protected final VisibilityAnimListener a;
|
||||
protected final Context b;
|
||||
protected ActionMenuView c;
|
||||
protected ActionMenuPresenter d;
|
||||
protected int e;
|
||||
protected ViewPropertyAnimatorCompat f;
|
||||
private boolean g;
|
||||
private boolean h;
|
||||
|
||||
AbsActionBarView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
protected static int a(int i, int i2, boolean z) {
|
||||
return z ? i - i2 : i + i2;
|
||||
}
|
||||
|
||||
public int getAnimatedVisibility() {
|
||||
return this.f != null ? this.a.b : getVisibility();
|
||||
}
|
||||
|
||||
public int getContentHeight() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected void onConfigurationChanged(Configuration configuration) {
|
||||
super.onConfigurationChanged(configuration);
|
||||
TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(null, R$styleable.ActionBar, R$attr.actionBarStyle, 0);
|
||||
setContentHeight(obtainStyledAttributes.getLayoutDimension(R$styleable.ActionBar_height, 0));
|
||||
obtainStyledAttributes.recycle();
|
||||
ActionMenuPresenter actionMenuPresenter = this.d;
|
||||
if (actionMenuPresenter != null) {
|
||||
actionMenuPresenter.a(configuration);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public boolean onHoverEvent(MotionEvent motionEvent) {
|
||||
int actionMasked = motionEvent.getActionMasked();
|
||||
if (actionMasked == 9) {
|
||||
this.h = false;
|
||||
}
|
||||
if (!this.h) {
|
||||
boolean onHoverEvent = super.onHoverEvent(motionEvent);
|
||||
if (actionMasked == 9 && !onHoverEvent) {
|
||||
this.h = true;
|
||||
}
|
||||
}
|
||||
if (actionMasked == 10 || actionMasked == 3) {
|
||||
this.h = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public boolean onTouchEvent(MotionEvent motionEvent) {
|
||||
int actionMasked = motionEvent.getActionMasked();
|
||||
if (actionMasked == 0) {
|
||||
this.g = false;
|
||||
}
|
||||
if (!this.g) {
|
||||
boolean onTouchEvent = super.onTouchEvent(motionEvent);
|
||||
if (actionMasked == 0 && !onTouchEvent) {
|
||||
this.g = true;
|
||||
}
|
||||
}
|
||||
if (actionMasked == 1 || actionMasked == 3) {
|
||||
this.g = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract void setContentHeight(int i);
|
||||
|
||||
@Override // android.view.View
|
||||
public void setVisibility(int i) {
|
||||
if (i != getVisibility()) {
|
||||
ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = this.f;
|
||||
if (viewPropertyAnimatorCompat != null) {
|
||||
viewPropertyAnimatorCompat.a();
|
||||
}
|
||||
super.setVisibility(i);
|
||||
}
|
||||
}
|
||||
|
||||
protected class VisibilityAnimListener implements ViewPropertyAnimatorListener {
|
||||
private boolean a = false;
|
||||
int b;
|
||||
|
||||
protected VisibilityAnimListener() {
|
||||
}
|
||||
|
||||
public VisibilityAnimListener a(ViewPropertyAnimatorCompat viewPropertyAnimatorCompat, int i) {
|
||||
AbsActionBarView.this.f = viewPropertyAnimatorCompat;
|
||||
this.b = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void b(View view) {
|
||||
if (this.a) {
|
||||
return;
|
||||
}
|
||||
AbsActionBarView absActionBarView = AbsActionBarView.this;
|
||||
absActionBarView.f = null;
|
||||
AbsActionBarView.super.setVisibility(this.b);
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void c(View view) {
|
||||
AbsActionBarView.super.setVisibility(0);
|
||||
this.a = false;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.ViewPropertyAnimatorListener
|
||||
public void a(View view) {
|
||||
this.a = true;
|
||||
}
|
||||
}
|
||||
|
||||
AbsActionBarView(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, 0);
|
||||
}
|
||||
|
||||
public ViewPropertyAnimatorCompat a(int i, long j) {
|
||||
ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = this.f;
|
||||
if (viewPropertyAnimatorCompat != null) {
|
||||
viewPropertyAnimatorCompat.a();
|
||||
}
|
||||
if (i != 0) {
|
||||
ViewPropertyAnimatorCompat a = ViewCompat.a(this);
|
||||
a.a(0.0f);
|
||||
a.a(j);
|
||||
VisibilityAnimListener visibilityAnimListener = this.a;
|
||||
visibilityAnimListener.a(a, i);
|
||||
a.a(visibilityAnimListener);
|
||||
return a;
|
||||
}
|
||||
if (getVisibility() != 0) {
|
||||
setAlpha(0.0f);
|
||||
}
|
||||
ViewPropertyAnimatorCompat a2 = ViewCompat.a(this);
|
||||
a2.a(1.0f);
|
||||
a2.a(j);
|
||||
VisibilityAnimListener visibilityAnimListener2 = this.a;
|
||||
visibilityAnimListener2.a(a2, i);
|
||||
a2.a(visibilityAnimListener2);
|
||||
return a2;
|
||||
}
|
||||
|
||||
AbsActionBarView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet, i);
|
||||
int i2;
|
||||
this.a = new VisibilityAnimListener();
|
||||
TypedValue typedValue = new TypedValue();
|
||||
if (context.getTheme().resolveAttribute(R$attr.actionBarPopupTheme, typedValue, true) && (i2 = typedValue.resourceId) != 0) {
|
||||
this.b = new ContextThemeWrapper(context, i2);
|
||||
} else {
|
||||
this.b = context;
|
||||
}
|
||||
}
|
||||
|
||||
protected int a(View view, int i, int i2, int i3) {
|
||||
view.measure(View.MeasureSpec.makeMeasureSpec(i, Integer.MIN_VALUE), i2);
|
||||
return Math.max(0, (i - view.getMeasuredWidth()) - i3);
|
||||
}
|
||||
|
||||
protected int a(View view, int i, int i2, int i3, boolean z) {
|
||||
int measuredWidth = view.getMeasuredWidth();
|
||||
int measuredHeight = view.getMeasuredHeight();
|
||||
int i4 = i2 + ((i3 - measuredHeight) / 2);
|
||||
if (z) {
|
||||
view.layout(i - measuredWidth, i4, i, measuredHeight + i4);
|
||||
} else {
|
||||
view.layout(i, i4, i + measuredWidth, measuredHeight + i4);
|
||||
}
|
||||
return z ? -measuredWidth : measuredWidth;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class ActionBarBackgroundDrawable extends Drawable {
|
||||
final ActionBarContainer a;
|
||||
|
||||
public ActionBarBackgroundDrawable(ActionBarContainer actionBarContainer) {
|
||||
this.a = actionBarContainer;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void draw(Canvas canvas) {
|
||||
ActionBarContainer actionBarContainer = this.a;
|
||||
if (actionBarContainer.h) {
|
||||
Drawable drawable = actionBarContainer.g;
|
||||
if (drawable != null) {
|
||||
drawable.draw(canvas);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
Drawable drawable2 = actionBarContainer.e;
|
||||
if (drawable2 != null) {
|
||||
drawable2.draw(canvas);
|
||||
}
|
||||
ActionBarContainer actionBarContainer2 = this.a;
|
||||
Drawable drawable3 = actionBarContainer2.f;
|
||||
if (drawable3 == null || !actionBarContainer2.i) {
|
||||
return;
|
||||
}
|
||||
drawable3.draw(canvas);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getOpacity() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void getOutline(Outline outline) {
|
||||
ActionBarContainer actionBarContainer = this.a;
|
||||
if (actionBarContainer.h) {
|
||||
Drawable drawable = actionBarContainer.g;
|
||||
if (drawable != null) {
|
||||
drawable.getOutline(outline);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
Drawable drawable2 = actionBarContainer.e;
|
||||
if (drawable2 != null) {
|
||||
drawable2.getOutline(outline);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setAlpha(int i) {
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setColorFilter(ColorFilter colorFilter) {
|
||||
}
|
||||
}
|
||||
309
sources/androidx/appcompat/widget/ActionBarContainer.java
Normal file
309
sources/androidx/appcompat/widget/ActionBarContainer.java
Normal file
@@ -0,0 +1,309 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ActionMode;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import androidx.appcompat.R$id;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActionBarContainer extends FrameLayout {
|
||||
private boolean a;
|
||||
private View b;
|
||||
private View c;
|
||||
private View d;
|
||||
Drawable e;
|
||||
Drawable f;
|
||||
Drawable g;
|
||||
boolean h;
|
||||
boolean i;
|
||||
private int j;
|
||||
|
||||
public ActionBarContainer(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
private int a(View view) {
|
||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) view.getLayoutParams();
|
||||
return view.getMeasuredHeight() + layoutParams.topMargin + layoutParams.bottomMargin;
|
||||
}
|
||||
|
||||
private boolean b(View view) {
|
||||
return view == null || view.getVisibility() == 8 || view.getMeasuredHeight() == 0;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.View
|
||||
protected void drawableStateChanged() {
|
||||
super.drawableStateChanged();
|
||||
Drawable drawable = this.e;
|
||||
if (drawable != null && drawable.isStateful()) {
|
||||
this.e.setState(getDrawableState());
|
||||
}
|
||||
Drawable drawable2 = this.f;
|
||||
if (drawable2 != null && drawable2.isStateful()) {
|
||||
this.f.setState(getDrawableState());
|
||||
}
|
||||
Drawable drawable3 = this.g;
|
||||
if (drawable3 == null || !drawable3.isStateful()) {
|
||||
return;
|
||||
}
|
||||
this.g.setState(getDrawableState());
|
||||
}
|
||||
|
||||
public View getTabContainer() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.View
|
||||
public void jumpDrawablesToCurrentState() {
|
||||
super.jumpDrawablesToCurrentState();
|
||||
Drawable drawable = this.e;
|
||||
if (drawable != null) {
|
||||
drawable.jumpToCurrentState();
|
||||
}
|
||||
Drawable drawable2 = this.f;
|
||||
if (drawable2 != null) {
|
||||
drawable2.jumpToCurrentState();
|
||||
}
|
||||
Drawable drawable3 = this.g;
|
||||
if (drawable3 != null) {
|
||||
drawable3.jumpToCurrentState();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
this.c = findViewById(R$id.action_bar);
|
||||
this.d = findViewById(R$id.action_context_bar);
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public boolean onHoverEvent(MotionEvent motionEvent) {
|
||||
super.onHoverEvent(motionEvent);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup
|
||||
public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
|
||||
return this.a || super.onInterceptTouchEvent(motionEvent);
|
||||
}
|
||||
|
||||
@Override // android.widget.FrameLayout, android.view.ViewGroup, android.view.View
|
||||
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
|
||||
Drawable drawable;
|
||||
super.onLayout(z, i, i2, i3, i4);
|
||||
View view = this.b;
|
||||
boolean z2 = true;
|
||||
boolean z3 = false;
|
||||
boolean z4 = (view == null || view.getVisibility() == 8) ? false : true;
|
||||
if (view != null && view.getVisibility() != 8) {
|
||||
int measuredHeight = getMeasuredHeight();
|
||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) view.getLayoutParams();
|
||||
view.layout(i, (measuredHeight - view.getMeasuredHeight()) - layoutParams.bottomMargin, i3, measuredHeight - layoutParams.bottomMargin);
|
||||
}
|
||||
if (this.h) {
|
||||
Drawable drawable2 = this.g;
|
||||
if (drawable2 != null) {
|
||||
drawable2.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight());
|
||||
} else {
|
||||
z2 = false;
|
||||
}
|
||||
} else {
|
||||
if (this.e != null) {
|
||||
if (this.c.getVisibility() == 0) {
|
||||
this.e.setBounds(this.c.getLeft(), this.c.getTop(), this.c.getRight(), this.c.getBottom());
|
||||
} else {
|
||||
View view2 = this.d;
|
||||
if (view2 == null || view2.getVisibility() != 0) {
|
||||
this.e.setBounds(0, 0, 0, 0);
|
||||
} else {
|
||||
this.e.setBounds(this.d.getLeft(), this.d.getTop(), this.d.getRight(), this.d.getBottom());
|
||||
}
|
||||
}
|
||||
z3 = true;
|
||||
}
|
||||
this.i = z4;
|
||||
if (!z4 || (drawable = this.f) == null) {
|
||||
z2 = z3;
|
||||
} else {
|
||||
drawable.setBounds(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
|
||||
}
|
||||
}
|
||||
if (z2) {
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.FrameLayout, android.view.View
|
||||
public void onMeasure(int i, int i2) {
|
||||
int i3;
|
||||
if (this.c == null && View.MeasureSpec.getMode(i2) == Integer.MIN_VALUE && (i3 = this.j) >= 0) {
|
||||
i2 = View.MeasureSpec.makeMeasureSpec(Math.min(i3, View.MeasureSpec.getSize(i2)), Integer.MIN_VALUE);
|
||||
}
|
||||
super.onMeasure(i, i2);
|
||||
if (this.c == null) {
|
||||
return;
|
||||
}
|
||||
int mode = View.MeasureSpec.getMode(i2);
|
||||
View view = this.b;
|
||||
if (view == null || view.getVisibility() == 8 || mode == 1073741824) {
|
||||
return;
|
||||
}
|
||||
setMeasuredDimension(getMeasuredWidth(), Math.min((!b(this.c) ? a(this.c) : !b(this.d) ? a(this.d) : 0) + a(this.b), mode == Integer.MIN_VALUE ? View.MeasureSpec.getSize(i2) : Integer.MAX_VALUE));
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public boolean onTouchEvent(MotionEvent motionEvent) {
|
||||
super.onTouchEvent(motionEvent);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setPrimaryBackground(Drawable drawable) {
|
||||
Drawable drawable2 = this.e;
|
||||
if (drawable2 != null) {
|
||||
drawable2.setCallback(null);
|
||||
unscheduleDrawable(this.e);
|
||||
}
|
||||
this.e = drawable;
|
||||
if (drawable != null) {
|
||||
drawable.setCallback(this);
|
||||
View view = this.c;
|
||||
if (view != null) {
|
||||
this.e.setBounds(view.getLeft(), this.c.getTop(), this.c.getRight(), this.c.getBottom());
|
||||
}
|
||||
}
|
||||
boolean z = true;
|
||||
if (!this.h ? this.e != null || this.f != null : this.g != null) {
|
||||
z = false;
|
||||
}
|
||||
setWillNotDraw(z);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public void setSplitBackground(Drawable drawable) {
|
||||
Drawable drawable2;
|
||||
Drawable drawable3 = this.g;
|
||||
if (drawable3 != null) {
|
||||
drawable3.setCallback(null);
|
||||
unscheduleDrawable(this.g);
|
||||
}
|
||||
this.g = drawable;
|
||||
boolean z = false;
|
||||
if (drawable != null) {
|
||||
drawable.setCallback(this);
|
||||
if (this.h && (drawable2 = this.g) != null) {
|
||||
drawable2.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight());
|
||||
}
|
||||
}
|
||||
if (!this.h ? !(this.e != null || this.f != null) : this.g == null) {
|
||||
z = true;
|
||||
}
|
||||
setWillNotDraw(z);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public void setStackedBackground(Drawable drawable) {
|
||||
Drawable drawable2;
|
||||
Drawable drawable3 = this.f;
|
||||
if (drawable3 != null) {
|
||||
drawable3.setCallback(null);
|
||||
unscheduleDrawable(this.f);
|
||||
}
|
||||
this.f = drawable;
|
||||
if (drawable != null) {
|
||||
drawable.setCallback(this);
|
||||
if (this.i && (drawable2 = this.f) != null) {
|
||||
drawable2.setBounds(this.b.getLeft(), this.b.getTop(), this.b.getRight(), this.b.getBottom());
|
||||
}
|
||||
}
|
||||
boolean z = true;
|
||||
if (!this.h ? this.e != null || this.f != null : this.g != null) {
|
||||
z = false;
|
||||
}
|
||||
setWillNotDraw(z);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public void setTabContainer(ScrollingTabContainerView scrollingTabContainerView) {
|
||||
View view = this.b;
|
||||
if (view != null) {
|
||||
removeView(view);
|
||||
}
|
||||
this.b = scrollingTabContainerView;
|
||||
if (scrollingTabContainerView != null) {
|
||||
addView(scrollingTabContainerView);
|
||||
ViewGroup.LayoutParams layoutParams = scrollingTabContainerView.getLayoutParams();
|
||||
layoutParams.width = -1;
|
||||
layoutParams.height = -2;
|
||||
scrollingTabContainerView.setAllowCollapse(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void setTransitioning(boolean z) {
|
||||
this.a = z;
|
||||
setDescendantFocusability(z ? 393216 : 262144);
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setVisibility(int i) {
|
||||
super.setVisibility(i);
|
||||
boolean z = i == 0;
|
||||
Drawable drawable = this.e;
|
||||
if (drawable != null) {
|
||||
drawable.setVisible(z, false);
|
||||
}
|
||||
Drawable drawable2 = this.f;
|
||||
if (drawable2 != null) {
|
||||
drawable2.setVisible(z, false);
|
||||
}
|
||||
Drawable drawable3 = this.g;
|
||||
if (drawable3 != null) {
|
||||
drawable3.setVisible(z, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.ViewParent
|
||||
public ActionMode startActionModeForChild(View view, ActionMode.Callback callback) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.ViewParent
|
||||
public ActionMode startActionModeForChild(View view, ActionMode.Callback callback, int i) {
|
||||
if (i != 0) {
|
||||
return super.startActionModeForChild(view, callback, i);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected boolean verifyDrawable(Drawable drawable) {
|
||||
return (drawable == this.e && !this.h) || (drawable == this.f && this.i) || ((drawable == this.g && this.h) || super.verifyDrawable(drawable));
|
||||
}
|
||||
|
||||
public ActionBarContainer(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
ViewCompat.a(this, new ActionBarBackgroundDrawable(this));
|
||||
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.ActionBar);
|
||||
this.e = obtainStyledAttributes.getDrawable(R$styleable.ActionBar_background);
|
||||
this.f = obtainStyledAttributes.getDrawable(R$styleable.ActionBar_backgroundStacked);
|
||||
this.j = obtainStyledAttributes.getDimensionPixelSize(R$styleable.ActionBar_height, -1);
|
||||
if (getId() == R$id.split_action_bar) {
|
||||
this.h = true;
|
||||
this.g = obtainStyledAttributes.getDrawable(R$styleable.ActionBar_backgroundSplit);
|
||||
}
|
||||
obtainStyledAttributes.recycle();
|
||||
boolean z = false;
|
||||
if (!this.h ? !(this.e != null || this.f != null) : this.g == null) {
|
||||
z = true;
|
||||
}
|
||||
setWillNotDraw(z);
|
||||
}
|
||||
}
|
||||
337
sources/androidx/appcompat/widget/ActionBarContextView.java
Normal file
337
sources/androidx/appcompat/widget/ActionBarContextView.java
Normal file
@@ -0,0 +1,337 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.R$id;
|
||||
import androidx.appcompat.R$layout;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.appcompat.view.menu.MenuBuilder;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActionBarContextView extends AbsActionBarView {
|
||||
private CharSequence i;
|
||||
private CharSequence j;
|
||||
private View k;
|
||||
private View l;
|
||||
private LinearLayout m;
|
||||
private TextView n;
|
||||
private TextView o;
|
||||
private int p;
|
||||
private int q;
|
||||
private boolean r;
|
||||
private int s;
|
||||
|
||||
public ActionBarContextView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
private void e() {
|
||||
if (this.m == null) {
|
||||
LayoutInflater.from(getContext()).inflate(R$layout.abc_action_bar_title_item, this);
|
||||
this.m = (LinearLayout) getChildAt(getChildCount() - 1);
|
||||
this.n = (TextView) this.m.findViewById(R$id.action_bar_title);
|
||||
this.o = (TextView) this.m.findViewById(R$id.action_bar_subtitle);
|
||||
if (this.p != 0) {
|
||||
this.n.setTextAppearance(getContext(), this.p);
|
||||
}
|
||||
if (this.q != 0) {
|
||||
this.o.setTextAppearance(getContext(), this.q);
|
||||
}
|
||||
}
|
||||
this.n.setText(this.i);
|
||||
this.o.setText(this.j);
|
||||
boolean z = !TextUtils.isEmpty(this.i);
|
||||
boolean z2 = !TextUtils.isEmpty(this.j);
|
||||
int i = 0;
|
||||
this.o.setVisibility(z2 ? 0 : 8);
|
||||
LinearLayout linearLayout = this.m;
|
||||
if (!z && !z2) {
|
||||
i = 8;
|
||||
}
|
||||
linearLayout.setVisibility(i);
|
||||
if (this.m.getParent() == null) {
|
||||
addView(this.m);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean b() {
|
||||
return this.r;
|
||||
}
|
||||
|
||||
public void c() {
|
||||
removeAllViews();
|
||||
this.l = null;
|
||||
this.c = null;
|
||||
}
|
||||
|
||||
public boolean d() {
|
||||
ActionMenuPresenter actionMenuPresenter = this.d;
|
||||
if (actionMenuPresenter != null) {
|
||||
return actionMenuPresenter.i();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup
|
||||
protected ViewGroup.LayoutParams generateDefaultLayoutParams() {
|
||||
return new ViewGroup.MarginLayoutParams(-1, -2);
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup
|
||||
public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
|
||||
return new ViewGroup.MarginLayoutParams(getContext(), attributeSet);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.AbsActionBarView
|
||||
public /* bridge */ /* synthetic */ int getAnimatedVisibility() {
|
||||
return super.getAnimatedVisibility();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.AbsActionBarView
|
||||
public /* bridge */ /* synthetic */ int getContentHeight() {
|
||||
return super.getContentHeight();
|
||||
}
|
||||
|
||||
public CharSequence getSubtitle() {
|
||||
return this.j;
|
||||
}
|
||||
|
||||
public CharSequence getTitle() {
|
||||
return this.i;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.View
|
||||
public void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
ActionMenuPresenter actionMenuPresenter = this.d;
|
||||
if (actionMenuPresenter != null) {
|
||||
actionMenuPresenter.e();
|
||||
this.d.f();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
|
||||
if (accessibilityEvent.getEventType() != 32) {
|
||||
super.onInitializeAccessibilityEvent(accessibilityEvent);
|
||||
return;
|
||||
}
|
||||
accessibilityEvent.setSource(this);
|
||||
accessibilityEvent.setClassName(ActionBarContextView.class.getName());
|
||||
accessibilityEvent.setPackageName(getContext().getPackageName());
|
||||
accessibilityEvent.setContentDescription(this.i);
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.View
|
||||
protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
|
||||
int i5;
|
||||
boolean a = ViewUtils.a(this);
|
||||
int paddingRight = a ? (i3 - i) - getPaddingRight() : getPaddingLeft();
|
||||
int paddingTop = getPaddingTop();
|
||||
int paddingTop2 = ((i4 - i2) - getPaddingTop()) - getPaddingBottom();
|
||||
View view = this.k;
|
||||
if (view == null || view.getVisibility() == 8) {
|
||||
i5 = paddingRight;
|
||||
} else {
|
||||
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) this.k.getLayoutParams();
|
||||
int i6 = a ? marginLayoutParams.rightMargin : marginLayoutParams.leftMargin;
|
||||
int i7 = a ? marginLayoutParams.leftMargin : marginLayoutParams.rightMargin;
|
||||
int a2 = AbsActionBarView.a(paddingRight, i6, a);
|
||||
i5 = AbsActionBarView.a(a2 + a(this.k, a2, paddingTop, paddingTop2, a), i7, a);
|
||||
}
|
||||
LinearLayout linearLayout = this.m;
|
||||
if (linearLayout != null && this.l == null && linearLayout.getVisibility() != 8) {
|
||||
i5 += a(this.m, i5, paddingTop, paddingTop2, a);
|
||||
}
|
||||
int i8 = i5;
|
||||
View view2 = this.l;
|
||||
if (view2 != null) {
|
||||
a(view2, i8, paddingTop, paddingTop2, a);
|
||||
}
|
||||
int paddingLeft = a ? getPaddingLeft() : (i3 - i) - getPaddingRight();
|
||||
ActionMenuView actionMenuView = this.c;
|
||||
if (actionMenuView != null) {
|
||||
a(actionMenuView, paddingLeft, paddingTop, paddingTop2, !a);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected void onMeasure(int i, int i2) {
|
||||
if (View.MeasureSpec.getMode(i) != 1073741824) {
|
||||
throw new IllegalStateException(ActionBarContextView.class.getSimpleName() + " can only be used with android:layout_width=\"match_parent\" (or fill_parent)");
|
||||
}
|
||||
if (View.MeasureSpec.getMode(i2) == 0) {
|
||||
throw new IllegalStateException(ActionBarContextView.class.getSimpleName() + " can only be used with android:layout_height=\"wrap_content\"");
|
||||
}
|
||||
int size = View.MeasureSpec.getSize(i);
|
||||
int i3 = this.e;
|
||||
if (i3 <= 0) {
|
||||
i3 = View.MeasureSpec.getSize(i2);
|
||||
}
|
||||
int paddingTop = getPaddingTop() + getPaddingBottom();
|
||||
int paddingLeft = (size - getPaddingLeft()) - getPaddingRight();
|
||||
int i4 = i3 - paddingTop;
|
||||
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(i4, Integer.MIN_VALUE);
|
||||
View view = this.k;
|
||||
if (view != null) {
|
||||
int a = a(view, paddingLeft, makeMeasureSpec, 0);
|
||||
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) this.k.getLayoutParams();
|
||||
paddingLeft = a - (marginLayoutParams.leftMargin + marginLayoutParams.rightMargin);
|
||||
}
|
||||
ActionMenuView actionMenuView = this.c;
|
||||
if (actionMenuView != null && actionMenuView.getParent() == this) {
|
||||
paddingLeft = a(this.c, paddingLeft, makeMeasureSpec, 0);
|
||||
}
|
||||
LinearLayout linearLayout = this.m;
|
||||
if (linearLayout != null && this.l == null) {
|
||||
if (this.r) {
|
||||
this.m.measure(View.MeasureSpec.makeMeasureSpec(0, 0), makeMeasureSpec);
|
||||
int measuredWidth = this.m.getMeasuredWidth();
|
||||
boolean z = measuredWidth <= paddingLeft;
|
||||
if (z) {
|
||||
paddingLeft -= measuredWidth;
|
||||
}
|
||||
this.m.setVisibility(z ? 0 : 8);
|
||||
} else {
|
||||
paddingLeft = a(linearLayout, paddingLeft, makeMeasureSpec, 0);
|
||||
}
|
||||
}
|
||||
View view2 = this.l;
|
||||
if (view2 != null) {
|
||||
ViewGroup.LayoutParams layoutParams = view2.getLayoutParams();
|
||||
int i5 = layoutParams.width != -2 ? 1073741824 : Integer.MIN_VALUE;
|
||||
int i6 = layoutParams.width;
|
||||
if (i6 >= 0) {
|
||||
paddingLeft = Math.min(i6, paddingLeft);
|
||||
}
|
||||
int i7 = layoutParams.height == -2 ? Integer.MIN_VALUE : 1073741824;
|
||||
int i8 = layoutParams.height;
|
||||
if (i8 >= 0) {
|
||||
i4 = Math.min(i8, i4);
|
||||
}
|
||||
this.l.measure(View.MeasureSpec.makeMeasureSpec(paddingLeft, i5), View.MeasureSpec.makeMeasureSpec(i4, i7));
|
||||
}
|
||||
if (this.e > 0) {
|
||||
setMeasuredDimension(size, i3);
|
||||
return;
|
||||
}
|
||||
int childCount = getChildCount();
|
||||
int i9 = 0;
|
||||
for (int i10 = 0; i10 < childCount; i10++) {
|
||||
int measuredHeight = getChildAt(i10).getMeasuredHeight() + paddingTop;
|
||||
if (measuredHeight > i9) {
|
||||
i9 = measuredHeight;
|
||||
}
|
||||
}
|
||||
setMeasuredDimension(size, i9);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.AbsActionBarView
|
||||
public void setContentHeight(int i) {
|
||||
this.e = i;
|
||||
}
|
||||
|
||||
public void setCustomView(View view) {
|
||||
LinearLayout linearLayout;
|
||||
View view2 = this.l;
|
||||
if (view2 != null) {
|
||||
removeView(view2);
|
||||
}
|
||||
this.l = view;
|
||||
if (view != null && (linearLayout = this.m) != null) {
|
||||
removeView(linearLayout);
|
||||
this.m = null;
|
||||
}
|
||||
if (view != null) {
|
||||
addView(view);
|
||||
}
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
public void setSubtitle(CharSequence charSequence) {
|
||||
this.j = charSequence;
|
||||
e();
|
||||
}
|
||||
|
||||
public void setTitle(CharSequence charSequence) {
|
||||
this.i = charSequence;
|
||||
e();
|
||||
}
|
||||
|
||||
public void setTitleOptional(boolean z) {
|
||||
if (z != this.r) {
|
||||
requestLayout();
|
||||
}
|
||||
this.r = z;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.AbsActionBarView, android.view.View
|
||||
public /* bridge */ /* synthetic */ void setVisibility(int i) {
|
||||
super.setVisibility(i);
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup
|
||||
public boolean shouldDelayChildPressedState() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public ActionBarContextView(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.actionModeStyle);
|
||||
}
|
||||
|
||||
public void a(final ActionMode actionMode) {
|
||||
View view = this.k;
|
||||
if (view == null) {
|
||||
this.k = LayoutInflater.from(getContext()).inflate(this.s, (ViewGroup) this, false);
|
||||
addView(this.k);
|
||||
} else if (view.getParent() == null) {
|
||||
addView(this.k);
|
||||
}
|
||||
this.k.findViewById(R$id.action_mode_close_button).setOnClickListener(new View.OnClickListener(this) { // from class: androidx.appcompat.widget.ActionBarContextView.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view2) {
|
||||
actionMode.a();
|
||||
}
|
||||
});
|
||||
MenuBuilder menuBuilder = (MenuBuilder) actionMode.c();
|
||||
ActionMenuPresenter actionMenuPresenter = this.d;
|
||||
if (actionMenuPresenter != null) {
|
||||
actionMenuPresenter.c();
|
||||
}
|
||||
this.d = new ActionMenuPresenter(getContext());
|
||||
this.d.c(true);
|
||||
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(-2, -1);
|
||||
menuBuilder.a(this.d, this.b);
|
||||
this.c = (ActionMenuView) this.d.b(this);
|
||||
ViewCompat.a(this.c, (Drawable) null);
|
||||
addView(this.c, layoutParams);
|
||||
}
|
||||
|
||||
public ActionBarContextView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet, i);
|
||||
TintTypedArray a = TintTypedArray.a(context, attributeSet, R$styleable.ActionMode, i, 0);
|
||||
ViewCompat.a(this, a.b(R$styleable.ActionMode_background));
|
||||
this.p = a.g(R$styleable.ActionMode_titleTextStyle, 0);
|
||||
this.q = a.g(R$styleable.ActionMode_subtitleTextStyle, 0);
|
||||
this.e = a.f(R$styleable.ActionMode_height, 0);
|
||||
this.s = a.g(R$styleable.ActionMode_closeItemLayout, R$layout.abc_action_mode_close_item_material);
|
||||
a.a();
|
||||
}
|
||||
|
||||
public void a() {
|
||||
if (this.k == null) {
|
||||
c();
|
||||
}
|
||||
}
|
||||
}
|
||||
634
sources/androidx/appcompat/widget/ActionBarOverlayLayout.java
Normal file
634
sources/androidx/appcompat/widget/ActionBarOverlayLayout.java
Normal file
@@ -0,0 +1,634 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.R;
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.Menu;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewPropertyAnimator;
|
||||
import android.view.Window;
|
||||
import android.widget.OverScroller;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.R$id;
|
||||
import androidx.appcompat.view.menu.MenuPresenter;
|
||||
import androidx.core.view.NestedScrollingParent;
|
||||
import androidx.core.view.NestedScrollingParentHelper;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import com.ijm.dataencryption.de.DataDecryptTool;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActionBarOverlayLayout extends ViewGroup implements DecorContentParent, NestedScrollingParent {
|
||||
static final int[] C = {R$attr.actionBarSize, R.attr.windowContentOverlay};
|
||||
private final Runnable A;
|
||||
private final NestedScrollingParentHelper B;
|
||||
private int a;
|
||||
private int b;
|
||||
private ContentFrameLayout c;
|
||||
ActionBarContainer d;
|
||||
private DecorToolbar e;
|
||||
private Drawable f;
|
||||
private boolean g;
|
||||
private boolean h;
|
||||
private boolean i;
|
||||
private boolean j;
|
||||
boolean k;
|
||||
private int l;
|
||||
private int m;
|
||||
private final Rect n;
|
||||
private final Rect o;
|
||||
private final Rect p;
|
||||
private final Rect q;
|
||||
private final Rect r;
|
||||
private final Rect s;
|
||||
private final Rect t;
|
||||
private ActionBarVisibilityCallback u;
|
||||
private OverScroller v;
|
||||
ViewPropertyAnimator x;
|
||||
final AnimatorListenerAdapter y;
|
||||
private final Runnable z;
|
||||
|
||||
public interface ActionBarVisibilityCallback {
|
||||
void a();
|
||||
|
||||
void a(int i);
|
||||
|
||||
void a(boolean z);
|
||||
|
||||
void b();
|
||||
|
||||
void c();
|
||||
|
||||
void d();
|
||||
}
|
||||
|
||||
public static class LayoutParams extends ViewGroup.MarginLayoutParams {
|
||||
public LayoutParams(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
}
|
||||
|
||||
public LayoutParams(int i, int i2) {
|
||||
super(i, i2);
|
||||
}
|
||||
|
||||
public LayoutParams(ViewGroup.LayoutParams layoutParams) {
|
||||
super(layoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionBarOverlayLayout(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
private void a(Context context) {
|
||||
TypedArray obtainStyledAttributes = getContext().getTheme().obtainStyledAttributes(C);
|
||||
this.a = obtainStyledAttributes.getDimensionPixelSize(0, 0);
|
||||
this.f = obtainStyledAttributes.getDrawable(1);
|
||||
setWillNotDraw(this.f == null);
|
||||
obtainStyledAttributes.recycle();
|
||||
this.g = context.getApplicationInfo().targetSdkVersion < 19;
|
||||
this.v = new OverScroller(context);
|
||||
}
|
||||
|
||||
private void k() {
|
||||
b();
|
||||
this.A.run();
|
||||
}
|
||||
|
||||
private void l() {
|
||||
b();
|
||||
postDelayed(this.A, 600L);
|
||||
}
|
||||
|
||||
private void m() {
|
||||
b();
|
||||
postDelayed(this.z, 600L);
|
||||
}
|
||||
|
||||
private void n() {
|
||||
b();
|
||||
this.z.run();
|
||||
}
|
||||
|
||||
void b() {
|
||||
removeCallbacks(this.z);
|
||||
removeCallbacks(this.A);
|
||||
ViewPropertyAnimator viewPropertyAnimator = this.x;
|
||||
if (viewPropertyAnimator != null) {
|
||||
viewPropertyAnimator.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.DecorContentParent
|
||||
public void c() {
|
||||
j();
|
||||
this.e.c();
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup
|
||||
protected boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
|
||||
return layoutParams instanceof LayoutParams;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.DecorContentParent
|
||||
public boolean d() {
|
||||
j();
|
||||
return this.e.d();
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void draw(Canvas canvas) {
|
||||
super.draw(canvas);
|
||||
if (this.f == null || this.g) {
|
||||
return;
|
||||
}
|
||||
int bottom = this.d.getVisibility() == 0 ? (int) (this.d.getBottom() + this.d.getTranslationY() + 0.5f) : 0;
|
||||
this.f.setBounds(0, bottom, getWidth(), this.f.getIntrinsicHeight() + bottom);
|
||||
this.f.draw(canvas);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.DecorContentParent
|
||||
public boolean e() {
|
||||
j();
|
||||
return this.e.e();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.DecorContentParent
|
||||
public boolean f() {
|
||||
j();
|
||||
return this.e.f();
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected boolean fitSystemWindows(Rect rect) {
|
||||
j();
|
||||
int q = ViewCompat.q(this) & DataDecryptTool.DECRYPT_ALL_FILE;
|
||||
boolean a = a(this.d, rect, true, true, false, true);
|
||||
this.q.set(rect);
|
||||
ViewUtils.a(this, this.q, this.n);
|
||||
if (!this.r.equals(this.q)) {
|
||||
this.r.set(this.q);
|
||||
a = true;
|
||||
}
|
||||
if (!this.o.equals(this.n)) {
|
||||
this.o.set(this.n);
|
||||
a = true;
|
||||
}
|
||||
if (a) {
|
||||
requestLayout();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.DecorContentParent
|
||||
public boolean g() {
|
||||
j();
|
||||
return this.e.g();
|
||||
}
|
||||
|
||||
public int getActionBarHideOffset() {
|
||||
ActionBarContainer actionBarContainer = this.d;
|
||||
if (actionBarContainer != null) {
|
||||
return -((int) actionBarContainer.getTranslationY());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup
|
||||
public int getNestedScrollAxes() {
|
||||
return this.B.a();
|
||||
}
|
||||
|
||||
public CharSequence getTitle() {
|
||||
j();
|
||||
return this.e.getTitle();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.DecorContentParent
|
||||
public void h() {
|
||||
j();
|
||||
this.e.h();
|
||||
}
|
||||
|
||||
public boolean i() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
void j() {
|
||||
if (this.c == null) {
|
||||
this.c = (ContentFrameLayout) findViewById(R$id.action_bar_activity_content);
|
||||
this.d = (ActionBarContainer) findViewById(R$id.action_bar_container);
|
||||
this.e = a(findViewById(R$id.action_bar));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected void onConfigurationChanged(Configuration configuration) {
|
||||
super.onConfigurationChanged(configuration);
|
||||
a(getContext());
|
||||
ViewCompat.B(this);
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.View
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
b();
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.View
|
||||
protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
|
||||
int childCount = getChildCount();
|
||||
int paddingLeft = getPaddingLeft();
|
||||
getPaddingRight();
|
||||
int paddingTop = getPaddingTop();
|
||||
getPaddingBottom();
|
||||
for (int i5 = 0; i5 < childCount; i5++) {
|
||||
View childAt = getChildAt(i5);
|
||||
if (childAt.getVisibility() != 8) {
|
||||
LayoutParams layoutParams = (LayoutParams) childAt.getLayoutParams();
|
||||
int measuredWidth = childAt.getMeasuredWidth();
|
||||
int measuredHeight = childAt.getMeasuredHeight();
|
||||
int i6 = ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin + paddingLeft;
|
||||
int i7 = ((ViewGroup.MarginLayoutParams) layoutParams).topMargin + paddingTop;
|
||||
childAt.layout(i6, i7, measuredWidth + i6, measuredHeight + i7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected void onMeasure(int i, int i2) {
|
||||
int measuredHeight;
|
||||
j();
|
||||
measureChildWithMargins(this.d, i, 0, i2, 0);
|
||||
LayoutParams layoutParams = (LayoutParams) this.d.getLayoutParams();
|
||||
int max = Math.max(0, this.d.getMeasuredWidth() + ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin);
|
||||
int max2 = Math.max(0, this.d.getMeasuredHeight() + ((ViewGroup.MarginLayoutParams) layoutParams).topMargin + ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin);
|
||||
int combineMeasuredStates = View.combineMeasuredStates(0, this.d.getMeasuredState());
|
||||
boolean z = (ViewCompat.q(this) & DataDecryptTool.DECRYPT_ALL_FILE) != 0;
|
||||
if (z) {
|
||||
measuredHeight = this.a;
|
||||
if (this.i && this.d.getTabContainer() != null) {
|
||||
measuredHeight += this.a;
|
||||
}
|
||||
} else {
|
||||
measuredHeight = this.d.getVisibility() != 8 ? this.d.getMeasuredHeight() : 0;
|
||||
}
|
||||
this.p.set(this.n);
|
||||
this.s.set(this.q);
|
||||
if (this.h || z) {
|
||||
Rect rect = this.s;
|
||||
rect.top += measuredHeight;
|
||||
rect.bottom += 0;
|
||||
} else {
|
||||
Rect rect2 = this.p;
|
||||
rect2.top += measuredHeight;
|
||||
rect2.bottom += 0;
|
||||
}
|
||||
a(this.c, this.p, true, true, true, true);
|
||||
if (!this.t.equals(this.s)) {
|
||||
this.t.set(this.s);
|
||||
this.c.a(this.s);
|
||||
}
|
||||
measureChildWithMargins(this.c, i, 0, i2, 0);
|
||||
LayoutParams layoutParams2 = (LayoutParams) this.c.getLayoutParams();
|
||||
int max3 = Math.max(max, this.c.getMeasuredWidth() + ((ViewGroup.MarginLayoutParams) layoutParams2).leftMargin + ((ViewGroup.MarginLayoutParams) layoutParams2).rightMargin);
|
||||
int max4 = Math.max(max2, this.c.getMeasuredHeight() + ((ViewGroup.MarginLayoutParams) layoutParams2).topMargin + ((ViewGroup.MarginLayoutParams) layoutParams2).bottomMargin);
|
||||
int combineMeasuredStates2 = View.combineMeasuredStates(combineMeasuredStates, this.c.getMeasuredState());
|
||||
setMeasuredDimension(View.resolveSizeAndState(Math.max(max3 + getPaddingLeft() + getPaddingRight(), getSuggestedMinimumWidth()), i, combineMeasuredStates2), View.resolveSizeAndState(Math.max(max4 + getPaddingTop() + getPaddingBottom(), getSuggestedMinimumHeight()), i2, combineMeasuredStates2 << 16));
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.ViewParent, androidx.core.view.NestedScrollingParent
|
||||
public boolean onNestedFling(View view, float f, float f2, boolean z) {
|
||||
if (!this.j || !z) {
|
||||
return false;
|
||||
}
|
||||
if (a(f, f2)) {
|
||||
k();
|
||||
} else {
|
||||
n();
|
||||
}
|
||||
this.k = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.ViewParent, androidx.core.view.NestedScrollingParent
|
||||
public boolean onNestedPreFling(View view, float f, float f2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.ViewParent, androidx.core.view.NestedScrollingParent
|
||||
public void onNestedPreScroll(View view, int i, int i2, int[] iArr) {
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.ViewParent, androidx.core.view.NestedScrollingParent
|
||||
public void onNestedScroll(View view, int i, int i2, int i3, int i4) {
|
||||
this.l += i2;
|
||||
setActionBarHideOffset(this.l);
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.ViewParent, androidx.core.view.NestedScrollingParent
|
||||
public void onNestedScrollAccepted(View view, View view2, int i) {
|
||||
this.B.a(view, view2, i);
|
||||
this.l = getActionBarHideOffset();
|
||||
b();
|
||||
ActionBarVisibilityCallback actionBarVisibilityCallback = this.u;
|
||||
if (actionBarVisibilityCallback != null) {
|
||||
actionBarVisibilityCallback.d();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.ViewParent, androidx.core.view.NestedScrollingParent
|
||||
public boolean onStartNestedScroll(View view, View view2, int i) {
|
||||
if ((i & 2) == 0 || this.d.getVisibility() != 0) {
|
||||
return false;
|
||||
}
|
||||
return this.j;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.ViewParent, androidx.core.view.NestedScrollingParent
|
||||
public void onStopNestedScroll(View view) {
|
||||
if (this.j && !this.k) {
|
||||
if (this.l <= this.d.getHeight()) {
|
||||
m();
|
||||
} else {
|
||||
l();
|
||||
}
|
||||
}
|
||||
ActionBarVisibilityCallback actionBarVisibilityCallback = this.u;
|
||||
if (actionBarVisibilityCallback != null) {
|
||||
actionBarVisibilityCallback.b();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void onWindowSystemUiVisibilityChanged(int i) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
super.onWindowSystemUiVisibilityChanged(i);
|
||||
}
|
||||
j();
|
||||
int i2 = this.m ^ i;
|
||||
this.m = i;
|
||||
boolean z = (i & 4) == 0;
|
||||
boolean z2 = (i & DataDecryptTool.DECRYPT_ALL_FILE) != 0;
|
||||
ActionBarVisibilityCallback actionBarVisibilityCallback = this.u;
|
||||
if (actionBarVisibilityCallback != null) {
|
||||
actionBarVisibilityCallback.a(!z2);
|
||||
if (z || !z2) {
|
||||
this.u.a();
|
||||
} else {
|
||||
this.u.c();
|
||||
}
|
||||
}
|
||||
if ((i2 & DataDecryptTool.DECRYPT_ALL_FILE) == 0 || this.u == null) {
|
||||
return;
|
||||
}
|
||||
ViewCompat.B(this);
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected void onWindowVisibilityChanged(int i) {
|
||||
super.onWindowVisibilityChanged(i);
|
||||
this.b = i;
|
||||
ActionBarVisibilityCallback actionBarVisibilityCallback = this.u;
|
||||
if (actionBarVisibilityCallback != null) {
|
||||
actionBarVisibilityCallback.a(i);
|
||||
}
|
||||
}
|
||||
|
||||
public void setActionBarHideOffset(int i) {
|
||||
b();
|
||||
this.d.setTranslationY(-Math.max(0, Math.min(i, this.d.getHeight())));
|
||||
}
|
||||
|
||||
public void setActionBarVisibilityCallback(ActionBarVisibilityCallback actionBarVisibilityCallback) {
|
||||
this.u = actionBarVisibilityCallback;
|
||||
if (getWindowToken() != null) {
|
||||
this.u.a(this.b);
|
||||
int i = this.m;
|
||||
if (i != 0) {
|
||||
onWindowSystemUiVisibilityChanged(i);
|
||||
ViewCompat.B(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setHasNonEmbeddedTabs(boolean z) {
|
||||
this.i = z;
|
||||
}
|
||||
|
||||
public void setHideOnContentScrollEnabled(boolean z) {
|
||||
if (z != this.j) {
|
||||
this.j = z;
|
||||
if (z) {
|
||||
return;
|
||||
}
|
||||
b();
|
||||
setActionBarHideOffset(0);
|
||||
}
|
||||
}
|
||||
|
||||
public void setIcon(int i) {
|
||||
j();
|
||||
this.e.setIcon(i);
|
||||
}
|
||||
|
||||
public void setLogo(int i) {
|
||||
j();
|
||||
this.e.b(i);
|
||||
}
|
||||
|
||||
public void setOverlayMode(boolean z) {
|
||||
this.h = z;
|
||||
this.g = z && getContext().getApplicationInfo().targetSdkVersion < 19;
|
||||
}
|
||||
|
||||
public void setShowingForActionMode(boolean z) {
|
||||
}
|
||||
|
||||
public void setUiOptions(int i) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.DecorContentParent
|
||||
public void setWindowCallback(Window.Callback callback) {
|
||||
j();
|
||||
this.e.setWindowCallback(callback);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.DecorContentParent
|
||||
public void setWindowTitle(CharSequence charSequence) {
|
||||
j();
|
||||
this.e.setWindowTitle(charSequence);
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup
|
||||
public boolean shouldDelayChildPressedState() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public ActionBarOverlayLayout(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
this.b = 0;
|
||||
this.n = new Rect();
|
||||
this.o = new Rect();
|
||||
this.p = new Rect();
|
||||
this.q = new Rect();
|
||||
this.r = new Rect();
|
||||
this.s = new Rect();
|
||||
this.t = new Rect();
|
||||
this.y = new AnimatorListenerAdapter() { // from class: androidx.appcompat.widget.ActionBarOverlayLayout.1
|
||||
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
||||
public void onAnimationCancel(Animator animator) {
|
||||
ActionBarOverlayLayout actionBarOverlayLayout = ActionBarOverlayLayout.this;
|
||||
actionBarOverlayLayout.x = null;
|
||||
actionBarOverlayLayout.k = false;
|
||||
}
|
||||
|
||||
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
ActionBarOverlayLayout actionBarOverlayLayout = ActionBarOverlayLayout.this;
|
||||
actionBarOverlayLayout.x = null;
|
||||
actionBarOverlayLayout.k = false;
|
||||
}
|
||||
};
|
||||
this.z = new Runnable() { // from class: androidx.appcompat.widget.ActionBarOverlayLayout.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
ActionBarOverlayLayout.this.b();
|
||||
ActionBarOverlayLayout actionBarOverlayLayout = ActionBarOverlayLayout.this;
|
||||
actionBarOverlayLayout.x = actionBarOverlayLayout.d.animate().translationY(0.0f).setListener(ActionBarOverlayLayout.this.y);
|
||||
}
|
||||
};
|
||||
this.A = new Runnable() { // from class: androidx.appcompat.widget.ActionBarOverlayLayout.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
ActionBarOverlayLayout.this.b();
|
||||
ActionBarOverlayLayout actionBarOverlayLayout = ActionBarOverlayLayout.this;
|
||||
actionBarOverlayLayout.x = actionBarOverlayLayout.d.animate().translationY(-ActionBarOverlayLayout.this.d.getHeight()).setListener(ActionBarOverlayLayout.this.y);
|
||||
}
|
||||
};
|
||||
a(context);
|
||||
this.B = new NestedScrollingParentHelper(this);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // android.view.ViewGroup
|
||||
public LayoutParams generateDefaultLayoutParams() {
|
||||
return new LayoutParams(-1, -1);
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup
|
||||
public LayoutParams generateLayoutParams(AttributeSet attributeSet) {
|
||||
return new LayoutParams(getContext(), attributeSet);
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup
|
||||
protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
|
||||
return new LayoutParams(layoutParams);
|
||||
}
|
||||
|
||||
public void setIcon(Drawable drawable) {
|
||||
j();
|
||||
this.e.setIcon(drawable);
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:11:0x0021 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:15:0x002c */
|
||||
/* JADX WARN: Removed duplicated region for block: B:21:? A[RETURN, SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:7:0x0016 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private boolean a(android.view.View r3, android.graphics.Rect r4, boolean r5, boolean r6, boolean r7, boolean r8) {
|
||||
/*
|
||||
r2 = this;
|
||||
android.view.ViewGroup$LayoutParams r3 = r3.getLayoutParams()
|
||||
androidx.appcompat.widget.ActionBarOverlayLayout$LayoutParams r3 = (androidx.appcompat.widget.ActionBarOverlayLayout.LayoutParams) r3
|
||||
r0 = 1
|
||||
if (r5 == 0) goto L13
|
||||
int r5 = r3.leftMargin
|
||||
int r1 = r4.left
|
||||
if (r5 == r1) goto L13
|
||||
r3.leftMargin = r1
|
||||
r5 = 1
|
||||
goto L14
|
||||
L13:
|
||||
r5 = 0
|
||||
L14:
|
||||
if (r6 == 0) goto L1f
|
||||
int r6 = r3.topMargin
|
||||
int r1 = r4.top
|
||||
if (r6 == r1) goto L1f
|
||||
r3.topMargin = r1
|
||||
r5 = 1
|
||||
L1f:
|
||||
if (r8 == 0) goto L2a
|
||||
int r6 = r3.rightMargin
|
||||
int r8 = r4.right
|
||||
if (r6 == r8) goto L2a
|
||||
r3.rightMargin = r8
|
||||
r5 = 1
|
||||
L2a:
|
||||
if (r7 == 0) goto L35
|
||||
int r6 = r3.bottomMargin
|
||||
int r4 = r4.bottom
|
||||
if (r6 == r4) goto L35
|
||||
r3.bottomMargin = r4
|
||||
r5 = 1
|
||||
L35:
|
||||
return r5
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.ActionBarOverlayLayout.a(android.view.View, android.graphics.Rect, boolean, boolean, boolean, boolean):boolean");
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private DecorToolbar a(View view) {
|
||||
if (view instanceof DecorToolbar) {
|
||||
return (DecorToolbar) view;
|
||||
}
|
||||
if (view instanceof Toolbar) {
|
||||
return ((Toolbar) view).getWrapper();
|
||||
}
|
||||
throw new IllegalStateException("Can't make a decor toolbar out of " + view.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
private boolean a(float f, float f2) {
|
||||
this.v.fling(0, 0, 0, (int) f2, 0, 0, Integer.MIN_VALUE, Integer.MAX_VALUE);
|
||||
return this.v.getFinalY() > this.d.getHeight();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.DecorContentParent
|
||||
public void a(int i) {
|
||||
j();
|
||||
if (i == 2) {
|
||||
this.e.n();
|
||||
} else if (i == 5) {
|
||||
this.e.o();
|
||||
} else {
|
||||
if (i != 109) {
|
||||
return;
|
||||
}
|
||||
setOverlayMode(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.DecorContentParent
|
||||
public boolean a() {
|
||||
j();
|
||||
return this.e.a();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.DecorContentParent
|
||||
public void a(Menu menu, MenuPresenter.Callback callback) {
|
||||
j();
|
||||
this.e.a(menu, callback);
|
||||
}
|
||||
}
|
||||
693
sources/androidx/appcompat/widget/ActionMenuPresenter.java
Normal file
693
sources/androidx/appcompat/widget/ActionMenuPresenter.java
Normal file
@@ -0,0 +1,693 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.SparseBooleanArray;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.R$layout;
|
||||
import androidx.appcompat.view.ActionBarPolicy;
|
||||
import androidx.appcompat.view.menu.ActionMenuItemView;
|
||||
import androidx.appcompat.view.menu.BaseMenuPresenter;
|
||||
import androidx.appcompat.view.menu.MenuBuilder;
|
||||
import androidx.appcompat.view.menu.MenuItemImpl;
|
||||
import androidx.appcompat.view.menu.MenuPopupHelper;
|
||||
import androidx.appcompat.view.menu.MenuPresenter;
|
||||
import androidx.appcompat.view.menu.MenuView;
|
||||
import androidx.appcompat.view.menu.ShowableListMenu;
|
||||
import androidx.appcompat.view.menu.SubMenuBuilder;
|
||||
import androidx.appcompat.widget.ActionMenuView;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.core.view.ActionProvider;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class ActionMenuPresenter extends BaseMenuPresenter implements ActionProvider.SubUiVisibilityListener {
|
||||
OpenOverflowRunnable A;
|
||||
private ActionMenuPopupCallback B;
|
||||
final PopupPresenterCallback C;
|
||||
int D;
|
||||
OverflowMenuButton i;
|
||||
private Drawable j;
|
||||
private boolean k;
|
||||
private boolean l;
|
||||
private boolean m;
|
||||
private int n;
|
||||
private int o;
|
||||
private int p;
|
||||
private boolean q;
|
||||
private boolean r;
|
||||
private boolean s;
|
||||
private boolean t;
|
||||
private int u;
|
||||
private final SparseBooleanArray v;
|
||||
private View x;
|
||||
OverflowPopup y;
|
||||
ActionButtonSubmenu z;
|
||||
|
||||
private class ActionButtonSubmenu extends MenuPopupHelper {
|
||||
public ActionButtonSubmenu(Context context, SubMenuBuilder subMenuBuilder, View view) {
|
||||
super(context, subMenuBuilder, view, false, R$attr.actionOverflowMenuStyle);
|
||||
if (!((MenuItemImpl) subMenuBuilder.getItem()).h()) {
|
||||
View view2 = ActionMenuPresenter.this.i;
|
||||
a(view2 == null ? (View) ((BaseMenuPresenter) ActionMenuPresenter.this).h : view2);
|
||||
}
|
||||
a(ActionMenuPresenter.this.C);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopupHelper
|
||||
protected void d() {
|
||||
ActionMenuPresenter actionMenuPresenter = ActionMenuPresenter.this;
|
||||
actionMenuPresenter.z = null;
|
||||
actionMenuPresenter.D = 0;
|
||||
super.d();
|
||||
}
|
||||
}
|
||||
|
||||
private class ActionMenuPopupCallback extends ActionMenuItemView.PopupCallback {
|
||||
ActionMenuPopupCallback() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.ActionMenuItemView.PopupCallback
|
||||
public ShowableListMenu a() {
|
||||
ActionButtonSubmenu actionButtonSubmenu = ActionMenuPresenter.this.z;
|
||||
if (actionButtonSubmenu != null) {
|
||||
return actionButtonSubmenu.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private class OpenOverflowRunnable implements Runnable {
|
||||
private OverflowPopup a;
|
||||
|
||||
public OpenOverflowRunnable(OverflowPopup overflowPopup) {
|
||||
this.a = overflowPopup;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (((BaseMenuPresenter) ActionMenuPresenter.this).c != null) {
|
||||
((BaseMenuPresenter) ActionMenuPresenter.this).c.a();
|
||||
}
|
||||
View view = (View) ((BaseMenuPresenter) ActionMenuPresenter.this).h;
|
||||
if (view != null && view.getWindowToken() != null && this.a.f()) {
|
||||
ActionMenuPresenter.this.y = this.a;
|
||||
}
|
||||
ActionMenuPresenter.this.A = null;
|
||||
}
|
||||
}
|
||||
|
||||
private class OverflowMenuButton extends AppCompatImageView implements ActionMenuView.ActionMenuChildView {
|
||||
public OverflowMenuButton(Context context) {
|
||||
super(context, null, R$attr.actionOverflowButtonStyle);
|
||||
setClickable(true);
|
||||
setFocusable(true);
|
||||
setVisibility(0);
|
||||
setEnabled(true);
|
||||
TooltipCompat.a(this, getContentDescription());
|
||||
setOnTouchListener(new ForwardingListener(this, ActionMenuPresenter.this) { // from class: androidx.appcompat.widget.ActionMenuPresenter.OverflowMenuButton.1
|
||||
@Override // androidx.appcompat.widget.ForwardingListener
|
||||
public ShowableListMenu a() {
|
||||
OverflowPopup overflowPopup = ActionMenuPresenter.this.y;
|
||||
if (overflowPopup == null) {
|
||||
return null;
|
||||
}
|
||||
return overflowPopup.b();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ForwardingListener
|
||||
public boolean b() {
|
||||
ActionMenuPresenter.this.i();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ForwardingListener
|
||||
public boolean c() {
|
||||
ActionMenuPresenter actionMenuPresenter = ActionMenuPresenter.this;
|
||||
if (actionMenuPresenter.A != null) {
|
||||
return false;
|
||||
}
|
||||
actionMenuPresenter.e();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ActionMenuView.ActionMenuChildView
|
||||
public boolean b() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ActionMenuView.ActionMenuChildView
|
||||
public boolean c() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public boolean performClick() {
|
||||
if (super.performClick()) {
|
||||
return true;
|
||||
}
|
||||
playSoundEffect(0);
|
||||
ActionMenuPresenter.this.i();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView
|
||||
protected boolean setFrame(int i, int i2, int i3, int i4) {
|
||||
boolean frame = super.setFrame(i, i2, i3, i4);
|
||||
Drawable drawable = getDrawable();
|
||||
Drawable background = getBackground();
|
||||
if (drawable != null && background != null) {
|
||||
int width = getWidth();
|
||||
int height = getHeight();
|
||||
int max = Math.max(width, height) / 2;
|
||||
int paddingLeft = (width + (getPaddingLeft() - getPaddingRight())) / 2;
|
||||
int paddingTop = (height + (getPaddingTop() - getPaddingBottom())) / 2;
|
||||
DrawableCompat.a(background, paddingLeft - max, paddingTop - max, paddingLeft + max, paddingTop + max);
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
}
|
||||
|
||||
private class OverflowPopup extends MenuPopupHelper {
|
||||
public OverflowPopup(Context context, MenuBuilder menuBuilder, View view, boolean z) {
|
||||
super(context, menuBuilder, view, z, R$attr.actionOverflowMenuStyle);
|
||||
a(8388613);
|
||||
a(ActionMenuPresenter.this.C);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPopupHelper
|
||||
protected void d() {
|
||||
if (((BaseMenuPresenter) ActionMenuPresenter.this).c != null) {
|
||||
((BaseMenuPresenter) ActionMenuPresenter.this).c.close();
|
||||
}
|
||||
ActionMenuPresenter.this.y = null;
|
||||
super.d();
|
||||
}
|
||||
}
|
||||
|
||||
private static class SavedState implements Parcelable {
|
||||
public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() { // from class: androidx.appcompat.widget.ActionMenuPresenter.SavedState.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public SavedState createFromParcel(Parcel parcel) {
|
||||
return new SavedState(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public SavedState[] newArray(int i) {
|
||||
return new SavedState[i];
|
||||
}
|
||||
};
|
||||
public int openSubMenuId;
|
||||
|
||||
SavedState() {
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeInt(this.openSubMenuId);
|
||||
}
|
||||
|
||||
SavedState(Parcel parcel) {
|
||||
this.openSubMenuId = parcel.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
public ActionMenuPresenter(Context context) {
|
||||
super(context, R$layout.abc_action_menu_layout, R$layout.abc_action_menu_item_layout);
|
||||
this.v = new SparseBooleanArray();
|
||||
this.C = new PopupPresenterCallback();
|
||||
}
|
||||
|
||||
public boolean g() {
|
||||
return this.A != null || h();
|
||||
}
|
||||
|
||||
public boolean h() {
|
||||
OverflowPopup overflowPopup = this.y;
|
||||
return overflowPopup != null && overflowPopup.c();
|
||||
}
|
||||
|
||||
public boolean i() {
|
||||
MenuBuilder menuBuilder;
|
||||
if (!this.l || h() || (menuBuilder = this.c) == null || this.h == null || this.A != null || menuBuilder.j().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
this.A = new OpenOverflowRunnable(new OverflowPopup(this.b, this.c, this.i, true));
|
||||
((View) this.h).post(this.A);
|
||||
super.a((SubMenuBuilder) null);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.BaseMenuPresenter, androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(Context context, MenuBuilder menuBuilder) {
|
||||
super.a(context, menuBuilder);
|
||||
Resources resources = context.getResources();
|
||||
ActionBarPolicy a = ActionBarPolicy.a(context);
|
||||
if (!this.m) {
|
||||
this.l = a.g();
|
||||
}
|
||||
if (!this.s) {
|
||||
this.n = a.b();
|
||||
}
|
||||
if (!this.q) {
|
||||
this.p = a.c();
|
||||
}
|
||||
int i = this.n;
|
||||
if (this.l) {
|
||||
if (this.i == null) {
|
||||
this.i = new OverflowMenuButton(this.a);
|
||||
if (this.k) {
|
||||
this.i.setImageDrawable(this.j);
|
||||
this.j = null;
|
||||
this.k = false;
|
||||
}
|
||||
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
|
||||
this.i.measure(makeMeasureSpec, makeMeasureSpec);
|
||||
}
|
||||
i -= this.i.getMeasuredWidth();
|
||||
} else {
|
||||
this.i = null;
|
||||
}
|
||||
this.o = i;
|
||||
this.u = (int) (resources.getDisplayMetrics().density * 56.0f);
|
||||
this.x = null;
|
||||
}
|
||||
|
||||
public void b(boolean z) {
|
||||
this.t = z;
|
||||
}
|
||||
|
||||
public void c(boolean z) {
|
||||
this.l = z;
|
||||
this.m = true;
|
||||
}
|
||||
|
||||
public Drawable d() {
|
||||
OverflowMenuButton overflowMenuButton = this.i;
|
||||
if (overflowMenuButton != null) {
|
||||
return overflowMenuButton.getDrawable();
|
||||
}
|
||||
if (this.k) {
|
||||
return this.j;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean e() {
|
||||
Object obj;
|
||||
OpenOverflowRunnable openOverflowRunnable = this.A;
|
||||
if (openOverflowRunnable != null && (obj = this.h) != null) {
|
||||
((View) obj).removeCallbacks(openOverflowRunnable);
|
||||
this.A = null;
|
||||
return true;
|
||||
}
|
||||
OverflowPopup overflowPopup = this.y;
|
||||
if (overflowPopup == null) {
|
||||
return false;
|
||||
}
|
||||
overflowPopup.a();
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean f() {
|
||||
ActionButtonSubmenu actionButtonSubmenu = this.z;
|
||||
if (actionButtonSubmenu == null) {
|
||||
return false;
|
||||
}
|
||||
actionButtonSubmenu.a();
|
||||
return true;
|
||||
}
|
||||
|
||||
private class PopupPresenterCallback implements MenuPresenter.Callback {
|
||||
PopupPresenterCallback() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
|
||||
public boolean a(MenuBuilder menuBuilder) {
|
||||
if (menuBuilder == null) {
|
||||
return false;
|
||||
}
|
||||
ActionMenuPresenter.this.D = ((SubMenuBuilder) menuBuilder).getItem().getItemId();
|
||||
MenuPresenter.Callback a = ActionMenuPresenter.this.a();
|
||||
if (a != null) {
|
||||
return a.a(menuBuilder);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
|
||||
public void a(MenuBuilder menuBuilder, boolean z) {
|
||||
if (menuBuilder instanceof SubMenuBuilder) {
|
||||
menuBuilder.m().a(false);
|
||||
}
|
||||
MenuPresenter.Callback a = ActionMenuPresenter.this.a();
|
||||
if (a != null) {
|
||||
a.a(menuBuilder, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.BaseMenuPresenter
|
||||
public MenuView b(ViewGroup viewGroup) {
|
||||
MenuView menuView = this.h;
|
||||
MenuView b = super.b(viewGroup);
|
||||
if (menuView != b) {
|
||||
((ActionMenuView) b).setPresenter(this);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
return e() | f();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean b() {
|
||||
ArrayList<MenuItemImpl> arrayList;
|
||||
int i;
|
||||
int i2;
|
||||
int i3;
|
||||
int i4;
|
||||
ActionMenuPresenter actionMenuPresenter = this;
|
||||
MenuBuilder menuBuilder = actionMenuPresenter.c;
|
||||
int i5 = 0;
|
||||
if (menuBuilder != null) {
|
||||
arrayList = menuBuilder.n();
|
||||
i = arrayList.size();
|
||||
} else {
|
||||
arrayList = null;
|
||||
i = 0;
|
||||
}
|
||||
int i6 = actionMenuPresenter.p;
|
||||
int i7 = actionMenuPresenter.o;
|
||||
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
|
||||
ViewGroup viewGroup = (ViewGroup) actionMenuPresenter.h;
|
||||
int i8 = i6;
|
||||
boolean z = false;
|
||||
int i9 = 0;
|
||||
int i10 = 0;
|
||||
for (int i11 = 0; i11 < i; i11++) {
|
||||
MenuItemImpl menuItemImpl = arrayList.get(i11);
|
||||
if (menuItemImpl.k()) {
|
||||
i9++;
|
||||
} else if (menuItemImpl.j()) {
|
||||
i10++;
|
||||
} else {
|
||||
z = true;
|
||||
}
|
||||
if (actionMenuPresenter.t && menuItemImpl.isActionViewExpanded()) {
|
||||
i8 = 0;
|
||||
}
|
||||
}
|
||||
if (actionMenuPresenter.l && (z || i10 + i9 > i8)) {
|
||||
i8--;
|
||||
}
|
||||
int i12 = i8 - i9;
|
||||
SparseBooleanArray sparseBooleanArray = actionMenuPresenter.v;
|
||||
sparseBooleanArray.clear();
|
||||
if (actionMenuPresenter.r) {
|
||||
int i13 = actionMenuPresenter.u;
|
||||
i3 = i7 / i13;
|
||||
i2 = i13 + ((i7 % i13) / i3);
|
||||
} else {
|
||||
i2 = 0;
|
||||
i3 = 0;
|
||||
}
|
||||
int i14 = i7;
|
||||
int i15 = 0;
|
||||
int i16 = 0;
|
||||
while (i15 < i) {
|
||||
MenuItemImpl menuItemImpl2 = arrayList.get(i15);
|
||||
if (menuItemImpl2.k()) {
|
||||
View a = actionMenuPresenter.a(menuItemImpl2, actionMenuPresenter.x, viewGroup);
|
||||
if (actionMenuPresenter.x == null) {
|
||||
actionMenuPresenter.x = a;
|
||||
}
|
||||
if (actionMenuPresenter.r) {
|
||||
i3 -= ActionMenuView.a(a, i2, i3, makeMeasureSpec, i5);
|
||||
} else {
|
||||
a.measure(makeMeasureSpec, makeMeasureSpec);
|
||||
}
|
||||
int measuredWidth = a.getMeasuredWidth();
|
||||
i14 -= measuredWidth;
|
||||
if (i16 != 0) {
|
||||
measuredWidth = i16;
|
||||
}
|
||||
int groupId = menuItemImpl2.getGroupId();
|
||||
if (groupId != 0) {
|
||||
sparseBooleanArray.put(groupId, true);
|
||||
}
|
||||
menuItemImpl2.d(true);
|
||||
i4 = i;
|
||||
i16 = measuredWidth;
|
||||
} else if (menuItemImpl2.j()) {
|
||||
int groupId2 = menuItemImpl2.getGroupId();
|
||||
boolean z2 = sparseBooleanArray.get(groupId2);
|
||||
boolean z3 = (i12 > 0 || z2) && i14 > 0 && (!actionMenuPresenter.r || i3 > 0);
|
||||
boolean z4 = z3;
|
||||
if (z3) {
|
||||
View a2 = actionMenuPresenter.a(menuItemImpl2, actionMenuPresenter.x, viewGroup);
|
||||
i4 = i;
|
||||
if (actionMenuPresenter.x == null) {
|
||||
actionMenuPresenter.x = a2;
|
||||
}
|
||||
if (actionMenuPresenter.r) {
|
||||
int a3 = ActionMenuView.a(a2, i2, i3, makeMeasureSpec, 0);
|
||||
i3 -= a3;
|
||||
if (a3 == 0) {
|
||||
z4 = false;
|
||||
}
|
||||
} else {
|
||||
a2.measure(makeMeasureSpec, makeMeasureSpec);
|
||||
}
|
||||
int measuredWidth2 = a2.getMeasuredWidth();
|
||||
i14 -= measuredWidth2;
|
||||
if (i16 == 0) {
|
||||
i16 = measuredWidth2;
|
||||
}
|
||||
z3 = z4 & (!actionMenuPresenter.r ? i14 + i16 <= 0 : i14 < 0);
|
||||
} else {
|
||||
i4 = i;
|
||||
}
|
||||
if (z3 && groupId2 != 0) {
|
||||
sparseBooleanArray.put(groupId2, true);
|
||||
} else if (z2) {
|
||||
sparseBooleanArray.put(groupId2, false);
|
||||
for (int i17 = 0; i17 < i15; i17++) {
|
||||
MenuItemImpl menuItemImpl3 = arrayList.get(i17);
|
||||
if (menuItemImpl3.getGroupId() == groupId2) {
|
||||
if (menuItemImpl3.h()) {
|
||||
i12++;
|
||||
}
|
||||
menuItemImpl3.d(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (z3) {
|
||||
i12--;
|
||||
}
|
||||
menuItemImpl2.d(z3);
|
||||
} else {
|
||||
i4 = i;
|
||||
menuItemImpl2.d(false);
|
||||
i15++;
|
||||
i5 = 0;
|
||||
actionMenuPresenter = this;
|
||||
i = i4;
|
||||
}
|
||||
i15++;
|
||||
i5 = 0;
|
||||
actionMenuPresenter = this;
|
||||
i = i4;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void a(Configuration configuration) {
|
||||
if (!this.q) {
|
||||
this.p = ActionBarPolicy.a(this.b).c();
|
||||
}
|
||||
MenuBuilder menuBuilder = this.c;
|
||||
if (menuBuilder != null) {
|
||||
menuBuilder.b(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Drawable drawable) {
|
||||
OverflowMenuButton overflowMenuButton = this.i;
|
||||
if (overflowMenuButton != null) {
|
||||
overflowMenuButton.setImageDrawable(drawable);
|
||||
} else {
|
||||
this.k = true;
|
||||
this.j = drawable;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.BaseMenuPresenter
|
||||
public View a(MenuItemImpl menuItemImpl, View view, ViewGroup viewGroup) {
|
||||
View actionView = menuItemImpl.getActionView();
|
||||
if (actionView == null || menuItemImpl.f()) {
|
||||
actionView = super.a(menuItemImpl, view, viewGroup);
|
||||
}
|
||||
actionView.setVisibility(menuItemImpl.isActionViewExpanded() ? 8 : 0);
|
||||
ActionMenuView actionMenuView = (ActionMenuView) viewGroup;
|
||||
ViewGroup.LayoutParams layoutParams = actionView.getLayoutParams();
|
||||
if (!actionMenuView.checkLayoutParams(layoutParams)) {
|
||||
actionView.setLayoutParams(actionMenuView.generateLayoutParams(layoutParams));
|
||||
}
|
||||
return actionView;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.BaseMenuPresenter
|
||||
public void a(MenuItemImpl menuItemImpl, MenuView.ItemView itemView) {
|
||||
itemView.a(menuItemImpl, 0);
|
||||
ActionMenuItemView actionMenuItemView = (ActionMenuItemView) itemView;
|
||||
actionMenuItemView.setItemInvoker((ActionMenuView) this.h);
|
||||
if (this.B == null) {
|
||||
this.B = new ActionMenuPopupCallback();
|
||||
}
|
||||
actionMenuItemView.setPopupCallback(this.B);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.BaseMenuPresenter
|
||||
public boolean a(int i, MenuItemImpl menuItemImpl) {
|
||||
return menuItemImpl.h();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.BaseMenuPresenter, androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(boolean z) {
|
||||
super.a(z);
|
||||
((View) this.h).requestLayout();
|
||||
MenuBuilder menuBuilder = this.c;
|
||||
boolean z2 = false;
|
||||
if (menuBuilder != null) {
|
||||
ArrayList<MenuItemImpl> c = menuBuilder.c();
|
||||
int size = c.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
ActionProvider a = c.get(i).a();
|
||||
if (a != null) {
|
||||
a.a(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
MenuBuilder menuBuilder2 = this.c;
|
||||
ArrayList<MenuItemImpl> j = menuBuilder2 != null ? menuBuilder2.j() : null;
|
||||
if (this.l && j != null) {
|
||||
int size2 = j.size();
|
||||
if (size2 == 1) {
|
||||
z2 = !j.get(0).isActionViewExpanded();
|
||||
} else if (size2 > 0) {
|
||||
z2 = true;
|
||||
}
|
||||
}
|
||||
if (z2) {
|
||||
if (this.i == null) {
|
||||
this.i = new OverflowMenuButton(this.a);
|
||||
}
|
||||
ViewGroup viewGroup = (ViewGroup) this.i.getParent();
|
||||
if (viewGroup != this.h) {
|
||||
if (viewGroup != null) {
|
||||
viewGroup.removeView(this.i);
|
||||
}
|
||||
ActionMenuView actionMenuView = (ActionMenuView) this.h;
|
||||
actionMenuView.addView(this.i, actionMenuView.e());
|
||||
}
|
||||
} else {
|
||||
OverflowMenuButton overflowMenuButton = this.i;
|
||||
if (overflowMenuButton != null) {
|
||||
Object parent = overflowMenuButton.getParent();
|
||||
Object obj = this.h;
|
||||
if (parent == obj) {
|
||||
((ViewGroup) obj).removeView(this.i);
|
||||
}
|
||||
}
|
||||
}
|
||||
((ActionMenuView) this.h).setOverflowReserved(this.l);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.BaseMenuPresenter
|
||||
public boolean a(ViewGroup viewGroup, int i) {
|
||||
if (viewGroup.getChildAt(i) == this.i) {
|
||||
return false;
|
||||
}
|
||||
return super.a(viewGroup, i);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.BaseMenuPresenter, androidx.appcompat.view.menu.MenuPresenter
|
||||
public boolean a(SubMenuBuilder subMenuBuilder) {
|
||||
boolean z = false;
|
||||
if (!subMenuBuilder.hasVisibleItems()) {
|
||||
return false;
|
||||
}
|
||||
SubMenuBuilder subMenuBuilder2 = subMenuBuilder;
|
||||
while (subMenuBuilder2.t() != this.c) {
|
||||
subMenuBuilder2 = (SubMenuBuilder) subMenuBuilder2.t();
|
||||
}
|
||||
View a = a(subMenuBuilder2.getItem());
|
||||
if (a == null) {
|
||||
return false;
|
||||
}
|
||||
subMenuBuilder.getItem().getItemId();
|
||||
int size = subMenuBuilder.size();
|
||||
int i = 0;
|
||||
while (true) {
|
||||
if (i >= size) {
|
||||
break;
|
||||
}
|
||||
MenuItem item = subMenuBuilder.getItem(i);
|
||||
if (item.isVisible() && item.getIcon() != null) {
|
||||
z = true;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
this.z = new ActionButtonSubmenu(this.b, subMenuBuilder, a);
|
||||
this.z.a(z);
|
||||
this.z.e();
|
||||
super.a(subMenuBuilder);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private View a(MenuItem menuItem) {
|
||||
ViewGroup viewGroup = (ViewGroup) this.h;
|
||||
if (viewGroup == null) {
|
||||
return null;
|
||||
}
|
||||
int childCount = viewGroup.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
View childAt = viewGroup.getChildAt(i);
|
||||
if ((childAt instanceof MenuView.ItemView) && ((MenuView.ItemView) childAt).getItemData() == menuItem) {
|
||||
return childAt;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.BaseMenuPresenter, androidx.appcompat.view.menu.MenuPresenter
|
||||
public void a(MenuBuilder menuBuilder, boolean z) {
|
||||
c();
|
||||
super.a(menuBuilder, z);
|
||||
}
|
||||
|
||||
public void a(ActionMenuView actionMenuView) {
|
||||
this.h = actionMenuView;
|
||||
actionMenuView.a(this.c);
|
||||
}
|
||||
}
|
||||
676
sources/androidx/appcompat/widget/ActionMenuView.java
Normal file
676
sources/androidx/appcompat/widget/ActionMenuView.java
Normal file
@@ -0,0 +1,676 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewDebug;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import androidx.appcompat.view.menu.ActionMenuItemView;
|
||||
import androidx.appcompat.view.menu.MenuBuilder;
|
||||
import androidx.appcompat.view.menu.MenuItemImpl;
|
||||
import androidx.appcompat.view.menu.MenuPresenter;
|
||||
import androidx.appcompat.view.menu.MenuView;
|
||||
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActionMenuView extends LinearLayoutCompat implements MenuBuilder.ItemInvoker, MenuView {
|
||||
private int A;
|
||||
OnMenuItemClickListener B;
|
||||
private MenuBuilder p;
|
||||
private Context q;
|
||||
private int r;
|
||||
private boolean s;
|
||||
private ActionMenuPresenter t;
|
||||
private MenuPresenter.Callback u;
|
||||
MenuBuilder.Callback v;
|
||||
private boolean x;
|
||||
private int y;
|
||||
private int z;
|
||||
|
||||
public interface ActionMenuChildView {
|
||||
boolean b();
|
||||
|
||||
boolean c();
|
||||
}
|
||||
|
||||
private static class ActionMenuPresenterCallback implements MenuPresenter.Callback {
|
||||
ActionMenuPresenterCallback() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
|
||||
public void a(MenuBuilder menuBuilder, boolean z) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
|
||||
public boolean a(MenuBuilder menuBuilder) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static class LayoutParams extends LinearLayoutCompat.LayoutParams {
|
||||
|
||||
@ViewDebug.ExportedProperty
|
||||
public boolean c;
|
||||
|
||||
@ViewDebug.ExportedProperty
|
||||
public int d;
|
||||
|
||||
@ViewDebug.ExportedProperty
|
||||
public int e;
|
||||
|
||||
@ViewDebug.ExportedProperty
|
||||
public boolean f;
|
||||
|
||||
@ViewDebug.ExportedProperty
|
||||
public boolean g;
|
||||
boolean h;
|
||||
|
||||
public LayoutParams(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
}
|
||||
|
||||
public LayoutParams(ViewGroup.LayoutParams layoutParams) {
|
||||
super(layoutParams);
|
||||
}
|
||||
|
||||
public LayoutParams(LayoutParams layoutParams) {
|
||||
super(layoutParams);
|
||||
this.c = layoutParams.c;
|
||||
}
|
||||
|
||||
public LayoutParams(int i, int i2) {
|
||||
super(i, i2);
|
||||
this.c = false;
|
||||
}
|
||||
}
|
||||
|
||||
public interface OnMenuItemClickListener {
|
||||
boolean onMenuItemClick(MenuItem menuItem);
|
||||
}
|
||||
|
||||
public ActionMenuView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
static int a(View view, int i, int i2, int i3, int i4) {
|
||||
LayoutParams layoutParams = (LayoutParams) view.getLayoutParams();
|
||||
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(View.MeasureSpec.getSize(i3) - i4, View.MeasureSpec.getMode(i3));
|
||||
ActionMenuItemView actionMenuItemView = view instanceof ActionMenuItemView ? (ActionMenuItemView) view : null;
|
||||
boolean z = actionMenuItemView != null && actionMenuItemView.d();
|
||||
int i5 = 2;
|
||||
if (i2 <= 0 || (z && i2 < 2)) {
|
||||
i5 = 0;
|
||||
} else {
|
||||
view.measure(View.MeasureSpec.makeMeasureSpec(i2 * i, Integer.MIN_VALUE), makeMeasureSpec);
|
||||
int measuredWidth = view.getMeasuredWidth();
|
||||
int i6 = measuredWidth / i;
|
||||
if (measuredWidth % i != 0) {
|
||||
i6++;
|
||||
}
|
||||
if (!z || i6 >= 2) {
|
||||
i5 = i6;
|
||||
}
|
||||
}
|
||||
layoutParams.f = !layoutParams.c && z;
|
||||
layoutParams.d = i5;
|
||||
view.measure(View.MeasureSpec.makeMeasureSpec(i * i5, 1073741824), makeMeasureSpec);
|
||||
return i5;
|
||||
}
|
||||
|
||||
/* JADX WARN: Type inference failed for: r13v12 */
|
||||
/* JADX WARN: Type inference failed for: r13v13, types: [boolean, int] */
|
||||
/* JADX WARN: Type inference failed for: r13v16 */
|
||||
private void c(int i, int i2) {
|
||||
int i3;
|
||||
int i4;
|
||||
boolean z;
|
||||
int i5;
|
||||
int i6;
|
||||
int i7;
|
||||
int i8;
|
||||
?? r13;
|
||||
int mode = View.MeasureSpec.getMode(i2);
|
||||
int size = View.MeasureSpec.getSize(i);
|
||||
int size2 = View.MeasureSpec.getSize(i2);
|
||||
int paddingLeft = getPaddingLeft() + getPaddingRight();
|
||||
int paddingTop = getPaddingTop() + getPaddingBottom();
|
||||
int childMeasureSpec = ViewGroup.getChildMeasureSpec(i2, paddingTop, -2);
|
||||
int i9 = size - paddingLeft;
|
||||
int i10 = this.z;
|
||||
int i11 = i9 / i10;
|
||||
int i12 = i9 % i10;
|
||||
if (i11 == 0) {
|
||||
setMeasuredDimension(i9, 0);
|
||||
return;
|
||||
}
|
||||
int i13 = i10 + (i12 / i11);
|
||||
int childCount = getChildCount();
|
||||
int i14 = i11;
|
||||
int i15 = 0;
|
||||
int i16 = 0;
|
||||
boolean z2 = false;
|
||||
int i17 = 0;
|
||||
int i18 = 0;
|
||||
int i19 = 0;
|
||||
long j = 0;
|
||||
while (i15 < childCount) {
|
||||
View childAt = getChildAt(i15);
|
||||
int i20 = size2;
|
||||
if (childAt.getVisibility() != 8) {
|
||||
boolean z3 = childAt instanceof ActionMenuItemView;
|
||||
int i21 = i17 + 1;
|
||||
if (z3) {
|
||||
int i22 = this.A;
|
||||
i8 = i21;
|
||||
r13 = 0;
|
||||
childAt.setPadding(i22, 0, i22, 0);
|
||||
} else {
|
||||
i8 = i21;
|
||||
r13 = 0;
|
||||
}
|
||||
LayoutParams layoutParams = (LayoutParams) childAt.getLayoutParams();
|
||||
layoutParams.h = r13;
|
||||
layoutParams.e = r13;
|
||||
layoutParams.d = r13;
|
||||
layoutParams.f = r13;
|
||||
((ViewGroup.MarginLayoutParams) layoutParams).leftMargin = r13;
|
||||
((ViewGroup.MarginLayoutParams) layoutParams).rightMargin = r13;
|
||||
layoutParams.g = z3 && ((ActionMenuItemView) childAt).d();
|
||||
int a = a(childAt, i13, layoutParams.c ? 1 : i14, childMeasureSpec, paddingTop);
|
||||
int max = Math.max(i18, a);
|
||||
if (layoutParams.f) {
|
||||
i19++;
|
||||
}
|
||||
if (layoutParams.c) {
|
||||
z2 = true;
|
||||
}
|
||||
i14 -= a;
|
||||
i16 = Math.max(i16, childAt.getMeasuredHeight());
|
||||
if (a == 1) {
|
||||
j |= 1 << i15;
|
||||
i16 = i16;
|
||||
}
|
||||
i18 = max;
|
||||
i17 = i8;
|
||||
}
|
||||
i15++;
|
||||
size2 = i20;
|
||||
}
|
||||
int i23 = size2;
|
||||
boolean z4 = z2 && i17 == 2;
|
||||
boolean z5 = false;
|
||||
while (i19 > 0 && i14 > 0) {
|
||||
int i24 = Integer.MAX_VALUE;
|
||||
int i25 = 0;
|
||||
int i26 = 0;
|
||||
long j2 = 0;
|
||||
while (i25 < childCount) {
|
||||
boolean z6 = z5;
|
||||
LayoutParams layoutParams2 = (LayoutParams) getChildAt(i25).getLayoutParams();
|
||||
int i27 = i16;
|
||||
if (layoutParams2.f) {
|
||||
int i28 = layoutParams2.d;
|
||||
if (i28 < i24) {
|
||||
i24 = i28;
|
||||
j2 = 1 << i25;
|
||||
i26 = 1;
|
||||
} else if (i28 == i24) {
|
||||
j2 |= 1 << i25;
|
||||
i26++;
|
||||
}
|
||||
}
|
||||
i25++;
|
||||
i16 = i27;
|
||||
z5 = z6;
|
||||
}
|
||||
z = z5;
|
||||
i5 = i16;
|
||||
j |= j2;
|
||||
if (i26 > i14) {
|
||||
i3 = mode;
|
||||
i4 = i9;
|
||||
break;
|
||||
}
|
||||
int i29 = i24 + 1;
|
||||
int i30 = 0;
|
||||
while (i30 < childCount) {
|
||||
View childAt2 = getChildAt(i30);
|
||||
LayoutParams layoutParams3 = (LayoutParams) childAt2.getLayoutParams();
|
||||
int i31 = i9;
|
||||
int i32 = mode;
|
||||
long j3 = 1 << i30;
|
||||
if ((j2 & j3) == 0) {
|
||||
if (layoutParams3.d == i29) {
|
||||
j |= j3;
|
||||
}
|
||||
i7 = i29;
|
||||
} else {
|
||||
if (z4 && layoutParams3.g && i14 == 1) {
|
||||
int i33 = this.A;
|
||||
i7 = i29;
|
||||
childAt2.setPadding(i33 + i13, 0, i33, 0);
|
||||
} else {
|
||||
i7 = i29;
|
||||
}
|
||||
layoutParams3.d++;
|
||||
layoutParams3.h = true;
|
||||
i14--;
|
||||
}
|
||||
i30++;
|
||||
mode = i32;
|
||||
i29 = i7;
|
||||
i9 = i31;
|
||||
}
|
||||
i16 = i5;
|
||||
z5 = true;
|
||||
}
|
||||
i3 = mode;
|
||||
i4 = i9;
|
||||
z = z5;
|
||||
i5 = i16;
|
||||
boolean z7 = !z2 && i17 == 1;
|
||||
if (i14 <= 0 || j == 0 || (i14 >= i17 - 1 && !z7 && i18 <= 1)) {
|
||||
i6 = 0;
|
||||
} else {
|
||||
float bitCount = Long.bitCount(j);
|
||||
if (z7) {
|
||||
i6 = 0;
|
||||
} else {
|
||||
i6 = 0;
|
||||
if ((j & 1) != 0 && !((LayoutParams) getChildAt(0).getLayoutParams()).g) {
|
||||
bitCount -= 0.5f;
|
||||
}
|
||||
int i34 = childCount - 1;
|
||||
if ((j & (1 << i34)) != 0 && !((LayoutParams) getChildAt(i34).getLayoutParams()).g) {
|
||||
bitCount -= 0.5f;
|
||||
}
|
||||
}
|
||||
int i35 = bitCount > 0.0f ? (int) ((i14 * i13) / bitCount) : 0;
|
||||
for (int i36 = 0; i36 < childCount; i36++) {
|
||||
if ((j & (1 << i36)) != 0) {
|
||||
View childAt3 = getChildAt(i36);
|
||||
LayoutParams layoutParams4 = (LayoutParams) childAt3.getLayoutParams();
|
||||
if (childAt3 instanceof ActionMenuItemView) {
|
||||
layoutParams4.e = i35;
|
||||
layoutParams4.h = true;
|
||||
if (i36 == 0 && !layoutParams4.g) {
|
||||
((ViewGroup.MarginLayoutParams) layoutParams4).leftMargin = (-i35) / 2;
|
||||
}
|
||||
} else if (layoutParams4.c) {
|
||||
layoutParams4.e = i35;
|
||||
layoutParams4.h = true;
|
||||
((ViewGroup.MarginLayoutParams) layoutParams4).rightMargin = (-i35) / 2;
|
||||
} else {
|
||||
if (i36 != 0) {
|
||||
((ViewGroup.MarginLayoutParams) layoutParams4).leftMargin = i35 / 2;
|
||||
}
|
||||
if (i36 != childCount - 1) {
|
||||
((ViewGroup.MarginLayoutParams) layoutParams4).rightMargin = i35 / 2;
|
||||
}
|
||||
}
|
||||
z = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (z) {
|
||||
while (i6 < childCount) {
|
||||
View childAt4 = getChildAt(i6);
|
||||
LayoutParams layoutParams5 = (LayoutParams) childAt4.getLayoutParams();
|
||||
if (layoutParams5.h) {
|
||||
childAt4.measure(View.MeasureSpec.makeMeasureSpec((layoutParams5.d * i13) + layoutParams5.e, 1073741824), childMeasureSpec);
|
||||
}
|
||||
i6++;
|
||||
}
|
||||
}
|
||||
setMeasuredDimension(i4, i3 != 1073741824 ? i5 : i23);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.ViewGroup
|
||||
protected boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
|
||||
return layoutParams != null && (layoutParams instanceof LayoutParams);
|
||||
}
|
||||
|
||||
public void d() {
|
||||
ActionMenuPresenter actionMenuPresenter = this.t;
|
||||
if (actionMenuPresenter != null) {
|
||||
actionMenuPresenter.c();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public LayoutParams e() {
|
||||
LayoutParams generateDefaultLayoutParams = generateDefaultLayoutParams();
|
||||
generateDefaultLayoutParams.c = true;
|
||||
return generateDefaultLayoutParams;
|
||||
}
|
||||
|
||||
public boolean f() {
|
||||
ActionMenuPresenter actionMenuPresenter = this.t;
|
||||
return actionMenuPresenter != null && actionMenuPresenter.e();
|
||||
}
|
||||
|
||||
public boolean g() {
|
||||
ActionMenuPresenter actionMenuPresenter = this.t;
|
||||
return actionMenuPresenter != null && actionMenuPresenter.g();
|
||||
}
|
||||
|
||||
public Menu getMenu() {
|
||||
if (this.p == null) {
|
||||
Context context = getContext();
|
||||
this.p = new MenuBuilder(context);
|
||||
this.p.a(new MenuBuilderCallback());
|
||||
this.t = new ActionMenuPresenter(context);
|
||||
this.t.c(true);
|
||||
ActionMenuPresenter actionMenuPresenter = this.t;
|
||||
MenuPresenter.Callback callback = this.u;
|
||||
if (callback == null) {
|
||||
callback = new ActionMenuPresenterCallback();
|
||||
}
|
||||
actionMenuPresenter.a(callback);
|
||||
this.p.a(this.t, this.q);
|
||||
this.t.a(this);
|
||||
}
|
||||
return this.p;
|
||||
}
|
||||
|
||||
public Drawable getOverflowIcon() {
|
||||
getMenu();
|
||||
return this.t.d();
|
||||
}
|
||||
|
||||
public int getPopupTheme() {
|
||||
return this.r;
|
||||
}
|
||||
|
||||
public int getWindowAnimations() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean h() {
|
||||
ActionMenuPresenter actionMenuPresenter = this.t;
|
||||
return actionMenuPresenter != null && actionMenuPresenter.h();
|
||||
}
|
||||
|
||||
public boolean i() {
|
||||
return this.s;
|
||||
}
|
||||
|
||||
public MenuBuilder j() {
|
||||
return this.p;
|
||||
}
|
||||
|
||||
public boolean k() {
|
||||
ActionMenuPresenter actionMenuPresenter = this.t;
|
||||
return actionMenuPresenter != null && actionMenuPresenter.i();
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void onConfigurationChanged(Configuration configuration) {
|
||||
super.onConfigurationChanged(configuration);
|
||||
ActionMenuPresenter actionMenuPresenter = this.t;
|
||||
if (actionMenuPresenter != null) {
|
||||
actionMenuPresenter.a(false);
|
||||
if (this.t.h()) {
|
||||
this.t.e();
|
||||
this.t.i();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.View
|
||||
public void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
d();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.ViewGroup, android.view.View
|
||||
protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
|
||||
int i5;
|
||||
int i6;
|
||||
int width;
|
||||
int i7;
|
||||
if (!this.x) {
|
||||
super.onLayout(z, i, i2, i3, i4);
|
||||
return;
|
||||
}
|
||||
int childCount = getChildCount();
|
||||
int i8 = (i4 - i2) / 2;
|
||||
int dividerWidth = getDividerWidth();
|
||||
int i9 = i3 - i;
|
||||
int paddingRight = (i9 - getPaddingRight()) - getPaddingLeft();
|
||||
boolean a = ViewUtils.a(this);
|
||||
int i10 = paddingRight;
|
||||
int i11 = 0;
|
||||
int i12 = 0;
|
||||
for (int i13 = 0; i13 < childCount; i13++) {
|
||||
View childAt = getChildAt(i13);
|
||||
if (childAt.getVisibility() != 8) {
|
||||
LayoutParams layoutParams = (LayoutParams) childAt.getLayoutParams();
|
||||
if (layoutParams.c) {
|
||||
int measuredWidth = childAt.getMeasuredWidth();
|
||||
if (d(i13)) {
|
||||
measuredWidth += dividerWidth;
|
||||
}
|
||||
int measuredHeight = childAt.getMeasuredHeight();
|
||||
if (a) {
|
||||
i7 = getPaddingLeft() + ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin;
|
||||
width = i7 + measuredWidth;
|
||||
} else {
|
||||
width = (getWidth() - getPaddingRight()) - ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin;
|
||||
i7 = width - measuredWidth;
|
||||
}
|
||||
int i14 = i8 - (measuredHeight / 2);
|
||||
childAt.layout(i7, i14, width, measuredHeight + i14);
|
||||
i10 -= measuredWidth;
|
||||
i11 = 1;
|
||||
} else {
|
||||
i10 -= (childAt.getMeasuredWidth() + ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin) + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin;
|
||||
d(i13);
|
||||
i12++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (childCount == 1 && i11 == 0) {
|
||||
View childAt2 = getChildAt(0);
|
||||
int measuredWidth2 = childAt2.getMeasuredWidth();
|
||||
int measuredHeight2 = childAt2.getMeasuredHeight();
|
||||
int i15 = (i9 / 2) - (measuredWidth2 / 2);
|
||||
int i16 = i8 - (measuredHeight2 / 2);
|
||||
childAt2.layout(i15, i16, measuredWidth2 + i15, measuredHeight2 + i16);
|
||||
return;
|
||||
}
|
||||
int i17 = i12 - (i11 ^ 1);
|
||||
if (i17 > 0) {
|
||||
i6 = i10 / i17;
|
||||
i5 = 0;
|
||||
} else {
|
||||
i5 = 0;
|
||||
i6 = 0;
|
||||
}
|
||||
int max = Math.max(i5, i6);
|
||||
if (a) {
|
||||
int width2 = getWidth() - getPaddingRight();
|
||||
while (i5 < childCount) {
|
||||
View childAt3 = getChildAt(i5);
|
||||
LayoutParams layoutParams2 = (LayoutParams) childAt3.getLayoutParams();
|
||||
if (childAt3.getVisibility() != 8 && !layoutParams2.c) {
|
||||
int i18 = width2 - ((ViewGroup.MarginLayoutParams) layoutParams2).rightMargin;
|
||||
int measuredWidth3 = childAt3.getMeasuredWidth();
|
||||
int measuredHeight3 = childAt3.getMeasuredHeight();
|
||||
int i19 = i8 - (measuredHeight3 / 2);
|
||||
childAt3.layout(i18 - measuredWidth3, i19, i18, measuredHeight3 + i19);
|
||||
width2 = i18 - ((measuredWidth3 + ((ViewGroup.MarginLayoutParams) layoutParams2).leftMargin) + max);
|
||||
}
|
||||
i5++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
int paddingLeft = getPaddingLeft();
|
||||
while (i5 < childCount) {
|
||||
View childAt4 = getChildAt(i5);
|
||||
LayoutParams layoutParams3 = (LayoutParams) childAt4.getLayoutParams();
|
||||
if (childAt4.getVisibility() != 8 && !layoutParams3.c) {
|
||||
int i20 = paddingLeft + ((ViewGroup.MarginLayoutParams) layoutParams3).leftMargin;
|
||||
int measuredWidth4 = childAt4.getMeasuredWidth();
|
||||
int measuredHeight4 = childAt4.getMeasuredHeight();
|
||||
int i21 = i8 - (measuredHeight4 / 2);
|
||||
childAt4.layout(i20, i21, i20 + measuredWidth4, measuredHeight4 + i21);
|
||||
paddingLeft = i20 + measuredWidth4 + ((ViewGroup.MarginLayoutParams) layoutParams3).rightMargin + max;
|
||||
}
|
||||
i5++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.View
|
||||
protected void onMeasure(int i, int i2) {
|
||||
MenuBuilder menuBuilder;
|
||||
boolean z = this.x;
|
||||
this.x = View.MeasureSpec.getMode(i) == 1073741824;
|
||||
if (z != this.x) {
|
||||
this.y = 0;
|
||||
}
|
||||
int size = View.MeasureSpec.getSize(i);
|
||||
if (this.x && (menuBuilder = this.p) != null && size != this.y) {
|
||||
this.y = size;
|
||||
menuBuilder.b(true);
|
||||
}
|
||||
int childCount = getChildCount();
|
||||
if (this.x && childCount > 0) {
|
||||
c(i, i2);
|
||||
return;
|
||||
}
|
||||
for (int i3 = 0; i3 < childCount; i3++) {
|
||||
LayoutParams layoutParams = (LayoutParams) getChildAt(i3).getLayoutParams();
|
||||
((ViewGroup.MarginLayoutParams) layoutParams).rightMargin = 0;
|
||||
((ViewGroup.MarginLayoutParams) layoutParams).leftMargin = 0;
|
||||
}
|
||||
super.onMeasure(i, i2);
|
||||
}
|
||||
|
||||
public void setExpandedActionViewsExclusive(boolean z) {
|
||||
this.t.b(z);
|
||||
}
|
||||
|
||||
public void setOnMenuItemClickListener(OnMenuItemClickListener onMenuItemClickListener) {
|
||||
this.B = onMenuItemClickListener;
|
||||
}
|
||||
|
||||
public void setOverflowIcon(Drawable drawable) {
|
||||
getMenu();
|
||||
this.t.a(drawable);
|
||||
}
|
||||
|
||||
public void setOverflowReserved(boolean z) {
|
||||
this.s = z;
|
||||
}
|
||||
|
||||
public void setPopupTheme(int i) {
|
||||
if (this.r != i) {
|
||||
this.r = i;
|
||||
if (i == 0) {
|
||||
this.q = getContext();
|
||||
} else {
|
||||
this.q = new ContextThemeWrapper(getContext(), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setPresenter(ActionMenuPresenter actionMenuPresenter) {
|
||||
this.t = actionMenuPresenter;
|
||||
this.t.a(this);
|
||||
}
|
||||
|
||||
private class MenuBuilderCallback implements MenuBuilder.Callback {
|
||||
MenuBuilderCallback() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
|
||||
public boolean a(MenuBuilder menuBuilder, MenuItem menuItem) {
|
||||
OnMenuItemClickListener onMenuItemClickListener = ActionMenuView.this.B;
|
||||
return onMenuItemClickListener != null && onMenuItemClickListener.onMenuItemClick(menuItem);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
|
||||
public void a(MenuBuilder menuBuilder) {
|
||||
MenuBuilder.Callback callback = ActionMenuView.this.v;
|
||||
if (callback != null) {
|
||||
callback.a(menuBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ActionMenuView(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
setBaselineAligned(false);
|
||||
float f = context.getResources().getDisplayMetrics().density;
|
||||
this.z = (int) (56.0f * f);
|
||||
this.A = (int) (f * 4.0f);
|
||||
this.q = context;
|
||||
this.r = 0;
|
||||
}
|
||||
|
||||
protected boolean d(int i) {
|
||||
boolean z = false;
|
||||
if (i == 0) {
|
||||
return false;
|
||||
}
|
||||
KeyEvent.Callback childAt = getChildAt(i - 1);
|
||||
KeyEvent.Callback childAt2 = getChildAt(i);
|
||||
if (i < getChildCount() && (childAt instanceof ActionMenuChildView)) {
|
||||
z = false | ((ActionMenuChildView) childAt).b();
|
||||
}
|
||||
return (i <= 0 || !(childAt2 instanceof ActionMenuChildView)) ? z : z | ((ActionMenuChildView) childAt2).c();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.ViewGroup
|
||||
public LayoutParams generateDefaultLayoutParams() {
|
||||
LayoutParams layoutParams = new LayoutParams(-2, -2);
|
||||
layoutParams.b = 16;
|
||||
return layoutParams;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.ViewGroup
|
||||
public LayoutParams generateLayoutParams(AttributeSet attributeSet) {
|
||||
return new LayoutParams(getContext(), attributeSet);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.ViewGroup
|
||||
public LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
|
||||
if (layoutParams != null) {
|
||||
LayoutParams layoutParams2 = layoutParams instanceof LayoutParams ? new LayoutParams((LayoutParams) layoutParams) : new LayoutParams(layoutParams);
|
||||
if (layoutParams2.b <= 0) {
|
||||
layoutParams2.b = 16;
|
||||
}
|
||||
return layoutParams2;
|
||||
}
|
||||
return generateDefaultLayoutParams();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuBuilder.ItemInvoker
|
||||
public boolean a(MenuItemImpl menuItemImpl) {
|
||||
return this.p.a(menuItemImpl, 0);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.view.menu.MenuView
|
||||
public void a(MenuBuilder menuBuilder) {
|
||||
this.p = menuBuilder;
|
||||
}
|
||||
|
||||
public void a(MenuPresenter.Callback callback, MenuBuilder.Callback callback2) {
|
||||
this.u = callback;
|
||||
this.v = callback2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActivityChooserView$InnerLayout extends LinearLayout {
|
||||
private static final int[] a = {R.attr.background};
|
||||
|
||||
public ActivityChooserView$InnerLayout(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
TintTypedArray a2 = TintTypedArray.a(context, attributeSet, a);
|
||||
setBackgroundDrawable(a2.b(0));
|
||||
a2.a();
|
||||
}
|
||||
}
|
||||
263
sources/androidx/appcompat/widget/AlertDialogLayout.java
Normal file
263
sources/androidx/appcompat/widget/AlertDialogLayout.java
Normal file
@@ -0,0 +1,263 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.appcompat.R$id;
|
||||
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AlertDialogLayout extends LinearLayoutCompat {
|
||||
public AlertDialogLayout(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
private void a(View view, int i, int i2, int i3, int i4) {
|
||||
view.layout(i, i2, i3 + i, i4 + i2);
|
||||
}
|
||||
|
||||
private void c(int i, int i2) {
|
||||
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), 1073741824);
|
||||
for (int i3 = 0; i3 < i; i3++) {
|
||||
View childAt = getChildAt(i3);
|
||||
if (childAt.getVisibility() != 8) {
|
||||
LinearLayoutCompat.LayoutParams layoutParams = (LinearLayoutCompat.LayoutParams) childAt.getLayoutParams();
|
||||
if (((ViewGroup.MarginLayoutParams) layoutParams).width == -1) {
|
||||
int i4 = ((ViewGroup.MarginLayoutParams) layoutParams).height;
|
||||
((ViewGroup.MarginLayoutParams) layoutParams).height = childAt.getMeasuredHeight();
|
||||
measureChildWithMargins(childAt, makeMeasureSpec, 0, i2, 0);
|
||||
((ViewGroup.MarginLayoutParams) layoutParams).height = i4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean d(int i, int i2) {
|
||||
int i3;
|
||||
int i4;
|
||||
int i5;
|
||||
int i6;
|
||||
int childCount = getChildCount();
|
||||
View view = null;
|
||||
View view2 = null;
|
||||
View view3 = null;
|
||||
for (int i7 = 0; i7 < childCount; i7++) {
|
||||
View childAt = getChildAt(i7);
|
||||
if (childAt.getVisibility() != 8) {
|
||||
int id = childAt.getId();
|
||||
if (id == R$id.topPanel) {
|
||||
view = childAt;
|
||||
} else if (id == R$id.buttonPanel) {
|
||||
view2 = childAt;
|
||||
} else {
|
||||
if ((id != R$id.contentPanel && id != R$id.customPanel) || view3 != null) {
|
||||
return false;
|
||||
}
|
||||
view3 = childAt;
|
||||
}
|
||||
}
|
||||
}
|
||||
int mode = View.MeasureSpec.getMode(i2);
|
||||
int size = View.MeasureSpec.getSize(i2);
|
||||
int mode2 = View.MeasureSpec.getMode(i);
|
||||
int paddingTop = getPaddingTop() + getPaddingBottom();
|
||||
if (view != null) {
|
||||
view.measure(i, 0);
|
||||
paddingTop += view.getMeasuredHeight();
|
||||
i3 = View.combineMeasuredStates(0, view.getMeasuredState());
|
||||
} else {
|
||||
i3 = 0;
|
||||
}
|
||||
if (view2 != null) {
|
||||
view2.measure(i, 0);
|
||||
i4 = c(view2);
|
||||
i5 = view2.getMeasuredHeight() - i4;
|
||||
paddingTop += i4;
|
||||
i3 = View.combineMeasuredStates(i3, view2.getMeasuredState());
|
||||
} else {
|
||||
i4 = 0;
|
||||
i5 = 0;
|
||||
}
|
||||
if (view3 != null) {
|
||||
view3.measure(i, mode == 0 ? 0 : View.MeasureSpec.makeMeasureSpec(Math.max(0, size - paddingTop), mode));
|
||||
i6 = view3.getMeasuredHeight();
|
||||
paddingTop += i6;
|
||||
i3 = View.combineMeasuredStates(i3, view3.getMeasuredState());
|
||||
} else {
|
||||
i6 = 0;
|
||||
}
|
||||
int i8 = size - paddingTop;
|
||||
if (view2 != null) {
|
||||
int i9 = paddingTop - i4;
|
||||
int min = Math.min(i8, i5);
|
||||
if (min > 0) {
|
||||
i8 -= min;
|
||||
i4 += min;
|
||||
}
|
||||
view2.measure(i, View.MeasureSpec.makeMeasureSpec(i4, 1073741824));
|
||||
paddingTop = i9 + view2.getMeasuredHeight();
|
||||
i3 = View.combineMeasuredStates(i3, view2.getMeasuredState());
|
||||
}
|
||||
if (view3 != null && i8 > 0) {
|
||||
view3.measure(i, View.MeasureSpec.makeMeasureSpec(i6 + i8, mode));
|
||||
paddingTop = (paddingTop - i6) + view3.getMeasuredHeight();
|
||||
i3 = View.combineMeasuredStates(i3, view3.getMeasuredState());
|
||||
}
|
||||
int i10 = 0;
|
||||
for (int i11 = 0; i11 < childCount; i11++) {
|
||||
View childAt2 = getChildAt(i11);
|
||||
if (childAt2.getVisibility() != 8) {
|
||||
i10 = Math.max(i10, childAt2.getMeasuredWidth());
|
||||
}
|
||||
}
|
||||
setMeasuredDimension(View.resolveSizeAndState(i10 + getPaddingLeft() + getPaddingRight(), i, i3), View.resolveSizeAndState(paddingTop, i2, 0));
|
||||
if (mode2 == 1073741824) {
|
||||
return true;
|
||||
}
|
||||
c(childCount, i2);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:25:0x00a8 */
|
||||
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.ViewGroup, android.view.View
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
protected void onLayout(boolean r18, int r19, int r20, int r21, int r22) {
|
||||
/*
|
||||
r17 = this;
|
||||
r6 = r17
|
||||
int r7 = r17.getPaddingLeft()
|
||||
int r0 = r21 - r19
|
||||
int r1 = r17.getPaddingRight()
|
||||
int r8 = r0 - r1
|
||||
int r0 = r0 - r7
|
||||
int r1 = r17.getPaddingRight()
|
||||
int r9 = r0 - r1
|
||||
int r0 = r17.getMeasuredHeight()
|
||||
int r10 = r17.getChildCount()
|
||||
int r1 = r17.getGravity()
|
||||
r2 = r1 & 112(0x70, float:1.57E-43)
|
||||
r3 = 8388615(0x800007, float:1.1754953E-38)
|
||||
r11 = r1 & r3
|
||||
r1 = 16
|
||||
if (r2 == r1) goto L40
|
||||
r1 = 80
|
||||
if (r2 == r1) goto L35
|
||||
int r0 = r17.getPaddingTop()
|
||||
goto L4b
|
||||
L35:
|
||||
int r1 = r17.getPaddingTop()
|
||||
int r1 = r1 + r22
|
||||
int r1 = r1 - r20
|
||||
int r0 = r1 - r0
|
||||
goto L4b
|
||||
L40:
|
||||
int r1 = r17.getPaddingTop()
|
||||
int r2 = r22 - r20
|
||||
int r2 = r2 - r0
|
||||
int r2 = r2 / 2
|
||||
int r0 = r1 + r2
|
||||
L4b:
|
||||
android.graphics.drawable.Drawable r1 = r17.getDividerDrawable()
|
||||
r2 = 0
|
||||
if (r1 != 0) goto L54
|
||||
r12 = 0
|
||||
goto L59
|
||||
L54:
|
||||
int r1 = r1.getIntrinsicHeight()
|
||||
r12 = r1
|
||||
L59:
|
||||
r13 = 0
|
||||
L5a:
|
||||
if (r13 >= r10) goto Lbf
|
||||
android.view.View r1 = r6.getChildAt(r13)
|
||||
if (r1 == 0) goto Lbc
|
||||
int r2 = r1.getVisibility()
|
||||
r3 = 8
|
||||
if (r2 == r3) goto Lbc
|
||||
int r4 = r1.getMeasuredWidth()
|
||||
int r14 = r1.getMeasuredHeight()
|
||||
android.view.ViewGroup$LayoutParams r2 = r1.getLayoutParams()
|
||||
r15 = r2
|
||||
androidx.appcompat.widget.LinearLayoutCompat$LayoutParams r15 = (androidx.appcompat.widget.LinearLayoutCompat.LayoutParams) r15
|
||||
int r2 = r15.b
|
||||
if (r2 >= 0) goto L7e
|
||||
r2 = r11
|
||||
L7e:
|
||||
int r3 = androidx.core.view.ViewCompat.k(r17)
|
||||
int r2 = androidx.core.view.GravityCompat.a(r2, r3)
|
||||
r2 = r2 & 7
|
||||
r3 = 1
|
||||
if (r2 == r3) goto L97
|
||||
r3 = 5
|
||||
if (r2 == r3) goto L92
|
||||
int r2 = r15.leftMargin
|
||||
int r2 = r2 + r7
|
||||
goto La2
|
||||
L92:
|
||||
int r2 = r8 - r4
|
||||
int r3 = r15.rightMargin
|
||||
goto La1
|
||||
L97:
|
||||
int r2 = r9 - r4
|
||||
int r2 = r2 / 2
|
||||
int r2 = r2 + r7
|
||||
int r3 = r15.leftMargin
|
||||
int r2 = r2 + r3
|
||||
int r3 = r15.rightMargin
|
||||
La1:
|
||||
int r2 = r2 - r3
|
||||
La2:
|
||||
boolean r3 = r6.b(r13)
|
||||
if (r3 == 0) goto La9
|
||||
int r0 = r0 + r12
|
||||
La9:
|
||||
int r3 = r15.topMargin
|
||||
int r16 = r0 + r3
|
||||
r0 = r17
|
||||
r3 = r16
|
||||
r5 = r14
|
||||
r0.a(r1, r2, r3, r4, r5)
|
||||
int r0 = r15.bottomMargin
|
||||
int r14 = r14 + r0
|
||||
int r16 = r16 + r14
|
||||
r0 = r16
|
||||
Lbc:
|
||||
int r13 = r13 + 1
|
||||
goto L5a
|
||||
Lbf:
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.AlertDialogLayout.onLayout(boolean, int, int, int, int):void");
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.View
|
||||
protected void onMeasure(int i, int i2) {
|
||||
if (d(i, i2)) {
|
||||
return;
|
||||
}
|
||||
super.onMeasure(i, i2);
|
||||
}
|
||||
|
||||
public AlertDialogLayout(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
}
|
||||
|
||||
private static int c(View view) {
|
||||
int l = ViewCompat.l(view);
|
||||
if (l > 0) {
|
||||
return l;
|
||||
}
|
||||
if (view instanceof ViewGroup) {
|
||||
ViewGroup viewGroup = (ViewGroup) view;
|
||||
if (viewGroup.getChildCount() == 1) {
|
||||
return c(viewGroup.getChildAt(0));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ActionMode;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.core.view.TintableBackgroundView;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatAutoCompleteTextView extends AutoCompleteTextView implements TintableBackgroundView {
|
||||
private static final int[] c = {R.attr.popupBackground};
|
||||
private final AppCompatBackgroundHelper a;
|
||||
private final AppCompatTextHelper b;
|
||||
|
||||
public AppCompatAutoCompleteTextView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
protected void drawableStateChanged() {
|
||||
super.drawableStateChanged();
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public ColorStateList getSupportBackgroundTintList() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public PorterDuff.Mode getSupportBackgroundTintMode() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
|
||||
InputConnection onCreateInputConnection = super.onCreateInputConnection(editorInfo);
|
||||
AppCompatHintHelper.a(onCreateInputConnection, editorInfo, this);
|
||||
return onCreateInputConnection;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundDrawable(Drawable drawable) {
|
||||
super.setBackgroundDrawable(drawable);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundResource(int i) {
|
||||
super.setBackgroundResource(i);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
|
||||
super.setCustomSelectionActionModeCallback(TextViewCompat.a(this, callback));
|
||||
}
|
||||
|
||||
@Override // android.widget.AutoCompleteTextView
|
||||
public void setDropDownBackgroundResource(int i) {
|
||||
setDropDownBackgroundDrawable(AppCompatResources.c(getContext(), i));
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.b(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setTextAppearance(Context context, int i) {
|
||||
super.setTextAppearance(context, i);
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(context, i);
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatAutoCompleteTextView(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.autoCompleteTextViewStyle);
|
||||
}
|
||||
|
||||
public AppCompatAutoCompleteTextView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(TintContextWrapper.b(context), attributeSet, i);
|
||||
TintTypedArray a = TintTypedArray.a(getContext(), attributeSet, c, i, 0);
|
||||
if (a.g(0)) {
|
||||
setDropDownBackgroundDrawable(a.b(0));
|
||||
}
|
||||
a.a();
|
||||
this.a = new AppCompatBackgroundHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
this.b = new AppCompatTextHelper(this);
|
||||
this.b.a(attributeSet, i);
|
||||
this.b.a();
|
||||
}
|
||||
}
|
||||
154
sources/androidx/appcompat/widget/AppCompatBackgroundHelper.java
Normal file
154
sources/androidx/appcompat/widget/AppCompatBackgroundHelper.java
Normal file
@@ -0,0 +1,154 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class AppCompatBackgroundHelper {
|
||||
private final View a;
|
||||
private TintInfo d;
|
||||
private TintInfo e;
|
||||
private TintInfo f;
|
||||
private int c = -1;
|
||||
private final AppCompatDrawableManager b = AppCompatDrawableManager.a();
|
||||
|
||||
AppCompatBackgroundHelper(View view) {
|
||||
this.a = view;
|
||||
}
|
||||
|
||||
private boolean d() {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
return i > 21 ? this.d != null : i == 21;
|
||||
}
|
||||
|
||||
void a(AttributeSet attributeSet, int i) {
|
||||
TintTypedArray a = TintTypedArray.a(this.a.getContext(), attributeSet, R$styleable.ViewBackgroundHelper, i, 0);
|
||||
try {
|
||||
if (a.g(R$styleable.ViewBackgroundHelper_android_background)) {
|
||||
this.c = a.g(R$styleable.ViewBackgroundHelper_android_background, -1);
|
||||
ColorStateList b = this.b.b(this.a.getContext(), this.c);
|
||||
if (b != null) {
|
||||
a(b);
|
||||
}
|
||||
}
|
||||
if (a.g(R$styleable.ViewBackgroundHelper_backgroundTint)) {
|
||||
ViewCompat.a(this.a, a.a(R$styleable.ViewBackgroundHelper_backgroundTint));
|
||||
}
|
||||
if (a.g(R$styleable.ViewBackgroundHelper_backgroundTintMode)) {
|
||||
ViewCompat.a(this.a, DrawableUtils.a(a.d(R$styleable.ViewBackgroundHelper_backgroundTintMode, -1), null));
|
||||
}
|
||||
} finally {
|
||||
a.a();
|
||||
}
|
||||
}
|
||||
|
||||
void b(ColorStateList colorStateList) {
|
||||
if (this.e == null) {
|
||||
this.e = new TintInfo();
|
||||
}
|
||||
TintInfo tintInfo = this.e;
|
||||
tintInfo.a = colorStateList;
|
||||
tintInfo.d = true;
|
||||
a();
|
||||
}
|
||||
|
||||
PorterDuff.Mode c() {
|
||||
TintInfo tintInfo = this.e;
|
||||
if (tintInfo != null) {
|
||||
return tintInfo.b;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
ColorStateList b() {
|
||||
TintInfo tintInfo = this.e;
|
||||
if (tintInfo != null) {
|
||||
return tintInfo.a;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean b(Drawable drawable) {
|
||||
if (this.f == null) {
|
||||
this.f = new TintInfo();
|
||||
}
|
||||
TintInfo tintInfo = this.f;
|
||||
tintInfo.a();
|
||||
ColorStateList c = ViewCompat.c(this.a);
|
||||
if (c != null) {
|
||||
tintInfo.d = true;
|
||||
tintInfo.a = c;
|
||||
}
|
||||
PorterDuff.Mode d = ViewCompat.d(this.a);
|
||||
if (d != null) {
|
||||
tintInfo.c = true;
|
||||
tintInfo.b = d;
|
||||
}
|
||||
if (!tintInfo.d && !tintInfo.c) {
|
||||
return false;
|
||||
}
|
||||
AppCompatDrawableManager.a(drawable, tintInfo, this.a.getDrawableState());
|
||||
return true;
|
||||
}
|
||||
|
||||
void a(int i) {
|
||||
this.c = i;
|
||||
AppCompatDrawableManager appCompatDrawableManager = this.b;
|
||||
a(appCompatDrawableManager != null ? appCompatDrawableManager.b(this.a.getContext(), i) : null);
|
||||
a();
|
||||
}
|
||||
|
||||
void a(Drawable drawable) {
|
||||
this.c = -1;
|
||||
a((ColorStateList) null);
|
||||
a();
|
||||
}
|
||||
|
||||
void a(PorterDuff.Mode mode) {
|
||||
if (this.e == null) {
|
||||
this.e = new TintInfo();
|
||||
}
|
||||
TintInfo tintInfo = this.e;
|
||||
tintInfo.b = mode;
|
||||
tintInfo.c = true;
|
||||
a();
|
||||
}
|
||||
|
||||
void a() {
|
||||
Drawable background = this.a.getBackground();
|
||||
if (background != null) {
|
||||
if (d() && b(background)) {
|
||||
return;
|
||||
}
|
||||
TintInfo tintInfo = this.e;
|
||||
if (tintInfo != null) {
|
||||
AppCompatDrawableManager.a(background, tintInfo, this.a.getDrawableState());
|
||||
return;
|
||||
}
|
||||
TintInfo tintInfo2 = this.d;
|
||||
if (tintInfo2 != null) {
|
||||
AppCompatDrawableManager.a(background, tintInfo2, this.a.getDrawableState());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void a(ColorStateList colorStateList) {
|
||||
if (colorStateList != null) {
|
||||
if (this.d == null) {
|
||||
this.d = new TintInfo();
|
||||
}
|
||||
TintInfo tintInfo = this.d;
|
||||
tintInfo.a = colorStateList;
|
||||
tintInfo.d = true;
|
||||
} else {
|
||||
this.d = null;
|
||||
}
|
||||
a();
|
||||
}
|
||||
}
|
||||
260
sources/androidx/appcompat/widget/AppCompatButton.java
Normal file
260
sources/androidx/appcompat/widget/AppCompatButton.java
Normal file
@@ -0,0 +1,260 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ActionMode;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import android.widget.Button;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.core.view.TintableBackgroundView;
|
||||
import androidx.core.widget.AutoSizeableTextView;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatButton extends Button implements TintableBackgroundView, AutoSizeableTextView {
|
||||
private final AppCompatBackgroundHelper a;
|
||||
private final AppCompatTextHelper b;
|
||||
|
||||
public AppCompatButton(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
protected void drawableStateChanged() {
|
||||
super.drawableStateChanged();
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int getAutoSizeMaxTextSize() {
|
||||
if (AutoSizeableTextView.w) {
|
||||
return super.getAutoSizeMaxTextSize();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
return appCompatTextHelper.c();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int getAutoSizeMinTextSize() {
|
||||
if (AutoSizeableTextView.w) {
|
||||
return super.getAutoSizeMinTextSize();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
return appCompatTextHelper.d();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int getAutoSizeStepGranularity() {
|
||||
if (AutoSizeableTextView.w) {
|
||||
return super.getAutoSizeStepGranularity();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
return appCompatTextHelper.e();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int[] getAutoSizeTextAvailableSizes() {
|
||||
if (AutoSizeableTextView.w) {
|
||||
return super.getAutoSizeTextAvailableSizes();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
return appCompatTextHelper != null ? appCompatTextHelper.f() : new int[0];
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int getAutoSizeTextType() {
|
||||
if (AutoSizeableTextView.w) {
|
||||
return super.getAutoSizeTextType() == 1 ? 1 : 0;
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
return appCompatTextHelper.g();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public ColorStateList getSupportBackgroundTintList() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public PorterDuff.Mode getSupportBackgroundTintMode() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
|
||||
super.onInitializeAccessibilityEvent(accessibilityEvent);
|
||||
accessibilityEvent.setClassName(Button.class.getName());
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
|
||||
super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
|
||||
accessibilityNodeInfo.setClassName(Button.class.getName());
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
|
||||
super.onLayout(z, i, i2, i3, i4);
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(z, i, i2, i3, i4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
protected void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
||||
super.onTextChanged(charSequence, i, i2, i3);
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper == null || AutoSizeableTextView.w || !appCompatTextHelper.h()) {
|
||||
return;
|
||||
}
|
||||
this.b.b();
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setAutoSizeTextTypeUniformWithConfiguration(int i, int i2, int i3, int i4) throws IllegalArgumentException {
|
||||
if (AutoSizeableTextView.w) {
|
||||
super.setAutoSizeTextTypeUniformWithConfiguration(i, i2, i3, i4);
|
||||
return;
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(i, i2, i3, i4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setAutoSizeTextTypeUniformWithPresetSizes(int[] iArr, int i) throws IllegalArgumentException {
|
||||
if (AutoSizeableTextView.w) {
|
||||
super.setAutoSizeTextTypeUniformWithPresetSizes(iArr, i);
|
||||
return;
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(iArr, i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setAutoSizeTextTypeWithDefaults(int i) {
|
||||
if (AutoSizeableTextView.w) {
|
||||
super.setAutoSizeTextTypeWithDefaults(i);
|
||||
return;
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundDrawable(Drawable drawable) {
|
||||
super.setBackgroundDrawable(drawable);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundResource(int i) {
|
||||
super.setBackgroundResource(i);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
|
||||
super.setCustomSelectionActionModeCallback(TextViewCompat.a(this, callback));
|
||||
}
|
||||
|
||||
public void setSupportAllCaps(boolean z) {
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.b(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setTextAppearance(Context context, int i) {
|
||||
super.setTextAppearance(context, i);
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(context, i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setTextSize(int i, float f) {
|
||||
if (AutoSizeableTextView.w) {
|
||||
super.setTextSize(i, f);
|
||||
return;
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(i, f);
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatButton(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.buttonStyle);
|
||||
}
|
||||
|
||||
public AppCompatButton(Context context, AttributeSet attributeSet, int i) {
|
||||
super(TintContextWrapper.b(context), attributeSet, i);
|
||||
this.a = new AppCompatBackgroundHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
this.b = new AppCompatTextHelper(this);
|
||||
this.b.a(attributeSet, i);
|
||||
this.b.a();
|
||||
}
|
||||
}
|
||||
79
sources/androidx/appcompat/widget/AppCompatCheckBox.java
Normal file
79
sources/androidx/appcompat/widget/AppCompatCheckBox.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.CheckBox;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.core.widget.TintableCompoundButton;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatCheckBox extends CheckBox implements TintableCompoundButton {
|
||||
private final AppCompatCompoundButtonHelper a;
|
||||
|
||||
public AppCompatCheckBox(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.checkboxStyle);
|
||||
}
|
||||
|
||||
@Override // android.widget.CompoundButton, android.widget.TextView
|
||||
public int getCompoundPaddingLeft() {
|
||||
int compoundPaddingLeft = super.getCompoundPaddingLeft();
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
return appCompatCompoundButtonHelper != null ? appCompatCompoundButtonHelper.a(compoundPaddingLeft) : compoundPaddingLeft;
|
||||
}
|
||||
|
||||
public ColorStateList getSupportButtonTintList() {
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
if (appCompatCompoundButtonHelper != null) {
|
||||
return appCompatCompoundButtonHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public PorterDuff.Mode getSupportButtonTintMode() {
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
if (appCompatCompoundButtonHelper != null) {
|
||||
return appCompatCompoundButtonHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.widget.CompoundButton
|
||||
public void setButtonDrawable(Drawable drawable) {
|
||||
super.setButtonDrawable(drawable);
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
if (appCompatCompoundButtonHelper != null) {
|
||||
appCompatCompoundButtonHelper.d();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableCompoundButton
|
||||
public void setSupportButtonTintList(ColorStateList colorStateList) {
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
if (appCompatCompoundButtonHelper != null) {
|
||||
appCompatCompoundButtonHelper.a(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableCompoundButton
|
||||
public void setSupportButtonTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
if (appCompatCompoundButtonHelper != null) {
|
||||
appCompatCompoundButtonHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatCheckBox(Context context, AttributeSet attributeSet, int i) {
|
||||
super(TintContextWrapper.b(context), attributeSet, i);
|
||||
this.a = new AppCompatCompoundButtonHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
}
|
||||
|
||||
@Override // android.widget.CompoundButton
|
||||
public void setButtonDrawable(int i) {
|
||||
setButtonDrawable(AppCompatResources.c(getContext(), i));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ActionMode;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
import android.widget.CheckedTextView;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatCheckedTextView extends CheckedTextView {
|
||||
private static final int[] b = {R.attr.checkMark};
|
||||
private final AppCompatTextHelper a;
|
||||
|
||||
public AppCompatCheckedTextView(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R.attr.checkedTextViewStyle);
|
||||
}
|
||||
|
||||
@Override // android.widget.CheckedTextView, android.widget.TextView, android.view.View
|
||||
protected void drawableStateChanged() {
|
||||
super.drawableStateChanged();
|
||||
AppCompatTextHelper appCompatTextHelper = this.a;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
|
||||
InputConnection onCreateInputConnection = super.onCreateInputConnection(editorInfo);
|
||||
AppCompatHintHelper.a(onCreateInputConnection, editorInfo, this);
|
||||
return onCreateInputConnection;
|
||||
}
|
||||
|
||||
@Override // android.widget.CheckedTextView
|
||||
public void setCheckMarkDrawable(int i) {
|
||||
setCheckMarkDrawable(AppCompatResources.c(getContext(), i));
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
|
||||
super.setCustomSelectionActionModeCallback(TextViewCompat.a(this, callback));
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setTextAppearance(Context context, int i) {
|
||||
super.setTextAppearance(context, i);
|
||||
AppCompatTextHelper appCompatTextHelper = this.a;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(context, i);
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatCheckedTextView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(TintContextWrapper.b(context), attributeSet, i);
|
||||
this.a = new AppCompatTextHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
this.a.a();
|
||||
TintTypedArray a = TintTypedArray.a(getContext(), attributeSet, b, i, 0);
|
||||
setCheckMarkDrawable(a.b(0));
|
||||
a.a();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.CompoundButton;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.core.widget.CompoundButtonCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class AppCompatCompoundButtonHelper {
|
||||
private final CompoundButton a;
|
||||
private ColorStateList b = null;
|
||||
private PorterDuff.Mode c = null;
|
||||
private boolean d = false;
|
||||
private boolean e = false;
|
||||
private boolean f;
|
||||
|
||||
AppCompatCompoundButtonHelper(CompoundButton compoundButton) {
|
||||
this.a = compoundButton;
|
||||
}
|
||||
|
||||
void a(AttributeSet attributeSet, int i) {
|
||||
int resourceId;
|
||||
TypedArray obtainStyledAttributes = this.a.getContext().obtainStyledAttributes(attributeSet, R$styleable.CompoundButton, i, 0);
|
||||
try {
|
||||
if (obtainStyledAttributes.hasValue(R$styleable.CompoundButton_android_button) && (resourceId = obtainStyledAttributes.getResourceId(R$styleable.CompoundButton_android_button, 0)) != 0) {
|
||||
this.a.setButtonDrawable(AppCompatResources.c(this.a.getContext(), resourceId));
|
||||
}
|
||||
if (obtainStyledAttributes.hasValue(R$styleable.CompoundButton_buttonTint)) {
|
||||
CompoundButtonCompat.a(this.a, obtainStyledAttributes.getColorStateList(R$styleable.CompoundButton_buttonTint));
|
||||
}
|
||||
if (obtainStyledAttributes.hasValue(R$styleable.CompoundButton_buttonTintMode)) {
|
||||
CompoundButtonCompat.a(this.a, DrawableUtils.a(obtainStyledAttributes.getInt(R$styleable.CompoundButton_buttonTintMode, -1), null));
|
||||
}
|
||||
} finally {
|
||||
obtainStyledAttributes.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
ColorStateList b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
PorterDuff.Mode c() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
void d() {
|
||||
if (this.f) {
|
||||
this.f = false;
|
||||
} else {
|
||||
this.f = true;
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
void a(ColorStateList colorStateList) {
|
||||
this.b = colorStateList;
|
||||
this.d = true;
|
||||
a();
|
||||
}
|
||||
|
||||
void a(PorterDuff.Mode mode) {
|
||||
this.c = mode;
|
||||
this.e = true;
|
||||
a();
|
||||
}
|
||||
|
||||
void a() {
|
||||
Drawable a = CompoundButtonCompat.a(this.a);
|
||||
if (a != null) {
|
||||
if (this.d || this.e) {
|
||||
Drawable mutate = DrawableCompat.h(a).mutate();
|
||||
if (this.d) {
|
||||
DrawableCompat.a(mutate, this.b);
|
||||
}
|
||||
if (this.e) {
|
||||
DrawableCompat.a(mutate, this.c);
|
||||
}
|
||||
if (mutate.isStateful()) {
|
||||
mutate.setState(this.a.getDrawableState());
|
||||
}
|
||||
this.a.setButtonDrawable(mutate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int a(int i) {
|
||||
Drawable a;
|
||||
return (Build.VERSION.SDK_INT >= 17 || (a = CompoundButtonCompat.a(this.a)) == null) ? i : i + a.getIntrinsicWidth();
|
||||
}
|
||||
}
|
||||
580
sources/androidx/appcompat/widget/AppCompatDrawableManager.java
Normal file
580
sources/androidx/appcompat/widget/AppCompatDrawableManager.java
Normal file
@@ -0,0 +1,580 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.util.Xml;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.R$color;
|
||||
import androidx.appcompat.R$drawable;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat;
|
||||
import androidx.collection.ArrayMap;
|
||||
import androidx.collection.LongSparseArray;
|
||||
import androidx.collection.LruCache;
|
||||
import androidx.collection.SparseArrayCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
|
||||
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.WeakHashMap;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AppCompatDrawableManager {
|
||||
private static AppCompatDrawableManager h;
|
||||
private WeakHashMap<Context, SparseArrayCompat<ColorStateList>> a;
|
||||
private ArrayMap<String, InflateDelegate> b;
|
||||
private SparseArrayCompat<String> c;
|
||||
private final WeakHashMap<Context, LongSparseArray<WeakReference<Drawable.ConstantState>>> d = new WeakHashMap<>(0);
|
||||
private TypedValue e;
|
||||
private boolean f;
|
||||
private static final PorterDuff.Mode g = PorterDuff.Mode.SRC_IN;
|
||||
private static final ColorFilterLruCache i = new ColorFilterLruCache(6);
|
||||
private static final int[] j = {R$drawable.abc_textfield_search_default_mtrl_alpha, R$drawable.abc_textfield_default_mtrl_alpha, R$drawable.abc_ab_share_pack_mtrl_alpha};
|
||||
private static final int[] k = {R$drawable.abc_ic_commit_search_api_mtrl_alpha, R$drawable.abc_seekbar_tick_mark_material, R$drawable.abc_ic_menu_share_mtrl_alpha, R$drawable.abc_ic_menu_copy_mtrl_am_alpha, R$drawable.abc_ic_menu_cut_mtrl_alpha, R$drawable.abc_ic_menu_selectall_mtrl_alpha, R$drawable.abc_ic_menu_paste_mtrl_am_alpha};
|
||||
private static final int[] l = {R$drawable.abc_textfield_activated_mtrl_alpha, R$drawable.abc_textfield_search_activated_mtrl_alpha, R$drawable.abc_cab_background_top_mtrl_alpha, R$drawable.abc_text_cursor_material, R$drawable.abc_text_select_handle_left_mtrl_dark, R$drawable.abc_text_select_handle_middle_mtrl_dark, R$drawable.abc_text_select_handle_right_mtrl_dark, R$drawable.abc_text_select_handle_left_mtrl_light, R$drawable.abc_text_select_handle_middle_mtrl_light, R$drawable.abc_text_select_handle_right_mtrl_light};
|
||||
private static final int[] m = {R$drawable.abc_popup_background_mtrl_mult, R$drawable.abc_cab_background_internal_bg, R$drawable.abc_menu_hardkey_panel_mtrl_mult};
|
||||
private static final int[] n = {R$drawable.abc_tab_indicator_material, R$drawable.abc_textfield_search_material};
|
||||
private static final int[] o = {R$drawable.abc_btn_check_material, R$drawable.abc_btn_radio_material};
|
||||
|
||||
static class AsldcInflateDelegate implements InflateDelegate {
|
||||
AsldcInflateDelegate() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.AppCompatDrawableManager.InflateDelegate
|
||||
public Drawable a(Context context, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) {
|
||||
try {
|
||||
return AnimatedStateListDrawableCompat.b(context, context.getResources(), xmlPullParser, attributeSet, theme);
|
||||
} catch (Exception e) {
|
||||
Log.e("AsldcInflateDelegate", "Exception while inflating <animated-selector>", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class AvdcInflateDelegate implements InflateDelegate {
|
||||
AvdcInflateDelegate() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.AppCompatDrawableManager.InflateDelegate
|
||||
public Drawable a(Context context, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) {
|
||||
try {
|
||||
return AnimatedVectorDrawableCompat.a(context, context.getResources(), xmlPullParser, attributeSet, theme);
|
||||
} catch (Exception e) {
|
||||
Log.e("AvdcInflateDelegate", "Exception while inflating <animated-vector>", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class ColorFilterLruCache extends LruCache<Integer, PorterDuffColorFilter> {
|
||||
public ColorFilterLruCache(int i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
private static int b(int i, PorterDuff.Mode mode) {
|
||||
return ((i + 31) * 31) + mode.hashCode();
|
||||
}
|
||||
|
||||
PorterDuffColorFilter a(int i, PorterDuff.Mode mode) {
|
||||
return b(Integer.valueOf(b(i, mode)));
|
||||
}
|
||||
|
||||
PorterDuffColorFilter a(int i, PorterDuff.Mode mode, PorterDuffColorFilter porterDuffColorFilter) {
|
||||
return a((ColorFilterLruCache) Integer.valueOf(b(i, mode)), (Integer) porterDuffColorFilter);
|
||||
}
|
||||
}
|
||||
|
||||
private interface InflateDelegate {
|
||||
Drawable a(Context context, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme);
|
||||
}
|
||||
|
||||
private static class VdcInflateDelegate implements InflateDelegate {
|
||||
VdcInflateDelegate() {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.AppCompatDrawableManager.InflateDelegate
|
||||
public Drawable a(Context context, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) {
|
||||
try {
|
||||
return VectorDrawableCompat.createFromXmlInner(context.getResources(), xmlPullParser, attributeSet, theme);
|
||||
} catch (Exception e) {
|
||||
Log.e("VdcInflateDelegate", "Exception while inflating <vector>", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized AppCompatDrawableManager a() {
|
||||
AppCompatDrawableManager appCompatDrawableManager;
|
||||
synchronized (AppCompatDrawableManager.class) {
|
||||
if (h == null) {
|
||||
h = new AppCompatDrawableManager();
|
||||
a(h);
|
||||
}
|
||||
appCompatDrawableManager = h;
|
||||
}
|
||||
return appCompatDrawableManager;
|
||||
}
|
||||
|
||||
private ColorStateList c(Context context) {
|
||||
return c(context, 0);
|
||||
}
|
||||
|
||||
private Drawable d(Context context, int i2) {
|
||||
if (this.e == null) {
|
||||
this.e = new TypedValue();
|
||||
}
|
||||
TypedValue typedValue = this.e;
|
||||
context.getResources().getValue(i2, typedValue, true);
|
||||
long a = a(typedValue);
|
||||
Drawable a2 = a(context, a);
|
||||
if (a2 != null) {
|
||||
return a2;
|
||||
}
|
||||
if (i2 == R$drawable.abc_cab_background_top_material) {
|
||||
a2 = new LayerDrawable(new Drawable[]{a(context, R$drawable.abc_cab_background_internal_bg), a(context, R$drawable.abc_cab_background_top_mtrl_alpha)});
|
||||
}
|
||||
if (a2 != null) {
|
||||
a2.setChangingConfigurations(typedValue.changingConfigurations);
|
||||
a(context, a, a2);
|
||||
}
|
||||
return a2;
|
||||
}
|
||||
|
||||
private ColorStateList e(Context context, int i2) {
|
||||
SparseArrayCompat<ColorStateList> sparseArrayCompat;
|
||||
WeakHashMap<Context, SparseArrayCompat<ColorStateList>> weakHashMap = this.a;
|
||||
if (weakHashMap == null || (sparseArrayCompat = weakHashMap.get(context)) == null) {
|
||||
return null;
|
||||
}
|
||||
return sparseArrayCompat.b(i2);
|
||||
}
|
||||
|
||||
private Drawable f(Context context, int i2) {
|
||||
int next;
|
||||
ArrayMap<String, InflateDelegate> arrayMap = this.b;
|
||||
if (arrayMap == null || arrayMap.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
SparseArrayCompat<String> sparseArrayCompat = this.c;
|
||||
if (sparseArrayCompat != null) {
|
||||
String b = sparseArrayCompat.b(i2);
|
||||
if ("appcompat_skip_skip".equals(b) || (b != null && this.b.get(b) == null)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
this.c = new SparseArrayCompat<>();
|
||||
}
|
||||
if (this.e == null) {
|
||||
this.e = new TypedValue();
|
||||
}
|
||||
TypedValue typedValue = this.e;
|
||||
Resources resources = context.getResources();
|
||||
resources.getValue(i2, typedValue, true);
|
||||
long a = a(typedValue);
|
||||
Drawable a2 = a(context, a);
|
||||
if (a2 != null) {
|
||||
return a2;
|
||||
}
|
||||
CharSequence charSequence = typedValue.string;
|
||||
if (charSequence != null && charSequence.toString().endsWith(".xml")) {
|
||||
try {
|
||||
XmlResourceParser xml = resources.getXml(i2);
|
||||
AttributeSet asAttributeSet = Xml.asAttributeSet(xml);
|
||||
do {
|
||||
next = xml.next();
|
||||
if (next == 2) {
|
||||
break;
|
||||
}
|
||||
} while (next != 1);
|
||||
if (next != 2) {
|
||||
throw new XmlPullParserException("No start tag found");
|
||||
}
|
||||
String name = xml.getName();
|
||||
this.c.a(i2, name);
|
||||
InflateDelegate inflateDelegate = this.b.get(name);
|
||||
if (inflateDelegate != null) {
|
||||
a2 = inflateDelegate.a(context, xml, asAttributeSet, context.getTheme());
|
||||
}
|
||||
if (a2 != null) {
|
||||
a2.setChangingConfigurations(typedValue.changingConfigurations);
|
||||
a(context, a, a2);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("AppCompatDrawableManag", "Exception while inflating drawable", e);
|
||||
}
|
||||
}
|
||||
if (a2 == null) {
|
||||
this.c.a(i2, "appcompat_skip_skip");
|
||||
}
|
||||
return a2;
|
||||
}
|
||||
|
||||
synchronized ColorStateList b(Context context, int i2) {
|
||||
ColorStateList e;
|
||||
e = e(context, i2);
|
||||
if (e == null) {
|
||||
if (i2 == R$drawable.abc_edit_text_material) {
|
||||
e = AppCompatResources.b(context, R$color.abc_tint_edittext);
|
||||
} else if (i2 == R$drawable.abc_switch_track_mtrl_alpha) {
|
||||
e = AppCompatResources.b(context, R$color.abc_tint_switch_track);
|
||||
} else if (i2 == R$drawable.abc_switch_thumb_material) {
|
||||
e = f(context);
|
||||
} else if (i2 == R$drawable.abc_btn_default_mtrl_shape) {
|
||||
e = e(context);
|
||||
} else if (i2 == R$drawable.abc_btn_borderless_material) {
|
||||
e = c(context);
|
||||
} else if (i2 == R$drawable.abc_btn_colored_material) {
|
||||
e = d(context);
|
||||
} else {
|
||||
if (i2 != R$drawable.abc_spinner_mtrl_am_alpha && i2 != R$drawable.abc_spinner_textfield_background_material) {
|
||||
if (a(k, i2)) {
|
||||
e = ThemeUtils.c(context, R$attr.colorControlNormal);
|
||||
} else if (a(n, i2)) {
|
||||
e = AppCompatResources.b(context, R$color.abc_tint_default);
|
||||
} else if (a(o, i2)) {
|
||||
e = AppCompatResources.b(context, R$color.abc_tint_btn_checkable);
|
||||
} else if (i2 == R$drawable.abc_seekbar_thumb_material) {
|
||||
e = AppCompatResources.b(context, R$color.abc_tint_seek_thumb);
|
||||
}
|
||||
}
|
||||
e = AppCompatResources.b(context, R$color.abc_tint_spinner);
|
||||
}
|
||||
if (e != null) {
|
||||
a(context, i2, e);
|
||||
}
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
private ColorStateList c(Context context, int i2) {
|
||||
int b = ThemeUtils.b(context, R$attr.colorControlHighlight);
|
||||
return new ColorStateList(new int[][]{ThemeUtils.b, ThemeUtils.d, ThemeUtils.c, ThemeUtils.f}, new int[]{ThemeUtils.a(context, R$attr.colorButtonNormal), ColorUtils.b(b, i2), ColorUtils.b(b, i2), i2});
|
||||
}
|
||||
|
||||
private ColorStateList e(Context context) {
|
||||
return c(context, ThemeUtils.b(context, R$attr.colorButtonNormal));
|
||||
}
|
||||
|
||||
private static void a(AppCompatDrawableManager appCompatDrawableManager) {
|
||||
if (Build.VERSION.SDK_INT < 24) {
|
||||
appCompatDrawableManager.a("vector", new VdcInflateDelegate());
|
||||
appCompatDrawableManager.a("animated-vector", new AvdcInflateDelegate());
|
||||
appCompatDrawableManager.a("animated-selector", new AsldcInflateDelegate());
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized Drawable a(Context context, int i2) {
|
||||
return a(context, i2, false);
|
||||
}
|
||||
|
||||
synchronized Drawable a(Context context, int i2, boolean z) {
|
||||
Drawable f;
|
||||
b(context);
|
||||
f = f(context, i2);
|
||||
if (f == null) {
|
||||
f = d(context, i2);
|
||||
}
|
||||
if (f == null) {
|
||||
f = ContextCompat.c(context, i2);
|
||||
}
|
||||
if (f != null) {
|
||||
f = a(context, i2, z, f);
|
||||
}
|
||||
if (f != null) {
|
||||
DrawableUtils.b(f);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
private ColorStateList d(Context context) {
|
||||
return c(context, ThemeUtils.b(context, R$attr.colorAccent));
|
||||
}
|
||||
|
||||
public synchronized void a(Context context) {
|
||||
LongSparseArray<WeakReference<Drawable.ConstantState>> longSparseArray = this.d.get(context);
|
||||
if (longSparseArray != null) {
|
||||
longSparseArray.a();
|
||||
}
|
||||
}
|
||||
|
||||
private static long a(TypedValue typedValue) {
|
||||
return (typedValue.assetCookie << 32) | typedValue.data;
|
||||
}
|
||||
|
||||
private Drawable a(Context context, int i2, boolean z, Drawable drawable) {
|
||||
ColorStateList b = b(context, i2);
|
||||
if (b != null) {
|
||||
if (DrawableUtils.a(drawable)) {
|
||||
drawable = drawable.mutate();
|
||||
}
|
||||
Drawable h2 = DrawableCompat.h(drawable);
|
||||
DrawableCompat.a(h2, b);
|
||||
PorterDuff.Mode a = a(i2);
|
||||
if (a == null) {
|
||||
return h2;
|
||||
}
|
||||
DrawableCompat.a(h2, a);
|
||||
return h2;
|
||||
}
|
||||
if (i2 == R$drawable.abc_seekbar_track_material) {
|
||||
LayerDrawable layerDrawable = (LayerDrawable) drawable;
|
||||
a(layerDrawable.findDrawableByLayerId(R.id.background), ThemeUtils.b(context, R$attr.colorControlNormal), g);
|
||||
a(layerDrawable.findDrawableByLayerId(R.id.secondaryProgress), ThemeUtils.b(context, R$attr.colorControlNormal), g);
|
||||
a(layerDrawable.findDrawableByLayerId(R.id.progress), ThemeUtils.b(context, R$attr.colorControlActivated), g);
|
||||
return drawable;
|
||||
}
|
||||
if (i2 != R$drawable.abc_ratingbar_material && i2 != R$drawable.abc_ratingbar_indicator_material && i2 != R$drawable.abc_ratingbar_small_material) {
|
||||
if (a(context, i2, drawable) || !z) {
|
||||
return drawable;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
LayerDrawable layerDrawable2 = (LayerDrawable) drawable;
|
||||
a(layerDrawable2.findDrawableByLayerId(R.id.background), ThemeUtils.a(context, R$attr.colorControlNormal), g);
|
||||
a(layerDrawable2.findDrawableByLayerId(R.id.secondaryProgress), ThemeUtils.b(context, R$attr.colorControlActivated), g);
|
||||
a(layerDrawable2.findDrawableByLayerId(R.id.progress), ThemeUtils.b(context, R$attr.colorControlActivated), g);
|
||||
return drawable;
|
||||
}
|
||||
|
||||
private void b(Context context) {
|
||||
if (this.f) {
|
||||
return;
|
||||
}
|
||||
this.f = true;
|
||||
Drawable a = a(context, R$drawable.abc_vector_test);
|
||||
if (a == null || !a(a)) {
|
||||
this.f = false;
|
||||
throw new IllegalStateException("This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.");
|
||||
}
|
||||
}
|
||||
|
||||
private ColorStateList f(Context context) {
|
||||
int[][] iArr = new int[3][];
|
||||
int[] iArr2 = new int[3];
|
||||
ColorStateList c = ThemeUtils.c(context, R$attr.colorSwitchThumbNormal);
|
||||
if (c != null && c.isStateful()) {
|
||||
iArr[0] = ThemeUtils.b;
|
||||
iArr2[0] = c.getColorForState(iArr[0], 0);
|
||||
iArr[1] = ThemeUtils.e;
|
||||
iArr2[1] = ThemeUtils.b(context, R$attr.colorControlActivated);
|
||||
iArr[2] = ThemeUtils.f;
|
||||
iArr2[2] = c.getDefaultColor();
|
||||
} else {
|
||||
iArr[0] = ThemeUtils.b;
|
||||
iArr2[0] = ThemeUtils.a(context, R$attr.colorSwitchThumbNormal);
|
||||
iArr[1] = ThemeUtils.e;
|
||||
iArr2[1] = ThemeUtils.b(context, R$attr.colorControlActivated);
|
||||
iArr[2] = ThemeUtils.f;
|
||||
iArr2[2] = ThemeUtils.b(context, R$attr.colorSwitchThumbNormal);
|
||||
}
|
||||
return new ColorStateList(iArr, iArr2);
|
||||
}
|
||||
|
||||
private synchronized Drawable a(Context context, long j2) {
|
||||
LongSparseArray<WeakReference<Drawable.ConstantState>> longSparseArray = this.d.get(context);
|
||||
if (longSparseArray == null) {
|
||||
return null;
|
||||
}
|
||||
WeakReference<Drawable.ConstantState> b = longSparseArray.b(j2);
|
||||
if (b != null) {
|
||||
Drawable.ConstantState constantState = b.get();
|
||||
if (constantState != null) {
|
||||
return constantState.newDrawable(context.getResources());
|
||||
}
|
||||
longSparseArray.a(j2);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private synchronized boolean a(Context context, long j2, Drawable drawable) {
|
||||
Drawable.ConstantState constantState = drawable.getConstantState();
|
||||
if (constantState == null) {
|
||||
return false;
|
||||
}
|
||||
LongSparseArray<WeakReference<Drawable.ConstantState>> longSparseArray = this.d.get(context);
|
||||
if (longSparseArray == null) {
|
||||
longSparseArray = new LongSparseArray<>();
|
||||
this.d.put(context, longSparseArray);
|
||||
}
|
||||
longSparseArray.c(j2, new WeakReference<>(constantState));
|
||||
return true;
|
||||
}
|
||||
|
||||
synchronized Drawable a(Context context, VectorEnabledTintResources vectorEnabledTintResources, int i2) {
|
||||
Drawable f = f(context, i2);
|
||||
if (f == null) {
|
||||
f = vectorEnabledTintResources.a(i2);
|
||||
}
|
||||
if (f == null) {
|
||||
return null;
|
||||
}
|
||||
return a(context, i2, false, f);
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:14:0x0061 A[RETURN] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:6:0x0046 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
static boolean a(android.content.Context r6, int r7, android.graphics.drawable.Drawable r8) {
|
||||
/*
|
||||
android.graphics.PorterDuff$Mode r0 = androidx.appcompat.widget.AppCompatDrawableManager.g
|
||||
int[] r1 = androidx.appcompat.widget.AppCompatDrawableManager.j
|
||||
boolean r1 = a(r1, r7)
|
||||
r2 = 16842801(0x1010031, float:2.3693695E-38)
|
||||
r3 = -1
|
||||
r4 = 0
|
||||
r5 = 1
|
||||
if (r1 == 0) goto L15
|
||||
int r2 = androidx.appcompat.R$attr.colorControlNormal
|
||||
L12:
|
||||
r7 = 1
|
||||
r1 = -1
|
||||
goto L44
|
||||
L15:
|
||||
int[] r1 = androidx.appcompat.widget.AppCompatDrawableManager.l
|
||||
boolean r1 = a(r1, r7)
|
||||
if (r1 == 0) goto L20
|
||||
int r2 = androidx.appcompat.R$attr.colorControlActivated
|
||||
goto L12
|
||||
L20:
|
||||
int[] r1 = androidx.appcompat.widget.AppCompatDrawableManager.m
|
||||
boolean r1 = a(r1, r7)
|
||||
if (r1 == 0) goto L2b
|
||||
android.graphics.PorterDuff$Mode r0 = android.graphics.PorterDuff.Mode.MULTIPLY
|
||||
goto L12
|
||||
L2b:
|
||||
int r1 = androidx.appcompat.R$drawable.abc_list_divider_mtrl_alpha
|
||||
if (r7 != r1) goto L3c
|
||||
r2 = 16842800(0x1010030, float:2.3693693E-38)
|
||||
r7 = 1109603123(0x42233333, float:40.8)
|
||||
int r7 = java.lang.Math.round(r7)
|
||||
r1 = r7
|
||||
r7 = 1
|
||||
goto L44
|
||||
L3c:
|
||||
int r1 = androidx.appcompat.R$drawable.abc_dialog_material_background
|
||||
if (r7 != r1) goto L41
|
||||
goto L12
|
||||
L41:
|
||||
r7 = 0
|
||||
r1 = -1
|
||||
r2 = 0
|
||||
L44:
|
||||
if (r7 == 0) goto L61
|
||||
boolean r7 = androidx.appcompat.widget.DrawableUtils.a(r8)
|
||||
if (r7 == 0) goto L50
|
||||
android.graphics.drawable.Drawable r8 = r8.mutate()
|
||||
L50:
|
||||
int r6 = androidx.appcompat.widget.ThemeUtils.b(r6, r2)
|
||||
android.graphics.PorterDuffColorFilter r6 = a(r6, r0)
|
||||
r8.setColorFilter(r6)
|
||||
if (r1 == r3) goto L60
|
||||
r8.setAlpha(r1)
|
||||
L60:
|
||||
return r5
|
||||
L61:
|
||||
return r4
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.AppCompatDrawableManager.a(android.content.Context, int, android.graphics.drawable.Drawable):boolean");
|
||||
}
|
||||
|
||||
private void a(String str, InflateDelegate inflateDelegate) {
|
||||
if (this.b == null) {
|
||||
this.b = new ArrayMap<>();
|
||||
}
|
||||
this.b.put(str, inflateDelegate);
|
||||
}
|
||||
|
||||
private static boolean a(int[] iArr, int i2) {
|
||||
for (int i3 : iArr) {
|
||||
if (i3 == i2) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static PorterDuff.Mode a(int i2) {
|
||||
if (i2 == R$drawable.abc_switch_thumb_material) {
|
||||
return PorterDuff.Mode.MULTIPLY;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void a(Context context, int i2, ColorStateList colorStateList) {
|
||||
if (this.a == null) {
|
||||
this.a = new WeakHashMap<>();
|
||||
}
|
||||
SparseArrayCompat<ColorStateList> sparseArrayCompat = this.a.get(context);
|
||||
if (sparseArrayCompat == null) {
|
||||
sparseArrayCompat = new SparseArrayCompat<>();
|
||||
this.a.put(context, sparseArrayCompat);
|
||||
}
|
||||
sparseArrayCompat.a(i2, colorStateList);
|
||||
}
|
||||
|
||||
static void a(Drawable drawable, TintInfo tintInfo, int[] iArr) {
|
||||
if (DrawableUtils.a(drawable) && drawable.mutate() != drawable) {
|
||||
Log.d("AppCompatDrawableManag", "Mutated drawable is not the same instance as the input.");
|
||||
return;
|
||||
}
|
||||
if (tintInfo.d || tintInfo.c) {
|
||||
drawable.setColorFilter(a(tintInfo.d ? tintInfo.a : null, tintInfo.c ? tintInfo.b : g, iArr));
|
||||
} else {
|
||||
drawable.clearColorFilter();
|
||||
}
|
||||
if (Build.VERSION.SDK_INT <= 23) {
|
||||
drawable.invalidateSelf();
|
||||
}
|
||||
}
|
||||
|
||||
private static PorterDuffColorFilter a(ColorStateList colorStateList, PorterDuff.Mode mode, int[] iArr) {
|
||||
if (colorStateList == null || mode == null) {
|
||||
return null;
|
||||
}
|
||||
return a(colorStateList.getColorForState(iArr, 0), mode);
|
||||
}
|
||||
|
||||
public static synchronized PorterDuffColorFilter a(int i2, PorterDuff.Mode mode) {
|
||||
PorterDuffColorFilter a;
|
||||
synchronized (AppCompatDrawableManager.class) {
|
||||
a = i.a(i2, mode);
|
||||
if (a == null) {
|
||||
a = new PorterDuffColorFilter(i2, mode);
|
||||
i.a(i2, mode, a);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
private static void a(Drawable drawable, int i2, PorterDuff.Mode mode) {
|
||||
if (DrawableUtils.a(drawable)) {
|
||||
drawable = drawable.mutate();
|
||||
}
|
||||
if (mode == null) {
|
||||
mode = g;
|
||||
}
|
||||
drawable.setColorFilter(a(i2, mode));
|
||||
}
|
||||
|
||||
private static boolean a(Drawable drawable) {
|
||||
return (drawable instanceof VectorDrawableCompat) || "android.graphics.drawable.VectorDrawable".equals(drawable.getClass().getName());
|
||||
}
|
||||
}
|
||||
130
sources/androidx/appcompat/widget/AppCompatEditText.java
Normal file
130
sources/androidx/appcompat/widget/AppCompatEditText.java
Normal file
@@ -0,0 +1,130 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.text.Editable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ActionMode;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
import android.widget.EditText;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.core.view.TintableBackgroundView;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatEditText extends EditText implements TintableBackgroundView {
|
||||
private final AppCompatBackgroundHelper a;
|
||||
private final AppCompatTextHelper b;
|
||||
|
||||
public AppCompatEditText(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
protected void drawableStateChanged() {
|
||||
super.drawableStateChanged();
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public ColorStateList getSupportBackgroundTintList() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public PorterDuff.Mode getSupportBackgroundTintMode() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
|
||||
InputConnection onCreateInputConnection = super.onCreateInputConnection(editorInfo);
|
||||
AppCompatHintHelper.a(onCreateInputConnection, editorInfo, this);
|
||||
return onCreateInputConnection;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundDrawable(Drawable drawable) {
|
||||
super.setBackgroundDrawable(drawable);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundResource(int i) {
|
||||
super.setBackgroundResource(i);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
|
||||
super.setCustomSelectionActionModeCallback(TextViewCompat.a(this, callback));
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.b(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setTextAppearance(Context context, int i) {
|
||||
super.setTextAppearance(context, i);
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(context, i);
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatEditText(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.editTextStyle);
|
||||
}
|
||||
|
||||
@Override // android.widget.EditText, android.widget.TextView
|
||||
public Editable getText() {
|
||||
return Build.VERSION.SDK_INT >= 28 ? super.getText() : super.getEditableText();
|
||||
}
|
||||
|
||||
public AppCompatEditText(Context context, AttributeSet attributeSet, int i) {
|
||||
super(TintContextWrapper.b(context), attributeSet, i);
|
||||
this.a = new AppCompatBackgroundHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
this.b = new AppCompatTextHelper(this);
|
||||
this.b.a(attributeSet, i);
|
||||
this.b.a();
|
||||
}
|
||||
}
|
||||
26
sources/androidx/appcompat/widget/AppCompatHintHelper.java
Normal file
26
sources/androidx/appcompat/widget/AppCompatHintHelper.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewParent;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class AppCompatHintHelper {
|
||||
static InputConnection a(InputConnection inputConnection, EditorInfo editorInfo, View view) {
|
||||
if (inputConnection != null && editorInfo.hintText == null) {
|
||||
ViewParent parent = view.getParent();
|
||||
while (true) {
|
||||
if (!(parent instanceof View)) {
|
||||
break;
|
||||
}
|
||||
if (parent instanceof WithHint) {
|
||||
editorInfo.hintText = ((WithHint) parent).a();
|
||||
break;
|
||||
}
|
||||
parent = parent.getParent();
|
||||
}
|
||||
}
|
||||
return inputConnection;
|
||||
}
|
||||
}
|
||||
171
sources/androidx/appcompat/widget/AppCompatImageButton.java
Normal file
171
sources/androidx/appcompat/widget/AppCompatImageButton.java
Normal file
@@ -0,0 +1,171 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ImageButton;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.core.view.TintableBackgroundView;
|
||||
import androidx.core.widget.TintableImageSourceView;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatImageButton extends ImageButton implements TintableBackgroundView, TintableImageSourceView {
|
||||
private final AppCompatBackgroundHelper a;
|
||||
private final AppCompatImageHelper b;
|
||||
|
||||
public AppCompatImageButton(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView, android.view.View
|
||||
protected void drawableStateChanged() {
|
||||
super.drawableStateChanged();
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a();
|
||||
}
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public ColorStateList getSupportBackgroundTintList() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public PorterDuff.Mode getSupportBackgroundTintMode() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableImageSourceView
|
||||
public ColorStateList getSupportImageTintList() {
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
return appCompatImageHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableImageSourceView
|
||||
public PorterDuff.Mode getSupportImageTintMode() {
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
return appCompatImageHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView, android.view.View
|
||||
public boolean hasOverlappingRendering() {
|
||||
return this.b.d() && super.hasOverlappingRendering();
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundDrawable(Drawable drawable) {
|
||||
super.setBackgroundDrawable(drawable);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundResource(int i) {
|
||||
super.setBackgroundResource(i);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView
|
||||
public void setImageBitmap(Bitmap bitmap) {
|
||||
super.setImageBitmap(bitmap);
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView
|
||||
public void setImageDrawable(Drawable drawable) {
|
||||
super.setImageDrawable(drawable);
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView
|
||||
public void setImageResource(int i) {
|
||||
this.b.a(i);
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView
|
||||
public void setImageURI(Uri uri) {
|
||||
super.setImageURI(uri);
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.b(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableImageSourceView
|
||||
public void setSupportImageTintList(ColorStateList colorStateList) {
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableImageSourceView
|
||||
public void setSupportImageTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatImageButton(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.imageButtonStyle);
|
||||
}
|
||||
|
||||
public AppCompatImageButton(Context context, AttributeSet attributeSet, int i) {
|
||||
super(TintContextWrapper.b(context), attributeSet, i);
|
||||
this.a = new AppCompatBackgroundHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
this.b = new AppCompatImageHelper(this);
|
||||
this.b.a(attributeSet, i);
|
||||
}
|
||||
}
|
||||
148
sources/androidx/appcompat/widget/AppCompatImageHelper.java
Normal file
148
sources/androidx/appcompat/widget/AppCompatImageHelper.java
Normal file
@@ -0,0 +1,148 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.RippleDrawable;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ImageView;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.core.widget.ImageViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatImageHelper {
|
||||
private final ImageView a;
|
||||
private TintInfo b;
|
||||
private TintInfo c;
|
||||
private TintInfo d;
|
||||
|
||||
public AppCompatImageHelper(ImageView imageView) {
|
||||
this.a = imageView;
|
||||
}
|
||||
|
||||
private boolean e() {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
return i > 21 ? this.b != null : i == 21;
|
||||
}
|
||||
|
||||
public void a(AttributeSet attributeSet, int i) {
|
||||
int g;
|
||||
TintTypedArray a = TintTypedArray.a(this.a.getContext(), attributeSet, R$styleable.AppCompatImageView, i, 0);
|
||||
try {
|
||||
Drawable drawable = this.a.getDrawable();
|
||||
if (drawable == null && (g = a.g(R$styleable.AppCompatImageView_srcCompat, -1)) != -1 && (drawable = AppCompatResources.c(this.a.getContext(), g)) != null) {
|
||||
this.a.setImageDrawable(drawable);
|
||||
}
|
||||
if (drawable != null) {
|
||||
DrawableUtils.b(drawable);
|
||||
}
|
||||
if (a.g(R$styleable.AppCompatImageView_tint)) {
|
||||
ImageViewCompat.a(this.a, a.a(R$styleable.AppCompatImageView_tint));
|
||||
}
|
||||
if (a.g(R$styleable.AppCompatImageView_tintMode)) {
|
||||
ImageViewCompat.a(this.a, DrawableUtils.a(a.d(R$styleable.AppCompatImageView_tintMode, -1), null));
|
||||
}
|
||||
} finally {
|
||||
a.a();
|
||||
}
|
||||
}
|
||||
|
||||
ColorStateList b() {
|
||||
TintInfo tintInfo = this.c;
|
||||
if (tintInfo != null) {
|
||||
return tintInfo.a;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
PorterDuff.Mode c() {
|
||||
TintInfo tintInfo = this.c;
|
||||
if (tintInfo != null) {
|
||||
return tintInfo.b;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean d() {
|
||||
return Build.VERSION.SDK_INT < 21 || !(this.a.getBackground() instanceof RippleDrawable);
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
if (i != 0) {
|
||||
Drawable c = AppCompatResources.c(this.a.getContext(), i);
|
||||
if (c != null) {
|
||||
DrawableUtils.b(c);
|
||||
}
|
||||
this.a.setImageDrawable(c);
|
||||
} else {
|
||||
this.a.setImageDrawable(null);
|
||||
}
|
||||
a();
|
||||
}
|
||||
|
||||
void a(ColorStateList colorStateList) {
|
||||
if (this.c == null) {
|
||||
this.c = new TintInfo();
|
||||
}
|
||||
TintInfo tintInfo = this.c;
|
||||
tintInfo.a = colorStateList;
|
||||
tintInfo.d = true;
|
||||
a();
|
||||
}
|
||||
|
||||
void a(PorterDuff.Mode mode) {
|
||||
if (this.c == null) {
|
||||
this.c = new TintInfo();
|
||||
}
|
||||
TintInfo tintInfo = this.c;
|
||||
tintInfo.b = mode;
|
||||
tintInfo.c = true;
|
||||
a();
|
||||
}
|
||||
|
||||
void a() {
|
||||
Drawable drawable = this.a.getDrawable();
|
||||
if (drawable != null) {
|
||||
DrawableUtils.b(drawable);
|
||||
}
|
||||
if (drawable != null) {
|
||||
if (e() && a(drawable)) {
|
||||
return;
|
||||
}
|
||||
TintInfo tintInfo = this.c;
|
||||
if (tintInfo != null) {
|
||||
AppCompatDrawableManager.a(drawable, tintInfo, this.a.getDrawableState());
|
||||
return;
|
||||
}
|
||||
TintInfo tintInfo2 = this.b;
|
||||
if (tintInfo2 != null) {
|
||||
AppCompatDrawableManager.a(drawable, tintInfo2, this.a.getDrawableState());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean a(Drawable drawable) {
|
||||
if (this.d == null) {
|
||||
this.d = new TintInfo();
|
||||
}
|
||||
TintInfo tintInfo = this.d;
|
||||
tintInfo.a();
|
||||
ColorStateList a = ImageViewCompat.a(this.a);
|
||||
if (a != null) {
|
||||
tintInfo.d = true;
|
||||
tintInfo.a = a;
|
||||
}
|
||||
PorterDuff.Mode b = ImageViewCompat.b(this.a);
|
||||
if (b != null) {
|
||||
tintInfo.c = true;
|
||||
tintInfo.b = b;
|
||||
}
|
||||
if (!tintInfo.d && !tintInfo.c) {
|
||||
return false;
|
||||
}
|
||||
AppCompatDrawableManager.a(drawable, tintInfo, this.a.getDrawableState());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
173
sources/androidx/appcompat/widget/AppCompatImageView.java
Normal file
173
sources/androidx/appcompat/widget/AppCompatImageView.java
Normal file
@@ -0,0 +1,173 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ImageView;
|
||||
import androidx.core.view.TintableBackgroundView;
|
||||
import androidx.core.widget.TintableImageSourceView;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatImageView extends ImageView implements TintableBackgroundView, TintableImageSourceView {
|
||||
private final AppCompatBackgroundHelper a;
|
||||
private final AppCompatImageHelper b;
|
||||
|
||||
public AppCompatImageView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView, android.view.View
|
||||
protected void drawableStateChanged() {
|
||||
super.drawableStateChanged();
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a();
|
||||
}
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public ColorStateList getSupportBackgroundTintList() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public PorterDuff.Mode getSupportBackgroundTintMode() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableImageSourceView
|
||||
public ColorStateList getSupportImageTintList() {
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
return appCompatImageHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableImageSourceView
|
||||
public PorterDuff.Mode getSupportImageTintMode() {
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
return appCompatImageHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView, android.view.View
|
||||
public boolean hasOverlappingRendering() {
|
||||
return this.b.d() && super.hasOverlappingRendering();
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundDrawable(Drawable drawable) {
|
||||
super.setBackgroundDrawable(drawable);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundResource(int i) {
|
||||
super.setBackgroundResource(i);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView
|
||||
public void setImageBitmap(Bitmap bitmap) {
|
||||
super.setImageBitmap(bitmap);
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView
|
||||
public void setImageDrawable(Drawable drawable) {
|
||||
super.setImageDrawable(drawable);
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView
|
||||
public void setImageResource(int i) {
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.ImageView
|
||||
public void setImageURI(Uri uri) {
|
||||
super.setImageURI(uri);
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.b(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableImageSourceView
|
||||
public void setSupportImageTintList(ColorStateList colorStateList) {
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableImageSourceView
|
||||
public void setSupportImageTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatImageHelper appCompatImageHelper = this.b;
|
||||
if (appCompatImageHelper != null) {
|
||||
appCompatImageHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatImageView(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, 0);
|
||||
}
|
||||
|
||||
public AppCompatImageView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(TintContextWrapper.b(context), attributeSet, i);
|
||||
this.a = new AppCompatBackgroundHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
this.b = new AppCompatImageHelper(this);
|
||||
this.b.a(attributeSet, i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
import android.widget.MultiAutoCompleteTextView;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.core.view.TintableBackgroundView;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatMultiAutoCompleteTextView extends MultiAutoCompleteTextView implements TintableBackgroundView {
|
||||
private static final int[] c = {R.attr.popupBackground};
|
||||
private final AppCompatBackgroundHelper a;
|
||||
private final AppCompatTextHelper b;
|
||||
|
||||
public AppCompatMultiAutoCompleteTextView(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.autoCompleteTextViewStyle);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
protected void drawableStateChanged() {
|
||||
super.drawableStateChanged();
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public ColorStateList getSupportBackgroundTintList() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public PorterDuff.Mode getSupportBackgroundTintMode() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
|
||||
InputConnection onCreateInputConnection = super.onCreateInputConnection(editorInfo);
|
||||
AppCompatHintHelper.a(onCreateInputConnection, editorInfo, this);
|
||||
return onCreateInputConnection;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundDrawable(Drawable drawable) {
|
||||
super.setBackgroundDrawable(drawable);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundResource(int i) {
|
||||
super.setBackgroundResource(i);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.AutoCompleteTextView
|
||||
public void setDropDownBackgroundResource(int i) {
|
||||
setDropDownBackgroundDrawable(AppCompatResources.c(getContext(), i));
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.b(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setTextAppearance(Context context, int i) {
|
||||
super.setTextAppearance(context, i);
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(context, i);
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatMultiAutoCompleteTextView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(TintContextWrapper.b(context), attributeSet, i);
|
||||
TintTypedArray a = TintTypedArray.a(getContext(), attributeSet, c, i, 0);
|
||||
if (a.g(0)) {
|
||||
setDropDownBackgroundDrawable(a.b(0));
|
||||
}
|
||||
a.a();
|
||||
this.a = new AppCompatBackgroundHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
this.b = new AppCompatTextHelper(this);
|
||||
this.b.a(attributeSet, i);
|
||||
this.b.a();
|
||||
}
|
||||
}
|
||||
65
sources/androidx/appcompat/widget/AppCompatPopupWindow.java
Normal file
65
sources/androidx/appcompat/widget/AppCompatPopupWindow.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.PopupWindow;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.core.widget.PopupWindowCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class AppCompatPopupWindow extends PopupWindow {
|
||||
private static final boolean b;
|
||||
private boolean a;
|
||||
|
||||
static {
|
||||
b = Build.VERSION.SDK_INT < 21;
|
||||
}
|
||||
|
||||
public AppCompatPopupWindow(Context context, AttributeSet attributeSet, int i, int i2) {
|
||||
super(context, attributeSet, i, i2);
|
||||
a(context, attributeSet, i, i2);
|
||||
}
|
||||
|
||||
private void a(Context context, AttributeSet attributeSet, int i, int i2) {
|
||||
TintTypedArray a = TintTypedArray.a(context, attributeSet, R$styleable.PopupWindow, i, i2);
|
||||
if (a.g(R$styleable.PopupWindow_overlapAnchor)) {
|
||||
a(a.a(R$styleable.PopupWindow_overlapAnchor, false));
|
||||
}
|
||||
setBackgroundDrawable(a.b(R$styleable.PopupWindow_android_popupBackground));
|
||||
a.a();
|
||||
}
|
||||
|
||||
@Override // android.widget.PopupWindow
|
||||
public void showAsDropDown(View view, int i, int i2) {
|
||||
if (b && this.a) {
|
||||
i2 -= view.getHeight();
|
||||
}
|
||||
super.showAsDropDown(view, i, i2);
|
||||
}
|
||||
|
||||
@Override // android.widget.PopupWindow
|
||||
public void update(View view, int i, int i2, int i3, int i4) {
|
||||
if (b && this.a) {
|
||||
i2 -= view.getHeight();
|
||||
}
|
||||
super.update(view, i, i2, i3, i4);
|
||||
}
|
||||
|
||||
@Override // android.widget.PopupWindow
|
||||
public void showAsDropDown(View view, int i, int i2, int i3) {
|
||||
if (b && this.a) {
|
||||
i2 -= view.getHeight();
|
||||
}
|
||||
super.showAsDropDown(view, i, i2, i3);
|
||||
}
|
||||
|
||||
private void a(boolean z) {
|
||||
if (b) {
|
||||
this.a = z;
|
||||
} else {
|
||||
PopupWindowCompat.a(this, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.R;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapShader;
|
||||
import android.graphics.Shader;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.ClipDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.graphics.drawable.ShapeDrawable;
|
||||
import android.graphics.drawable.shapes.RoundRectShape;
|
||||
import android.graphics.drawable.shapes.Shape;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ProgressBar;
|
||||
import androidx.core.graphics.drawable.WrappedDrawable;
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class AppCompatProgressBarHelper {
|
||||
private static final int[] c = {R.attr.indeterminateDrawable, R.attr.progressDrawable};
|
||||
private final ProgressBar a;
|
||||
private Bitmap b;
|
||||
|
||||
AppCompatProgressBarHelper(ProgressBar progressBar) {
|
||||
this.a = progressBar;
|
||||
}
|
||||
|
||||
private Shape b() {
|
||||
return new RoundRectShape(new float[]{5.0f, 5.0f, 5.0f, 5.0f, 5.0f, 5.0f, 5.0f, 5.0f}, null, null);
|
||||
}
|
||||
|
||||
void a(AttributeSet attributeSet, int i) {
|
||||
TintTypedArray a = TintTypedArray.a(this.a.getContext(), attributeSet, c, i, 0);
|
||||
Drawable c2 = a.c(0);
|
||||
if (c2 != null) {
|
||||
this.a.setIndeterminateDrawable(a(c2));
|
||||
}
|
||||
Drawable c3 = a.c(1);
|
||||
if (c3 != null) {
|
||||
this.a.setProgressDrawable(a(c3, false));
|
||||
}
|
||||
a.a();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private Drawable a(Drawable drawable, boolean z) {
|
||||
if (drawable instanceof WrappedDrawable) {
|
||||
WrappedDrawable wrappedDrawable = (WrappedDrawable) drawable;
|
||||
Drawable a = wrappedDrawable.a();
|
||||
if (a == null) {
|
||||
return drawable;
|
||||
}
|
||||
wrappedDrawable.a(a(a, z));
|
||||
return drawable;
|
||||
}
|
||||
if (drawable instanceof LayerDrawable) {
|
||||
LayerDrawable layerDrawable = (LayerDrawable) drawable;
|
||||
int numberOfLayers = layerDrawable.getNumberOfLayers();
|
||||
Drawable[] drawableArr = new Drawable[numberOfLayers];
|
||||
for (int i = 0; i < numberOfLayers; i++) {
|
||||
int id = layerDrawable.getId(i);
|
||||
drawableArr[i] = a(layerDrawable.getDrawable(i), id == 16908301 || id == 16908303);
|
||||
}
|
||||
LayerDrawable layerDrawable2 = new LayerDrawable(drawableArr);
|
||||
for (int i2 = 0; i2 < numberOfLayers; i2++) {
|
||||
layerDrawable2.setId(i2, layerDrawable.getId(i2));
|
||||
}
|
||||
return layerDrawable2;
|
||||
}
|
||||
if (!(drawable instanceof BitmapDrawable)) {
|
||||
return drawable;
|
||||
}
|
||||
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
|
||||
Bitmap bitmap = bitmapDrawable.getBitmap();
|
||||
if (this.b == null) {
|
||||
this.b = bitmap;
|
||||
}
|
||||
ShapeDrawable shapeDrawable = new ShapeDrawable(b());
|
||||
shapeDrawable.getPaint().setShader(new BitmapShader(bitmap, Shader.TileMode.REPEAT, Shader.TileMode.CLAMP));
|
||||
shapeDrawable.getPaint().setColorFilter(bitmapDrawable.getPaint().getColorFilter());
|
||||
return z ? new ClipDrawable(shapeDrawable, 3, 1) : shapeDrawable;
|
||||
}
|
||||
|
||||
private Drawable a(Drawable drawable) {
|
||||
if (!(drawable instanceof AnimationDrawable)) {
|
||||
return drawable;
|
||||
}
|
||||
AnimationDrawable animationDrawable = (AnimationDrawable) drawable;
|
||||
int numberOfFrames = animationDrawable.getNumberOfFrames();
|
||||
AnimationDrawable animationDrawable2 = new AnimationDrawable();
|
||||
animationDrawable2.setOneShot(animationDrawable.isOneShot());
|
||||
for (int i = 0; i < numberOfFrames; i++) {
|
||||
Drawable a = a(animationDrawable.getFrame(i), true);
|
||||
a.setLevel(XStream.PRIORITY_VERY_HIGH);
|
||||
animationDrawable2.addFrame(a, animationDrawable.getDuration(i));
|
||||
}
|
||||
animationDrawable2.setLevel(XStream.PRIORITY_VERY_HIGH);
|
||||
return animationDrawable2;
|
||||
}
|
||||
|
||||
Bitmap a() {
|
||||
return this.b;
|
||||
}
|
||||
}
|
||||
82
sources/androidx/appcompat/widget/AppCompatRadioButton.java
Normal file
82
sources/androidx/appcompat/widget/AppCompatRadioButton.java
Normal file
@@ -0,0 +1,82 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.RadioButton;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.core.widget.TintableCompoundButton;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatRadioButton extends RadioButton implements TintableCompoundButton {
|
||||
private final AppCompatCompoundButtonHelper a;
|
||||
private final AppCompatTextHelper b;
|
||||
|
||||
public AppCompatRadioButton(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.radioButtonStyle);
|
||||
}
|
||||
|
||||
@Override // android.widget.CompoundButton, android.widget.TextView
|
||||
public int getCompoundPaddingLeft() {
|
||||
int compoundPaddingLeft = super.getCompoundPaddingLeft();
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
return appCompatCompoundButtonHelper != null ? appCompatCompoundButtonHelper.a(compoundPaddingLeft) : compoundPaddingLeft;
|
||||
}
|
||||
|
||||
public ColorStateList getSupportButtonTintList() {
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
if (appCompatCompoundButtonHelper != null) {
|
||||
return appCompatCompoundButtonHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public PorterDuff.Mode getSupportButtonTintMode() {
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
if (appCompatCompoundButtonHelper != null) {
|
||||
return appCompatCompoundButtonHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.widget.CompoundButton
|
||||
public void setButtonDrawable(Drawable drawable) {
|
||||
super.setButtonDrawable(drawable);
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
if (appCompatCompoundButtonHelper != null) {
|
||||
appCompatCompoundButtonHelper.d();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableCompoundButton
|
||||
public void setSupportButtonTintList(ColorStateList colorStateList) {
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
if (appCompatCompoundButtonHelper != null) {
|
||||
appCompatCompoundButtonHelper.a(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.widget.TintableCompoundButton
|
||||
public void setSupportButtonTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
||||
if (appCompatCompoundButtonHelper != null) {
|
||||
appCompatCompoundButtonHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatRadioButton(Context context, AttributeSet attributeSet, int i) {
|
||||
super(TintContextWrapper.b(context), attributeSet, i);
|
||||
this.a = new AppCompatCompoundButtonHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
this.b = new AppCompatTextHelper(this);
|
||||
this.b.a(attributeSet, i);
|
||||
}
|
||||
|
||||
@Override // android.widget.CompoundButton
|
||||
public void setButtonDrawable(int i) {
|
||||
setButtonDrawable(AppCompatResources.c(getContext(), i));
|
||||
}
|
||||
}
|
||||
32
sources/androidx/appcompat/widget/AppCompatRatingBar.java
Normal file
32
sources/androidx/appcompat/widget/AppCompatRatingBar.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.RatingBar;
|
||||
import androidx.appcompat.R$attr;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatRatingBar extends RatingBar {
|
||||
private final AppCompatProgressBarHelper a;
|
||||
|
||||
public AppCompatRatingBar(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.ratingBarStyle);
|
||||
}
|
||||
|
||||
@Override // android.widget.RatingBar, android.widget.AbsSeekBar, android.widget.ProgressBar, android.view.View
|
||||
protected synchronized void onMeasure(int i, int i2) {
|
||||
super.onMeasure(i, i2);
|
||||
Bitmap a = this.a.a();
|
||||
if (a != null) {
|
||||
setMeasuredDimension(View.resolveSizeAndState(a.getWidth() * getNumStars(), i, 0), getMeasuredHeight());
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatRatingBar(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet, i);
|
||||
this.a = new AppCompatProgressBarHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
}
|
||||
}
|
||||
40
sources/androidx/appcompat/widget/AppCompatSeekBar.java
Normal file
40
sources/androidx/appcompat/widget/AppCompatSeekBar.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.SeekBar;
|
||||
import androidx.appcompat.R$attr;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatSeekBar extends SeekBar {
|
||||
private final AppCompatSeekBarHelper a;
|
||||
|
||||
public AppCompatSeekBar(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.seekBarStyle);
|
||||
}
|
||||
|
||||
@Override // android.widget.AbsSeekBar, android.widget.ProgressBar, android.view.View
|
||||
protected void drawableStateChanged() {
|
||||
super.drawableStateChanged();
|
||||
this.a.b();
|
||||
}
|
||||
|
||||
@Override // android.widget.AbsSeekBar, android.widget.ProgressBar, android.view.View
|
||||
public void jumpDrawablesToCurrentState() {
|
||||
super.jumpDrawablesToCurrentState();
|
||||
this.a.c();
|
||||
}
|
||||
|
||||
@Override // android.widget.AbsSeekBar, android.widget.ProgressBar, android.view.View
|
||||
protected synchronized void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
this.a.a(canvas);
|
||||
}
|
||||
|
||||
public AppCompatSeekBar(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet, i);
|
||||
this.a = new AppCompatSeekBarHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
}
|
||||
}
|
||||
120
sources/androidx/appcompat/widget/AppCompatSeekBarHelper.java
Normal file
120
sources/androidx/appcompat/widget/AppCompatSeekBarHelper.java
Normal file
@@ -0,0 +1,120 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.SeekBar;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class AppCompatSeekBarHelper extends AppCompatProgressBarHelper {
|
||||
private final SeekBar d;
|
||||
private Drawable e;
|
||||
private ColorStateList f;
|
||||
private PorterDuff.Mode g;
|
||||
private boolean h;
|
||||
private boolean i;
|
||||
|
||||
AppCompatSeekBarHelper(SeekBar seekBar) {
|
||||
super(seekBar);
|
||||
this.f = null;
|
||||
this.g = null;
|
||||
this.h = false;
|
||||
this.i = false;
|
||||
this.d = seekBar;
|
||||
}
|
||||
|
||||
private void d() {
|
||||
if (this.e != null) {
|
||||
if (this.h || this.i) {
|
||||
this.e = DrawableCompat.h(this.e.mutate());
|
||||
if (this.h) {
|
||||
DrawableCompat.a(this.e, this.f);
|
||||
}
|
||||
if (this.i) {
|
||||
DrawableCompat.a(this.e, this.g);
|
||||
}
|
||||
if (this.e.isStateful()) {
|
||||
this.e.setState(this.d.getDrawableState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.AppCompatProgressBarHelper
|
||||
void a(AttributeSet attributeSet, int i) {
|
||||
super.a(attributeSet, i);
|
||||
TintTypedArray a = TintTypedArray.a(this.d.getContext(), attributeSet, R$styleable.AppCompatSeekBar, i, 0);
|
||||
Drawable c = a.c(R$styleable.AppCompatSeekBar_android_thumb);
|
||||
if (c != null) {
|
||||
this.d.setThumb(c);
|
||||
}
|
||||
a(a.b(R$styleable.AppCompatSeekBar_tickMark));
|
||||
if (a.g(R$styleable.AppCompatSeekBar_tickMarkTintMode)) {
|
||||
this.g = DrawableUtils.a(a.d(R$styleable.AppCompatSeekBar_tickMarkTintMode, -1), this.g);
|
||||
this.i = true;
|
||||
}
|
||||
if (a.g(R$styleable.AppCompatSeekBar_tickMarkTint)) {
|
||||
this.f = a.a(R$styleable.AppCompatSeekBar_tickMarkTint);
|
||||
this.h = true;
|
||||
}
|
||||
a.a();
|
||||
d();
|
||||
}
|
||||
|
||||
void b() {
|
||||
Drawable drawable = this.e;
|
||||
if (drawable != null && drawable.isStateful() && drawable.setState(this.d.getDrawableState())) {
|
||||
this.d.invalidateDrawable(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
void c() {
|
||||
Drawable drawable = this.e;
|
||||
if (drawable != null) {
|
||||
drawable.jumpToCurrentState();
|
||||
}
|
||||
}
|
||||
|
||||
void a(Drawable drawable) {
|
||||
Drawable drawable2 = this.e;
|
||||
if (drawable2 != null) {
|
||||
drawable2.setCallback(null);
|
||||
}
|
||||
this.e = drawable;
|
||||
if (drawable != null) {
|
||||
drawable.setCallback(this.d);
|
||||
DrawableCompat.a(drawable, ViewCompat.k(this.d));
|
||||
if (drawable.isStateful()) {
|
||||
drawable.setState(this.d.getDrawableState());
|
||||
}
|
||||
d();
|
||||
}
|
||||
this.d.invalidate();
|
||||
}
|
||||
|
||||
void a(Canvas canvas) {
|
||||
if (this.e != null) {
|
||||
int max = this.d.getMax();
|
||||
if (max > 1) {
|
||||
int intrinsicWidth = this.e.getIntrinsicWidth();
|
||||
int intrinsicHeight = this.e.getIntrinsicHeight();
|
||||
int i = intrinsicWidth >= 0 ? intrinsicWidth / 2 : 1;
|
||||
int i2 = intrinsicHeight >= 0 ? intrinsicHeight / 2 : 1;
|
||||
this.e.setBounds(-i, -i2, i, i2);
|
||||
float width = ((this.d.getWidth() - this.d.getPaddingLeft()) - this.d.getPaddingRight()) / max;
|
||||
int save = canvas.save();
|
||||
canvas.translate(this.d.getPaddingLeft(), this.d.getHeight() / 2);
|
||||
for (int i3 = 0; i3 <= max; i3++) {
|
||||
this.e.draw(canvas);
|
||||
canvas.translate(width, 0.0f);
|
||||
}
|
||||
canvas.restoreToCount(save);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
695
sources/androidx/appcompat/widget/AppCompatSpinner.java
Normal file
695
sources/androidx/appcompat/widget/AppCompatSpinner.java
Normal file
@@ -0,0 +1,695 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.database.DataSetObserver;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.SpinnerAdapter;
|
||||
import androidx.appcompat.R$attr;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.core.view.TintableBackgroundView;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatSpinner extends Spinner implements TintableBackgroundView {
|
||||
private static final int[] i = {R.attr.spinnerMode};
|
||||
private final AppCompatBackgroundHelper a;
|
||||
private final Context b;
|
||||
private ForwardingListener c;
|
||||
private SpinnerAdapter d;
|
||||
private final boolean e;
|
||||
DropdownPopup f;
|
||||
int g;
|
||||
final Rect h;
|
||||
|
||||
private static class DropDownAdapter implements ListAdapter, SpinnerAdapter {
|
||||
private SpinnerAdapter a;
|
||||
private ListAdapter b;
|
||||
|
||||
public DropDownAdapter(SpinnerAdapter spinnerAdapter, Resources.Theme theme) {
|
||||
this.a = spinnerAdapter;
|
||||
if (spinnerAdapter instanceof ListAdapter) {
|
||||
this.b = (ListAdapter) spinnerAdapter;
|
||||
}
|
||||
if (theme != null) {
|
||||
if (Build.VERSION.SDK_INT >= 23 && (spinnerAdapter instanceof android.widget.ThemedSpinnerAdapter)) {
|
||||
android.widget.ThemedSpinnerAdapter themedSpinnerAdapter = (android.widget.ThemedSpinnerAdapter) spinnerAdapter;
|
||||
if (themedSpinnerAdapter.getDropDownViewTheme() != theme) {
|
||||
themedSpinnerAdapter.setDropDownViewTheme(theme);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (spinnerAdapter instanceof ThemedSpinnerAdapter) {
|
||||
ThemedSpinnerAdapter themedSpinnerAdapter2 = (ThemedSpinnerAdapter) spinnerAdapter;
|
||||
if (themedSpinnerAdapter2.getDropDownViewTheme() == null) {
|
||||
themedSpinnerAdapter2.setDropDownViewTheme(theme);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.ListAdapter
|
||||
public boolean areAllItemsEnabled() {
|
||||
ListAdapter listAdapter = this.b;
|
||||
if (listAdapter != null) {
|
||||
return listAdapter.areAllItemsEnabled();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public int getCount() {
|
||||
SpinnerAdapter spinnerAdapter = this.a;
|
||||
if (spinnerAdapter == null) {
|
||||
return 0;
|
||||
}
|
||||
return spinnerAdapter.getCount();
|
||||
}
|
||||
|
||||
@Override // android.widget.SpinnerAdapter
|
||||
public View getDropDownView(int i, View view, ViewGroup viewGroup) {
|
||||
SpinnerAdapter spinnerAdapter = this.a;
|
||||
if (spinnerAdapter == null) {
|
||||
return null;
|
||||
}
|
||||
return spinnerAdapter.getDropDownView(i, view, viewGroup);
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public Object getItem(int i) {
|
||||
SpinnerAdapter spinnerAdapter = this.a;
|
||||
if (spinnerAdapter == null) {
|
||||
return null;
|
||||
}
|
||||
return spinnerAdapter.getItem(i);
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public long getItemId(int i) {
|
||||
SpinnerAdapter spinnerAdapter = this.a;
|
||||
if (spinnerAdapter == null) {
|
||||
return -1L;
|
||||
}
|
||||
return spinnerAdapter.getItemId(i);
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public int getItemViewType(int i) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
return getDropDownView(i, view, viewGroup);
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public int getViewTypeCount() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public boolean hasStableIds() {
|
||||
SpinnerAdapter spinnerAdapter = this.a;
|
||||
return spinnerAdapter != null && spinnerAdapter.hasStableIds();
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public boolean isEmpty() {
|
||||
return getCount() == 0;
|
||||
}
|
||||
|
||||
@Override // android.widget.ListAdapter
|
||||
public boolean isEnabled(int i) {
|
||||
ListAdapter listAdapter = this.b;
|
||||
if (listAdapter != null) {
|
||||
return listAdapter.isEnabled(i);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public void registerDataSetObserver(DataSetObserver dataSetObserver) {
|
||||
SpinnerAdapter spinnerAdapter = this.a;
|
||||
if (spinnerAdapter != null) {
|
||||
spinnerAdapter.registerDataSetObserver(dataSetObserver);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public void unregisterDataSetObserver(DataSetObserver dataSetObserver) {
|
||||
SpinnerAdapter spinnerAdapter = this.a;
|
||||
if (spinnerAdapter != null) {
|
||||
spinnerAdapter.unregisterDataSetObserver(dataSetObserver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class DropdownPopup extends ListPopupWindow {
|
||||
private CharSequence J;
|
||||
ListAdapter K;
|
||||
private final Rect L;
|
||||
|
||||
public DropdownPopup(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet, i);
|
||||
this.L = new Rect();
|
||||
a(AppCompatSpinner.this);
|
||||
a(true);
|
||||
f(0);
|
||||
a(new AdapterView.OnItemClickListener(AppCompatSpinner.this) { // from class: androidx.appcompat.widget.AppCompatSpinner.DropdownPopup.1
|
||||
@Override // android.widget.AdapterView.OnItemClickListener
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i2, long j) {
|
||||
AppCompatSpinner.this.setSelection(i2);
|
||||
if (AppCompatSpinner.this.getOnItemClickListener() != null) {
|
||||
DropdownPopup dropdownPopup = DropdownPopup.this;
|
||||
AppCompatSpinner.this.performItemClick(view, i2, dropdownPopup.K.getItemId(i2));
|
||||
}
|
||||
DropdownPopup.this.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
boolean b(View view) {
|
||||
return ViewCompat.w(view) && view.getGlobalVisibleRect(this.L);
|
||||
}
|
||||
|
||||
void l() {
|
||||
Drawable f = f();
|
||||
int i = 0;
|
||||
if (f != null) {
|
||||
f.getPadding(AppCompatSpinner.this.h);
|
||||
i = ViewUtils.a(AppCompatSpinner.this) ? AppCompatSpinner.this.h.right : -AppCompatSpinner.this.h.left;
|
||||
} else {
|
||||
Rect rect = AppCompatSpinner.this.h;
|
||||
rect.right = 0;
|
||||
rect.left = 0;
|
||||
}
|
||||
int paddingLeft = AppCompatSpinner.this.getPaddingLeft();
|
||||
int paddingRight = AppCompatSpinner.this.getPaddingRight();
|
||||
int width = AppCompatSpinner.this.getWidth();
|
||||
AppCompatSpinner appCompatSpinner = AppCompatSpinner.this;
|
||||
int i2 = appCompatSpinner.g;
|
||||
if (i2 == -2) {
|
||||
int a = appCompatSpinner.a((SpinnerAdapter) this.K, f());
|
||||
int i3 = AppCompatSpinner.this.getContext().getResources().getDisplayMetrics().widthPixels;
|
||||
Rect rect2 = AppCompatSpinner.this.h;
|
||||
int i4 = (i3 - rect2.left) - rect2.right;
|
||||
if (a > i4) {
|
||||
a = i4;
|
||||
}
|
||||
b(Math.max(a, (width - paddingLeft) - paddingRight));
|
||||
} else if (i2 == -1) {
|
||||
b((width - paddingLeft) - paddingRight);
|
||||
} else {
|
||||
b(i2);
|
||||
}
|
||||
d(ViewUtils.a(AppCompatSpinner.this) ? i + ((width - paddingRight) - i()) : i + paddingLeft);
|
||||
}
|
||||
|
||||
public CharSequence m() {
|
||||
return this.J;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ListPopupWindow
|
||||
public void a(ListAdapter listAdapter) {
|
||||
super.a(listAdapter);
|
||||
this.K = listAdapter;
|
||||
}
|
||||
|
||||
public void a(CharSequence charSequence) {
|
||||
this.J = charSequence;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.widget.ListPopupWindow, androidx.appcompat.view.menu.ShowableListMenu
|
||||
public void a() {
|
||||
ViewTreeObserver viewTreeObserver;
|
||||
boolean c = c();
|
||||
l();
|
||||
e(2);
|
||||
super.a();
|
||||
d().setChoiceMode(1);
|
||||
g(AppCompatSpinner.this.getSelectedItemPosition());
|
||||
if (c || (viewTreeObserver = AppCompatSpinner.this.getViewTreeObserver()) == null) {
|
||||
return;
|
||||
}
|
||||
final ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() { // from class: androidx.appcompat.widget.AppCompatSpinner.DropdownPopup.2
|
||||
@Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
|
||||
public void onGlobalLayout() {
|
||||
DropdownPopup dropdownPopup = DropdownPopup.this;
|
||||
if (!dropdownPopup.b(AppCompatSpinner.this)) {
|
||||
DropdownPopup.this.dismiss();
|
||||
} else {
|
||||
DropdownPopup.this.l();
|
||||
DropdownPopup.super.a();
|
||||
}
|
||||
}
|
||||
};
|
||||
viewTreeObserver.addOnGlobalLayoutListener(onGlobalLayoutListener);
|
||||
a(new PopupWindow.OnDismissListener() { // from class: androidx.appcompat.widget.AppCompatSpinner.DropdownPopup.3
|
||||
@Override // android.widget.PopupWindow.OnDismissListener
|
||||
public void onDismiss() {
|
||||
ViewTreeObserver viewTreeObserver2 = AppCompatSpinner.this.getViewTreeObserver();
|
||||
if (viewTreeObserver2 != null) {
|
||||
viewTreeObserver2.removeGlobalOnLayoutListener(onGlobalLayoutListener);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatSpinner(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R$attr.spinnerStyle);
|
||||
}
|
||||
|
||||
int a(SpinnerAdapter spinnerAdapter, Drawable drawable) {
|
||||
int i2 = 0;
|
||||
if (spinnerAdapter == null) {
|
||||
return 0;
|
||||
}
|
||||
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), 0);
|
||||
int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(getMeasuredHeight(), 0);
|
||||
int max = Math.max(0, getSelectedItemPosition());
|
||||
int min = Math.min(spinnerAdapter.getCount(), max + 15);
|
||||
View view = null;
|
||||
int i3 = 0;
|
||||
for (int max2 = Math.max(0, max - (15 - (min - max))); max2 < min; max2++) {
|
||||
int itemViewType = spinnerAdapter.getItemViewType(max2);
|
||||
if (itemViewType != i2) {
|
||||
view = null;
|
||||
i2 = itemViewType;
|
||||
}
|
||||
view = spinnerAdapter.getView(max2, view, this);
|
||||
if (view.getLayoutParams() == null) {
|
||||
view.setLayoutParams(new ViewGroup.LayoutParams(-2, -2));
|
||||
}
|
||||
view.measure(makeMeasureSpec, makeMeasureSpec2);
|
||||
i3 = Math.max(i3, view.getMeasuredWidth());
|
||||
}
|
||||
if (drawable == null) {
|
||||
return i3;
|
||||
}
|
||||
drawable.getPadding(this.h);
|
||||
Rect rect = this.h;
|
||||
return i3 + rect.left + rect.right;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.View
|
||||
protected void drawableStateChanged() {
|
||||
super.drawableStateChanged();
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public int getDropDownHorizontalOffset() {
|
||||
DropdownPopup dropdownPopup = this.f;
|
||||
if (dropdownPopup != null) {
|
||||
return dropdownPopup.g();
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return super.getDropDownHorizontalOffset();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public int getDropDownVerticalOffset() {
|
||||
DropdownPopup dropdownPopup = this.f;
|
||||
if (dropdownPopup != null) {
|
||||
return dropdownPopup.h();
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return super.getDropDownVerticalOffset();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public int getDropDownWidth() {
|
||||
if (this.f != null) {
|
||||
return this.g;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return super.getDropDownWidth();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public Drawable getPopupBackground() {
|
||||
DropdownPopup dropdownPopup = this.f;
|
||||
if (dropdownPopup != null) {
|
||||
return dropdownPopup.f();
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
return super.getPopupBackground();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public Context getPopupContext() {
|
||||
if (this.f != null) {
|
||||
return this.b;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return super.getPopupContext();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public CharSequence getPrompt() {
|
||||
DropdownPopup dropdownPopup = this.f;
|
||||
return dropdownPopup != null ? dropdownPopup.m() : super.getPrompt();
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public ColorStateList getSupportBackgroundTintList() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public PorterDuff.Mode getSupportBackgroundTintMode() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner, android.widget.AdapterView, android.view.ViewGroup, android.view.View
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
DropdownPopup dropdownPopup = this.f;
|
||||
if (dropdownPopup == null || !dropdownPopup.c()) {
|
||||
return;
|
||||
}
|
||||
this.f.dismiss();
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner, android.widget.AbsSpinner, android.view.View
|
||||
protected void onMeasure(int i2, int i3) {
|
||||
super.onMeasure(i2, i3);
|
||||
if (this.f == null || View.MeasureSpec.getMode(i2) != Integer.MIN_VALUE) {
|
||||
return;
|
||||
}
|
||||
setMeasuredDimension(Math.min(Math.max(getMeasuredWidth(), a(getAdapter(), getBackground())), View.MeasureSpec.getSize(i2)), getMeasuredHeight());
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner, android.view.View
|
||||
public boolean onTouchEvent(MotionEvent motionEvent) {
|
||||
ForwardingListener forwardingListener = this.c;
|
||||
if (forwardingListener == null || !forwardingListener.onTouch(this, motionEvent)) {
|
||||
return super.onTouchEvent(motionEvent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner, android.view.View
|
||||
public boolean performClick() {
|
||||
DropdownPopup dropdownPopup = this.f;
|
||||
if (dropdownPopup == null) {
|
||||
return super.performClick();
|
||||
}
|
||||
if (dropdownPopup.c()) {
|
||||
return true;
|
||||
}
|
||||
this.f.a();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundDrawable(Drawable drawable) {
|
||||
super.setBackgroundDrawable(drawable);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundResource(int i2) {
|
||||
super.setBackgroundResource(i2);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(i2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public void setDropDownHorizontalOffset(int i2) {
|
||||
DropdownPopup dropdownPopup = this.f;
|
||||
if (dropdownPopup != null) {
|
||||
dropdownPopup.d(i2);
|
||||
} else if (Build.VERSION.SDK_INT >= 16) {
|
||||
super.setDropDownHorizontalOffset(i2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public void setDropDownVerticalOffset(int i2) {
|
||||
DropdownPopup dropdownPopup = this.f;
|
||||
if (dropdownPopup != null) {
|
||||
dropdownPopup.h(i2);
|
||||
} else if (Build.VERSION.SDK_INT >= 16) {
|
||||
super.setDropDownVerticalOffset(i2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public void setDropDownWidth(int i2) {
|
||||
if (this.f != null) {
|
||||
this.g = i2;
|
||||
} else if (Build.VERSION.SDK_INT >= 16) {
|
||||
super.setDropDownWidth(i2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public void setPopupBackgroundDrawable(Drawable drawable) {
|
||||
DropdownPopup dropdownPopup = this.f;
|
||||
if (dropdownPopup != null) {
|
||||
dropdownPopup.a(drawable);
|
||||
} else if (Build.VERSION.SDK_INT >= 16) {
|
||||
super.setPopupBackgroundDrawable(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public void setPopupBackgroundResource(int i2) {
|
||||
setPopupBackgroundDrawable(AppCompatResources.c(getPopupContext(), i2));
|
||||
}
|
||||
|
||||
@Override // android.widget.Spinner
|
||||
public void setPrompt(CharSequence charSequence) {
|
||||
DropdownPopup dropdownPopup = this.f;
|
||||
if (dropdownPopup != null) {
|
||||
dropdownPopup.a(charSequence);
|
||||
} else {
|
||||
super.setPrompt(charSequence);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.b(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatSpinner(Context context, AttributeSet attributeSet, int i2) {
|
||||
this(context, attributeSet, i2, -1);
|
||||
}
|
||||
|
||||
@Override // android.widget.AdapterView
|
||||
public void setAdapter(SpinnerAdapter spinnerAdapter) {
|
||||
if (!this.e) {
|
||||
this.d = spinnerAdapter;
|
||||
return;
|
||||
}
|
||||
super.setAdapter(spinnerAdapter);
|
||||
if (this.f != null) {
|
||||
Context context = this.b;
|
||||
if (context == null) {
|
||||
context = getContext();
|
||||
}
|
||||
this.f.a(new DropDownAdapter(spinnerAdapter, context.getTheme()));
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatSpinner(Context context, AttributeSet attributeSet, int i2, int i3) {
|
||||
this(context, attributeSet, i2, i3, null);
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:17:0x0056, code lost:
|
||||
|
||||
if (r12 != null) goto L22;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:18:0x0058, code lost:
|
||||
|
||||
r12.recycle();
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:21:0x006a, code lost:
|
||||
|
||||
if (r12 == null) goto L36;
|
||||
*/
|
||||
/* JADX WARN: Removed duplicated region for block: B:25:0x0070 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public AppCompatSpinner(android.content.Context r8, android.util.AttributeSet r9, int r10, int r11, android.content.res.Resources.Theme r12) {
|
||||
/*
|
||||
r7 = this;
|
||||
r7.<init>(r8, r9, r10)
|
||||
android.graphics.Rect r0 = new android.graphics.Rect
|
||||
r0.<init>()
|
||||
r7.h = r0
|
||||
int[] r0 = androidx.appcompat.R$styleable.Spinner
|
||||
r1 = 0
|
||||
androidx.appcompat.widget.TintTypedArray r0 = androidx.appcompat.widget.TintTypedArray.a(r8, r9, r0, r10, r1)
|
||||
androidx.appcompat.widget.AppCompatBackgroundHelper r2 = new androidx.appcompat.widget.AppCompatBackgroundHelper
|
||||
r2.<init>(r7)
|
||||
r7.a = r2
|
||||
r2 = 0
|
||||
if (r12 == 0) goto L23
|
||||
androidx.appcompat.view.ContextThemeWrapper r3 = new androidx.appcompat.view.ContextThemeWrapper
|
||||
r3.<init>(r8, r12)
|
||||
r7.b = r3
|
||||
goto L3e
|
||||
L23:
|
||||
int r12 = androidx.appcompat.R$styleable.Spinner_popupTheme
|
||||
int r12 = r0.g(r12, r1)
|
||||
if (r12 == 0) goto L33
|
||||
androidx.appcompat.view.ContextThemeWrapper r3 = new androidx.appcompat.view.ContextThemeWrapper
|
||||
r3.<init>(r8, r12)
|
||||
r7.b = r3
|
||||
goto L3e
|
||||
L33:
|
||||
int r12 = android.os.Build.VERSION.SDK_INT
|
||||
r3 = 23
|
||||
if (r12 >= r3) goto L3b
|
||||
r12 = r8
|
||||
goto L3c
|
||||
L3b:
|
||||
r12 = r2
|
||||
L3c:
|
||||
r7.b = r12
|
||||
L3e:
|
||||
android.content.Context r12 = r7.b
|
||||
r3 = 1
|
||||
if (r12 == 0) goto Lac
|
||||
r12 = -1
|
||||
if (r11 != r12) goto L74
|
||||
int[] r12 = androidx.appcompat.widget.AppCompatSpinner.i // Catch: java.lang.Throwable -> L5e java.lang.Exception -> L61
|
||||
android.content.res.TypedArray r12 = r8.obtainStyledAttributes(r9, r12, r10, r1) // Catch: java.lang.Throwable -> L5e java.lang.Exception -> L61
|
||||
boolean r4 = r12.hasValue(r1) // Catch: java.lang.Exception -> L5c java.lang.Throwable -> L6d
|
||||
if (r4 == 0) goto L56
|
||||
int r11 = r12.getInt(r1, r1) // Catch: java.lang.Exception -> L5c java.lang.Throwable -> L6d
|
||||
L56:
|
||||
if (r12 == 0) goto L74
|
||||
L58:
|
||||
r12.recycle()
|
||||
goto L74
|
||||
L5c:
|
||||
r4 = move-exception
|
||||
goto L63
|
||||
L5e:
|
||||
r8 = move-exception
|
||||
r12 = r2
|
||||
goto L6e
|
||||
L61:
|
||||
r4 = move-exception
|
||||
r12 = r2
|
||||
L63:
|
||||
java.lang.String r5 = "AppCompatSpinner"
|
||||
java.lang.String r6 = "Could not read android:spinnerMode"
|
||||
android.util.Log.i(r5, r6, r4) // Catch: java.lang.Throwable -> L6d
|
||||
if (r12 == 0) goto L74
|
||||
goto L58
|
||||
L6d:
|
||||
r8 = move-exception
|
||||
L6e:
|
||||
if (r12 == 0) goto L73
|
||||
r12.recycle()
|
||||
L73:
|
||||
throw r8
|
||||
L74:
|
||||
if (r11 != r3) goto Lac
|
||||
androidx.appcompat.widget.AppCompatSpinner$DropdownPopup r11 = new androidx.appcompat.widget.AppCompatSpinner$DropdownPopup
|
||||
android.content.Context r12 = r7.b
|
||||
r11.<init>(r12, r9, r10)
|
||||
android.content.Context r12 = r7.b
|
||||
int[] r4 = androidx.appcompat.R$styleable.Spinner
|
||||
androidx.appcompat.widget.TintTypedArray r12 = androidx.appcompat.widget.TintTypedArray.a(r12, r9, r4, r10, r1)
|
||||
int r1 = androidx.appcompat.R$styleable.Spinner_android_dropDownWidth
|
||||
r4 = -2
|
||||
int r1 = r12.f(r1, r4)
|
||||
r7.g = r1
|
||||
int r1 = androidx.appcompat.R$styleable.Spinner_android_popupBackground
|
||||
android.graphics.drawable.Drawable r1 = r12.b(r1)
|
||||
r11.a(r1)
|
||||
int r1 = androidx.appcompat.R$styleable.Spinner_android_prompt
|
||||
java.lang.String r1 = r0.d(r1)
|
||||
r11.a(r1)
|
||||
r12.a()
|
||||
r7.f = r11
|
||||
androidx.appcompat.widget.AppCompatSpinner$1 r12 = new androidx.appcompat.widget.AppCompatSpinner$1
|
||||
r12.<init>(r7)
|
||||
r7.c = r12
|
||||
Lac:
|
||||
int r11 = androidx.appcompat.R$styleable.Spinner_android_entries
|
||||
java.lang.CharSequence[] r11 = r0.f(r11)
|
||||
if (r11 == 0) goto Lc4
|
||||
android.widget.ArrayAdapter r12 = new android.widget.ArrayAdapter
|
||||
r1 = 17367048(0x1090008, float:2.5162948E-38)
|
||||
r12.<init>(r8, r1, r11)
|
||||
int r8 = androidx.appcompat.R$layout.support_simple_spinner_dropdown_item
|
||||
r12.setDropDownViewResource(r8)
|
||||
r7.setAdapter(r12)
|
||||
Lc4:
|
||||
r0.a()
|
||||
r7.e = r3
|
||||
android.widget.SpinnerAdapter r8 = r7.d
|
||||
if (r8 == 0) goto Ld2
|
||||
r7.setAdapter(r8)
|
||||
r7.d = r2
|
||||
Ld2:
|
||||
androidx.appcompat.widget.AppCompatBackgroundHelper r8 = r7.a
|
||||
r8.a(r9, r10)
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.AppCompatSpinner.<init>(android.content.Context, android.util.AttributeSet, int, int, android.content.res.Resources$Theme):void");
|
||||
}
|
||||
}
|
||||
338
sources/androidx/appcompat/widget/AppCompatTextHelper.java
Normal file
338
sources/androidx/appcompat/widget/AppCompatTextHelper.java
Normal file
@@ -0,0 +1,338 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.text.method.PasswordTransformationMethod;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.core.widget.AutoSizeableTextView;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class AppCompatTextHelper {
|
||||
private final TextView a;
|
||||
private TintInfo b;
|
||||
private TintInfo c;
|
||||
private TintInfo d;
|
||||
private TintInfo e;
|
||||
private TintInfo f;
|
||||
private TintInfo g;
|
||||
private final AppCompatTextViewAutoSizeHelper h;
|
||||
private int i = 0;
|
||||
private Typeface j;
|
||||
private boolean k;
|
||||
|
||||
AppCompatTextHelper(TextView textView) {
|
||||
this.a = textView;
|
||||
this.h = new AppCompatTextViewAutoSizeHelper(this.a);
|
||||
}
|
||||
|
||||
@SuppressLint({"NewApi"})
|
||||
void a(AttributeSet attributeSet, int i) {
|
||||
ColorStateList colorStateList;
|
||||
ColorStateList colorStateList2;
|
||||
boolean z;
|
||||
boolean z2;
|
||||
Context context = this.a.getContext();
|
||||
AppCompatDrawableManager a = AppCompatDrawableManager.a();
|
||||
TintTypedArray a2 = TintTypedArray.a(context, attributeSet, R$styleable.AppCompatTextHelper, i, 0);
|
||||
int g = a2.g(R$styleable.AppCompatTextHelper_android_textAppearance, -1);
|
||||
if (a2.g(R$styleable.AppCompatTextHelper_android_drawableLeft)) {
|
||||
this.b = a(context, a, a2.g(R$styleable.AppCompatTextHelper_android_drawableLeft, 0));
|
||||
}
|
||||
if (a2.g(R$styleable.AppCompatTextHelper_android_drawableTop)) {
|
||||
this.c = a(context, a, a2.g(R$styleable.AppCompatTextHelper_android_drawableTop, 0));
|
||||
}
|
||||
if (a2.g(R$styleable.AppCompatTextHelper_android_drawableRight)) {
|
||||
this.d = a(context, a, a2.g(R$styleable.AppCompatTextHelper_android_drawableRight, 0));
|
||||
}
|
||||
if (a2.g(R$styleable.AppCompatTextHelper_android_drawableBottom)) {
|
||||
this.e = a(context, a, a2.g(R$styleable.AppCompatTextHelper_android_drawableBottom, 0));
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 17) {
|
||||
if (a2.g(R$styleable.AppCompatTextHelper_android_drawableStart)) {
|
||||
this.f = a(context, a, a2.g(R$styleable.AppCompatTextHelper_android_drawableStart, 0));
|
||||
}
|
||||
if (a2.g(R$styleable.AppCompatTextHelper_android_drawableEnd)) {
|
||||
this.g = a(context, a, a2.g(R$styleable.AppCompatTextHelper_android_drawableEnd, 0));
|
||||
}
|
||||
}
|
||||
a2.a();
|
||||
boolean z3 = this.a.getTransformationMethod() instanceof PasswordTransformationMethod;
|
||||
boolean z4 = true;
|
||||
if (g != -1) {
|
||||
TintTypedArray a3 = TintTypedArray.a(context, g, R$styleable.TextAppearance);
|
||||
if (z3 || !a3.g(R$styleable.TextAppearance_textAllCaps)) {
|
||||
z = false;
|
||||
z2 = false;
|
||||
} else {
|
||||
z2 = a3.a(R$styleable.TextAppearance_textAllCaps, false);
|
||||
z = true;
|
||||
}
|
||||
a(context, a3);
|
||||
if (Build.VERSION.SDK_INT < 23) {
|
||||
ColorStateList a4 = a3.g(R$styleable.TextAppearance_android_textColor) ? a3.a(R$styleable.TextAppearance_android_textColor) : null;
|
||||
colorStateList2 = a3.g(R$styleable.TextAppearance_android_textColorHint) ? a3.a(R$styleable.TextAppearance_android_textColorHint) : null;
|
||||
ColorStateList colorStateList3 = a4;
|
||||
colorStateList = a3.g(R$styleable.TextAppearance_android_textColorLink) ? a3.a(R$styleable.TextAppearance_android_textColorLink) : null;
|
||||
r10 = colorStateList3;
|
||||
} else {
|
||||
colorStateList = null;
|
||||
colorStateList2 = null;
|
||||
}
|
||||
a3.a();
|
||||
} else {
|
||||
colorStateList = null;
|
||||
colorStateList2 = null;
|
||||
z = false;
|
||||
z2 = false;
|
||||
}
|
||||
TintTypedArray a5 = TintTypedArray.a(context, attributeSet, R$styleable.TextAppearance, i, 0);
|
||||
if (z3 || !a5.g(R$styleable.TextAppearance_textAllCaps)) {
|
||||
z4 = z;
|
||||
} else {
|
||||
z2 = a5.a(R$styleable.TextAppearance_textAllCaps, false);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < 23) {
|
||||
if (a5.g(R$styleable.TextAppearance_android_textColor)) {
|
||||
r10 = a5.a(R$styleable.TextAppearance_android_textColor);
|
||||
}
|
||||
if (a5.g(R$styleable.TextAppearance_android_textColorHint)) {
|
||||
colorStateList2 = a5.a(R$styleable.TextAppearance_android_textColorHint);
|
||||
}
|
||||
if (a5.g(R$styleable.TextAppearance_android_textColorLink)) {
|
||||
colorStateList = a5.a(R$styleable.TextAppearance_android_textColorLink);
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 28 && a5.g(R$styleable.TextAppearance_android_textSize) && a5.c(R$styleable.TextAppearance_android_textSize, -1) == 0) {
|
||||
this.a.setTextSize(0, 0.0f);
|
||||
}
|
||||
a(context, a5);
|
||||
a5.a();
|
||||
if (r10 != null) {
|
||||
this.a.setTextColor(r10);
|
||||
}
|
||||
if (colorStateList2 != null) {
|
||||
this.a.setHintTextColor(colorStateList2);
|
||||
}
|
||||
if (colorStateList != null) {
|
||||
this.a.setLinkTextColor(colorStateList);
|
||||
}
|
||||
if (!z3 && z4) {
|
||||
a(z2);
|
||||
}
|
||||
Typeface typeface = this.j;
|
||||
if (typeface != null) {
|
||||
this.a.setTypeface(typeface, this.i);
|
||||
}
|
||||
this.h.a(attributeSet, i);
|
||||
if (AutoSizeableTextView.w && this.h.f() != 0) {
|
||||
int[] e = this.h.e();
|
||||
if (e.length > 0) {
|
||||
if (this.a.getAutoSizeStepGranularity() != -1.0f) {
|
||||
this.a.setAutoSizeTextTypeUniformWithConfiguration(this.h.c(), this.h.b(), this.h.d(), 0);
|
||||
} else {
|
||||
this.a.setAutoSizeTextTypeUniformWithPresetSizes(e, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
TintTypedArray a6 = TintTypedArray.a(context, attributeSet, R$styleable.AppCompatTextView);
|
||||
int c = a6.c(R$styleable.AppCompatTextView_firstBaselineToTopHeight, -1);
|
||||
int c2 = a6.c(R$styleable.AppCompatTextView_lastBaselineToBottomHeight, -1);
|
||||
int c3 = a6.c(R$styleable.AppCompatTextView_lineHeight, -1);
|
||||
a6.a();
|
||||
if (c != -1) {
|
||||
TextViewCompat.a(this.a, c);
|
||||
}
|
||||
if (c2 != -1) {
|
||||
TextViewCompat.b(this.a, c2);
|
||||
}
|
||||
if (c3 != -1) {
|
||||
TextViewCompat.c(this.a, c3);
|
||||
}
|
||||
}
|
||||
|
||||
void b() {
|
||||
this.h.a();
|
||||
}
|
||||
|
||||
int c() {
|
||||
return this.h.b();
|
||||
}
|
||||
|
||||
int d() {
|
||||
return this.h.c();
|
||||
}
|
||||
|
||||
int e() {
|
||||
return this.h.d();
|
||||
}
|
||||
|
||||
int[] f() {
|
||||
return this.h.e();
|
||||
}
|
||||
|
||||
int g() {
|
||||
return this.h.f();
|
||||
}
|
||||
|
||||
boolean h() {
|
||||
return this.h.g();
|
||||
}
|
||||
|
||||
private void b(int i, float f) {
|
||||
this.h.a(i, f);
|
||||
}
|
||||
|
||||
private void a(Context context, TintTypedArray tintTypedArray) {
|
||||
String d;
|
||||
this.i = tintTypedArray.d(R$styleable.TextAppearance_android_textStyle, this.i);
|
||||
if (!tintTypedArray.g(R$styleable.TextAppearance_android_fontFamily) && !tintTypedArray.g(R$styleable.TextAppearance_fontFamily)) {
|
||||
if (tintTypedArray.g(R$styleable.TextAppearance_android_typeface)) {
|
||||
this.k = false;
|
||||
int d2 = tintTypedArray.d(R$styleable.TextAppearance_android_typeface, 1);
|
||||
if (d2 == 1) {
|
||||
this.j = Typeface.SANS_SERIF;
|
||||
return;
|
||||
} else if (d2 == 2) {
|
||||
this.j = Typeface.SERIF;
|
||||
return;
|
||||
} else {
|
||||
if (d2 != 3) {
|
||||
return;
|
||||
}
|
||||
this.j = Typeface.MONOSPACE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.j = null;
|
||||
int i = tintTypedArray.g(R$styleable.TextAppearance_fontFamily) ? R$styleable.TextAppearance_fontFamily : R$styleable.TextAppearance_android_fontFamily;
|
||||
if (!context.isRestricted()) {
|
||||
final WeakReference weakReference = new WeakReference(this.a);
|
||||
try {
|
||||
this.j = tintTypedArray.a(i, this.i, new ResourcesCompat.FontCallback() { // from class: androidx.appcompat.widget.AppCompatTextHelper.1
|
||||
@Override // androidx.core.content.res.ResourcesCompat.FontCallback
|
||||
public void a(int i2) {
|
||||
}
|
||||
|
||||
@Override // androidx.core.content.res.ResourcesCompat.FontCallback
|
||||
public void a(Typeface typeface) {
|
||||
AppCompatTextHelper.this.a(weakReference, typeface);
|
||||
}
|
||||
});
|
||||
this.k = this.j == null;
|
||||
} catch (Resources.NotFoundException | UnsupportedOperationException unused) {
|
||||
}
|
||||
}
|
||||
if (this.j != null || (d = tintTypedArray.d(i)) == null) {
|
||||
return;
|
||||
}
|
||||
this.j = Typeface.create(d, this.i);
|
||||
}
|
||||
|
||||
void a(WeakReference<TextView> weakReference, Typeface typeface) {
|
||||
if (this.k) {
|
||||
this.j = typeface;
|
||||
TextView textView = weakReference.get();
|
||||
if (textView != null) {
|
||||
textView.setTypeface(typeface, this.i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void a(Context context, int i) {
|
||||
ColorStateList a;
|
||||
TintTypedArray a2 = TintTypedArray.a(context, i, R$styleable.TextAppearance);
|
||||
if (a2.g(R$styleable.TextAppearance_textAllCaps)) {
|
||||
a(a2.a(R$styleable.TextAppearance_textAllCaps, false));
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < 23 && a2.g(R$styleable.TextAppearance_android_textColor) && (a = a2.a(R$styleable.TextAppearance_android_textColor)) != null) {
|
||||
this.a.setTextColor(a);
|
||||
}
|
||||
if (a2.g(R$styleable.TextAppearance_android_textSize) && a2.c(R$styleable.TextAppearance_android_textSize, -1) == 0) {
|
||||
this.a.setTextSize(0, 0.0f);
|
||||
}
|
||||
a(context, a2);
|
||||
a2.a();
|
||||
Typeface typeface = this.j;
|
||||
if (typeface != null) {
|
||||
this.a.setTypeface(typeface, this.i);
|
||||
}
|
||||
}
|
||||
|
||||
void a(boolean z) {
|
||||
this.a.setAllCaps(z);
|
||||
}
|
||||
|
||||
void a() {
|
||||
if (this.b != null || this.c != null || this.d != null || this.e != null) {
|
||||
Drawable[] compoundDrawables = this.a.getCompoundDrawables();
|
||||
a(compoundDrawables[0], this.b);
|
||||
a(compoundDrawables[1], this.c);
|
||||
a(compoundDrawables[2], this.d);
|
||||
a(compoundDrawables[3], this.e);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 17) {
|
||||
if (this.f == null && this.g == null) {
|
||||
return;
|
||||
}
|
||||
Drawable[] compoundDrawablesRelative = this.a.getCompoundDrawablesRelative();
|
||||
a(compoundDrawablesRelative[0], this.f);
|
||||
a(compoundDrawablesRelative[2], this.g);
|
||||
}
|
||||
}
|
||||
|
||||
private void a(Drawable drawable, TintInfo tintInfo) {
|
||||
if (drawable == null || tintInfo == null) {
|
||||
return;
|
||||
}
|
||||
AppCompatDrawableManager.a(drawable, tintInfo, this.a.getDrawableState());
|
||||
}
|
||||
|
||||
private static TintInfo a(Context context, AppCompatDrawableManager appCompatDrawableManager, int i) {
|
||||
ColorStateList b = appCompatDrawableManager.b(context, i);
|
||||
if (b == null) {
|
||||
return null;
|
||||
}
|
||||
TintInfo tintInfo = new TintInfo();
|
||||
tintInfo.d = true;
|
||||
tintInfo.a = b;
|
||||
return tintInfo;
|
||||
}
|
||||
|
||||
void a(boolean z, int i, int i2, int i3, int i4) {
|
||||
if (AutoSizeableTextView.w) {
|
||||
return;
|
||||
}
|
||||
b();
|
||||
}
|
||||
|
||||
void a(int i, float f) {
|
||||
if (AutoSizeableTextView.w || h()) {
|
||||
return;
|
||||
}
|
||||
b(i, f);
|
||||
}
|
||||
|
||||
void a(int i) {
|
||||
this.h.a(i);
|
||||
}
|
||||
|
||||
void a(int i, int i2, int i3, int i4) throws IllegalArgumentException {
|
||||
this.h.a(i, i2, i3, i4);
|
||||
}
|
||||
|
||||
void a(int[] iArr, int i) throws IllegalArgumentException {
|
||||
this.h.a(iArr, i);
|
||||
}
|
||||
}
|
||||
326
sources/androidx/appcompat/widget/AppCompatTextView.java
Normal file
326
sources/androidx/appcompat/widget/AppCompatTextView.java
Normal file
@@ -0,0 +1,326 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ActionMode;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
import android.widget.TextView;
|
||||
import androidx.core.text.PrecomputedTextCompat;
|
||||
import androidx.core.view.TintableBackgroundView;
|
||||
import androidx.core.widget.AutoSizeableTextView;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppCompatTextView extends TextView implements TintableBackgroundView, AutoSizeableTextView {
|
||||
private final AppCompatBackgroundHelper a;
|
||||
private final AppCompatTextHelper b;
|
||||
private Future<PrecomputedTextCompat> c;
|
||||
|
||||
public AppCompatTextView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
private void d() {
|
||||
Future<PrecomputedTextCompat> future = this.c;
|
||||
if (future != null) {
|
||||
try {
|
||||
this.c = null;
|
||||
TextViewCompat.a(this, future.get());
|
||||
} catch (InterruptedException | ExecutionException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
protected void drawableStateChanged() {
|
||||
super.drawableStateChanged();
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int getAutoSizeMaxTextSize() {
|
||||
if (AutoSizeableTextView.w) {
|
||||
return super.getAutoSizeMaxTextSize();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
return appCompatTextHelper.c();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int getAutoSizeMinTextSize() {
|
||||
if (AutoSizeableTextView.w) {
|
||||
return super.getAutoSizeMinTextSize();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
return appCompatTextHelper.d();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int getAutoSizeStepGranularity() {
|
||||
if (AutoSizeableTextView.w) {
|
||||
return super.getAutoSizeStepGranularity();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
return appCompatTextHelper.e();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int[] getAutoSizeTextAvailableSizes() {
|
||||
if (AutoSizeableTextView.w) {
|
||||
return super.getAutoSizeTextAvailableSizes();
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
return appCompatTextHelper != null ? appCompatTextHelper.f() : new int[0];
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int getAutoSizeTextType() {
|
||||
if (AutoSizeableTextView.w) {
|
||||
return super.getAutoSizeTextType() == 1 ? 1 : 0;
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
return appCompatTextHelper.g();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int getFirstBaselineToTopHeight() {
|
||||
return TextViewCompat.b(this);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public int getLastBaselineToBottomHeight() {
|
||||
return TextViewCompat.c(this);
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public ColorStateList getSupportBackgroundTintList() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.b();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public PorterDuff.Mode getSupportBackgroundTintMode() {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
return appCompatBackgroundHelper.c();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public CharSequence getText() {
|
||||
d();
|
||||
return super.getText();
|
||||
}
|
||||
|
||||
public PrecomputedTextCompat.Params getTextMetricsParamsCompat() {
|
||||
return TextViewCompat.f(this);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
|
||||
InputConnection onCreateInputConnection = super.onCreateInputConnection(editorInfo);
|
||||
AppCompatHintHelper.a(onCreateInputConnection, editorInfo, this);
|
||||
return onCreateInputConnection;
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
|
||||
super.onLayout(z, i, i2, i3, i4);
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(z, i, i2, i3, i4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
protected void onMeasure(int i, int i2) {
|
||||
d();
|
||||
super.onMeasure(i, i2);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
protected void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
||||
super.onTextChanged(charSequence, i, i2, i3);
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper == null || AutoSizeableTextView.w || !appCompatTextHelper.h()) {
|
||||
return;
|
||||
}
|
||||
this.b.b();
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setAutoSizeTextTypeUniformWithConfiguration(int i, int i2, int i3, int i4) throws IllegalArgumentException {
|
||||
if (AutoSizeableTextView.w) {
|
||||
super.setAutoSizeTextTypeUniformWithConfiguration(i, i2, i3, i4);
|
||||
return;
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(i, i2, i3, i4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setAutoSizeTextTypeUniformWithPresetSizes(int[] iArr, int i) throws IllegalArgumentException {
|
||||
if (AutoSizeableTextView.w) {
|
||||
super.setAutoSizeTextTypeUniformWithPresetSizes(iArr, i);
|
||||
return;
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(iArr, i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setAutoSizeTextTypeWithDefaults(int i) {
|
||||
if (AutoSizeableTextView.w) {
|
||||
super.setAutoSizeTextTypeWithDefaults(i);
|
||||
return;
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundDrawable(Drawable drawable) {
|
||||
super.setBackgroundDrawable(drawable);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundResource(int i) {
|
||||
super.setBackgroundResource(i);
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
|
||||
super.setCustomSelectionActionModeCallback(TextViewCompat.a(this, callback));
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setFirstBaselineToTopHeight(int i) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
super.setFirstBaselineToTopHeight(i);
|
||||
} else {
|
||||
TextViewCompat.a(this, i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setLastBaselineToBottomHeight(int i) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
super.setLastBaselineToBottomHeight(i);
|
||||
} else {
|
||||
TextViewCompat.b(this, i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setLineHeight(int i) {
|
||||
TextViewCompat.c(this, i);
|
||||
}
|
||||
|
||||
public void setPrecomputedText(PrecomputedTextCompat precomputedTextCompat) {
|
||||
TextViewCompat.a(this, precomputedTextCompat);
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.b(colorStateList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.TintableBackgroundView
|
||||
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
|
||||
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
||||
if (appCompatBackgroundHelper != null) {
|
||||
appCompatBackgroundHelper.a(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setTextAppearance(Context context, int i) {
|
||||
super.setTextAppearance(context, i);
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(context, i);
|
||||
}
|
||||
}
|
||||
|
||||
public void setTextFuture(Future<PrecomputedTextCompat> future) {
|
||||
this.c = future;
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
public void setTextMetricsParamsCompat(PrecomputedTextCompat.Params params) {
|
||||
TextViewCompat.a(this, params);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setTextSize(int i, float f) {
|
||||
if (AutoSizeableTextView.w) {
|
||||
super.setTextSize(i, f);
|
||||
return;
|
||||
}
|
||||
AppCompatTextHelper appCompatTextHelper = this.b;
|
||||
if (appCompatTextHelper != null) {
|
||||
appCompatTextHelper.a(i, f);
|
||||
}
|
||||
}
|
||||
|
||||
public AppCompatTextView(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, R.attr.textViewStyle);
|
||||
}
|
||||
|
||||
public AppCompatTextView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(TintContextWrapper.b(context), attributeSet, i);
|
||||
this.a = new AppCompatBackgroundHelper(this);
|
||||
this.a.a(attributeSet, i);
|
||||
this.b = new AppCompatTextHelper(this);
|
||||
this.b.a(attributeSet, i);
|
||||
this.b.a();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,419 @@
|
||||
package androidx.appcompat.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.RectF;
|
||||
import android.os.Build;
|
||||
import android.text.Layout;
|
||||
import android.text.StaticLayout;
|
||||
import android.text.TextDirectionHeuristic;
|
||||
import android.text.TextDirectionHeuristics;
|
||||
import android.text.TextPaint;
|
||||
import android.text.method.TransformationMethod;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.R$styleable;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class AppCompatTextViewAutoSizeHelper {
|
||||
private static final RectF k = new RectF();
|
||||
private static ConcurrentHashMap<String, Method> l = new ConcurrentHashMap<>();
|
||||
private int a = 0;
|
||||
private boolean b = false;
|
||||
private float c = -1.0f;
|
||||
private float d = -1.0f;
|
||||
private float e = -1.0f;
|
||||
private int[] f = new int[0];
|
||||
private boolean g = false;
|
||||
private TextPaint h;
|
||||
private final TextView i;
|
||||
private final Context j;
|
||||
|
||||
AppCompatTextViewAutoSizeHelper(TextView textView) {
|
||||
this.i = textView;
|
||||
this.j = this.i.getContext();
|
||||
}
|
||||
|
||||
private void h() {
|
||||
this.a = 0;
|
||||
this.d = -1.0f;
|
||||
this.e = -1.0f;
|
||||
this.c = -1.0f;
|
||||
this.f = new int[0];
|
||||
this.b = false;
|
||||
}
|
||||
|
||||
private boolean i() {
|
||||
if (k() && this.a == 1) {
|
||||
if (!this.g || this.f.length == 0) {
|
||||
float round = Math.round(this.d);
|
||||
int i = 1;
|
||||
while (Math.round(this.c + round) <= Math.round(this.e)) {
|
||||
i++;
|
||||
round += this.c;
|
||||
}
|
||||
int[] iArr = new int[i];
|
||||
float f = this.d;
|
||||
for (int i2 = 0; i2 < i; i2++) {
|
||||
iArr[i2] = Math.round(f);
|
||||
f += this.c;
|
||||
}
|
||||
this.f = a(iArr);
|
||||
}
|
||||
this.b = true;
|
||||
} else {
|
||||
this.b = false;
|
||||
}
|
||||
return this.b;
|
||||
}
|
||||
|
||||
private boolean j() {
|
||||
this.g = this.f.length > 0;
|
||||
if (this.g) {
|
||||
this.a = 1;
|
||||
int[] iArr = this.f;
|
||||
this.d = iArr[0];
|
||||
this.e = iArr[r0 - 1];
|
||||
this.c = -1.0f;
|
||||
}
|
||||
return this.g;
|
||||
}
|
||||
|
||||
private boolean k() {
|
||||
return !(this.i instanceof AppCompatEditText);
|
||||
}
|
||||
|
||||
void a(AttributeSet attributeSet, int i) {
|
||||
int resourceId;
|
||||
TypedArray obtainStyledAttributes = this.j.obtainStyledAttributes(attributeSet, R$styleable.AppCompatTextView, i, 0);
|
||||
if (obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeTextType)) {
|
||||
this.a = obtainStyledAttributes.getInt(R$styleable.AppCompatTextView_autoSizeTextType, 0);
|
||||
}
|
||||
float dimension = obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeStepGranularity) ? obtainStyledAttributes.getDimension(R$styleable.AppCompatTextView_autoSizeStepGranularity, -1.0f) : -1.0f;
|
||||
float dimension2 = obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeMinTextSize) ? obtainStyledAttributes.getDimension(R$styleable.AppCompatTextView_autoSizeMinTextSize, -1.0f) : -1.0f;
|
||||
float dimension3 = obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeMaxTextSize) ? obtainStyledAttributes.getDimension(R$styleable.AppCompatTextView_autoSizeMaxTextSize, -1.0f) : -1.0f;
|
||||
if (obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizePresetSizes) && (resourceId = obtainStyledAttributes.getResourceId(R$styleable.AppCompatTextView_autoSizePresetSizes, 0)) > 0) {
|
||||
TypedArray obtainTypedArray = obtainStyledAttributes.getResources().obtainTypedArray(resourceId);
|
||||
a(obtainTypedArray);
|
||||
obtainTypedArray.recycle();
|
||||
}
|
||||
obtainStyledAttributes.recycle();
|
||||
if (!k()) {
|
||||
this.a = 0;
|
||||
return;
|
||||
}
|
||||
if (this.a == 1) {
|
||||
if (!this.g) {
|
||||
DisplayMetrics displayMetrics = this.j.getResources().getDisplayMetrics();
|
||||
if (dimension2 == -1.0f) {
|
||||
dimension2 = TypedValue.applyDimension(2, 12.0f, displayMetrics);
|
||||
}
|
||||
if (dimension3 == -1.0f) {
|
||||
dimension3 = TypedValue.applyDimension(2, 112.0f, displayMetrics);
|
||||
}
|
||||
if (dimension == -1.0f) {
|
||||
dimension = 1.0f;
|
||||
}
|
||||
a(dimension2, dimension3, dimension);
|
||||
}
|
||||
i();
|
||||
}
|
||||
}
|
||||
|
||||
int b() {
|
||||
return Math.round(this.e);
|
||||
}
|
||||
|
||||
int c() {
|
||||
return Math.round(this.d);
|
||||
}
|
||||
|
||||
int d() {
|
||||
return Math.round(this.c);
|
||||
}
|
||||
|
||||
int[] e() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
int f() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
boolean g() {
|
||||
return k() && this.a != 0;
|
||||
}
|
||||
|
||||
void a(int i) {
|
||||
if (k()) {
|
||||
if (i == 0) {
|
||||
h();
|
||||
return;
|
||||
}
|
||||
if (i == 1) {
|
||||
DisplayMetrics displayMetrics = this.j.getResources().getDisplayMetrics();
|
||||
a(TypedValue.applyDimension(2, 12.0f, displayMetrics), TypedValue.applyDimension(2, 112.0f, displayMetrics), 1.0f);
|
||||
if (i()) {
|
||||
a();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown auto-size text type: " + i);
|
||||
}
|
||||
}
|
||||
|
||||
void a(int i, int i2, int i3, int i4) throws IllegalArgumentException {
|
||||
if (k()) {
|
||||
DisplayMetrics displayMetrics = this.j.getResources().getDisplayMetrics();
|
||||
a(TypedValue.applyDimension(i4, i, displayMetrics), TypedValue.applyDimension(i4, i2, displayMetrics), TypedValue.applyDimension(i4, i3, displayMetrics));
|
||||
if (i()) {
|
||||
a();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void a(int[] iArr, int i) throws IllegalArgumentException {
|
||||
if (k()) {
|
||||
int length = iArr.length;
|
||||
if (length > 0) {
|
||||
int[] iArr2 = new int[length];
|
||||
if (i == 0) {
|
||||
iArr2 = Arrays.copyOf(iArr, length);
|
||||
} else {
|
||||
DisplayMetrics displayMetrics = this.j.getResources().getDisplayMetrics();
|
||||
for (int i2 = 0; i2 < length; i2++) {
|
||||
iArr2[i2] = Math.round(TypedValue.applyDimension(i, iArr[i2], displayMetrics));
|
||||
}
|
||||
}
|
||||
this.f = a(iArr2);
|
||||
if (!j()) {
|
||||
throw new IllegalArgumentException("None of the preset sizes is valid: " + Arrays.toString(iArr));
|
||||
}
|
||||
} else {
|
||||
this.g = false;
|
||||
}
|
||||
if (i()) {
|
||||
a();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void a(TypedArray typedArray) {
|
||||
int length = typedArray.length();
|
||||
int[] iArr = new int[length];
|
||||
if (length > 0) {
|
||||
for (int i = 0; i < length; i++) {
|
||||
iArr[i] = typedArray.getDimensionPixelSize(i, -1);
|
||||
}
|
||||
this.f = a(iArr);
|
||||
j();
|
||||
}
|
||||
}
|
||||
|
||||
private int[] a(int[] iArr) {
|
||||
int length = iArr.length;
|
||||
if (length == 0) {
|
||||
return iArr;
|
||||
}
|
||||
Arrays.sort(iArr);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (int i : iArr) {
|
||||
if (i > 0 && Collections.binarySearch(arrayList, Integer.valueOf(i)) < 0) {
|
||||
arrayList.add(Integer.valueOf(i));
|
||||
}
|
||||
}
|
||||
if (length == arrayList.size()) {
|
||||
return iArr;
|
||||
}
|
||||
int size = arrayList.size();
|
||||
int[] iArr2 = new int[size];
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
iArr2[i2] = ((Integer) arrayList.get(i2)).intValue();
|
||||
}
|
||||
return iArr2;
|
||||
}
|
||||
|
||||
private void a(float f, float f2, float f3) throws IllegalArgumentException {
|
||||
if (f <= 0.0f) {
|
||||
throw new IllegalArgumentException("Minimum auto-size text size (" + f + "px) is less or equal to (0px)");
|
||||
}
|
||||
if (f2 <= f) {
|
||||
throw new IllegalArgumentException("Maximum auto-size text size (" + f2 + "px) is less or equal to minimum auto-size text size (" + f + "px)");
|
||||
}
|
||||
if (f3 > 0.0f) {
|
||||
this.a = 1;
|
||||
this.d = f;
|
||||
this.e = f2;
|
||||
this.c = f3;
|
||||
this.g = false;
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("The auto-size step granularity (" + f3 + "px) is less or equal to (0px)");
|
||||
}
|
||||
|
||||
void a() {
|
||||
if (g()) {
|
||||
if (this.b) {
|
||||
if (this.i.getMeasuredHeight() <= 0 || this.i.getMeasuredWidth() <= 0) {
|
||||
return;
|
||||
}
|
||||
int measuredWidth = ((Boolean) a((Object) this.i, "getHorizontallyScrolling", (String) false)).booleanValue() ? 1048576 : (this.i.getMeasuredWidth() - this.i.getTotalPaddingLeft()) - this.i.getTotalPaddingRight();
|
||||
int height = (this.i.getHeight() - this.i.getCompoundPaddingBottom()) - this.i.getCompoundPaddingTop();
|
||||
if (measuredWidth <= 0 || height <= 0) {
|
||||
return;
|
||||
}
|
||||
synchronized (k) {
|
||||
k.setEmpty();
|
||||
k.right = measuredWidth;
|
||||
k.bottom = height;
|
||||
float a = a(k);
|
||||
if (a != this.i.getTextSize()) {
|
||||
a(0, a);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.b = true;
|
||||
}
|
||||
}
|
||||
|
||||
void a(int i, float f) {
|
||||
Resources resources;
|
||||
Context context = this.j;
|
||||
if (context == null) {
|
||||
resources = Resources.getSystem();
|
||||
} else {
|
||||
resources = context.getResources();
|
||||
}
|
||||
a(TypedValue.applyDimension(i, f, resources.getDisplayMetrics()));
|
||||
}
|
||||
|
||||
private void a(float f) {
|
||||
if (f != this.i.getPaint().getTextSize()) {
|
||||
this.i.getPaint().setTextSize(f);
|
||||
boolean isInLayout = Build.VERSION.SDK_INT >= 18 ? this.i.isInLayout() : false;
|
||||
if (this.i.getLayout() != null) {
|
||||
this.b = false;
|
||||
try {
|
||||
Method a = a("nullLayouts");
|
||||
if (a != null) {
|
||||
a.invoke(this.i, new Object[0]);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.w("ACTVAutoSizeHelper", "Failed to invoke TextView#nullLayouts() method", e);
|
||||
}
|
||||
if (!isInLayout) {
|
||||
this.i.requestLayout();
|
||||
} else {
|
||||
this.i.forceLayout();
|
||||
}
|
||||
this.i.invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int a(RectF rectF) {
|
||||
int length = this.f.length;
|
||||
if (length != 0) {
|
||||
int i = length - 1;
|
||||
int i2 = 1;
|
||||
int i3 = 0;
|
||||
while (i2 <= i) {
|
||||
int i4 = (i2 + i) / 2;
|
||||
if (a(this.f[i4], rectF)) {
|
||||
int i5 = i4 + 1;
|
||||
i3 = i2;
|
||||
i2 = i5;
|
||||
} else {
|
||||
i3 = i4 - 1;
|
||||
i = i3;
|
||||
}
|
||||
}
|
||||
return this.f[i3];
|
||||
}
|
||||
throw new IllegalStateException("No available text sizes to choose from.");
|
||||
}
|
||||
|
||||
private boolean a(int i, RectF rectF) {
|
||||
StaticLayout a;
|
||||
CharSequence transformation;
|
||||
CharSequence text = this.i.getText();
|
||||
TransformationMethod transformationMethod = this.i.getTransformationMethod();
|
||||
if (transformationMethod != null && (transformation = transformationMethod.getTransformation(text, this.i)) != null) {
|
||||
text = transformation;
|
||||
}
|
||||
int maxLines = Build.VERSION.SDK_INT >= 16 ? this.i.getMaxLines() : -1;
|
||||
TextPaint textPaint = this.h;
|
||||
if (textPaint == null) {
|
||||
this.h = new TextPaint();
|
||||
} else {
|
||||
textPaint.reset();
|
||||
}
|
||||
this.h.set(this.i.getPaint());
|
||||
this.h.setTextSize(i);
|
||||
Layout.Alignment alignment = (Layout.Alignment) a((Object) this.i, "getLayoutAlignment", (String) Layout.Alignment.ALIGN_NORMAL);
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
a = a(text, alignment, Math.round(rectF.right), maxLines);
|
||||
} else {
|
||||
a = a(text, alignment, Math.round(rectF.right));
|
||||
}
|
||||
return (maxLines == -1 || (a.getLineCount() <= maxLines && a.getLineEnd(a.getLineCount() - 1) == text.length())) && ((float) a.getHeight()) <= rectF.bottom;
|
||||
}
|
||||
|
||||
private StaticLayout a(CharSequence charSequence, Layout.Alignment alignment, int i, int i2) {
|
||||
TextDirectionHeuristic textDirectionHeuristic = (TextDirectionHeuristic) a((Object) this.i, "getTextDirectionHeuristic", (String) TextDirectionHeuristics.FIRSTSTRONG_LTR);
|
||||
StaticLayout.Builder hyphenationFrequency = StaticLayout.Builder.obtain(charSequence, 0, charSequence.length(), this.h, i).setAlignment(alignment).setLineSpacing(this.i.getLineSpacingExtra(), this.i.getLineSpacingMultiplier()).setIncludePad(this.i.getIncludeFontPadding()).setBreakStrategy(this.i.getBreakStrategy()).setHyphenationFrequency(this.i.getHyphenationFrequency());
|
||||
if (i2 == -1) {
|
||||
i2 = Integer.MAX_VALUE;
|
||||
}
|
||||
return hyphenationFrequency.setMaxLines(i2).setTextDirection(textDirectionHeuristic).build();
|
||||
}
|
||||
|
||||
private StaticLayout a(CharSequence charSequence, Layout.Alignment alignment, int i) {
|
||||
float floatValue;
|
||||
float floatValue2;
|
||||
boolean booleanValue;
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
floatValue = this.i.getLineSpacingMultiplier();
|
||||
floatValue2 = this.i.getLineSpacingExtra();
|
||||
booleanValue = this.i.getIncludeFontPadding();
|
||||
} else {
|
||||
floatValue = ((Float) a((Object) this.i, "getLineSpacingMultiplier", (String) Float.valueOf(1.0f))).floatValue();
|
||||
floatValue2 = ((Float) a((Object) this.i, "getLineSpacingExtra", (String) Float.valueOf(0.0f))).floatValue();
|
||||
booleanValue = ((Boolean) a((Object) this.i, "getIncludeFontPadding", (String) true)).booleanValue();
|
||||
}
|
||||
return new StaticLayout(charSequence, this.h, i, alignment, floatValue, floatValue2, booleanValue);
|
||||
}
|
||||
|
||||
private <T> T a(Object obj, String str, T t) {
|
||||
try {
|
||||
return (T) a(str).invoke(obj, new Object[0]);
|
||||
} catch (Exception e) {
|
||||
Log.w("ACTVAutoSizeHelper", "Failed to invoke TextView#" + str + "() method", e);
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
private Method a(String str) {
|
||||
try {
|
||||
Method method = l.get(str);
|
||||
if (method == null && (method = TextView.class.getDeclaredMethod(str, new Class[0])) != null) {
|
||||
method.setAccessible(true);
|
||||
l.put(str, method);
|
||||
}
|
||||
return method;
|
||||
} catch (Exception e) {
|
||||
Log.w("ACTVAutoSizeHelper", "Failed to retrieve TextView#" + str + "() method", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user