Update padding for reader nav, making more room for the seekbar

This commit is contained in:
Jays2Kings 2021-04-14 02:39:00 -04:00
parent ee4f3e6586
commit 820dfaf7b5
2 changed files with 12 additions and 7 deletions

View File

@ -73,6 +73,7 @@ import eu.kanade.tachiyomi.util.system.launchIO
import eu.kanade.tachiyomi.util.system.launchUI import eu.kanade.tachiyomi.util.system.launchUI
import eu.kanade.tachiyomi.util.system.openInBrowser import eu.kanade.tachiyomi.util.system.openInBrowser
import eu.kanade.tachiyomi.util.system.setThemeAndNight import eu.kanade.tachiyomi.util.system.setThemeAndNight
import eu.kanade.tachiyomi.util.system.spToPx
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import eu.kanade.tachiyomi.util.view.collapse import eu.kanade.tachiyomi.util.view.collapse
import eu.kanade.tachiyomi.util.view.compatToolTipText import eu.kanade.tachiyomi.util.view.compatToolTipText
@ -352,6 +353,14 @@ class ReaderActivity :
else R.drawable.ic_book_open_variant_24dp else R.drawable.ic_book_open_variant_24dp
) )
) )
with(binding.readerNav) {
listOf(leftPageText, rightPageText).forEach {
it.updateLayoutParams<ViewGroup.MarginLayoutParams> {
val isCurrent = (viewer is R2LPagerViewer).xor(it === leftPageText)
width = if (isDoublePage && isCurrent) 48.spToPx else 32.spToPx
}
}
}
binding.chaptersSheet.doublePage.compatToolTipText = binding.chaptersSheet.doublePage.compatToolTipText =
getString( getString(
if (isDoublePage) R.string.switch_to_single if (isDoublePage) R.string.switch_to_single

View File

@ -22,7 +22,6 @@
android:visibility="gone" android:visibility="gone"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginEnd="8dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="56dp" /> android:layout_marginStart="56dp" />
@ -33,7 +32,6 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="56dp" android:layout_marginStart="56dp"
android:background="?selectableItemBackgroundBorderless" android:background="?selectableItemBackgroundBorderless"
android:layout_marginEnd="8dp"
android:contentDescription="@string/previous_chapter" android:contentDescription="@string/previous_chapter"
android:padding="@dimen/material_layout_keylines_screen_edge_margin" android:padding="@dimen/material_layout_keylines_screen_edge_margin"
app:tint="?actionBarTintColor" app:tint="?actionBarTintColor"
@ -46,12 +44,12 @@
<TextView <TextView
android:id="@+id/left_page_text" android:id="@+id/left_page_text"
android:layout_width="48dp" android:layout_width="32sp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:textColor="?actionBarTintColor" android:textColor="?actionBarTintColor"
android:textSize="15sp" android:textSize="15sp"
tools:text="12-14" /> tools:text="1-2" />
<eu.kanade.tachiyomi.ui.reader.ReaderSeekBar <eu.kanade.tachiyomi.ui.reader.ReaderSeekBar
android:id="@+id/page_seekbar" android:id="@+id/page_seekbar"
@ -64,7 +62,7 @@
<TextView <TextView
android:id="@+id/right_page_text" android:id="@+id/right_page_text"
android:layout_width="48dp" android:layout_width="32sp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:textColor="?actionBarTintColor" android:textColor="?actionBarTintColor"
@ -78,7 +76,6 @@
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="8dp"
android:layout_marginEnd="56dp" android:layout_marginEnd="56dp"
android:background="?selectableItemBackgroundBorderless" android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/next_chapter" android:contentDescription="@string/next_chapter"
@ -93,7 +90,6 @@
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="8dp"
android:layout_marginEnd="56dp" /> android:layout_marginEnd="56dp" />
</LinearLayout> </LinearLayout>