6.6.3 - Alpha5 - 修复 Android 15 UI 模式顶部内容被状态栏覆盖的问题
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
"定时任务页面编辑自定义广播内容时出现的输入法遮挡问题",
|
"定时任务页面编辑自定义广播内容时出现的输入法遮挡问题",
|
||||||
"APK 文件类型信息对话框可能无法获取应用名称及 SDK 信息的问题",
|
"APK 文件类型信息对话框可能无法获取应用名称及 SDK 信息的问题",
|
||||||
"文件管理器示例代码进入项目目录时可能无法自动加载子目录文件内容的问题",
|
"文件管理器示例代码进入项目目录时可能无法自动加载子目录文件内容的问题",
|
||||||
|
"Android 15 UI 模式顶部内容被状态栏覆盖的问题",
|
||||||
"Android 15 部分页面状态栏背景颜色可能无法动态跟随主题色的问题",
|
"Android 15 部分页面状态栏背景颜色可能无法动态跟随主题色的问题",
|
||||||
"dialogs 模块无法正常使用 customView 属性的问题 _[`issue #364`](http://issues.autojs6.com/364)_",
|
"dialogs 模块无法正常使用 customView 属性的问题 _[`issue #364`](http://issues.autojs6.com/364)_",
|
||||||
"dialogs.input 方法的表达式参数可能无法获得执行结果的问题",
|
"dialogs.input 方法的表达式参数可能无法获得执行结果的问题",
|
||||||
|
|||||||
@@ -12,12 +12,18 @@ import android.view.KeyEvent
|
|||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
|
import android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
|
import android.view.View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||||
|
import android.view.View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.graphics.drawable.toDrawable
|
import androidx.core.graphics.drawable.toDrawable
|
||||||
|
import androidx.core.view.ViewCompat
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
import androidx.core.view.isNotEmpty
|
import androidx.core.view.isNotEmpty
|
||||||
import org.autojs.autojs.AbstractAutoJs.Companion.isInrt
|
import org.autojs.autojs.AbstractAutoJs.Companion.isInrt
|
||||||
import org.autojs.autojs.annotation.ScriptInterface
|
import org.autojs.autojs.annotation.ScriptInterface
|
||||||
|
import org.autojs.autojs.app.OnActivityResultDelegate
|
||||||
import org.autojs.autojs.core.eventloop.EventEmitter
|
import org.autojs.autojs.core.eventloop.EventEmitter
|
||||||
import org.autojs.autojs.core.eventloop.SimpleEvent
|
import org.autojs.autojs.core.eventloop.SimpleEvent
|
||||||
import org.autojs.autojs.engine.JavaScriptEngine
|
import org.autojs.autojs.engine.JavaScriptEngine
|
||||||
@@ -81,6 +87,17 @@ class ScriptExecuteActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
ViewUtils.addWindowFlags(this, WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
|
ViewUtils.addWindowFlags(this, WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
|
ViewUtils.appendSystemUiVisibility(this, SYSTEM_UI_FLAG_LAYOUT_STABLE or SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(android.R.id.content)) { v, insets ->
|
||||||
|
val sysBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||||
|
v.setPadding(0, sysBars.top, 0, sysBars.bottom)
|
||||||
|
WindowInsetsCompat.CONSUMED
|
||||||
|
}
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
||||||
|
ViewUtils.setNavigationBarBackgroundColor(this, getColor(R.color.black_alpha_44))
|
||||||
|
}
|
||||||
|
|
||||||
val executionId = intent.getIntExtra(EXTRA_EXECUTION_ID, ScriptExecution.NO_ID)
|
val executionId = intent.getIntExtra(EXTRA_EXECUTION_ID, ScriptExecution.NO_ID)
|
||||||
if (executionId == ScriptExecution.NO_ID) {
|
if (executionId == ScriptExecution.NO_ID) {
|
||||||
super.finish()
|
super.finish()
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ abstract class BaseActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
if (handleNavigationBarContrastEnforcedAutomatically) {
|
if (handleNavigationBarContrastEnforcedAutomatically) {
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
||||||
@Suppress("DEPRECATION")
|
ViewUtils.setNavigationBarBackgroundColor(this, getColor(R.color.black_alpha_44))
|
||||||
window.navigationBarColor = getColor(R.color.black_alpha_44)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user