From 401f73c4c5f070ffc0b83130ca65929cf0e5a050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frans-Lukas=20L=C3=B6venvald?= Date: Thu, 4 Jun 2020 11:07:42 +0200 Subject: [PATCH 01/43] Added link to DESIGN.md --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 872427730..868686fb0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,6 +54,10 @@ All branches should have distinct history and should be visually easy to follow, If you wish to rebase you should be following the [Golden Rule](https://www.atlassian.com/git/tutorials/merging-vs-rebasing#the-golden-rule-of-rebasing) and ahere to the advice in the heading [Aside: Rebase as cleanup is awesome in the coding lifecycle](https://www.atlassian.com/git/articles/git-team-workflows-merge-or-rebase). +### Design and style + +For an overview of how to make design changes to Kiwix Android, check out [DESIGN.md](https://github.com/kiwix/kiwix-android/edit/develop/DESIGN.md). + ### Building The Kiwix app is split into 3 modules From 616103420f7ffd91a39957145b16d324be931576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frans-Lukas=20L=C3=B6venvald?= Date: Thu, 4 Jun 2020 11:49:05 +0200 Subject: [PATCH 02/43] First draft of DESIGN.md --- DESIGN.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 DESIGN.md diff --git a/DESIGN.md b/DESIGN.md new file mode 100644 index 000000000..d53aaa328 --- /dev/null +++ b/DESIGN.md @@ -0,0 +1,30 @@ +# Design + +This file intends to provide links to design resources, display kiwix colors and how to use them and present accessibility. + +## Colors + +drawing + +The Kiwix colors are black and white with different colored accents. For Kiwix Android, black is accented by different shades of blue: + +- ![#000000](https://via.placeholder.com/15/000000/000000?text=+) `#000000`/`black` +- ![#1565c0](https://via.placeholder.com/15/1565c0/000000?text=+) `#1565c0`/`color_primary` +- ![#2196F3](https://via.placeholder.com/15/2196F3/000000?text=+) `#2196F3`/`accent` +- ![#42a5f5](https://via.placeholder.com/15/42a5f5/000000?text=+) `#42a5f5`/`blue400` + +> Color indicates which elements are interactive, how they relate to other elements, and their level of prominence. Important elements should stand out the most [1]. + +For a guide on how to apply colors to UI, see [Applying color to UI - Material Design](https://material.io/design/color/applying-color-to-ui.html#backdrop). + +## Resources +Following is a list of resources that can and should be used to support a design decsion. + +1. [Material Design](https://material.io/) - Googles design guide that should be followed to keep Android applications consistent. +2. [Design for Android](https://developer.android.com/design) - Another design guide by Google, this one is specifically for Android while Material Design is more general. +3. [Figma](https://www.figma.com) - A tool that can be used to mock design ideas. + +## Accessibility + + +[1] https://material.io/design/color/the-color-system.html 2020-06-04 From e92aa29bd6a586ebc4ebfbea798ccb5f82c5fad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frans-Lukas=20L=C3=B6venvald?= Date: Thu, 4 Jun 2020 11:52:15 +0200 Subject: [PATCH 03/43] #2111 Spelling fix and re-phrasing. --- DESIGN.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index d53aaa328..33f5fc9b3 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -1,30 +1,32 @@ # Design -This file intends to provide links to design resources, display kiwix colors and how to use them and present accessibility. +This file intends to provide links to design resources, display the Kiwix colors, as well as presenting accessibility. ## Colors drawing -The Kiwix colors are black and white with different colored accents. For Kiwix Android, black is accented by different shades of blue: +The Kiwix colors are black and white with different colored accents. For Kiwix Android, black is accented by different shades of blue: - ![#000000](https://via.placeholder.com/15/000000/000000?text=+) `#000000`/`black` -- ![#1565c0](https://via.placeholder.com/15/1565c0/000000?text=+) `#1565c0`/`color_primary` +- ![#1565c0](https://via.placeholder.com/15/1565c0/000000?text=+) `#1565c0`/`color_primary` - ![#2196F3](https://via.placeholder.com/15/2196F3/000000?text=+) `#2196F3`/`accent` -- ![#42a5f5](https://via.placeholder.com/15/42a5f5/000000?text=+) `#42a5f5`/`blue400` +- ![#42a5f5](https://via.placeholder.com/15/42a5f5/000000?text=+) `#42a5f5`/`blue400` > Color indicates which elements are interactive, how they relate to other elements, and their level of prominence. Important elements should stand out the most [1]. For a guide on how to apply colors to UI, see [Applying color to UI - Material Design](https://material.io/design/color/applying-color-to-ui.html#backdrop). ## Resources -Following is a list of resources that can and should be used to support a design decsion. +Following is a list of resources that can and should be used to support a design decision. -1. [Material Design](https://material.io/) - Googles design guide that should be followed to keep Android applications consistent. -2. [Design for Android](https://developer.android.com/design) - Another design guide by Google, this one is specifically for Android while Material Design is more general. +1. [Material Design](https://material.io/) - Googles design guide that should be followed to keep Android applications consistent. +2. [Design for Android](https://developer.android.com/design) - Another design guide by Google, this one is specifically for Android while Material Design is more general. 3. [Figma](https://www.figma.com) - A tool that can be used to mock design ideas. -## Accessibility +## Accessibility [1] https://material.io/design/color/the-color-system.html 2020-06-04 + + From bfd16cf22d6b00de3275595b29c34de91ff345a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frans-Lukas=20L=C3=B6venvald?= Date: Thu, 4 Jun 2020 13:36:07 +0200 Subject: [PATCH 04/43] #2111 Added Accessibility section of DESIGN.md --- DESIGN.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/DESIGN.md b/DESIGN.md index 33f5fc9b3..452eabb1c 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -15,7 +15,7 @@ The Kiwix colors are black and white with different colored accents. For Kiwix A > Color indicates which elements are interactive, how they relate to other elements, and their level of prominence. Important elements should stand out the most [1]. -For a guide on how to apply colors to UI, see [Applying color to UI - Material Design](https://material.io/design/color/applying-color-to-ui.html#backdrop). +For a guide on how to apply colors to UI, see ["Applying color to UI - Material Design"](https://material.io/design/color/applying-color-to-ui.html#backdrop). ## Resources Following is a list of resources that can and should be used to support a design decision. @@ -25,7 +25,15 @@ Following is a list of resources that can and should be used to support a design 3. [Figma](https://www.figma.com) - A tool that can be used to mock design ideas. ## Accessibility +Accessibility is an important part of Android applications. Especially applications that are as widely used as Kiwix. As such, accessibility should be a part of the argument for most if not all design decisions for Kiwix Android. This can include choices such as: +- Having text with a large font and good contrast ratio. +- Large simple controls. +- Consistent controls and navigation. (consistent to Kiwix, and other Android applications.) + +Kiwix does not yet contain content descriptions for its UI elements. This can prohibit users with for example poor eyesight to use Kiwix successfully. Therefore, newly introduced interactive elements should contain content descriptions (boy scout rule applies here too!). + +See ["Make apps more accessible"](https://developer.android.com/guide/topics/ui/accessibility/apps) for a more detailed guide on accessibility. [Firefox Fenix](https://github.com/mozilla-mobile/shared-docs/blob/master/android/accessibility_guide.md) also has a great concise description of accessibility. [1] https://material.io/design/color/the-color-system.html 2020-06-04 From 429341715876505a06041dfe52050dd004ceb982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frans-Lukas=20L=C3=B6venvald?= Date: Thu, 4 Jun 2020 13:38:30 +0200 Subject: [PATCH 05/43] #2111 small rephrasing --- DESIGN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESIGN.md b/DESIGN.md index 452eabb1c..e084e7a38 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -25,7 +25,7 @@ Following is a list of resources that can and should be used to support a design 3. [Figma](https://www.figma.com) - A tool that can be used to mock design ideas. ## Accessibility -Accessibility is an important part of Android applications. Especially applications that are as widely used as Kiwix. As such, accessibility should be a part of the argument for most if not all design decisions for Kiwix Android. This can include choices such as: +Accessibility is an important part of Android applications. Especially applications that are as widely used as Kiwix. As such, accessibility should be part of design decisions. This can include choices such as: - Having text with a large font and good contrast ratio. - Large simple controls. From ee496e02c6f23da8b4d34a8a57a6a74b9f4d4307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frans-Lukas=20L=C3=B6venvald?= Date: Thu, 4 Jun 2020 13:43:29 +0200 Subject: [PATCH 06/43] #2111 Added link to accessibility step by step --- DESIGN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESIGN.md b/DESIGN.md index e084e7a38..2969a00fa 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -33,7 +33,7 @@ Accessibility is an important part of Android applications. Especially applicati Kiwix does not yet contain content descriptions for its UI elements. This can prohibit users with for example poor eyesight to use Kiwix successfully. Therefore, newly introduced interactive elements should contain content descriptions (boy scout rule applies here too!). -See ["Make apps more accessible"](https://developer.android.com/guide/topics/ui/accessibility/apps) for a more detailed guide on accessibility. [Firefox Fenix](https://github.com/mozilla-mobile/shared-docs/blob/master/android/accessibility_guide.md) also has a great concise description of accessibility. +See ["Make apps more accessible"](https://developer.android.com/guide/topics/ui/accessibility/apps) for a more detailed guide on accessibility. [Firefox Fenix](https://github.com/mozilla-mobile/shared-docs/blob/master/android/accessibility_guide.md) also has a great concise description of accessibility. A third accessibility resource is googles [list of key steps](https://android-developers.googleblog.com/2012/04/accessibility-are-you-serving-all-your.html) for making sure an Android application is accessible. [1] https://material.io/design/color/the-color-system.html 2020-06-04 From 54cda8194fd73a3548512fd8f17db08b66db2671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frans-Lukas=20L=C3=B6venvald?= Date: Thu, 4 Jun 2020 13:46:42 +0200 Subject: [PATCH 07/43] #2111 Added string resource md link --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 868686fb0..a563ca547 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,6 +58,10 @@ If you wish to rebase you should be following the [Golden Rule](https://www.atla For an overview of how to make design changes to Kiwix Android, check out [DESIGN.md](https://github.com/kiwix/kiwix-android/edit/develop/DESIGN.md). +### Adding new string resources + +To add a new string resource see [STRING_RESOURCES.md](https://github.com/kiwix/kiwix-android/edit/develop/STRING_RESOURCES.md). + ### Building The Kiwix app is split into 3 modules From fc5d44b3b1e2a344e94677401e7b103b1715d50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frans-Lukas=20L=C3=B6venvald?= Date: Thu, 4 Jun 2020 14:04:20 +0200 Subject: [PATCH 08/43] #2111 Created STRING_RESOURCES.md --- STRING_RESOURCES.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 STRING_RESOURCES.md diff --git a/STRING_RESOURCES.md b/STRING_RESOURCES.md new file mode 100644 index 000000000..d6fead918 --- /dev/null +++ b/STRING_RESOURCES.md @@ -0,0 +1,20 @@ +# String resources +All user visible strings in an Android application should be listed in strings.xml files to allow for easy translation, replacement and modification. Newly added string resources are imported by translatewiki and are then manually translated. After translations are complete the translations are merged with Kiwix Android. + +## How do I add a new string resource? +Start by adding your new string resource `new_string` to `values/strings.xml` in English. That is: +``` +... +New String +... +``` +You will now have to describe the string in `values-qq/strings.xml` with where and how the new string is used. E.x. for the string `On`: + +`values-qq/strings.xml:` +``` +... +This is used in the settings screen to turn on the night mode. +... +``` +- The values in `values/strings.xml` are the strings that are going to be displayed in the Kiwix application to the user. +- The values in `values-qq/strings.xml` are only visible to the translator and are only there to help them make a correct translation. From 18b969c7f90a3d1baea420fff54d1991672e6965 Mon Sep 17 00:00:00 2001 From: HissPirat Date: Tue, 23 Jun 2020 15:08:21 +0200 Subject: [PATCH 09/43] #2111 updated color names using "Name that color" tool --- app/src/main/res/layout/activity_intro.xml | 2 +- .../layout/activity_local_file_transfer.xml | 4 +- app/src/main/res/layout/activity_zim_host.xml | 2 +- .../core/main/CoreMainActivity.java | 4 +- .../res/drawable/search_widget_background.xml | 2 +- .../main/res/layout/activity_kiwix_error.xml | 18 ++++---- .../main/res/layout/kiwix_search_widget.xml | 2 +- core/src/main/res/values-night/color.xml | 16 ++++---- core/src/main/res/values/colors.xml | 41 ++++++++++--------- core/src/main/res/values/styles.xml | 4 +- 10 files changed, 49 insertions(+), 46 deletions(-) diff --git a/app/src/main/res/layout/activity_intro.xml b/app/src/main/res/layout/activity_intro.xml index f87159fa5..67d37b8d4 100644 --- a/app/src/main/res/layout/activity_intro.xml +++ b/app/src/main/res/layout/activity_intro.xml @@ -28,7 +28,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/activity_vertical_margin" - app:ipi_currentPageIndicatorColor="@color/blue800" + app:ipi_currentPageIndicatorColor="@color/denim_blue800" app:ipi_pageIndicatorColor="@color/blueTransparent" app:layout_constraintBottom_toBottomOf="parent" /> diff --git a/app/src/main/res/layout/activity_local_file_transfer.xml b/app/src/main/res/layout/activity_local_file_transfer.xml index aaefafe4f..8ba06a1b9 100644 --- a/app/src/main/res/layout/activity_local_file_transfer.xml +++ b/app/src/main/res/layout/activity_local_file_transfer.xml @@ -52,7 +52,7 @@ android:layout_height="2dp" android:layout_marginStart="5dp" android:layout_marginEnd="5dp" - android:background="@color/accent" + android:background="@color/dodger_blue" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/text_view_device_name" /> @@ -113,7 +113,7 @@ android:layout_marginStart="5dp" android:layout_marginTop="200dp" android:layout_marginEnd="5dp" - android:background="@color/accent" + android:background="@color/dodger_blue" app:layout_constraintBottom_toTopOf="@+id/text_view_files_for_transfer" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/activity_zim_host.xml b/app/src/main/res/layout/activity_zim_host.xml index 281d54d06..e5ef272f8 100644 --- a/app/src/main/res/layout/activity_zim_host.xml +++ b/app/src/main/res/layout/activity_zim_host.xml @@ -42,7 +42,7 @@ android:layout_marginBottom="8dp" android:background="@color/greenTick" android:text="@string/start_server_label" - android:textColor="@color/white" + android:textColor="@color/alabaster_white" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.java index 3cc973206..aa02d1fbb 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.java @@ -1263,7 +1263,7 @@ public abstract class CoreMainActivity extends BaseActivity goToBookmarks(); return Unit.INSTANCE; }, - getResources().getColor(R.color.white) + getResources().getColor(R.color.alabaster_white) ); } else { ContextExtensionsKt.toast(this, R.string.unable_to_add_to_bookmarks, Toast.LENGTH_SHORT); @@ -1718,7 +1718,7 @@ public abstract class CoreMainActivity extends BaseActivity .setAction(getString(R.string.open), v -> { if (webViewList.size() > 1) selectTab(webViewList.size() - 1); }) - .setActionTextColor(getResources().getColor(R.color.white)) + .setActionTextColor(getResources().getColor(R.color.alabaster_white)) .show(); } else { newTab(url); diff --git a/core/src/main/res/drawable/search_widget_background.xml b/core/src/main/res/drawable/search_widget_background.xml index f7bb732aa..39428a2c4 100644 --- a/core/src/main/res/drawable/search_widget_background.xml +++ b/core/src/main/res/drawable/search_widget_background.xml @@ -1,6 +1,6 @@ - + + android:textColor="@color/alabaster_white" /> + android:textColor="@color/alabaster_white" /> + android:textColor="@color/alabaster_white" /> + android:textColor="@color/alabaster_white" /> + android:textColor="@color/alabaster_white" /> + android:textColor="@color/alabaster_white" /> diff --git a/core/src/main/res/layout/kiwix_search_widget.xml b/core/src/main/res/layout/kiwix_search_widget.xml index 332de33a5..666440178 100644 --- a/core/src/main/res/layout/kiwix_search_widget.xml +++ b/core/src/main/res/layout/kiwix_search_widget.xml @@ -23,7 +23,7 @@ android:layout_height="wrap_content" android:layout_weight="0.7" android:text="@string/search_widget_text" - android:textColor="@color/gray" /> + android:textColor="@color/scorpion_gray" /> - @color/blue400 + @color/denim_blue400 - @color/gray900 + @color/mine_shaft_gray900 @color/pink300 - @color/white - @color/white - @color/white + @color/alabaster_white + @color/alabaster_white + @color/alabaster_white - @color/gray350 - @color/gray500 - @color/gray850 + @color/mine_shaft_gray350 + @color/mine_shaft_gray500 + @color/mine_shaft_gray850 diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 5b57d8896..13b17e112 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -1,32 +1,35 @@ #000000 + #ffffff - #2196F3 - #fafafa - #5a5a5a - #212121 - #42a5f5 - #1565c0 + #2196F3 + #fafafa + #5a5a5a + #42a5f5 + #1565c0 #f06292 - #4285F4 - #FFD6D6D6 - #9E9E9E - #616161 - #303030 - @color/white - @color/gray700 - @color/gray500 + #4285F4 + #FFD6D6D6 + #9E9E9E + #212121 + #616161 + #303030 + #b00020 + @color/alabaster_white + @color/mine_shaft_gray700 + @color/mine_shaft_gray500 - @color/blue800 + @color/denim_blue800 + @color/cornflower_blue - @color/white - #b00020 + @color/alabaster_white + @color/monza_red - #ffffff + @color/white @color/black - @color/white + @color/alabaster_white diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 580cd7a15..f317a2aaf 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -34,7 +34,7 @@ From 51b02a3985d73527519e26131da2cd100cbf35d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frans-Lukas=20L=C3=B6venvald?= Date: Tue, 23 Jun 2020 15:13:53 +0200 Subject: [PATCH 10/43] Update DESIGN.md with new color names. --- DESIGN.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index 2969a00fa..51cc23511 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -9,9 +9,9 @@ This file intends to provide links to design resources, display the Kiwix colors The Kiwix colors are black and white with different colored accents. For Kiwix Android, black is accented by different shades of blue: - ![#000000](https://via.placeholder.com/15/000000/000000?text=+) `#000000`/`black` -- ![#1565c0](https://via.placeholder.com/15/1565c0/000000?text=+) `#1565c0`/`color_primary` -- ![#2196F3](https://via.placeholder.com/15/2196F3/000000?text=+) `#2196F3`/`accent` -- ![#42a5f5](https://via.placeholder.com/15/42a5f5/000000?text=+) `#42a5f5`/`blue400` +- ![#1565c0](https://via.placeholder.com/15/1565c0/000000?text=+) `#1565c0`/`denim_blue800` +- ![#42a5f5](https://via.placeholder.com/15/42a5f5/000000?text=+) `#42a5f5`/`denim_blue400` +- ![#2196F3](https://via.placeholder.com/15/2196F3/000000?text=+) `#2196F3`/`dodger_blue` > Color indicates which elements are interactive, how they relate to other elements, and their level of prominence. Important elements should stand out the most [1]. From 678ee2dc27bd44302f62dfe20f041dc53da89a09 Mon Sep 17 00:00:00 2001 From: HissPirat Date: Tue, 23 Jun 2020 16:06:09 +0200 Subject: [PATCH 11/43] #2111 updated night theme to use correct colors instead of relying on night color changes --- core/src/main/res/values-night/color.xml | 3 +-- core/src/main/res/values-night/themes.xml | 7 +++++++ core/src/main/res/values/colors.xml | 5 ++--- core/src/main/res/values/themes.xml | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core/src/main/res/values-night/color.xml b/core/src/main/res/values-night/color.xml index c2c24d5c8..7d1036b16 100644 --- a/core/src/main/res/values-night/color.xml +++ b/core/src/main/res/values-night/color.xml @@ -5,10 +5,9 @@ - @color/denim_blue400 @color/mine_shaft_gray900 - @color/pink300 + @color/froly_pink300 @color/alabaster_white @color/alabaster_white diff --git a/core/src/main/res/values-night/themes.xml b/core/src/main/res/values-night/themes.xml index 31d077d1e..29f4229e1 100644 --- a/core/src/main/res/values-night/themes.xml +++ b/core/src/main/res/values-night/themes.xml @@ -4,6 +4,13 @@ diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 13b17e112..45fe94750 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -8,7 +8,7 @@ #5a5a5a #42a5f5 #1565c0 - #f06292 + #f06292 #4285F4 #FFD6D6D6 #9E9E9E @@ -22,10 +22,9 @@ - @color/denim_blue800 @color/cornflower_blue - @color/alabaster_white + @color/monza_red @color/white diff --git a/core/src/main/res/values/themes.xml b/core/src/main/res/values/themes.xml index 9aa52cb15..981144984 100644 --- a/core/src/main/res/values/themes.xml +++ b/core/src/main/res/values/themes.xml @@ -11,7 +11,7 @@ - @color/color_primary + @color/denim_blue800 ?colorPrimary ?colorPrimary ?colorPrimary @@ -23,7 +23,7 @@ - @color/color_surface + @color/alabaster_white ?colorSurface @color/color_error From d71cd7bb4aacfe6882cf9e449839264eae9ac3ae Mon Sep 17 00:00:00 2001 From: HissPirat Date: Wed, 24 Jun 2020 14:22:56 +0200 Subject: [PATCH 12/43] #2111 removed more redundant colors --- core/src/main/res/values-night/color.xml | 7 ------- core/src/main/res/values-night/themes.xml | 6 +++++- core/src/main/res/values/colors.xml | 5 ----- core/src/main/res/values/themes.xml | 8 ++++---- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/core/src/main/res/values-night/color.xml b/core/src/main/res/values-night/color.xml index 7d1036b16..5d9c88d55 100644 --- a/core/src/main/res/values-night/color.xml +++ b/core/src/main/res/values-night/color.xml @@ -4,14 +4,7 @@ - - @color/mine_shaft_gray900 - @color/froly_pink300 - - @color/alabaster_white - @color/alabaster_white - @color/alabaster_white @color/mine_shaft_gray350 @color/mine_shaft_gray500 diff --git a/core/src/main/res/values-night/themes.xml b/core/src/main/res/values-night/themes.xml index 29f4229e1..10059ce3f 100644 --- a/core/src/main/res/values-night/themes.xml +++ b/core/src/main/res/values-night/themes.xml @@ -8,9 +8,13 @@ @color/mine_shaft_gray900 @color/froly_pink300 + @color/alabaster_white @color/alabaster_white - @color/alabaster_white + + + @color/black diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 45fe94750..14ff648de 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -25,10 +25,5 @@ @color/cornflower_blue @color/alabaster_white - @color/monza_red - - @color/white - @color/black - @color/alabaster_white diff --git a/core/src/main/res/values/themes.xml b/core/src/main/res/values/themes.xml index 981144984..858214501 100644 --- a/core/src/main/res/values/themes.xml +++ b/core/src/main/res/values/themes.xml @@ -25,15 +25,15 @@ @color/alabaster_white ?colorSurface - @color/color_error + @color/monza_red - @color/color_on_primary + @color/white ?colorOnPrimary - @color/color_on_surface + @color/black ?colorOnSurface - @color/color_on_error + @color/alabaster_white @style/TextAppearance.KiwixTheme.Headline1 From b4d2ca535a7d9e5df31726badc0a84fe99475a95 Mon Sep 17 00:00:00 2001 From: HissPirat Date: Wed, 24 Jun 2020 15:21:48 +0200 Subject: [PATCH 13/43] #2111 made launch_screen use correct colors for night/day mode --- .../org/kiwix/kiwixmobile/main/KiwixMainActivity.kt | 2 +- core/src/main/res/drawable-night/launch_screen.xml | 11 +++++++++++ core/src/main/res/drawable/launch_screen.xml | 2 +- core/src/main/res/values-night/color.xml | 1 - core/src/main/res/values/colors.xml | 1 - 5 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 core/src/main/res/drawable-night/launch_screen.xml diff --git a/app/src/main/java/org/kiwix/kiwixmobile/main/KiwixMainActivity.kt b/app/src/main/java/org/kiwix/kiwixmobile/main/KiwixMainActivity.kt index 1efe858e3..c20d6ffdf 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/main/KiwixMainActivity.kt +++ b/app/src/main/java/org/kiwix/kiwixmobile/main/KiwixMainActivity.kt @@ -33,8 +33,8 @@ import org.kiwix.kiwixmobile.core.main.CoreMainActivity import org.kiwix.kiwixmobile.core.main.WebViewCallback import org.kiwix.kiwixmobile.core.reader.ZimFileReader import org.kiwix.kiwixmobile.core.reader.ZimReaderContainer -import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_KIWIX_MOBILE import org.kiwix.kiwixmobile.core.utils.EXTRA_ZIM_FILE +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_KIWIX_MOBILE import org.kiwix.kiwixmobile.core.utils.TAG_CURRENT_ARTICLES import org.kiwix.kiwixmobile.core.utils.TAG_CURRENT_FILE import org.kiwix.kiwixmobile.core.utils.TAG_CURRENT_POSITIONS diff --git a/core/src/main/res/drawable-night/launch_screen.xml b/core/src/main/res/drawable-night/launch_screen.xml new file mode 100644 index 000000000..e9df7bff5 --- /dev/null +++ b/core/src/main/res/drawable-night/launch_screen.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/core/src/main/res/drawable/launch_screen.xml b/core/src/main/res/drawable/launch_screen.xml index ae7b61922..6021eeb72 100644 --- a/core/src/main/res/drawable/launch_screen.xml +++ b/core/src/main/res/drawable/launch_screen.xml @@ -2,7 +2,7 @@ - + - @color/mine_shaft_gray900 @color/mine_shaft_gray350 @color/mine_shaft_gray500 diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 14ff648de..370f1acb0 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -23,7 +23,6 @@ @color/cornflower_blue - @color/alabaster_white From 0d78704956e5838029354bf8541ae80a05880acf Mon Sep 17 00:00:00 2001 From: HissPirat Date: Thu, 25 Jun 2020 09:33:36 +0200 Subject: [PATCH 14/43] #2111 replaced bad color names with attributes --- app/src/main/res/layout/item_download.xml | 6 +++--- app/src/main/res/layout/item_library.xml | 14 ++++++------ core/src/main/res/layout/item_book.xml | 8 +++---- core/src/main/res/layout/item_help.xml | 2 +- core/src/main/res/values-night/color.xml | 11 ---------- core/src/main/res/values-night/themes.xml | 3 +++ core/src/main/res/values/attrs.xml | 3 +++ core/src/main/res/values/colors.xml | 26 +++++++---------------- core/src/main/res/values/styles.xml | 2 +- core/src/main/res/values/themes.xml | 6 +++++- 10 files changed, 35 insertions(+), 46 deletions(-) delete mode 100644 core/src/main/res/values-night/color.xml diff --git a/app/src/main/res/layout/item_download.xml b/app/src/main/res/layout/item_download.xml index fcdacaa39..acb99fccf 100644 --- a/app/src/main/res/layout/item_download.xml +++ b/app/src/main/res/layout/item_download.xml @@ -48,7 +48,7 @@ style="@style/list_item_body" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/text_secondary" + android:textColor="?textSecondary" android:layout_gravity="start" tools:text="Description" /> @@ -71,7 +71,7 @@ style="@style/list_item_body" android:layout_width="0dp" android:layout_height="wrap_content" - android:textColor="@color/text_tertiary" + android:textColor="?textTertiary" android:layout_weight="1" tools:text="In Progress" /> @@ -80,7 +80,7 @@ style="@style/list_item_body" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/text_tertiary" + android:textColor="?textTertiary" tools:text="1min 10secs" /> diff --git a/app/src/main/res/layout/item_library.xml b/app/src/main/res/layout/item_library.xml index dce98c6a7..c2a1c09d3 100644 --- a/app/src/main/res/layout/item_library.xml +++ b/app/src/main/res/layout/item_library.xml @@ -47,7 +47,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/activity_horizontal_margin" - android:textColor="@color/text_secondary" + android:textColor="?textSecondary" android:maxLines="2" android:ellipsize="end" app:layout_constraintEnd_toEndOf="parent" @@ -60,7 +60,7 @@ style="@style/list_item_body" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/text_tertiary" + android:textColor="?textTertiary" app:layout_constraintStart_toStartOf="@+id/libraryBookTitle" app:layout_constraintTop_toBottomOf="@+id/libraryBookDescription" tools:text="File Size" /> @@ -70,7 +70,7 @@ style="@style/list_item_body" android:layout_width="0dp" android:layout_height="wrap_content" - android:textColor="@color/text_tertiary" + android:textColor="?textTertiary" android:gravity="start" android:layout_marginRight="10dp" android:layout_marginEnd="10dp" @@ -84,7 +84,7 @@ style="@style/list_item_body" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/text_tertiary" + android:textColor="?textTertiary" app:layout_constraintStart_toStartOf="@+id/libraryBookCreator" app:layout_constraintTop_toBottomOf="@+id/libraryBookCreator" tools:text="Publisher" /> @@ -95,7 +95,7 @@ style="@style/list_item_body" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/text_tertiary" + android:textColor="?textTertiary" android:layout_marginEnd="@dimen/activity_horizontal_margin" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="@+id/libraryBookSize" @@ -106,7 +106,7 @@ style="@style/list_item_body" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/text_tertiary" + android:textColor="?textTertiary" android:layout_marginStart="50dp" app:layout_constraintEnd_toEndOf="@+id/libraryBookDate" app:layout_constraintTop_toBottomOf="@+id/libraryBookDate" @@ -117,7 +117,7 @@ style="@style/list_item_body" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/text_tertiary" + android:textColor="?textTertiary" app:layout_constraintEnd_toEndOf="@+id/libraryBookLanguage" app:layout_constraintTop_toBottomOf="@+id/libraryBookLanguage" tools:text="File Name" /> diff --git a/core/src/main/res/layout/item_book.xml b/core/src/main/res/layout/item_book.xml index 21034e92d..975616f41 100644 --- a/core/src/main/res/layout/item_book.xml +++ b/core/src/main/res/layout/item_book.xml @@ -65,7 +65,7 @@ android:layout_marginEnd="8dp" android:ellipsize="end" android:maxLines="2" - android:textColor="@color/text_secondary" + android:textColor="?textSecondary" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="@id/item_book_title" app:layout_constraintTop_toBottomOf="@id/item_book_title" @@ -76,7 +76,7 @@ style="@style/list_item_body" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/text_tertiary" + android:textColor="?textTertiary" app:layout_constraintStart_toStartOf="@id/item_book_title" app:layout_constraintTop_toBottomOf="@id/item_book_description" tools:text="1 Jan 2018" /> @@ -88,7 +88,7 @@ android:layout_height="wrap_content" android:layout_marginStart="@dimen/activity_horizontal_margin" android:layout_marginEnd="@dimen/activity_horizontal_margin" - android:textColor="@color/text_tertiary" + android:textColor="?textTertiary" app:layout_constraintStart_toEndOf="@id/item_book_date" app:layout_constraintTop_toTopOf="@id/item_book_date" tools:text="20 GB" /> @@ -100,7 +100,7 @@ android:layout_height="wrap_content" android:layout_marginStart="@dimen/activity_horizontal_margin" android:layout_marginEnd="@dimen/activity_horizontal_margin" - android:textColor="@color/text_tertiary" + android:textColor="?textTertiary" app:layout_constraintStart_toEndOf="@id/item_book_size" app:layout_constraintTop_toTopOf="@id/item_book_size" tools:text="10.1 K articles" /> diff --git a/core/src/main/res/layout/item_help.xml b/core/src/main/res/layout/item_help.xml index 223aa5400..12cc0e52b 100644 --- a/core/src/main/res/layout/item_help.xml +++ b/core/src/main/res/layout/item_help.xml @@ -33,8 +33,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="@dimen/activity_vertical_margin" + android:textColor="?textSecondary" android:visibility="gone" - android:textColor="@color/text_secondary" app:layout_constraintTop_toBottomOf="@id/item_help_title" tools:text="@string/help_3" tools:visibility="visible" /> diff --git a/core/src/main/res/values-night/color.xml b/core/src/main/res/values-night/color.xml deleted file mode 100644 index 9e88115c7..000000000 --- a/core/src/main/res/values-night/color.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - @color/mine_shaft_gray350 - @color/mine_shaft_gray500 - @color/mine_shaft_gray850 - diff --git a/core/src/main/res/values-night/themes.xml b/core/src/main/res/values-night/themes.xml index 10059ce3f..0b372e941 100644 --- a/core/src/main/res/values-night/themes.xml +++ b/core/src/main/res/values-night/themes.xml @@ -7,6 +7,9 @@ @color/denim_blue400 @color/mine_shaft_gray900 @color/froly_pink300 + @color/mine_shaft_gray350 + @color/mine_shaft_gray500 + @color/mine_shaft_gray850 @color/alabaster_white diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index 21b933f1e..2d8f75c76 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -4,5 +4,8 @@ + + + diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 370f1acb0..1f2437afb 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -1,28 +1,18 @@ - #000000 #ffffff - - #2196F3 #fafafa - #5a5a5a - #42a5f5 - #1565c0 - #f06292 - #4285F4 #FFD6D6D6 #9E9E9E - #212121 + #5a5a5a #616161 #303030 + #212121 + #000000 + #42a5f5 + #2196F3 + #4285F4 + #1565c0 + #f06292 #b00020 - @color/alabaster_white - @color/mine_shaft_gray700 - @color/mine_shaft_gray500 - - - - @color/cornflower_blue - - diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index f317a2aaf..28c9b95f6 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -57,7 +57,7 @@ - diff --git a/core/src/main/res/values/themes.xml b/core/src/main/res/values/themes.xml index f3ce2b6c8..02af0ca32 100644 --- a/core/src/main/res/values/themes.xml +++ b/core/src/main/res/values/themes.xml @@ -2,16 +2,35 @@ - + + +