From 1bb2edc4bba4c1cc2b039cd709e8c73524d3888e Mon Sep 17 00:00:00 2001 From: Jay Date: Sat, 8 Feb 2020 20:57:02 -0800 Subject: [PATCH] Removed unread badge from catelouge items + warning for nav drawer Side nav is painful to maintain so sooner or later it's going bye bye --- .../ui/catalogue/browse/CatalogueItem.kt | 7 ++--- .../ui/setting/SettingsGeneralController.kt | 28 +++++++++++++++---- .../main/res/layout/catalogue_grid_item.xml | 4 ++- .../main/res/layout/catalogue_list_item.xml | 2 ++ .../main/res/layout/filter_bottom_sheet.xml | 6 ++-- app/src/main/res/layout/filter_buttons.xml | 7 +++-- app/src/main/res/values/strings.xml | 5 ++++ 7 files changed, 43 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt index a31b5fbf86..781ca75c82 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt @@ -30,11 +30,8 @@ class CatalogueItem(val manga: Manga, private val catalogueAsList: Preference + bottomNav as Boolean + if (!bottomNav) { + MaterialDialog(activity!!).title(R.string.switch_to_sidebar) + .message(R.string.switch_to_sidebar_summary) + .positiveButton(R.string.action_switch) { + preferences.useBottonNav().set(bottomNav) + switchNavType(bottomNav) + }.negativeButton(android.R.string.no).show() + false } - true + else { + switchNavType(bottomNav) + true + } + } } @@ -148,4 +159,11 @@ class SettingsGeneralController : SettingsController() { } } } + + fun switchNavType(bottomNav: Boolean) { + activity?.recreate() + if (bottomNav) { + (activity as MainActivity).navigationView.selectedItemId = R.id.nav_drawer_settings + } + } } diff --git a/app/src/main/res/layout/catalogue_grid_item.xml b/app/src/main/res/layout/catalogue_grid_item.xml index 818ad16e42..e59629051f 100644 --- a/app/src/main/res/layout/catalogue_grid_item.xml +++ b/app/src/main/res/layout/catalogue_grid_item.xml @@ -45,8 +45,8 @@ android:paddingStart="3dp" android:paddingEnd="3dp" android:paddingTop="1dp" - android:visibility="gone" android:textColor="@color/md_white_1000" + android:visibility="gone" tools:visibility="visible" tools:text="120" app:layout_constraintStart_toEndOf="@+id/download_text" @@ -124,6 +124,8 @@ android:id="@+id/unread_badge" android:layout_width="20dp" android:layout_height="20dp" + android:visibility="gone" + tools:visibility="visible" android:layout_gravity="end" android:src="@drawable/unread_circle_badge"/> diff --git a/app/src/main/res/layout/catalogue_list_item.xml b/app/src/main/res/layout/catalogue_list_item.xml index 4a8c1374b9..8cf6ecf2a9 100644 --- a/app/src/main/res/layout/catalogue_list_item.xml +++ b/app/src/main/res/layout/catalogue_list_item.xml @@ -120,6 +120,8 @@ android:id="@+id/unread_badge" android:layout_width="10dp" android:layout_height="10dp" + android:visibility="gone" + tools:visibility="visible" android:layout_gravity="end" app:layout_constraintTop_toTopOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/filter_bottom_sheet.xml b/app/src/main/res/layout/filter_bottom_sheet.xml index 0a002974cd..884064ae5d 100644 --- a/app/src/main/res/layout/filter_bottom_sheet.xml +++ b/app/src/main/res/layout/filter_bottom_sheet.xml @@ -1,6 +1,7 @@ @@ -39,7 +40,7 @@ android:clickable="true" android:focusable="true" android:textStyle="normal" - android:text="112" + tools:text="Item 2" android:paddingStart="20dp" android:paddingEnd="20dp"/> @@ -61,7 +62,7 @@ android:clickable="true" android:focusable="true" android:textStyle="normal" - android:text="112" + tools:text="Item 3" android:paddingStart="20dp" android:paddingEnd="20dp"/> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 519ef79208..7e0bade948 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -168,6 +168,11 @@ Check for updates Automatically check for new app versions Use bottom navigation + Switch to navigation drawer? + Navigation drawer is no longer supported by this + version of Tachiyomi and will later be removed. Non-critical bugs and features + relating to it will be ignored. + Switch Display