Guest User

Untitled

a guest
Jun 30th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
  2.  
  3. All Clickable Views:
  4. -----------
  5. * ripple effect (Lollipop only) -- "colorControlHighlight"
  6.  
  7. Status Bar:
  8. ------------
  9. * background (Lollipop only) - "colorPrimaryDark"
  10.  
  11. Navigation Bar:
  12. ----------------
  13. * background (Lollipop only) - "android:navigationBarColor"
  14.  
  15. EditText:
  16. ----------
  17. * underline (unfocused) -- "colorControlNormal"
  18. * underline overlay (focus) -- "colorAccent"
  19. * cursor -- "colorAccent"
  20. * text color -- "android:textColorPrimary"
  21.  
  22. CheckBox:
  23. ----------
  24. * box unchecked -- "colorControlNormal"
  25. * box checked -- "colorAccent"
  26.  
  27. RadioButton:
  28. -------------
  29. * unselected -- "colorControlNormal"
  30. * selected -- "colorAccent"
  31. * ripple effect (Lollipop only) -- "colorControlHighlight"
  32.  
  33. SwitchCompat:
  34. -------------
  35. * thumb switch off -- "colorSwitchThumbNormal"
  36. * thumb switch on -- "colorAccent"
  37. * track overlay (when switched on) -- "colorAccent"
  38.  
  39. Spinner:
  40. ---------
  41. * indicator (not pressed) -- "colorControlNormal"
  42. * indicator (pressed) -- "colorAccent"
  43. * selected entry text color (Lollipop only) -- "android:textColorPrimary"
  44.  
  45. ActionBar:
  46. -----------
  47. * background -- "colorPrimary"
  48. * title color -- "android:textColorPrimary"
  49. * overflow icon -- "android:textColorPrimary"
  50. * up button -- "android:textColorPrimary"
  51. * action icons -- "android:textColorPrimary" †
  52. * overflow menu background -- "android:colorBackground"
  53. * overflow text color -- "android:textColorPrimary"
  54.  
  55. Toolbar (Theme Overlay should be used):
  56. ----------------------------------------
  57. * background -- must be set manually in XML. Can do (android:background="?attr/colorPrimary")
  58. * overflow icon -- "android:textColorPrimary"
  59. * navigation icon -- "android:textColorPrimary" †
  60. * action icons -- "android:textColorPrimary" †
  61. * overflow menu background -- "android:colorBackground"
  62. * overflow text color -- "android:textColorPrimary"
  63.  
  64.  
  65. † tinting by default only works with whitelisted stock action icons (see TintManager source code). For instance, the back arrow icon "abc_ic_ab_back_mtrl_am_alpha" is tinted, but copying that exact file and renaming it will result in the icon not being tinted while taking a random image and renaming it to "abc_ic_ab_back_mtrl_am_alpha" will result in it being tinted. Tinting can be done in XML in Lollipop by creating a <bitmap> xml file in drawable and applying the "android:tint" attribute. This icon can be used in both Lollipop and pre-Lollipop, but it will only be tinted in Lollipop. Tinting of action icons can also be done programmatically using a ColorFilter.
Add Comment
Please, Sign In to add comment