Android Studio - Material Design (Stile, Colori e controlli) inizio
Relative Layout
Nello Styles appena creato, realizziamo questo.
styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/design_default_color_primary</item>
<item name="colorPrimaryDark">@color/design_default_color_primary_dark</item>
<item name="colorAccent">@color/design_default_color_surface</item>
</style>
</resources>
colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
→ Material Design opzioni
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.MaterialComponents">
<item name="colorPrimary">@color/design_default_color_primary</item>
<item name="colorPrimaryDark">@color/design_default_color_primary_dark</item>
<item name="colorAccent">@color/design_default_color_surface</item>
</style>
</resources>
Progettazione Material Design
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
{
}
else
{
}