mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Add support for margins in Webtoon view
On larger tablets, matching the page width to the screen width in webtoon mode causes eye strain due to the image looking so magnified. Adding a page margin to the image can resolve this by effectively scaling the image down.
This commit is contained in:
		| @@ -240,6 +240,25 @@ | ||||
|         android:textColor="?android:attr/textColorSecondary" | ||||
|         app:layout_constraintTop_toBottomOf="@id/webtoon_prefs" /> | ||||
|  | ||||
|     <TextView | ||||
|         android:id="@+id/margin_ratio_text" | ||||
|         android:layout_width="0dp" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:text="@string/pref_reader_margin" | ||||
|         app:layout_constraintLeft_toLeftOf="parent" | ||||
|         app:layout_constraintRight_toLeftOf="@id/verticalcenter" | ||||
|         app:layout_constraintBaseline_toBaselineOf="@id/margin_ratio_webtoon"/> | ||||
|  | ||||
|     <android.support.v7.widget.AppCompatSpinner | ||||
|         android:id="@+id/margin_ratio_webtoon" | ||||
|         android:layout_width="0dp" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_marginTop="16dp" | ||||
|         android:entries="@array/margin_ratio" | ||||
|         app:layout_constraintLeft_toRightOf="@id/verticalcenter" | ||||
|         app:layout_constraintRight_toRightOf="@id/spinner_end" | ||||
|         app:layout_constraintTop_toBottomOf="@id/crop_borders_webtoon"/> | ||||
|  | ||||
|     <!-- Groups of preferences --> | ||||
|  | ||||
|     <android.support.constraint.Group | ||||
| @@ -255,7 +274,7 @@ | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:visibility="gone" | ||||
|         app:constraint_referenced_ids="webtoon_prefs,crop_borders_webtoon" /> | ||||
|         app:constraint_referenced_ids="webtoon_prefs,crop_borders_webtoon,margin_ratio_text,margin_ratio_webtoon" /> | ||||
|  | ||||
|     <android.support.constraint.Guideline | ||||
|         android:id="@+id/verticalcenter" | ||||
|   | ||||
| @@ -53,6 +53,12 @@ | ||||
|         <item>@string/scale_type_smart_fit</item> | ||||
|     </string-array> | ||||
|  | ||||
|     <string-array name="margin_ratio"> | ||||
|         <item>@string/webtoon_margin_ratio_0</item> | ||||
|         <item>@string/webtoon_margin_ratio_10</item> | ||||
|         <item>@string/webtoon_margin_ratio_25</item> | ||||
|     </string-array> | ||||
|  | ||||
|     <string-array name="image_scale_type_values"> | ||||
|         <item>1</item> | ||||
|         <item>2</item> | ||||
|   | ||||
| @@ -196,6 +196,7 @@ | ||||
|     <string name="pref_read_with_tapping">Tapping</string> | ||||
|     <string name="pref_read_with_long_tap">Long tap dialog</string> | ||||
|     <string name="pref_reader_theme">Background color</string> | ||||
|     <string name="pref_reader_margin">Margin ratio</string> | ||||
|     <string name="white_background">White</string> | ||||
|     <string name="black_background">Black</string> | ||||
|     <string name="pref_viewer_type">Default viewer</string> | ||||
| @@ -230,6 +231,9 @@ | ||||
|     <string name="color_filter_g_value">G</string> | ||||
|     <string name="color_filter_b_value">B</string> | ||||
|     <string name="color_filter_a_value">A</string> | ||||
|     <string name="webtoon_margin_ratio_0">No margin</string> | ||||
|     <string name="webtoon_margin_ratio_10">10%</string> | ||||
|     <string name="webtoon_margin_ratio_25">25%</string> | ||||
|  | ||||
|  | ||||
|       <!-- Downloads section --> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user