Supporting Android material design -
Supporting Android material design -
we're redesigning our android app , question rises considering upcoming android l platform material style: ways of supporting older devices? new design acceptable on 4.x devices?
according android material design compatibility docs
i'm going rehash material here incase link gets taken down, in near future.
for material theme
the material theme available in android l developer preview. configure app utilize material theme on devices running android l developer preview , older theme on devices running before versions of android:
define theme inherits older theme (like holo) in res/values/styles.xml. define theme same name inherits material theme in res/values-v21/styles.xml. set theme app's theme in manifest file.
as layouts
if layouts design according material design guidelines not utilize of new xml attributes android l developer preview, work on previous versions of android. otherwise, can provide alternative layouts. can provide alternative layouts customize how app looks on before versions of android.
create layout files android l developer preview within res/layout-v21/ , alternative layout files before versions of android within res/layout/. alternative layouts have same file name.
to avoid duplication of code, define styles within res/values/ , modify styles in res/values-v21/ new apis.
for ui widgets
the recyclerview , cardview widgets included in android l developer preview back upwards library, available in before versions of android these limitations:
cardview falls programmatic shadow implementation using additional padding. cardview not clip children views intersect rounded corners. these limitations not apply android l developer preview.
and lastly animations
the next new apis available in android l developer preview:
activity transitions, touch feedback, reveal animations, path-based animations. preserve compatibility before verisons of android, check scheme version @ runtime before invoke these apis.
android material android-5.0-lollipop
Comments
Post a Comment