Android Material Design: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
=Introduction=
With Android lollipop (21) wcan the RecyclerView and CardView. The page will cover
List and Card Views
*RecyclerView
*CardView
Views and Shadows
*Elevation
*Clipping View
Animation
*Touch Feedback (Ripple)
*Circular Reveal
*Activity Transitions
Not Covered
*Path-Based Animations
*Vector Drawables
*Drawable Tinting
=Basics=
=Basics=
The theme is defined in the styles.xml. You have to make sure the minSdkVersion is compatible with the theme. The backward compatible themes without Material Design is
The theme is defined in the styles.xml. You have to make sure the minSdkVersion is compatible with the theme. The backward compatible themes without Material Design is
Line 22: Line 6:
Theme.AppCompat.Light.DarkActionBar
Theme.AppCompat.Light.DarkActionBar
Theme.AppCompat.Light.NoActionBar
Theme.AppCompat.Light.NoActionBar
</syntaxhightlight>
</syntaxhighlight>
The equivalent Material Themes are
The equivalent Material Themes are
<syntaxhightlight lang="xml">
<syntaxhighlight lang="xml">
android.style/Theme.Material
android.style/Theme.Material
android.style/Theme.Material.Light
android.style/Theme.Material.Light
Line 30: Line 14:
android.style/Theme.Material.Light.NoActionBar
android.style/Theme.Material.Light.NoActionBar
</syntaxhighlight>
</syntaxhighlight>
 
To support older phones we are required to provide a drawable-v21, values-v21 and layout-v21 if we want to be backward compatible.
==Colors==
==Colors==
*Primary
*Primary
*Primary Dark
*Primary Dark
*Accent
*Accent

Revision as of 00:02, 23 December 2020

Basics

The theme is defined in the styles.xml. You have to make sure the minSdkVersion is compatible with the theme. The backward compatible themes without Material Design is

Theme.AppCompat
Theme.AppCompat.Light
Theme.AppCompat.Light.DarkActionBar
Theme.AppCompat.Light.NoActionBar

The equivalent Material Themes are

android.style/Theme.Material
android.style/Theme.Material.Light
android.style/Theme.Material.Light.DarkActionBar
android.style/Theme.Material.Light.NoActionBar

To support older phones we are required to provide a drawable-v21, values-v21 and layout-v21 if we want to be backward compatible.

Colors

  • Primary
  • Primary Dark
  • Accent