Migrate to AGP 8.7

This commit is contained in:
Hunter Stich 2024-11-10 07:21:52 -08:00
parent 43fa5b69cd
commit cd2d3af658
57 changed files with 160 additions and 145 deletions

View File

@ -4,7 +4,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.7.2'
}
}

View File

@ -103,6 +103,7 @@ def srcDirs = [
]
android {
namespace "io.material.catalog"
defaultConfig {
manifestPlaceholders = [
application_name : 'CatalogApplication',

View File

@ -99,7 +99,7 @@ public class BottomSheetMainDemoFragment extends DemoFragment {
// Opt in to perform swipe to dismiss animation when dismissing bottom sheet dialog.
bottomSheetDialog.setDismissWithAnimation(true);
windowPreferencesManager.applyEdgeToEdgePreference(bottomSheetDialog.getWindow());
View bottomSheetInternal = bottomSheetDialog.findViewById(R.id.design_bottom_sheet);
View bottomSheetInternal = bottomSheetDialog.findViewById(com.google.android.material.R.id.design_bottom_sheet);
BottomSheetBehavior.from(bottomSheetInternal).setPeekHeight(peekHeightPx);
View button = view.findViewById(R.id.bottomsheet_button);
button.setOnClickListener(

View File

@ -66,7 +66,7 @@ public class BottomSheetUnscrollableContentDemoFragment extends DemoFragment {
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(getContext());
new WindowPreferencesManager(requireContext()).applyEdgeToEdgePreference(bottomSheetDialog.getWindow());
bottomSheetDialog.setContentView(R.layout.cat_bottomsheet_unscrollable_content);
View bottomSheetInternal = bottomSheetDialog.findViewById(R.id.design_bottom_sheet);
View bottomSheetInternal = bottomSheetDialog.findViewById(com.google.android.material.R.id.design_bottom_sheet);
BottomSheetBehavior.from(bottomSheetInternal).setPeekHeight(400);
View bottomSheetContent = bottomSheetInternal.findViewById(R.id.bottom_drawer_3);

View File

@ -54,7 +54,7 @@ public class ButtonToggleGroupDemoFragment extends DemoFragment {
View view =
layoutInflater.inflate(getButtonToggleGroupContent(), viewGroup, /* attachToRoot= */ false);
MaterialSwitch requireSelectionToggle = view.findViewById(R.id.switch_toggle);
defaultInset = getResources().getDimensionPixelSize(R.dimen.mtrl_btn_inset);
defaultInset = getResources().getDimensionPixelSize(com.google.android.material.R.dimen.mtrl_btn_inset);
List<MaterialButtonToggleGroup> toggleGroups =
DemoUtils.findViewsWithType(view, MaterialButtonToggleGroup.class);
requireSelectionToggle.setOnCheckedChangeListener(

View File

@ -64,10 +64,10 @@ public class ColorHarmonizationDemoActivity extends DemoActivity {
R.id.cat_colors_error,
R.id.cat_colors_harmonized_error,
new int[] {
R.attr.colorError,
R.attr.colorOnError,
R.attr.colorErrorContainer,
R.attr.colorOnErrorContainer
androidx.appcompat.R.attr.colorError,
com.google.android.material.R.attr.colorOnError,
com.google.android.material.R.attr.colorErrorContainer,
com.google.android.material.R.attr.colorOnErrorContainer
},
R.array.cat_error_strings),
new ColorHarmonizationGridRowData(

View File

@ -68,111 +68,111 @@ public final class ColorMainDemoFragment extends DemoFragment {
return Arrays.asList(
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_background, android.R.attr.colorBackground),
new ColorRoleItem(R.string.cat_color_role_on_background, R.attr.colorOnBackground)),
new ColorRoleItem(R.string.cat_color_role_on_background, com.google.android.material.R.attr.colorOnBackground)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_surface, R.attr.colorSurface),
new ColorRoleItem(R.string.cat_color_role_on_surface, R.attr.colorOnSurface)),
new ColorRoleItem(R.string.cat_color_role_surface, com.google.android.material.R.attr.colorSurface),
new ColorRoleItem(R.string.cat_color_role_on_surface, com.google.android.material.R.attr.colorOnSurface)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_surface_variant, R.attr.colorSurfaceVariant),
new ColorRoleItem(R.string.cat_color_role_surface_variant, com.google.android.material.R.attr.colorSurfaceVariant),
new ColorRoleItem(
R.string.cat_color_role_on_surface_variant, R.attr.colorOnSurfaceVariant)),
R.string.cat_color_role_on_surface_variant, com.google.android.material.R.attr.colorOnSurfaceVariant)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_inverse_surface, R.attr.colorSurfaceInverse),
new ColorRoleItem(R.string.cat_color_role_inverse_surface, com.google.android.material.R.attr.colorSurfaceInverse),
new ColorRoleItem(
R.string.cat_color_role_inverse_on_surface, R.attr.colorOnSurfaceInverse)),
R.string.cat_color_role_inverse_on_surface, com.google.android.material.R.attr.colorOnSurfaceInverse)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_surface_bright, R.attr.colorSurfaceBright),
new ColorRoleItem(R.string.cat_color_role_surface_dim, R.attr.colorSurfaceDim)),
new ColorRoleItem(R.string.cat_color_role_surface_bright, com.google.android.material.R.attr.colorSurfaceBright),
new ColorRoleItem(R.string.cat_color_role_surface_dim, com.google.android.material.R.attr.colorSurfaceDim)),
new ColorRow(
new ColorRoleItem(
R.string.cat_color_role_surface_container_low, R.attr.colorSurfaceContainerLow),
R.string.cat_color_role_surface_container_low, com.google.android.material.R.attr.colorSurfaceContainerLow),
new ColorRoleItem(
R.string.cat_color_role_surface_container_high, R.attr.colorSurfaceContainerHigh)),
R.string.cat_color_role_surface_container_high, com.google.android.material.R.attr.colorSurfaceContainerHigh)),
new ColorRow(
new ColorRoleItem(
R.string.cat_color_role_surface_container_lowest,
R.attr.colorSurfaceContainerLowest),
com.google.android.material.R.attr.colorSurfaceContainerLowest),
new ColorRoleItem(
R.string.cat_color_role_surface_container_highest,
R.attr.colorSurfaceContainerHighest)),
com.google.android.material.R.attr.colorSurfaceContainerHighest)),
new ColorRow(
new ColorRoleItem(
R.string.cat_color_role_surface_container, R.attr.colorSurfaceContainer),
R.string.cat_color_role_surface_container, com.google.android.material.R.attr.colorSurfaceContainer),
null));
}
private List<ColorRow> getColorRolesContent() {
return Arrays.asList(
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_primary, R.attr.colorPrimary),
new ColorRoleItem(R.string.cat_color_role_on_primary, R.attr.colorOnPrimary)),
new ColorRoleItem(R.string.cat_color_role_primary, androidx.appcompat.R.attr.colorPrimary),
new ColorRoleItem(R.string.cat_color_role_on_primary, com.google.android.material.R.attr.colorOnPrimary)),
new ColorRow(
new ColorRoleItem(
R.string.cat_color_role_primary_container, R.attr.colorPrimaryContainer),
R.string.cat_color_role_primary_container, com.google.android.material.R.attr.colorPrimaryContainer),
new ColorRoleItem(
R.string.cat_color_role_on_primary_container, R.attr.colorOnPrimaryContainer)),
R.string.cat_color_role_on_primary_container, com.google.android.material.R.attr.colorOnPrimaryContainer)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_primary_fixed, R.attr.colorPrimaryFixed),
new ColorRoleItem(R.string.cat_color_role_primary_fixed, com.google.android.material.R.attr.colorPrimaryFixed),
new ColorRoleItem(
R.string.cat_color_role_primary_fixed_dim, R.attr.colorPrimaryFixedDim)),
R.string.cat_color_role_primary_fixed_dim, com.google.android.material.R.attr.colorPrimaryFixedDim)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_on_primary_fixed, R.attr.colorOnPrimaryFixed),
new ColorRoleItem(R.string.cat_color_role_on_primary_fixed, com.google.android.material.R.attr.colorOnPrimaryFixed),
new ColorRoleItem(
R.string.cat_color_role_on_primary_fixed_variant,
R.attr.colorOnPrimaryFixedVariant)),
com.google.android.material.R.attr.colorOnPrimaryFixedVariant)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_inverse_primary, R.attr.colorPrimaryInverse),
new ColorRoleItem(R.string.cat_color_role_inverse_primary, com.google.android.material.R.attr.colorPrimaryInverse),
/* colorRoleItemRight= */ null),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_secondary, R.attr.colorSecondary),
new ColorRoleItem(R.string.cat_color_role_on_secondary, R.attr.colorOnSecondary)),
new ColorRoleItem(R.string.cat_color_role_secondary, com.google.android.material.R.attr.colorSecondary),
new ColorRoleItem(R.string.cat_color_role_on_secondary, com.google.android.material.R.attr.colorOnSecondary)),
new ColorRow(
new ColorRoleItem(
R.string.cat_color_role_secondary_container, R.attr.colorSecondaryContainer),
R.string.cat_color_role_secondary_container, com.google.android.material.R.attr.colorSecondaryContainer),
new ColorRoleItem(
R.string.cat_color_role_on_secondary_container, R.attr.colorOnSecondaryContainer)),
R.string.cat_color_role_on_secondary_container, com.google.android.material.R.attr.colorOnSecondaryContainer)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_secondary_fixed, R.attr.colorSecondaryFixed),
new ColorRoleItem(R.string.cat_color_role_secondary_fixed, com.google.android.material.R.attr.colorSecondaryFixed),
new ColorRoleItem(
R.string.cat_color_role_secondary_fixed_dim, R.attr.colorSecondaryFixedDim)),
R.string.cat_color_role_secondary_fixed_dim, com.google.android.material.R.attr.colorSecondaryFixedDim)),
new ColorRow(
new ColorRoleItem(
R.string.cat_color_role_on_secondary_fixed, R.attr.colorOnSecondaryFixed),
R.string.cat_color_role_on_secondary_fixed, com.google.android.material.R.attr.colorOnSecondaryFixed),
new ColorRoleItem(
R.string.cat_color_role_on_secondary_fixed_variant,
R.attr.colorOnSecondaryFixedVariant)),
com.google.android.material.R.attr.colorOnSecondaryFixedVariant)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_tertiary, R.attr.colorTertiary),
new ColorRoleItem(R.string.cat_color_role_on_tertiary, R.attr.colorOnTertiary)),
new ColorRoleItem(R.string.cat_color_role_tertiary, com.google.android.material.R.attr.colorTertiary),
new ColorRoleItem(R.string.cat_color_role_on_tertiary, com.google.android.material.R.attr.colorOnTertiary)),
new ColorRow(
new ColorRoleItem(
R.string.cat_color_role_tertiary_container, R.attr.colorTertiaryContainer),
R.string.cat_color_role_tertiary_container, com.google.android.material.R.attr.colorTertiaryContainer),
new ColorRoleItem(
R.string.cat_color_role_on_tertiary_container, R.attr.colorOnTertiaryContainer)),
R.string.cat_color_role_on_tertiary_container, com.google.android.material.R.attr.colorOnTertiaryContainer)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_tertiary_fixed, R.attr.colorTertiaryFixed),
new ColorRoleItem(R.string.cat_color_role_tertiary_fixed, com.google.android.material.R.attr.colorTertiaryFixed),
new ColorRoleItem(
R.string.cat_color_role_tertiary_fixed_dim, R.attr.colorTertiaryFixedDim)),
R.string.cat_color_role_tertiary_fixed_dim, com.google.android.material.R.attr.colorTertiaryFixedDim)),
new ColorRow(
new ColorRoleItem(
R.string.cat_color_role_on_tertiary_fixed, R.attr.colorOnTertiaryFixed),
R.string.cat_color_role_on_tertiary_fixed, com.google.android.material.R.attr.colorOnTertiaryFixed),
new ColorRoleItem(
R.string.cat_color_role_on_tertiary_fixed_variant,
R.attr.colorOnTertiaryFixedVariant)));
com.google.android.material.R.attr.colorOnTertiaryFixedVariant)));
}
private List<ColorRow> getColorRolesUtility() {
return Arrays.asList(
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_error, R.attr.colorError),
new ColorRoleItem(R.string.cat_color_role_on_error, R.attr.colorOnError)),
new ColorRoleItem(R.string.cat_color_role_error, androidx.appcompat.R.attr.colorError),
new ColorRoleItem(R.string.cat_color_role_on_error, com.google.android.material.R.attr.colorOnError)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_error_container, R.attr.colorErrorContainer),
new ColorRoleItem(R.string.cat_color_role_error_container, com.google.android.material.R.attr.colorErrorContainer),
new ColorRoleItem(
R.string.cat_color_role_on_error_container, R.attr.colorOnErrorContainer)),
R.string.cat_color_role_on_error_container, com.google.android.material.R.attr.colorOnErrorContainer)),
new ColorRow(
new ColorRoleItem(R.string.cat_color_role_outline, R.attr.colorOutline),
new ColorRoleItem(R.string.cat_color_role_outline, com.google.android.material.R.attr.colorOutline),
new ColorRoleItem(
R.string.cat_color_role_outline_variant, R.attr.colorOutlineVariant)));
R.string.cat_color_role_outline_variant, com.google.android.material.R.attr.colorOutlineVariant)));
}
}

