Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
R3.15.6.1
Browse files Browse the repository at this point in the history
快速修正MIUI背景模糊,防止变黑
  • Loading branch information
ryuunoakaihitomi committed Mar 19, 2022
1 parent d144e50 commit cb9e096
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ android {
//targetSdkVersion compileSdkVersion
targetSdkVersion 32
// 版本号:发布日期
versionCode 20220319
versionCode 20220320
// 版本名说明: R3.x.y.z (R3:Refactoring 第三次重构,z:Quick Fix序号)
// 不要包含非ASCII可打印字符,会导致Github release文件名异常
versionName 'R3.15.6'
versionName 'R3.15.6.1'
resConfigs "en", "zh-rCN"

buildConfigField 'String', 'BUILD_TIME', '\"' + new Date() + '\"'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,10 @@ class MainActivity : AppCompatActivity() {
}
})
powerViewModel.prepare()
// 基于以下文章给Android 12之前的MIUI添加背景模糊特效,手表都是黑色背景故不作处理
// 遵照其环境下的系统电源菜单界面,基于以下文章给Android 12之前的MIUI添加背景模糊特效,手表都是黑色背景故不作处理
// https://www.cnblogs.com/zhucai/p/miui-real-time-blur.html
if (!isWatch() && DeviceCompatibility.isMiui() && Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
setTheme(R.style.Theme_AppCompat_DayNight) // 不使用Dialog是因为模糊区仅中间一小块,非常难看
setTheme(R.style.MainStyleBlurCompat)
window.run {
decorView.alpha = 0f
addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND)
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@
<!-- 防止在Wear OS中崩溃和隐藏默认Dialog -->
<item name="windowNoTitle">true</item>
</style>

<!-- 不使用Dialog是因为模糊区仅中间一小块,非常难看 -->
<style name="MainStyleBlurCompat" parent="Theme.AppCompat.DayNight">
<item name="android:backgroundDimAmount">0</item>
</style>
</resources>

0 comments on commit cb9e096

Please sign in to comment.