mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-17 14:39:18 +01:00
Use insetter library for handling inset padding
This commit is contained in:
parent
912687ac78
commit
3ddd1033c3
@ -153,6 +153,8 @@ dependencies {
|
|||||||
// UI library
|
// UI library
|
||||||
implementation 'com.google.android.material:material:1.3.0-alpha02'
|
implementation 'com.google.android.material:material:1.3.0-alpha02'
|
||||||
|
|
||||||
|
implementation 'dev.chrisbanes:insetter-ktx:0.3.1'
|
||||||
|
|
||||||
standardImplementation 'com.google.firebase:firebase-core:17.4.4'
|
standardImplementation 'com.google.firebase:firebase-core:17.4.4'
|
||||||
|
|
||||||
// ReactiveX
|
// ReactiveX
|
||||||
|
@ -20,11 +20,11 @@ import android.view.WindowManager
|
|||||||
import android.view.animation.Animation
|
import android.view.animation.Animation
|
||||||
import android.view.animation.AnimationUtils
|
import android.view.animation.AnimationUtils
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.core.view.setPadding
|
import androidx.core.view.setPadding
|
||||||
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
|
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
|
import dev.chrisbanes.insetter.applySystemWindowInsetsToPadding
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.data.database.models.Chapter
|
import eu.kanade.tachiyomi.data.database.models.Chapter
|
||||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||||
@ -288,17 +288,14 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
|||||||
onBackPressed()
|
onBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(binding.readerMenu) { _, insets ->
|
|
||||||
if (!window.isDefaultBar()) {
|
if (!window.isDefaultBar()) {
|
||||||
binding.readerMenu.setPadding(
|
binding.readerMenu.applySystemWindowInsetsToPadding(
|
||||||
insets.systemWindowInsetLeft,
|
left = true,
|
||||||
insets.systemWindowInsetTop,
|
top = true,
|
||||||
insets.systemWindowInsetRight,
|
right = true,
|
||||||
insets.systemWindowInsetBottom
|
bottom = true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
insets
|
|
||||||
}
|
|
||||||
|
|
||||||
// Init listeners on bottom menu
|
// Init listeners on bottom menu
|
||||||
binding.pageSeekbar.setOnSeekBarChangeListener(object : SimpleSeekBarListener() {
|
binding.pageSeekbar.setOnSeekBarChangeListener(object : SimpleSeekBarListener() {
|
||||||
|
Loading…
Reference in New Issue
Block a user