View File

@ -43,11 +43,11 @@ class BackgroundHighlightDecorator extends DayViewDecorator {
public void initialize(@NonNull Context context) {
int highlightColor =
MaterialColors.getColor(
context, R.attr.colorTertiary, BackgroundHighlightDecorator.class.getSimpleName());
context, com.google.android.material.R.attr.colorTertiary, BackgroundHighlightDecorator.class.getSimpleName());
backgroundHighlightColor = ColorStateList.valueOf(highlightColor);
int textColor =
MaterialColors.getColor(
context, R.attr.colorOnTertiary, BackgroundHighlightDecorator.class.getSimpleName());
context, com.google.android.material.R.attr.colorOnTertiary, BackgroundHighlightDecorator.class.getSimpleName());
textHighlightColor = ColorStateList.valueOf(textColor);
}

View File

@ -134,10 +134,10 @@ class CircleIndicatorDecorator extends DayViewDecorator {
resources.getDimensionPixelSize(R.dimen.cat_picker_demo_circle_indicator_top_spacer_size);
int indicatorColorDefault =
MaterialColors.getColor(
context, R.attr.colorTertiary, IndicatorDrawables.class.getSimpleName());
context, com.google.android.material.R.attr.colorTertiary, IndicatorDrawables.class.getSimpleName());
int indicatorColorSelected =
MaterialColors.getColor(
context, R.attr.colorOnPrimary, IndicatorDrawables.class.getSimpleName());
context, com.google.android.material.R.attr.colorOnPrimary, IndicatorDrawables.class.getSimpleName());
topSpacerDrawable = createSpacerDrawable(topSpacerSize);
indicatorDrawableNone = createIndicatorDrawable(Color.TRANSPARENT);

