diff --git a/app/build.gradle b/app/build.gradle index 2ef18021d..10edf9d61 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,8 +58,8 @@ androidExtensions { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3' - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5' implementation 'androidx.core:core-ktx:1.3.0-rc01' implementation 'androidx.fragment:fragment-ktx:1.2.4' diff --git a/app/src/main/java/org/koitharu/kotatsu/ui/reader/ReaderActivity.kt b/app/src/main/java/org/koitharu/kotatsu/ui/reader/ReaderActivity.kt index f842297a6..af8bc33a4 100644 --- a/app/src/main/java/org/koitharu/kotatsu/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/org/koitharu/kotatsu/ui/reader/ReaderActivity.kt @@ -42,7 +42,8 @@ import org.koitharu.kotatsu.utils.ext.* class ReaderActivity : BaseFullscreenActivity(), ReaderView, ChaptersDialog.OnChapterChangeListener, GridTouchHelper.OnGridTouchListener, OnPageSelectListener, ReaderConfigDialog.Callback, - ReaderListener, SharedPreferences.OnSharedPreferenceChangeListener { + ReaderListener, SharedPreferences.OnSharedPreferenceChangeListener, + View.OnApplyWindowInsetsListener { private val presenter by moxyPresenter(factory = ::ReaderPresenter) private val settings by inject() @@ -66,7 +67,7 @@ class ReaderActivity : BaseFullscreenActivity(), ReaderView, ChaptersDialog.OnCh toolbar_bottom.setOnMenuItemClickListener(::onOptionsItemSelected) state = savedInstanceState?.getParcelable(EXTRA_STATE) - ?: intent.getParcelableExtra(EXTRA_STATE) + ?: intent.getParcelableExtra(EXTRA_STATE) ?: let { Toast.makeText(this, R.string.error_occurred, Toast.LENGTH_SHORT).show() finish() @@ -79,10 +80,7 @@ class ReaderActivity : BaseFullscreenActivity(), ReaderView, ChaptersDialog.OnCh getString(R.string.chapter_d_of_d, state.chapter?.number ?: 0, size) } - appbar_bottom.setOnApplyWindowInsetsListener { view, insets -> - view.updatePadding(bottom = insets.systemWindowInsetBottom) - insets - } + rootLayout.setOnApplyWindowInsetsListener(this) settings.subscribe(this) loadSettings() @@ -356,6 +354,11 @@ class ReaderActivity : BaseFullscreenActivity(), ReaderView, ChaptersDialog.OnCh } } + override fun onApplyWindowInsets(v: View, insets: WindowInsets): WindowInsets { + appbar_top.updatePadding(top = insets.systemWindowInsetTop) + appbar_bottom.updatePadding(bottom = insets.systemWindowInsetBottom) + return insets.consumeSystemWindowInsets() + } private fun loadSettings() { settings.readerPageSwitch.let { diff --git a/app/src/main/res/layout/activity_reader.xml b/app/src/main/res/layout/activity_reader.xml index 16201aeeb..0e1f66a4d 100644 --- a/app/src/main/res/layout/activity_reader.xml +++ b/app/src/main/res/layout/activity_reader.xml @@ -27,7 +27,6 @@ android:layout_height="wrap_content" android:background="@color/dim" android:elevation="0dp" - android:fitsSystemWindows="true" android:theme="@style/AppToolbarTheme" app:elevation="0dp"> @@ -46,7 +45,6 @@ android:layout_gravity="bottom" android:background="@color/dim" android:elevation="0dp" - android:fitsSystemWindows="true" android:theme="@style/AppToolbarTheme" app:elevation="0dp"> diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index b89c0e703..292d7e10f 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,12 +1,11 @@ - - + - \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ea3af997a..70aa6bb91 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun May 03 16:59:44 EEST 2020 +#Sat May 09 10:22:49 EEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-rc-4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-all.zip