android - Dynamically Created Radio Button or CheckBox does not use Color Accent -
android - Dynamically Created Radio Button or CheckBox does not use Color Accent -
using v21 appcompat can set custom color themes following:
<style name="theme.mytheme" parent="theme.appcompat"> <!-- customize color palette --> <item name="colorprimary">@color/primary</item> <item name="colorprimarydark">@color/primary_dark</item> <item name="coloraccent">@color/accent</item> </style>
but have bunch of dynamically created checkboxes , radio buttons which not inflated xml. these dynamically created objects not inherit color accent have specified. can set these color accents properly?
you can't other creating layout file 1 checkbox in , inflate it.
as developers site stated: the material theme design can applied when loading views using layout inflater.
this because new material design backport hooks layout inflation process.
source: http://android-developers.blogspot.nl/2014/10/appcompat-v21-material-design-for-pre.html
edit: in newer versions 22.1+ of appcompat v7 widgets checkbox , radiobutton can created dynamically (no longer hidden/internal api).
currently these widgets supported:
appcompatautocompletetextview appcompatbutton appcompatcheckbox appcompatcheckedtextview appcompatedittext appcompatmultiautocompletetextview appcompatradiobutton appcompatratingbar appcompatspinner appcompattextview appcompatseekbar (since 23.1) appcompatimagebutton (since 23.1) appcompatimageview (since 23.1) android themes android-5.0-lollipop appcompat
Comments
Post a Comment