Dbrant has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/368837 )
Change subject: Update styling of ToC for light and dark mode. ...................................................................... Update styling of ToC for light and dark mode. ...including a few simplifications. Bug: T165415 Change-Id: I74d46e2e141eeace4d6fc0efe69713c77cf83ba4 --- D app/src/main/res/drawable-v21/selectable_item_background.xml R app/src/main/res/drawable/toc_item_background_dark.xml C app/src/main/res/drawable/toc_item_background_light.xml M app/src/main/res/layout/header_toc_list.xml M app/src/main/res/layout/item_toc_entry.xml M app/src/main/res/values/attrs.xml M app/src/main/res/values/colors.xml M app/src/main/res/values/styles_dark.xml M app/src/main/res/values/styles_light.xml 9 files changed, 15 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/37/368837/1 diff --git a/app/src/main/res/drawable-v21/selectable_item_background.xml b/app/src/main/res/drawable-v21/selectable_item_background.xml deleted file mode 100644 index 576babb..0000000 --- a/app/src/main/res/drawable-v21/selectable_item_background.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<ripple xmlns:android="http://schemas.android.com/apk/res/android" - android:color="@color/list_item_highlight"> - <item> - <selector> - <item android:state_activated="true" android:drawable="@color/list_item_highlight" /> - <item android:state_checked="true" android:drawable="@color/list_item_highlight" /> - <item android:state_pressed="true" android:drawable="@color/list_item_selected" /> - </selector> - </item> -</ripple> \ No newline at end of file diff --git a/app/src/main/res/drawable/selectable_item_background.xml b/app/src/main/res/drawable/toc_item_background_dark.xml similarity index 64% rename from app/src/main/res/drawable/selectable_item_background.xml rename to app/src/main/res/drawable/toc_item_background_dark.xml index 003b141..e99d6a5 100644 --- a/app/src/main/res/drawable/selectable_item_background.xml +++ b/app/src/main/res/drawable/toc_item_background_dark.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" android:drawable="@color/list_item_selected" /> - <item android:state_checked="true" android:drawable="@color/list_item_highlight" /> - <item android:state_activated="true" android:drawable="@color/list_item_highlight" /> + <item android:state_checked="true" android:drawable="@color/base20" /> + <item android:state_activated="true" android:drawable="@color/base20" /> </selector> \ No newline at end of file diff --git a/app/src/main/res/drawable/selectable_item_background.xml b/app/src/main/res/drawable/toc_item_background_light.xml similarity index 64% copy from app/src/main/res/drawable/selectable_item_background.xml copy to app/src/main/res/drawable/toc_item_background_light.xml index 003b141..04f1db6 100644 --- a/app/src/main/res/drawable/selectable_item_background.xml +++ b/app/src/main/res/drawable/toc_item_background_light.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" android:drawable="@color/list_item_selected" /> - <item android:state_checked="true" android:drawable="@color/list_item_highlight" /> - <item android:state_activated="true" android:drawable="@color/list_item_highlight" /> + <item android:state_checked="true" android:drawable="@color/base70" /> + <item android:state_activated="true" android:drawable="@color/base70" /> </selector> \ No newline at end of file diff --git a/app/src/main/res/layout/header_toc_list.xml b/app/src/main/res/layout/header_toc_list.xml index c4c108f..c96b1ba 100644 --- a/app/src/main/res/layout/header_toc_list.xml +++ b/app/src/main/res/layout/header_toc_list.xml @@ -10,6 +10,6 @@ android:padding="16dp" android:textStyle="bold" tools:text="Sample title" - android:background="@drawable/selectable_item_background" + android:background="?attr/toc_item_background" /> diff --git a/app/src/main/res/layout/item_toc_entry.xml b/app/src/main/res/layout/item_toc_entry.xml index 8430cb4..6d0c3eb 100644 --- a/app/src/main/res/layout/item_toc_entry.xml +++ b/app/src/main/res/layout/item_toc_entry.xml @@ -8,7 +8,7 @@ android:paddingRight="@dimen/list_item_horizontal_padding" android:paddingBottom="@dimen/list_item_vertical_padding" android:paddingLeft="@dimen/list_item_horizontal_padding" - android:background="@drawable/selectable_item_background"> + android:background="?attr/toc_item_background"> <View android:layout_width="0dp" android:layout_height="match_parent" diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 8ebd7f5..f6212ef 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -9,6 +9,7 @@ <attr name="toc_background_color" format="reference"/> <attr name="toc_section_text_color" format="reference"/> <attr name="toc_subsection_text_color" format="reference"/> + <attr name="toc_item_background" format="reference"/> <attr name="edit_text_color" format="reference"/> <attr name="edit_improve_tag_selected_drawable" format="reference" /> <attr name="edit_improve_tag_unselected_drawable" format="reference" /> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 4cf9ae2..3d72338 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -74,9 +74,6 @@ <color name="window_background_light">#fff</color> <color name="page_background_light">#fff</color> - <color name="toc_background_light">#fff</color> - <color name="toc_section_text_light">#333</color> - <color name="toc_subsection_text_light">#898989</color> <color name="edit_text_light">#000</color> <color name="abusefilter_background_light">#e8e8e8</color> <color name="list_separator_light">#ccc</color> @@ -90,9 +87,6 @@ <color name="window_background_dark">#000</color> <color name="page_background_dark">@color/base14</color> - <color name="toc_background_dark">#0c0c0c</color> - <color name="toc_section_text_dark">#d0d0d0</color> - <color name="toc_subsection_text_dark">#a0a0a0</color> <color name="edit_text_dark">#909090</color> <color name="abusefilter_background_dark">#505050</color> <color name="list_separator_dark">#606060</color> @@ -104,8 +98,6 @@ <color name="list_item_text_secondary_dark">#808080</color> <color name="multi_select_background_dark">@color/accent30</color> - <color name="list_item_highlight">#60808080</color> - <color name="list_item_selected">#20808080</color> <color name="lead_text_color">#f0f0f0</color> <color name="lead_text_shadow">#80000000</color> <color name="lead_text_light">#000</color> diff --git a/app/src/main/res/values/styles_dark.xml b/app/src/main/res/values/styles_dark.xml index 13d9347..807f2ea 100644 --- a/app/src/main/res/values/styles_dark.xml +++ b/app/src/main/res/values/styles_dark.xml @@ -34,9 +34,10 @@ <item name="main_toolbar_color">@color/accent30</item> <item name="main_status_bar_color">@color/accent20</item> <item name="inline_onboarding_background_color">@color/base14</item> - <item name="toc_background_color">@color/toc_background_dark</item> - <item name="toc_section_text_color">@color/toc_section_text_dark</item> - <item name="toc_subsection_text_color">@color/toc_subsection_text_dark</item> + <item name="toc_background_color">@color/base18</item> + <item name="toc_section_text_color">@color/base90</item> + <item name="toc_subsection_text_color">@color/base70</item> + <item name="toc_item_background">@drawable/toc_item_background_dark</item> <item name="edit_text_color">@color/edit_text_dark</item> <item name="edit_improve_tag_selected_drawable">@drawable/edit_improve_tag_selected_dark</item> <item name="edit_improve_tag_unselected_drawable">@drawable/edit_improve_tag_unselected_dark</item> diff --git a/app/src/main/res/values/styles_light.xml b/app/src/main/res/values/styles_light.xml index f3b54ac..f8cd179 100644 --- a/app/src/main/res/values/styles_light.xml +++ b/app/src/main/res/values/styles_light.xml @@ -34,9 +34,10 @@ <item name="main_toolbar_color">@color/accent50</item> <item name="main_status_bar_color">@color/accent30</item> <item name="inline_onboarding_background_color">@color/base80</item> - <item name="toc_background_color">@color/toc_background_light</item> - <item name="toc_section_text_color">@color/toc_section_text_light</item> - <item name="toc_subsection_text_color">@color/toc_subsection_text_light</item> + <item name="toc_background_color">@android:color/white</item> + <item name="toc_section_text_color">@color/base10</item> + <item name="toc_subsection_text_color">@color/base30</item> + <item name="toc_item_background">@drawable/toc_item_background_light</item> <item name="edit_text_color">@color/edit_text_light</item> <item name="edit_improve_tag_selected_drawable">@drawable/edit_improve_tag_selected_light</item> <item name="edit_improve_tag_unselected_drawable">@drawable/edit_improve_tag_unselected_light</item> -- To view, visit https://gerrit.wikimedia.org/r/368837 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I74d46e2e141eeace4d6fc0efe69713c77cf83ba4 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Dbrant <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
