Reader bottom bar actions configurable

This commit is contained in:
Koitharu
2025-02-05 14:56:41 +02:00
parent cfecfce51e
commit 26a2ffcbb1
11 changed files with 64 additions and 20 deletions

View File

@@ -69,20 +69,19 @@
android:layout_height="wrap_content"
tools:menu="@menu/opt_reader_bottom">
<RelativeLayout
<LinearLayout
android:id="@+id/layout_slider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="2dp">
android:layout_marginEnd="2dp"
android:gravity="center_vertical|end">
<ImageButton
android:id="@+id/button_prev"
style="?actionButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:contentDescription="@string/prev_chapter"
android:src="@drawable/ic_prev"
android:tooltipText="@string/prev_chapter" />
@@ -91,9 +90,7 @@
android:id="@+id/slider"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/button_next"
android:layout_toEndOf="@id/button_prev"
android:layout_weight="1"
android:stepSize="1.0"
android:valueFrom="0"
app:labelBehavior="floating"
@@ -105,13 +102,11 @@
style="?actionButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:contentDescription="@string/next_chapter"
android:src="@drawable/ic_next"
android:tooltipText="@string/next_chapter" />
</RelativeLayout>
</LinearLayout>
</com.google.android.material.appbar.MaterialToolbar>

View File

@@ -124,4 +124,10 @@
<item>@string/portrait</item>
<item>@string/landscape</item>
</string-array>
<string-array name="reader_controls" translatable="false">
<item>@string/prev_chapter</item>
<item>@string/next_chapter</item>
<item>@string/pages_slider</item>
<item>@string/chapters_and_pages</item>
</string-array>
</resources>

View File

@@ -795,4 +795,7 @@
<string name="reader_info_bar_transparent">Transparent reader information bar</string>
<string name="backup_restored_background">The backup will be restored in the background</string>
<string name="restoring_backup">Restoring backup</string>
<string name="reader_controls_in_bottom_bar">Reader controls in bottom bar</string>
<string name="chapters_and_pages">Chapters and pages</string>
<string name="pages_slider">Page switch slider</string>
</resources>

View File

@@ -138,7 +138,12 @@
android:defaultValue="false"
android:key="pages_numbers"
android:summary="@string/show_pages_numbers_summary"
android:title="@string/show_pages_numbers" />x
android:title="@string/show_pages_numbers" />
<MultiSelectListPreference
android:entries="@array/reader_controls"
android:key="reader_controls"
android:title="@string/reader_controls_in_bottom_bar" />
<ListPreference
android:defaultValue="2"