theme should we implement? - How should we inherit and manage themes? - How can we change theme and night mode dynamically? 2. Theme attributes - Which attributes affect where? - How can we find all the attributes for AppCompat and Material Components? - Which should we apply theme or style?
theme should we implement? - How should we inherit and manage themes? - How can we change theme and night mode dynamically? 2. Theme attributes - Which attributes affect where? - How can we find all the attributes for AppCompat and Material Components? - Which should we apply theme or style?
theme should we implement? - How should we inherit and manage themes? - How can we change theme and night mode dynamically? 2. Theme attributes - Which attributes affect where? - How can we find all the attributes for AppCompat and Material Components? - Which should we apply theme or style?
</style> parent (higher priority than dot style) dot Theme.AppCompat.Light.NoActionBar inherites Theme.AppCompat.Light with some attributes which is related to ActionBar.
use the platform styles on API 28+ --> <item name="dialogCornerRadius">?android:attr/dialogCornerRadius</item> </style> parent="Base.Theme.AppCompat.Light"/>
prefix. • ThemeOverlay Special themes that overlay the base theme and redefine some of the properties to be applied to a specific views. Theme.AppCompat.Light.DarkActionBar Prefix
https://github.com/material-components/material-components-android/blob/ master/lib/java/com/google/android/material/theme/res/values/themes.xml • Design Same as AppCompat. Just alias defined by MaterialComponents. Theme.AppCompat.Light.DarkActionBar Theme (Library) name
but also define the mandatory new Material Components theme attributes to migrate to MaterialComponents easily. https://github.com/material-components/material-components-android/blob/master/docs/getting- started.md#bridge-themes-bridge-themes
each categories to a simple markdown table. https://github.com/konifar/android-theme-attrs-to-markdown-table • This repository would be help you to find the attribute and know each meaning.
colorAccent colorSecondary FAB, ProgressBar colorBackground colorBackground Background colorBackgroundFloating colorSurface CardView Differences between AppCompat and MC
Default values are defined in themes_base.xml Android Platform: https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/res/res/values/ styles.xml AppCompat: https://github.com/aosp-mirror/platform_frameworks_support/blob/master/v7/appcompat/res/values/ styles_base.xml Material Components: Each styles.xml in https://github.com/material-components/material-components-android/tree/ master/lib/java/com/google/android/material
by using theme. • If the design is common in the app, it should be defined as theme. • If the widget font or shape is specific in the app, it should be defined as style and apply it in layout.xml.