View File

@ -94,8 +94,8 @@ public class DatePickerMainDemoFragment extends DemoFragment {
MaterialButton launcher = root.findViewById(R.id.cat_picker_launch_button);
snackbar = Snackbar.make(viewGroup, R.string.cat_picker_no_action, Snackbar.LENGTH_LONG);
int dialogTheme = resolveOrThrow(getContext(), R.attr.materialCalendarTheme);
int fullscreenTheme = resolveOrThrow(getContext(), R.attr.materialCalendarFullscreenTheme);
int dialogTheme = resolveOrThrow(getContext(), com.google.android.material.R.attr.materialCalendarTheme);
int fullscreenTheme = resolveOrThrow(getContext(), com.google.android.material.R.attr.materialCalendarFullscreenTheme);
final RadioGroup selectionMode = root.findViewById(R.id.cat_picker_date_selector_group);
final RadioGroup theme = root.findViewById(R.id.cat_picker_theme_group);
@ -267,7 +267,7 @@ public class DatePickerMainDemoFragment extends DemoFragment {
String titleAndDescriptionText =
context.getString(R.string.cat_picker_title_description_main) + alarmTimes;
SpannableString spannable = new SpannableString(titleAndDescriptionText);
int alarmTimesColor = resolveOrThrow(context, R.attr.colorPrimary);
int alarmTimesColor = resolveOrThrow(context, androidx.appcompat.R.attr.colorPrimary);
int spanStart = titleAndDescriptionText.indexOf(alarmTimes);
int spanEnd = spanStart + alarmTimes.length();
spannable.setSpan(

View File

@ -309,7 +309,7 @@ public class DialogMainDemoFragment extends DemoFragment {
@StyleRes
protected int getCenteredTitleThemeOverlay() {
return R.style.ThemeOverlay_Material3_MaterialAlertDialog_Centered;
return com.google.android.material.R.style.ThemeOverlay_Material3_MaterialAlertDialog_Centered;
}
@StyleRes

View File

@ -103,7 +103,7 @@ public abstract class DemoActivity extends BaseCatalogActivity {
MaterialContainerTransform transform = new MaterialContainerTransform(this, entering);
transform.addTarget(android.R.id.content);
transform.setContainerColor(
MaterialColors.getColor(findViewById(android.R.id.content), R.attr.colorSurface));
MaterialColors.getColor(findViewById(android.R.id.content), com.google.android.material.R.attr.colorSurface));
transform.setFadeMode(MaterialContainerTransform.FADE_MODE_THROUGH);
return transform;
}

View File

@ -94,7 +94,7 @@ public abstract class DemoLandingFragment extends DaggerFragment {
TypedArray a =
toolbarContext
.getTheme()
.obtainStyledAttributes(new int[] {R.attr.colorOnSurfaceVariant, R.attr.colorPrimary});
.obtainStyledAttributes(new int[] {com.google.android.material.R.attr.colorOnSurfaceVariant, androidx.appcompat.R.attr.colorPrimary});
menuIconColorUnchecked = a.getColor(0, 0);
menuIconColorChecked = a.getColor(1, 0);
a.recycle();

View File

@ -69,7 +69,7 @@ public abstract class FeatureDemoUtils {
Context context = currentFragment.requireContext();
MaterialContainerTransform transform =
new MaterialContainerTransform(context, /* entering= */ true);
transform.setContainerColor(MaterialColors.getColor(sharedElement, R.attr.colorSurface));
transform.setContainerColor(MaterialColors.getColor(sharedElement, com.google.android.material.R.attr.colorSurface));
transform.setFadeMode(MaterialContainerTransform.FADE_MODE_THROUGH);
fragment.setSharedElementEnterTransition(transform);
transaction.addSharedElement(sharedElement, sharedElementName);
@ -90,10 +90,10 @@ public abstract class FeatureDemoUtils {
}
} else {
transaction.setCustomAnimations(
R.anim.abc_grow_fade_in_from_bottom,
R.anim.abc_fade_out,
R.anim.abc_fade_in,
R.anim.abc_shrink_fade_out_from_bottom);
androidx.appcompat.R.anim.abc_grow_fade_in_from_bottom,
androidx.appcompat.R.anim.abc_fade_out,
androidx.appcompat.R.anim.abc_fade_in,
androidx.appcompat.R.anim.abc_shrink_fade_out_from_bottom);
}
transaction

View File

@ -123,7 +123,7 @@ public final class MemoryView extends AppCompatTextView {
TypedValue typedValue = new TypedValue();
getContext()
.getTheme()
.resolveAttribute(R.attr.colorPrimary, typedValue, true);
.resolveAttribute(androidx.appcompat.R.attr.colorPrimary, typedValue, true);
int colorPrimary = typedValue.data;
paint.setColor(colorPrimary);

View File

@ -43,7 +43,7 @@ public class LoadingIndicatorMainDemoFragment extends DemoFragment {
R.layout.cat_loading_indicator_fragment, viewGroup, false /* attachToRoot */);
LoadingIndicatorSpec spec =
new LoadingIndicatorSpec(getContext(), null, 0, R.style.Widget_Material3_LoadingIndicator);
new LoadingIndicatorSpec(getContext(), null, 0, com.google.android.material.R.style.Widget_Material3_LoadingIndicator);
spec.setScaleToFit(true);
LoadingIndicatorDrawable loadingIndicatorDrawable =
LoadingIndicatorDrawable.create(getContext(), spec);

View File

@ -173,7 +173,7 @@ public class MenuMainDemoFragment extends DemoFragment {
private ListPopupWindow initializeListPopupMenu(View v) {
ListPopupWindow listPopupWindow =
new ListPopupWindow(getContext(), null, R.attr.listPopupWindowStyle);
new ListPopupWindow(getContext(), null, androidx.appcompat.R.attr.listPopupWindowStyle);
ArrayAdapter<CharSequence> adapter =
new ArrayAdapter<>(
getContext(),
@ -198,7 +198,7 @@ public class MenuMainDemoFragment extends DemoFragment {
Context context = textView.getContext();
CharSequence text = textView.getText();
TypedValue value = new TypedValue();
context.getTheme().resolveAttribute(R.attr.colorPrimary, value, true);
context.getTheme().resolveAttribute(androidx.appcompat.R.attr.colorPrimary, value, true);
Spannable spanText = Spannable.Factory.getInstance().newSpannable(text);
spanText.setSpan(
new BackgroundColorSpan(value.data), 0, text.length(), SPAN_EXCLUSIVE_EXCLUSIVE);

View File

@ -61,6 +61,6 @@ public class ProgressIndicatorStandaloneDemoFragment extends ProgressIndicatorDe
@StyleRes
protected int getSpecStyleResId() {
return R.style.Widget_Material3_CircularProgressIndicator_ExtraSmall;
return com.google.android.material.R.style.Widget_Material3_CircularProgressIndicator_ExtraSmall;
}
}

View File

@ -52,7 +52,7 @@ public abstract class ShapeThemingDemoFragment extends DemoFragment {
final TypedValue value = new TypedValue();
wrappedContext
.getTheme()
.resolveAttribute(R.attr.colorPrimaryDark, value, true);
.resolveAttribute(androidx.appcompat.R.attr.colorPrimaryDark, value, true);
window.setStatusBarColor(value.data);
return super.onCreateView(layoutInflaterWithThemedContext, viewGroup, bundle);
@ -84,7 +84,7 @@ public abstract class ShapeThemingDemoFragment extends DemoFragment {
materialButton.setOnClickListener(v -> materialAlertDialogBuilder.show());
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(wrappedContext);
bottomSheetDialog.setContentView(R.layout.cat_shape_theming_bottomsheet_content);
View bottomSheetInternal = bottomSheetDialog.findViewById(R.id.design_bottom_sheet);
View bottomSheetInternal = bottomSheetDialog.findViewById(com.google.android.material.R.id.design_bottom_sheet);
BottomSheetBehavior.from(bottomSheetInternal).setPeekHeight(300);
MaterialButton button = container.findViewById(R.id.material_button_2);
button.setOnClickListener(v -> bottomSheetDialog.show());

View File

@ -254,7 +254,7 @@ public class SideSheetMainDemoFragment extends DemoFragment {
setUpModalSheet(
getDetachedModalThemeOverlayResId(),
R.layout.cat_sidesheet_content,
R.id.m3_side_sheet,
com.google.android.material.R.id.m3_side_sheet,
R.id.side_sheet_title_text,
R.string.cat_sidesheet_modal_detached_title,
showDetachedModalSheetButton,
@ -264,7 +264,7 @@ public class SideSheetMainDemoFragment extends DemoFragment {
private void setUpModalSheet() {
setUpModalSheet(
R.layout.cat_sidesheet_content,
R.id.m3_side_sheet,
com.google.android.material.R.id.m3_side_sheet,
R.id.side_sheet_title_text,
R.string.cat_sidesheet_modal_title,
showModalSheetButton,

View File

@ -64,7 +64,7 @@ public class TopAppBarCollapsingMultilineDemoFragment extends DemoFragment {
Toolbar toolbar = view.findViewById(R.id.toolbar);
AppCompatActivity activity = (AppCompatActivity) getActivity();
activity.setSupportActionBar(toolbar);
colorPrimary = MaterialColors.getColor(view, R.attr.colorPrimary);
colorPrimary = MaterialColors.getColor(view, androidx.appcompat.R.attr.colorPrimary);
return view;
}

View File

@ -60,7 +60,7 @@ public class TopAppBarCompressEffectFragment extends DemoFragment {
AppBarLayout appBarLayout = view.findViewById(R.id.appbarlayout);
appBarLayout.setStatusBarForegroundColor(
MaterialColors.getColor(appBarLayout, R.attr.colorSurface));
MaterialColors.getColor(appBarLayout, com.google.android.material.R.attr.colorSurface));
TabLayout tabs = view.findViewById(R.id.tabs);
ToggleButton showHideTabsButton = view.findViewById(R.id.show_hide_tabs_button);

View File

@ -53,7 +53,7 @@ public class TopAppBarScrollingDemoFragment extends DemoFragment {
AppBarLayout appBarLayout = view.findViewById(R.id.appbarlayout);
appBarLayout.setStatusBarForegroundColor(
MaterialColors.getColor(appBarLayout, R.attr.colorSurface));
MaterialColors.getColor(appBarLayout, com.google.android.material.R.attr.colorSurface));
return view;
}

View File

@ -167,7 +167,7 @@ public class TransitionContainerTransformDemoFragment extends DemoFragment {
// For all 3 container layer colors, use colorSurface since this transform can be configured
// using any fade mode and some of the start views don't have a background and the end view
// doesn't have a background.
int colorSurface = MaterialColors.getColor(requireView(), R.attr.colorSurface);
int colorSurface = MaterialColors.getColor(requireView(), com.google.android.material.R.attr.colorSurface);
MaterialContainerTransform enterContainerTransform = buildContainerTransform(true);
enterContainerTransform.setAllContainerColors(colorSurface);

View File

@ -69,7 +69,7 @@ public class TransitionContainerTransformEndDemoActivity extends DemoActivity {
// and some of the start views don't have a background and the end view doesn't have a
// background.
transform.setAllContainerColors(
MaterialColors.getColor(findViewById(android.R.id.content), R.attr.colorSurface));
MaterialColors.getColor(findViewById(android.R.id.content), com.google.android.material.R.attr.colorSurface));
transform.addTarget(android.R.id.content);
configurationHelper.configure(transform, entering);
return transform;

Binary file not shown.

View File

@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

29
gradlew vendored
View File

@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@ -133,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \

View File

@ -1,5 +1,6 @@
import org.gradle.internal.os.OperatingSystem
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
@ -99,6 +100,8 @@ def srcDirs = [
]
android {
namespace "com.google.android.material"
sourceSets {
main.manifest.srcFile 'java/com/google/android/material/AndroidManifest.xml'
main.java.srcDir 'java'
@ -269,7 +272,7 @@ afterEvaluate {
publications {
release(MavenPublication) {
from components.release
from components.findByName('release')
artifact androidSourcesJar

View File

@ -93,7 +93,7 @@ public class MaterialToolbar extends Toolbar {
}
public MaterialToolbar(@NonNull Context context, @Nullable AttributeSet attrs) {
this(context, attrs, R.attr.toolbarStyle);
this(context, attrs, androidx.appcompat.R.attr.toolbarStyle);
}
public MaterialToolbar(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {

View File

@ -143,11 +143,11 @@ class MaterialCardViewHelper {
TypedArray cardViewAttributes =
card.getContext()
.obtainStyledAttributes(attrs, R.styleable.CardView, defStyleAttr, R.style.CardView);
if (cardViewAttributes.hasValue(R.styleable.CardView_cardCornerRadius)) {
.obtainStyledAttributes(attrs, androidx.cardview.R.styleable.CardView, defStyleAttr, androidx.cardview.R.style.CardView);
if (cardViewAttributes.hasValue(androidx.cardview.R.styleable.CardView_cardCornerRadius)) {
// If cardCornerRadius is set, let it override the shape appearance.
shapeAppearanceModelBuilder.setAllCornerSizes(
cardViewAttributes.getDimension(R.styleable.CardView_cardCornerRadius, 0));
cardViewAttributes.getDimension(androidx.cardview.R.styleable.CardView_cardCornerRadius, 0));
}
foregroundContentDrawable = new MaterialShapeDrawable();
@ -199,7 +199,7 @@ class MaterialCardViewHelper {
if (rippleColor == null) {
rippleColor =
ColorStateList.valueOf(
MaterialColors.getColor(materialCardView, R.attr.colorControlHighlight));
MaterialColors.getColor(materialCardView, androidx.appcompat.R.attr.colorControlHighlight));
}
ColorStateList foregroundColor =

View File

@ -207,7 +207,7 @@ public class CarouselLayoutManager extends LayoutManager
if (attrs != null) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Carousel);
setCarouselAlignment(a.getInt(R.styleable.Carousel_carousel_alignment, ALIGNMENT_START));
setOrientation(a.getInt(R.styleable.RecyclerView_android_orientation, HORIZONTAL));
setOrientation(a.getInt(androidx.recyclerview.R.styleable.RecyclerView_android_orientation, HORIZONTAL));
a.recycle();
}
}

View File

@ -229,7 +229,7 @@ public class MaterialCheckBox extends AppCompatCheckBox {
}
public MaterialCheckBox(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, R.attr.checkboxStyle);
this(context, attrs, androidx.appcompat.R.attr.checkboxStyle);
}
public MaterialCheckBox(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
@ -813,8 +813,8 @@ public class MaterialCheckBox extends AppCompatCheckBox {
private ColorStateList getMaterialThemeColorsTintList() {
if (materialThemeColorsTintList == null) {
int[] checkBoxColorsList = new int[CHECKBOX_STATES.length];
int colorControlActivated = MaterialColors.getColor(this, R.attr.colorControlActivated);
int colorError = MaterialColors.getColor(this, R.attr.colorError);
int colorControlActivated = MaterialColors.getColor(this, androidx.appcompat.R.attr.colorControlActivated);
int colorError = MaterialColors.getColor(this, androidx.appcompat.R.attr.colorError);
int colorSurface = MaterialColors.getColor(this, R.attr.colorSurface);
int colorOnSurface = MaterialColors.getColor(this, R.attr.colorOnSurface);

View File

@ -33,7 +33,7 @@ public final class HarmonizedColorAttributes {
private static final int[] HARMONIZED_MATERIAL_ATTRIBUTES =
new int[] {
R.attr.colorError,
androidx.appcompat.R.attr.colorError,
R.attr.colorOnError,
R.attr.colorErrorContainer,
R.attr.colorOnErrorContainer

View File

@ -80,7 +80,7 @@ public class HarmonizedColorsOptions {
@NonNull @ColorRes private int[] colorResourceIds = new int[] {};
@Nullable private HarmonizedColorAttributes colorAttributes;
@AttrRes private int colorAttributeToHarmonizeWith = R.attr.colorPrimary;
@AttrRes private int colorAttributeToHarmonizeWith = androidx.appcompat.R.attr.colorPrimary;
/**
* Sets the array of color resource ids for harmonization.

View File

@ -263,7 +263,7 @@ public class MaterialColors {
public static int harmonizeWithPrimary(@NonNull Context context, @ColorInt int colorToHarmonize) {
return harmonize(
colorToHarmonize,
getColor(context, R.attr.colorPrimary, MaterialColors.class.getCanonicalName()));
getColor(context, androidx.appcompat.R.attr.colorPrimary, MaterialColors.class.getCanonicalName()));
}
/**
@ -348,7 +348,7 @@ public class MaterialColors {
static boolean isLightTheme(@NonNull Context context) {
return MaterialAttributes.resolveBoolean(
context, R.attr.isLightTheme, /* defaultValue= */ true);
context, androidx.appcompat.R.attr.isLightTheme, /* defaultValue= */ true);
}
@ColorInt

View File

@ -72,7 +72,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
*/
public class MaterialAlertDialogBuilder extends AlertDialog.Builder {
@AttrRes private static final int DEF_STYLE_ATTR = R.attr.alertDialogStyle;
@AttrRes private static final int DEF_STYLE_ATTR = androidx.appcompat.R.attr.alertDialogStyle;
@StyleRes private static final int DEF_STYLE_RES = R.style.MaterialAlertDialog_MaterialComponents;
@AttrRes

View File

@ -41,7 +41,7 @@ import com.google.android.material.resources.MaterialAttributes;
@RestrictTo(LIBRARY_GROUP)
public final class ThemeEnforcement {
private static final int[] APPCOMPAT_CHECK_ATTRS = {R.attr.colorPrimary};
private static final int[] APPCOMPAT_CHECK_ATTRS = {androidx.appcompat.R.attr.colorPrimary};
private static final String APPCOMPAT_THEME_NAME = "Theme.AppCompat";
private static final int[] MATERIAL_CHECK_ATTRS = {R.attr.colorPrimaryVariant};

View File

@ -271,7 +271,7 @@ public final class LoadingIndicator extends View implements Drawable.Callback {
public void setIndicatorColor(@ColorInt int... indicatorColors) {
if (indicatorColors.length == 0) {
// Uses theme primary color for indicator by default. Indicator color cannot be empty.
indicatorColors = new int[] {MaterialColors.getColor(getContext(), R.attr.colorPrimary, -1)};
indicatorColors = new int[] {MaterialColors.getColor(getContext(), androidx.appcompat.R.attr.colorPrimary, -1)};
}
if (!Arrays.equals(getIndicatorColor(), indicatorColors)) {
specs.indicatorColors = indicatorColors;

View File

@ -85,7 +85,7 @@ public final class LoadingIndicatorSpec {
private void loadIndicatorColors(@NonNull Context context, @NonNull TypedArray typedArray) {
if (!typedArray.hasValue(R.styleable.LoadingIndicator_indicatorColor)) {
// Uses theme primary color for indicator if not provided in the attribute set.
indicatorColors = new int[] {MaterialColors.getColor(context, R.attr.colorPrimary, -1)};
indicatorColors = new int[] {MaterialColors.getColor(context, androidx.appcompat.R.attr.colorPrimary, -1)};
return;
}

View File

@ -587,7 +587,7 @@ public abstract class BaseProgressIndicator<S extends BaseProgressIndicatorSpec>
public void setIndicatorColor(@ColorInt int... indicatorColors) {
if (indicatorColors.length == 0) {
// Uses theme primary color for indicator by default. Indicator color cannot be empty.
indicatorColors = new int[] {MaterialColors.getColor(getContext(), R.attr.colorPrimary, -1)};
indicatorColors = new int[] {MaterialColors.getColor(getContext(), androidx.appcompat.R.attr.colorPrimary, -1)};
}
if (!Arrays.equals(getIndicatorColor(), indicatorColors)) {
spec.indicatorColors = indicatorColors;

View File

@ -153,7 +153,7 @@ public abstract class BaseProgressIndicatorSpec {
private void loadIndicatorColors(@NonNull Context context, @NonNull TypedArray typedArray) {
if (!typedArray.hasValue(R.styleable.BaseProgressIndicator_indicatorColor)) {
// Uses theme primary color for indicator if not provided in the attribute set.
indicatorColors = new int[] {MaterialColors.getColor(context, R.attr.colorPrimary, -1)};
indicatorColors = new int[] {MaterialColors.getColor(context, androidx.appcompat.R.attr.colorPrimary, -1)};
return;
}

View File

@ -64,7 +64,7 @@ public class MaterialRadioButton extends AppCompatRadioButton {
}
public MaterialRadioButton(@NonNull Context context, @Nullable AttributeSet attrs) {
this(context, attrs, R.attr.radioButtonStyle);
this(context, attrs, androidx.appcompat.R.attr.radioButtonStyle);
}
public MaterialRadioButton(
@ -122,7 +122,7 @@ public class MaterialRadioButton extends AppCompatRadioButton {
private ColorStateList getMaterialThemeColorsTintList() {
if (materialThemeColorsTintList == null) {
int colorControlActivated = MaterialColors.getColor(this, R.attr.colorControlActivated);
int colorControlActivated = MaterialColors.getColor(this, androidx.appcompat.R.attr.colorControlActivated);
int colorOnSurface = MaterialColors.getColor(this, R.attr.colorOnSurface);
int colorSurface = MaterialColors.getColor(this, R.attr.colorSurface);

View File

@ -200,9 +200,9 @@ public class MaterialResources {
return defValue;
}
TypedArray a = context.obtainStyledAttributes(textAppearance, R.styleable.TextAppearance);
TypedArray a = context.obtainStyledAttributes(textAppearance, androidx.appcompat.R.styleable.TextAppearance);
TypedValue v = new TypedValue();
boolean available = a.getValue(R.styleable.TextAppearance_android_textSize, v);
boolean available = a.getValue(androidx.appcompat.R.styleable.TextAppearance_android_textSize, v);
a.recycle();
if (!available) {

View File

@ -86,34 +86,34 @@ public class TextAppearance {
/** Parses the given TextAppearance style resource. */
public TextAppearance(@NonNull Context context, @StyleRes int id) {
TypedArray a = context.obtainStyledAttributes(id, R.styleable.TextAppearance);
TypedArray a = context.obtainStyledAttributes(id, androidx.appcompat.R.styleable.TextAppearance);
setTextSize(a.getDimension(R.styleable.TextAppearance_android_textSize, 0f));
setTextSize(a.getDimension(androidx.appcompat.R.styleable.TextAppearance_android_textSize, 0f));
setTextColor(
MaterialResources.getColorStateList(
context, a, R.styleable.TextAppearance_android_textColor));
context, a, androidx.appcompat.R.styleable.TextAppearance_android_textColor));
textColorHint =
MaterialResources.getColorStateList(
context, a, R.styleable.TextAppearance_android_textColorHint);
context, a, androidx.appcompat.R.styleable.TextAppearance_android_textColorHint);
textColorLink =
MaterialResources.getColorStateList(
context, a, R.styleable.TextAppearance_android_textColorLink);
textStyle = a.getInt(R.styleable.TextAppearance_android_textStyle, Typeface.NORMAL);
typeface = a.getInt(R.styleable.TextAppearance_android_typeface, TYPEFACE_SANS);
context, a, androidx.appcompat.R.styleable.TextAppearance_android_textColorLink);
textStyle = a.getInt(androidx.appcompat.R.styleable.TextAppearance_android_textStyle, Typeface.NORMAL);
typeface = a.getInt(androidx.appcompat.R.styleable.TextAppearance_android_typeface, TYPEFACE_SANS);
int fontFamilyIndex =
MaterialResources.getIndexWithValue(
a,
R.styleable.TextAppearance_fontFamily,
R.styleable.TextAppearance_android_fontFamily);
androidx.appcompat.R.styleable.TextAppearance_fontFamily,
androidx.appcompat.R.styleable.TextAppearance_android_fontFamily);
fontFamilyResourceId = a.getResourceId(fontFamilyIndex, 0);
fontFamily = a.getString(fontFamilyIndex);
textAllCaps = a.getBoolean(R.styleable.TextAppearance_textAllCaps, false);
textAllCaps = a.getBoolean(androidx.appcompat.R.styleable.TextAppearance_textAllCaps, false);
shadowColor =
MaterialResources.getColorStateList(
context, a, R.styleable.TextAppearance_android_shadowColor);
shadowDx = a.getFloat(R.styleable.TextAppearance_android_shadowDx, 0);
shadowDy = a.getFloat(R.styleable.TextAppearance_android_shadowDy, 0);
shadowRadius = a.getFloat(R.styleable.TextAppearance_android_shadowRadius, 0);
context, a, androidx.appcompat.R.styleable.TextAppearance_android_shadowColor);
shadowDx = a.getFloat(androidx.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
shadowDy = a.getFloat(androidx.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
shadowRadius = a.getFloat(androidx.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
a.recycle();

View File

@ -229,7 +229,7 @@ public class RippleUtils {
new InsetDrawable(maskDrawable, padding, padding, padding, padding);
return new RippleDrawable(
MaterialColors.getColorStateList(
context, R.attr.colorControlHighlight, ColorStateList.valueOf(Color.TRANSPARENT)),
context, androidx.appcompat.R.attr.colorControlHighlight, ColorStateList.valueOf(Color.TRANSPARENT)),
null,
maskWithPaddings);
}

View File

@ -254,7 +254,7 @@ public class SearchBar extends Toolbar {
backgroundShape.setStroke(strokeWidth, strokeColor);
}
int rippleColor = MaterialColors.getColor(this, R.attr.colorControlHighlight);
int rippleColor = MaterialColors.getColor(this, androidx.appcompat.R.attr.colorControlHighlight);
Drawable background;
backgroundShape.setFillColor(ColorStateList.valueOf(backgroundColor));
background =

View File

@ -63,7 +63,7 @@ public class SwitchMaterial extends SwitchCompat {
}
public SwitchMaterial(@NonNull Context context, @Nullable AttributeSet attrs) {
this(context, attrs, R.attr.switchStyle);
this(context, attrs, androidx.appcompat.R.attr.switchStyle);
}
public SwitchMaterial(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
@ -120,7 +120,7 @@ public class SwitchMaterial extends SwitchCompat {
private ColorStateList getMaterialThemeColorsThumbTintList() {
if (materialThemeColorsThumbTintList == null) {
int colorSurface = MaterialColors.getColor(this, R.attr.colorSurface);
int colorControlActivated = MaterialColors.getColor(this, R.attr.colorControlActivated);
int colorControlActivated = MaterialColors.getColor(this, androidx.appcompat.R.attr.colorControlActivated);
float thumbElevation = getResources().getDimension(R.dimen.mtrl_switch_thumb_elevation);
if (elevationOverlayProvider.isThemeElevationOverlayEnabled()) {
thumbElevation += ViewUtils.getParentAbsoluteElevation(this);
@ -145,7 +145,7 @@ public class SwitchMaterial extends SwitchCompat {
if (materialThemeColorsTrackTintList == null) {
int[] switchTrackColorsList = new int[ENABLED_CHECKED_STATES.length];
int colorSurface = MaterialColors.getColor(this, R.attr.colorSurface);
int colorControlActivated = MaterialColors.getColor(this, R.attr.colorControlActivated);
int colorControlActivated = MaterialColors.getColor(this, androidx.appcompat.R.attr.colorControlActivated);
int colorOnSurface = MaterialColors.getColor(this, R.attr.colorOnSurface);
switchTrackColorsList[0] =
MaterialColors.layer(colorSurface, colorControlActivated, MaterialColors.ALPHA_MEDIUM);

View File

@ -90,7 +90,7 @@ public class MaterialAutoCompleteTextView extends AppCompatAutoCompleteTextView
public MaterialAutoCompleteTextView(
@NonNull Context context, @Nullable AttributeSet attributeSet) {
this(context, attributeSet, R.attr.autoCompleteTextViewStyle);
this(context, attributeSet, androidx.appcompat.R.attr.autoCompleteTextViewStyle);
}
public MaterialAutoCompleteTextView(
@ -105,7 +105,7 @@ public class MaterialAutoCompleteTextView extends AppCompatAutoCompleteTextView
attributeSet,
R.styleable.MaterialAutoCompleteTextView,
defStyleAttr,
R.style.Widget_AppCompat_AutoCompleteTextView);
androidx.appcompat.R.style.Widget_AppCompat_AutoCompleteTextView);
// Due to a framework bug, setting android:inputType="none" on xml has no effect. Therefore,
// we check it here in case the autoCompleteTextView should be non-editable.

View File

@ -66,7 +66,7 @@ public class TextInputEditText extends AppCompatEditText {
}
public TextInputEditText(@NonNull Context context, @Nullable AttributeSet attrs) {
this(context, attrs, R.attr.editTextStyle);
this(context, attrs, androidx.appcompat.R.attr.editTextStyle);
}
public TextInputEditText(

View File

@ -868,7 +868,7 @@ public class TextInputLayout extends LinearLayout implements OnGlobalLayoutListe
return boxBackground;
}
int rippleColor = MaterialColors.getColor(editText, R.attr.colorControlHighlight);
int rippleColor = MaterialColors.getColor(editText, androidx.appcompat.R.attr.colorControlHighlight);
if (boxBackgroundMode == TextInputLayout.BOX_BACKGROUND_OUTLINE) {
return getOutlinedBoxBackgroundWithRipple(
getContext(), boxBackground, rippleColor, EDIT_TEXT_BACKGROUND_RIPPLE_STATE);
@ -2877,7 +2877,7 @@ public class TextInputLayout extends LinearLayout implements OnGlobalLayoutListe
if (useDefaultColor) {
// Probably caused by our theme not extending from Theme.Design*. Instead
// we manually set something appropriate
TextViewCompat.setTextAppearance(textView, R.style.TextAppearance_AppCompat_Caption);
TextViewCompat.setTextAppearance(textView, androidx.appcompat.R.style.TextAppearance_AppCompat_Caption);
textView.setTextColor(ContextCompat.getColor(getContext(), R.color.design_error));
}
}
@ -4539,7 +4539,7 @@ public class TextInputLayout extends LinearLayout implements OnGlobalLayoutListe
private void updateCursorColor() {
ColorStateList color = cursorColor != null
? cursorColor
: MaterialColors.getColorStateListOrNull(getContext(), R.attr.colorControlActivated);
: MaterialColors.getColorStateListOrNull(getContext(), androidx.appcompat.R.attr.colorControlActivated);
if (editText == null || editText.getTextCursorDrawable() == null) {
// If there's no cursor, return.

View File

@ -46,7 +46,7 @@ public class MaterialThemeOverlay {
}
private static final int[] ANDROID_THEME_OVERLAY_ATTRS =
new int[] {android.R.attr.theme, R.attr.theme};
new int[] {android.R.attr.theme, androidx.appcompat.R.attr.theme};
private static final int[] MATERIAL_THEME_OVERLAY_ATTR = new int[] {R.attr.materialThemeOverlay};

View File

@ -27,6 +27,7 @@ dependencies {
}
android {
namespace "com.google.android.material.testapp.animation"
sourceSets {
main.manifest.srcFile 'AndroidManifest.xml'
main.java.srcDirs = [ '.' ]

View File

@ -23,6 +23,7 @@ dependencies {
}
android {
namespace "com.google.android.material.testapp.base"
sourceSets {
main.manifest.srcFile 'AndroidManifest.xml'
main.java.srcDirs = [ '.' ]

View File

@ -13,6 +13,7 @@ dependencies {
}
android {
namespace "com.google.android.material.testapp"
defaultConfig {
multiDexEnabled true
minSdkVersion 21

View File

@ -10,6 +10,7 @@ dependencies {
}
android {
namespace "com.google.android.material.testapp.custom"
sourceSets {
main.manifest.srcFile 'AndroidManifest.xml'
main.java.srcDirs = [ '.' ]

View File

@ -32,6 +32,7 @@ dependencies {
}
android {
namespace "com.google.android.material.testapp.theme"
sourceSets {
main.manifest.srcFile 'AndroidManifest.xml'
main.java.srcDirs = [ '.' ]