Reader settings

This commit is contained in:
Koitharu
2020-03-03 18:57:37 +02:00
parent 22a6d06e1f
commit 6953ca21a9
18 changed files with 313 additions and 23 deletions

View File

@@ -0,0 +1,12 @@
<!-- drawable/book_outline.xml -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000"
android:pathData="M18,2A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H18M18,4H13V12L10.5,9.75L8,12V4H6V20H18V4Z" />
</vector>

View File

@@ -0,0 +1,8 @@
<!-- drawable/information_outline.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#000" android:pathData="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z" />
</vector>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?colorPrimary"
android:fitsSystemWindows="true"
android:theme="@style/AppToolbarTheme">
<androidx.appcompat.widget.Toolbar
android:id="@id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppPopupTheme" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.fragment.app.FragmentContainerView
android:id="@id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -1,31 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:ignore="AlwaysShowAction">
<item
android:id="@+id/action_bookmark_add"
android:icon="@drawable/ic_bookmark_add"
android:title="@string/add_bookmark"
android:visible="false"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
<item
android:id="@+id/action_save_page"
android:icon="@drawable/ic_page_image"
android:title="@string/save_page"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
<item
android:id="@+id/action_pages_thumbs"
android:icon="@drawable/ic_grid"
android:title="@string/pages"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
<item
android:id="@+id/action_reader_mode"
android:icon="@drawable/ic_book_page"
android:title="@string/read_mode"
app:showAsAction="always" />
<item
android:id="@+id/action_settings"
android:icon="@drawable/ic_tune"
android:title="@string/settings"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
</menu>

View File

@@ -86,4 +86,8 @@
<string name="search_results_on_s">Результаты поиска по %s</string>
<string name="delete_manga">Удалить мангу</string>
<string name="text_delete_local_manga">Вы уверены, что хотите удалить \"%s\" с устройства? \nЭто действие нельзя будет отменить.</string>
<string name="reader_settings">Настройки чтения</string>
<string name="switch_pages">Листание страниц</string>
<string name="taps_on_edges">Нажатия по краям</string>
<string name="volume_buttons">Кнопки громкости</string>
</resources>

View File

@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="themes">
<item>@string/automatic</item>
<item>@string/light</item>
<item>@string/dark</item>
</string-array>
<string-array name="themes">
<item>@string/automatic</item>
<item>@string/light</item>
<item>@string/dark</item>
</string-array>
<string-array name="reader_switchers">
<item>@string/taps_on_edges</item>
<item>@string/volume_buttons</item>
</string-array>
</resources>

View File

@@ -5,9 +5,17 @@
<string name="key_sources_order">sources_order</string>
<string name="key_pages_cache_clear">pages_cache_clear</string>
<string name="key_grid_size">grid_size</string>
<string name="key_reader_switchers">reader_switchers</string>
<string-array name="values_theme">
<item>-1</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="values_reader_switchers">
<item>taps</item>
<item>volume</item>
</string-array>
<string-array name="values_reader_switchers_default">
<item>taps</item>
</string-array>
</resources>

View File

@@ -87,4 +87,8 @@
<string name="search_results_on_s">Search results on %s</string>
<string name="delete_manga">Delete manga</string>
<string name="text_delete_local_manga">Are you really want to delete \"%s\" from your phone\'s local storage? \nThis operation cannot be undone.</string>
<string name="reader_settings">Reader settings</string>
<string name="switch_pages">Switch pages</string>
<string name="taps_on_edges">Taps on edges</string>
<string name="volume_buttons">Volume buttons</string>
</resources>

View File

@@ -12,6 +12,11 @@
android:icon="@drawable/ic_web"
android:title="@string/remote_sources" />
<PreferenceScreen
android:fragment="org.koitharu.kotatsu.ui.settings.ReaderSettingsFragment"
android:icon="@drawable/ic_book"
android:title="@string/reader_settings" />
<PreferenceScreen
android:fragment="org.koitharu.kotatsu.ui.settings.HistorySettingsFragment"
android:icon="@drawable/ic_history"

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<MultiSelectListPreference
android:defaultValue="@array/values_reader_switchers_default"
android:entries="@array/reader_switchers"
android:entryValues="@array/values_reader_switchers"
android:key="@string/key_reader_switchers"
android:title="@string/switch_pages"
app:iconSpaceReserved="false" />
</PreferenceScreen>