2015年1月13日火曜日

Android 5.0 でのカラーカスタマイズと属性名の関係

CheckBox
  • normal : colorControlNormal
  • checked: colorControlActivated
btn_check_material_anim.xml


RadioButton
  • normal : colorControlNormal
  • checked: colorControlActivated
btn_radio_material_anim.xml


Switch

thumb
  • normal : colorSwitchThumbNormal
  • checked: colorControlActivated
switch_thumb_material_anim.xml

track
  • normal : colorForeground, alpha=0.3
  • checked: colorControlActivated, alpha=0.3
switch_track_material.xml


RatingBar
  • normal : colorControlNormal
  • pressed: colorControlActivated
ratingbar_full_empty_material.xml
ratingbar_full_filled_material.xml


EditText
  • normal : colorControlNormal
  • focused: colorControlActivated
edit_text_material.xml


Text選択
  • ハンドル : colorControlActivated
  • カーソル : colorControlActivated
text_cursor_material.xml
text_select_handle_left_material.xml
text_select_handle_middle_material.xml
text_select_handle_right_material.xml


Button

ベース
  • normal : colorButtonNormal
  • pressed : colorControlHighlight
btn_default_material.xml
btn_borderless_material.xml


ToggleButton

ベース
  • normal : colorButtonNormal
  • pressed : colorControlHighlight
インディケータ
  • normal : colorControlNormal
  • checked: colorControlActivated
btn_toggle_material.xml


ProgressBar

  • くるくる : colorControlActivated
vector_drawable_progress_indeterminate_horizontal.xml

Horizontal
  • ベース : colorControlNormal, alpha=disabledAlpha
  • Progress : colorControlActivated
  • SecondaryProgress : colorControlActivated, alpha=disabledAlpha
progress_horizontal_material.xml


SeekBar
  • ベース : colorControlNormal
  • Progress : colorControlActivated
  • 取手 : colorControlActivated
scrubber_control_selector_material.xml
scrubber_control_material_anim.xml
scrubber_progress_horizontal_material.xml


Spinner
  • normal : colorControlNormal
  • pressed : colorControlActivated
  • checked : colorControlActivated
spinner_background_material.xml


ScrollBar
  • handle : colorControlNormal
scrollbar_handle_material.xml


FastScroll

thumb
  • normal : colorControlNormal
  • pressed : colorControlActivated
fastscroll_thumb_material.xml

track
  • 常時 : colorControlNormal
fastscroll_track_material.xml


TimePicker のヘッダー
  • normal : colorAccent
  • pressed: colorControlHighlight
time_picker_header_material.xml


ExpandableListView
  • expander : colorControlNormal
expander_group_material.xml


selectableItemBackground
  • pressed: colorControlHighlight
item_background_material.xml
item_background_borderless_material.xml


■ 参考 <style name="Theme.Material"> ... <!-- Color palette --> <item name="colorPrimaryDark">@color/primary_dark_material_dark</item> <item name="colorPrimary">@color/primary_material_dark</item> <item name="colorAccent">@color/accent_material_dark</item> <item name="colorEdgeEffect">?attr/colorPrimary</item> <item name="colorControlNormal">?attr/textColorSecondary</item> <item name="colorControlActivated">?attr/colorAccent</item> <item name="colorControlHighlight">@color/ripple_material_dark</item> <item name="colorButtonNormal">@color/btn_default_material_dark</item> <item name="colorSwitchThumbNormal">@color/switch_thumb_material_dark</item> </style> <style name="Theme.Material.Light" parent="Theme.Light"> ... <!-- Color palette --> <item name="colorPrimaryDark">@color/primary_dark_material_light</item> <item name="colorPrimary">@color/primary_material_light</item> <item name="colorAccent">@color/accent_material_light</item> <item name="colorControlNormal">?attr/textColorSecondary</item> <item name="colorControlActivated">?attr/colorAccent</item> <item name="colorControlHighlight">@color/ripple_material_light</item> <item name="colorButtonNormal">@color/btn_default_material_light</item> <item name="colorSwitchThumbNormal">@color/switch_thumb_material_light</item> </style>
  • support/v7/appcompat/src/android/support/v7/internal/widget/TintManager.java
  • support/v7/appcompat/src/android/support/v7/internal/widget/TintDrawableWrapper.java



0 件のコメント:

コメントを投稿