mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -74,11 +74,6 @@ android {
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
ndk {
|
||||
//noinspection ChromeOsAbiSupport
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
}
|
||||
|
||||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
signingConfig signingConfigs.myConfig
|
||||
}
|
||||
@@ -94,11 +89,6 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'cronet-proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
ndk {
|
||||
//noinspection ChromeOsAbiSupport
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
}
|
||||
|
||||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
signingConfig signingConfigs.myConfig
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import androidx.annotation.ColorInt
|
||||
import androidx.annotation.StyleRes
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.core.graphics.alpha
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.children
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
@@ -23,6 +22,7 @@ import io.legado.app.help.config.AppConfig
|
||||
import io.legado.app.lib.theme.elevation
|
||||
import io.legado.app.lib.theme.primaryColor
|
||||
import io.legado.app.utils.activity
|
||||
import io.legado.app.utils.setOnApplyWindowInsetsListenerCompat
|
||||
import splitties.views.bottomPadding
|
||||
import splitties.views.topPadding
|
||||
|
||||
@@ -165,7 +165,7 @@ class TitleBar @JvmOverloads constructor(
|
||||
// }
|
||||
|
||||
if (fitStatusBar || fitNavigationBar) {
|
||||
ViewCompat.setOnApplyWindowInsetsListener(this) { _, windowInsets ->
|
||||
setOnApplyWindowInsetsListenerCompat { _, windowInsets ->
|
||||
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||
if (fitStatusBar) {
|
||||
topPadding = insets.top
|
||||
|
||||
@@ -304,3 +304,15 @@ fun View.canScroll(direction: Int): Boolean {
|
||||
return canScrollVertically(direction) || canScrollHorizontally(direction)
|
||||
}
|
||||
|
||||
fun View.setOnApplyWindowInsetsListenerCompat(listener: (View, WindowInsetsCompat) -> WindowInsetsCompat) {
|
||||
ViewCompat.setOnApplyWindowInsetsListener(this) { view, insets ->
|
||||
val windowInsets = listener(view, insets)
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M && isLayoutRequested) {
|
||||
post {
|
||||
requestLayout()
|
||||
}
|
||||
}
|
||||
windowInsets
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user