Initial support for custom images scaling (#40)

This commit is contained in:
inorichi
2016-01-27 01:48:40 +01:00
parent c6ecfb2f67
commit 0c9bc97fe8
19 changed files with 127 additions and 91 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/reader_menu_background"
android:paddingRight="10dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:paddingBottom="5dp">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/reader_menu_settings_item"
android:text="@string/pref_custom_brightness"
android:id="@+id/custom_brightness" />
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/brightness_seekbar" />
</LinearLayout>

View File

@@ -74,18 +74,19 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="@+id/reader_brightness"
android:src="@drawable/ic_brightness_high"
android:id="@+id/lock_orientation"
android:src="@drawable/ic_screen_rotation"
android:layout_gravity="center_vertical"
android:background="?android:selectableItemBackground" />
<ImageButton
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="@+id/lock_orientation"
android:src="@drawable/ic_screen_rotation"
android:id="@+id/reader_scale_type_selector"
android:src="@drawable/ic_zoom_out_map_white_24dp"
android:layout_gravity="center_vertical"
android:background="?android:selectableItemBackground" />
<ImageButton
android:layout_width="0dp"
android:layout_height="match_parent"

View File

@@ -10,7 +10,8 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:id="@+id/image_decoder_container">
<TextView
android:id="@+id/image_decoder_initial"
@@ -53,4 +54,16 @@
style="@style/reader_menu_settings_item"
android:text="@string/pref_keep_screen_on"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/reader_menu_settings_item"
android:text="@string/pref_custom_brightness"
android:id="@+id/custom_brightness" />
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/brightness_seekbar" />
</LinearLayout>

View File

@@ -48,6 +48,22 @@
<item>1</item>
</string-array>
<string-array name="image_scale_type">
<item>@string/scale_type_fit_screen</item>
<item>@string/scale_type_stretch</item>
<item>@string/scale_type_fit_width</item>
<item>@string/scale_type_fit_height</item>
<item>@string/scale_type_original_size</item>
</string-array>
<string-array name="image_scale_type_values">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
<string-array name="library_update_interval">
<item>@string/update_never</item>
<item>@string/update_1hour</item>

View File

@@ -16,6 +16,7 @@
<string name="pref_ask_update_manga_sync_key">pref_ask_update_manga_sync_key</string>
<string name="pref_default_viewer_key">pref_default_viewer_key</string>
<string name="pref_image_scale_type_key">pref_image_scale_type_key</string>
<string name="pref_hide_status_bar_key">pref_hide_status_bar_key</string>
<string name="pref_lock_orientation_key">pref_lock_orientation_key</string>
<string name="pref_enable_transitions_key">pref_enable_transitions_key</string>

View File

@@ -97,6 +97,12 @@
<string name="pref_image_decoder">Image decoder</string>
<string name="rapid_decoder">Rapid</string>
<string name="skia_decoder">Skia</string>
<string name="pref_image_scale_type">Scale type</string>
<string name="scale_type_fit_screen">Fit screen</string>
<string name="scale_type_stretch">Stretch</string>
<string name="scale_type_fit_width">Fit width</string>
<string name="scale_type_fit_height">Fit height</string>
<string name="scale_type_original_size">Original size</string>
<!-- Downloads section -->
<string name="pref_download_directory">Downloads directory</string>

View File

@@ -25,6 +25,14 @@
android:defaultValue="1"
android:summary="%s"/>
<eu.kanade.tachiyomi.widget.preference.IntListPreference
android:title="@string/pref_image_scale_type"
android:key="@string/pref_image_scale_type_key"
android:entries="@array/image_scale_type"
android:entryValues="@array/image_scale_type_values"
android:defaultValue="1"
android:summary="%s"/>
<eu.kanade.tachiyomi.widget.preference.IntListPreference
android:title="@string/pref_reader_theme"
android:key="@string/pref_reader_theme_key"