|
|
@ -10,6 +10,7 @@ import android.os.Build |
|
|
|
import android.view.View |
|
|
|
import android.view.View |
|
|
|
import android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR |
|
|
|
import android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR |
|
|
|
import android.view.WindowInsetsController |
|
|
|
import android.view.WindowInsetsController |
|
|
|
|
|
|
|
import android.view.WindowManager |
|
|
|
import android.widget.EdgeEffect |
|
|
|
import android.widget.EdgeEffect |
|
|
|
import android.widget.ScrollView |
|
|
|
import android.widget.ScrollView |
|
|
|
import androidx.annotation.ColorInt |
|
|
|
import androidx.annotation.ColorInt |
|
|
@ -41,6 +42,25 @@ object ATH { |
|
|
|
) > since |
|
|
|
) > since |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun fullScreen(activity: Activity) { |
|
|
|
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { |
|
|
|
|
|
|
|
activity.window.setDecorFitsSystemWindows(true) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
fullScreenO(activity) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
activity.window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Suppress("DEPRECATION") |
|
|
|
|
|
|
|
private fun fullScreenO(activity: Activity) { |
|
|
|
|
|
|
|
activity.window.decorView.systemUiVisibility = |
|
|
|
|
|
|
|
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
|
|
|
|
|
|
activity.window.clearFlags( |
|
|
|
|
|
|
|
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS |
|
|
|
|
|
|
|
or WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setStatusBarColorAuto(activity: Activity, fullScreen: Boolean) { |
|
|
|
fun setStatusBarColorAuto(activity: Activity, fullScreen: Boolean) { |
|
|
|
val isTransparentStatusBar = AppConfig.isTransparentStatusBar |
|
|
|
val isTransparentStatusBar = AppConfig.isTransparentStatusBar |
|
|
|
val statusBarColor = ThemeStore.statusBarColor(activity, isTransparentStatusBar) |
|
|
|
val statusBarColor = ThemeStore.statusBarColor(activity, isTransparentStatusBar) |
|
|
|