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
This commit is contained in:
Jay 2020-02-08 20:57:02 -08:00
parent c48252b61c
commit 1bb2edc4bb
7 changed files with 43 additions and 16 deletions

View File

@ -30,11 +30,8 @@ class CatalogueItem(val manga: Manga, private val catalogueAsList: Preference<Bo
val parent = adapter.recyclerView
return if (parent is AutofitRecyclerView) {
view.apply {
/*val params = card.layoutParams
//val fiveDp = 10.dpToPx
params.height = MATCH_PARENT
params.width = parent.itemWidth / 3 * 4
card.layoutParams = params*/
card.layoutParams = FrameLayout.LayoutParams(
MATCH_PARENT, parent.itemWidth / 3 * 4)
gradient.layoutParams = FrameLayout.LayoutParams(
MATCH_PARENT, parent.itemWidth / 3 * 4 / 2, Gravity.BOTTOM)
}

View File

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.setting
import androidx.appcompat.app.AppCompatDelegate
import androidx.biometric.BiometricManager
import androidx.preference.PreferenceScreen
import com.afollestad.materialdialogs.MaterialDialog
import eu.kanade.tachiyomi.BuildConfig
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.preference.getOrDefault
@ -64,12 +65,22 @@ class SettingsGeneralController : SettingsController() {
key = Keys.useBottomNav
titleRes = R.string.use_bottom_nav
defaultValue = true
onChange {
activity?.recreate()
if (it as Boolean) {
(activity as MainActivity).navigationView.selectedItemId = R.id.nav_drawer_settings
onChange { bottomNav ->
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
}
}
}

View File

@ -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"/>

View File

@ -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"

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<eu.kanade.tachiyomi.ui.library.filter.SortFilterBottomSheet xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/bottom_sheet"
style="@style/BottomSheetDialogTheme"
android:layout_width="match_parent"
@ -91,7 +92,7 @@
android:focusable="true"
android:gravity="start|center"
android:padding="5dp"
android:text="srgdg"
tools:text="Library Sort"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
android:textColor="?android:attr/textColorPrimary"
android:textSize="15sp"
@ -110,7 +111,7 @@
android:textAlignment="textStart"
android:focusable="true"
android:gravity="start|center"
android:text="srgdg"
tools:text="Category Sort"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
android:textColor="?android:attr/textColorPrimary"
android:textSize="15sp"
@ -202,6 +203,7 @@
android:id="@+id/top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:visibility="invisible"
android:background="@drawable/bg_bottom_sheet_primary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<eu.kanade.tachiyomi.ui.library.filter.FilterTagGroup xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/round_textview_border"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
@ -17,7 +18,7 @@
android:clickable="true"
android:focusable="true"
android:textStyle="normal"
android:text="112"
tools:text="Item 1"
android:paddingStart="20dp"
android:paddingEnd="20dp"/>
@ -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"/>
</eu.kanade.tachiyomi.ui.library.filter.FilterTagGroup>

View File

@ -168,6 +168,11 @@
<string name="pref_enable_automatic_updates">Check for updates</string>
<string name="pref_enable_automatic_updates_summary">Automatically check for new app versions</string>
<string name="use_bottom_nav">Use bottom navigation</string>
<string name="switch_to_sidebar">Switch to navigation drawer?</string>
<string name="switch_to_sidebar_summary">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.</string>
<string name="action_switch">Switch</string>
<!-- Library section -->
<string name="pref_category_library_display">Display</string>