diff --git a/app/build.gradle b/app/build.gradle
index 9febe4562..871cee9aa 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -98,7 +98,7 @@ android {
dependencies {
// Modified dependencies
- compile 'com.github.inorichi:subsampling-scale-image-view:44aa442'
+ compile 'com.github.inorichi:subsampling-scale-image-view:9048f23'
compile 'com.github.inorichi:junrar-android:634c1f5'
// Android support library
diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt
index 4812b0c72..fa77e4ad4 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt
@@ -41,6 +41,8 @@ class PreferenceKeys(context: Context) {
val readerTheme = context.getString(R.string.pref_reader_theme_key)
+ val cropBorders = context.getString(R.string.pref_crop_borders_key)
+
val readWithTapping = context.getString(R.string.pref_read_with_tapping_key)
val readWithVolumeKeys = context.getString(R.string.pref_read_with_volume_keys_key)
diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt
index 9fdda648a..f6a964829 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt
@@ -34,7 +34,7 @@ class PreferencesHelper(val context: Context) {
fun rotation() = rxPrefs.getInteger(keys.rotation, 1)
- fun enableTransitions() = rxPrefs.getBoolean(keys.enableTransitions, true)
+ fun pageTransitions() = rxPrefs.getBoolean(keys.enableTransitions, true)
fun showPageNumber() = rxPrefs.getBoolean(keys.showPageNumber, true)
@@ -60,6 +60,8 @@ class PreferencesHelper(val context: Context) {
fun readerTheme() = rxPrefs.getInteger(keys.readerTheme, 0)
+ fun cropBorders() = rxPrefs.getBoolean(keys.cropBorders, false)
+
fun readWithTapping() = rxPrefs.getBoolean(keys.readWithTapping, true)
fun readWithVolumeKeys() = rxPrefs.getBoolean(keys.readWithVolumeKeys, false)
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsDialog.kt
index 56659e637..bdcc558dd 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsDialog.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsDialog.kt
@@ -83,6 +83,11 @@ class ReaderSettingsDialog : DialogFragment() {
fullscreen.setOnCheckedChangeListener { v, isChecked ->
preferences.fullscreen().set(isChecked)
}
+
+ crop_borders.isChecked = preferences.cropBorders().getOrDefault()
+ crop_borders.setOnCheckedChangeListener { v, isChecked ->
+ preferences.cropBorders().set(isChecked)
+ }
}
override fun onDestroyView() {
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PageView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PageView.kt
index 26326cb32..a75eaaee7 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PageView.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PageView.kt
@@ -70,6 +70,7 @@ class PageView @JvmOverloads constructor(context: Context, attrs: AttributeSet?
setRegionDecoderClass(reader.regionDecoderClass)
setBitmapDecoderClass(reader.bitmapDecoderClass)
setVerticalScrollingParent(reader is VerticalReader)
+ setCropBorders(reader.cropBorders)
setOnTouchListener { v, motionEvent -> reader.gestureDetector.onTouchEvent(motionEvent) }
setOnLongClickListener { reader.onLongClick(page) }
setOnImageEventListener(object : SubsamplingScaleImageView.DefaultOnImageEventListener() {
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerReader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerReader.kt
index 3e3581cb1..d3c1f4589 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerReader.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerReader.kt
@@ -79,6 +79,12 @@ abstract class PagerReader : BaseReader() {
var transitions: Boolean = false
private set
+ /**
+ * Whether to crop image borders.
+ */
+ var cropBorders: Boolean = false
+ private set
+
/**
* Scale type (fit width, fit screen, etc).
*/
@@ -150,9 +156,16 @@ abstract class PagerReader : BaseReader() {
.distinctUntilChanged()
.subscribe { refreshAdapter() })
- add(preferences.enableTransitions()
+ add(preferences.pageTransitions()
.asObservable()
.subscribe { transitions = it })
+
+ add(preferences.cropBorders()
+ .asObservable()
+ .doOnNext { cropBorders = it }
+ .skip(1)
+ .distinctUntilChanged()
+ .subscribe { refreshAdapter() })
}
setPagesOnAdapter()
diff --git a/app/src/main/res/layout/dialog_reader_settings.xml b/app/src/main/res/layout/dialog_reader_settings.xml
index 67244208d..2ac02900b 100644
--- a/app/src/main/res/layout/dialog_reader_settings.xml
+++ b/app/src/main/res/layout/dialog_reader_settings.xml
@@ -165,6 +165,12 @@
android:layout_height="wrap_content"
android:text="@string/pref_show_page_number"/>
+
+
Цял екран
Заключи ориентацията
- Преходи
+ Преходи
Номер на страница
Персонализирана яркост
Персонализиран цветен филтър
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 40dbdadc7..ff82bcd3e 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -95,7 +95,7 @@
Pantalla completa
Bloquear orientación
- Habilitar transiciones
+ Habilitar transiciones
Mostrar el número de página
Utilizar brillo personalizado
Mantener la pantalla encendida
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 96a272ec9..e9f448295 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -115,7 +115,7 @@
Plein écran
Verrouiller l\'orientation
- Activer les transitions
+ Activer les transitions
Afficher le numéro de page
Utiliser une luminosité personnalisée
Utiliser un filtre de couleur personnalisé
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index f1dc9eaf7..ab7da63cd 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -115,7 +115,7 @@
Schermo intero
Blocca orientamento
- Abilita transizioni
+ Abilita transizioni
Mostra numero di pagina
Usa luminosità personalizzata
Usa filtro colore personalizzato
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 6c9191347..8bc775afa 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -100,7 +100,7 @@
Ocultar barra de estado
Bloquear orientação
- Permitir transições
+ Permitir transições
Mostrar número de página
Usar brilho personalizado
Manter ecrã ligado
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 363fd5a09..6eb73b128 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -213,7 +213,7 @@
Отсылать отчеты о падениях
Проверять обновления
Автоматически проверять новые версии
- Включить переходы
+ Включить переходы
Полноэкранный режим
Декодер изображений
Масштабирование
diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml
index c300f1e83..0aec85ace 100644
--- a/app/src/main/res/values-vi/strings.xml
+++ b/app/src/main/res/values-vi/strings.xml
@@ -118,7 +118,7 @@
Đầy màn hình
Khóa xoay
- Bật hiệu ứng chuyển trang
+ Bật hiệu ứng chuyển trang
Hiện số trang
Dùng độ sáng tùy chỉnh
Dùng bộ lọc màu tùy chỉnh
diff --git a/app/src/main/res/values/keys.xml b/app/src/main/res/values/keys.xml
index 8e672c3db..4c2ea1549 100644
--- a/app/src/main/res/values/keys.xml
+++ b/app/src/main/res/values/keys.xml
@@ -37,8 +37,10 @@
pref_red_filter_value
pref_reader_theme_key
image_decoder
+ crop_borders
reader_volume_keys
reader_tap
+
pref_filter_downloaded_key
pref_filter_unread_key
library_sorting_mode
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index d4e29f6fc..cfc4d4866 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -120,8 +120,9 @@
Fullscreen
Lock orientation
- Enable transitions
+ Page transitions
Show page number
+ Crop borders
Use custom brightness
Use custom color filter
Keep screen on
diff --git a/app/src/main/res/xml/pref_reader.xml b/app/src/main/res/xml/pref_reader.xml
index ec3a5b63d..4c59665d6 100644
--- a/app/src/main/res/xml/pref_reader.xml
+++ b/app/src/main/res/xml/pref_reader.xml
@@ -64,7 +64,7 @@
android:defaultValue="true" />
@@ -73,6 +73,11 @@
android:key="@string/pref_show_page_number_key"
android:defaultValue="true" />
+
+