diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9943d4a1..d5af8f88 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -12,8 +12,8 @@ android { applicationId = "com.lt2333.simplicitytools" minSdk = 31 targetSdk = 32 - versionCode = 66 - versionName = "1.6.5" + versionCode = 67 + versionName = "1.6.6" } buildTypes { @@ -59,4 +59,5 @@ dependencies { val appCenterSdkVersion = "4.4.3" implementation("com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}") implementation("com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}") + implementation("androidx.core:core-splashscreen:1.0.0-rc01") } \ No newline at end of file diff --git a/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt b/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt index c2ba74f1..e7960fa7 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt @@ -300,6 +300,10 @@ class SettingsActivity : MIUIActivity() { onClickListener = { showFragment("hide_icon") } ) ) + TextWithSwitch( + TextV(resId = R.string.show_wifi_standard), + SwitchV("show_wifi_standard") + ) val customMobileTypeTextBinding = GetDataBinding(object : DefValue { override fun getValue(): Any { return safeSP.getBoolean("custom_mobile_type_text_switch", false) @@ -362,10 +366,6 @@ class SettingsActivity : MIUIActivity() { 2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE } } - TextWithSwitch( - TextV(resId = R.string.show_wifi_standard), - SwitchV("show_wifi_standard") - ) TextSummaryWithSwitch( TextSummaryV( textId = R.string.big_mobile_type_icon diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/cast/ForceSupportSendApp.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/cast/ForceSupportSendApp.kt index 7c171c6d..13c24f8e 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/hook/app/cast/ForceSupportSendApp.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/cast/ForceSupportSendApp.kt @@ -7,14 +7,11 @@ import com.lt2333.simplicitytools.util.xposed.base.HookRegister object ForceSupportSendApp : HookRegister() { - override fun init() { - hasEnable("force_support_send_app") { - findMethod("com.xiaomi.mirror.synergy.MiuiSynergySdk") { - name == "isSupportSendApp" - }.hookAfter { - it.result = true - } + override fun init() = hasEnable("force_support_send_app") { + findMethod("com.xiaomi.mirror.synergy.MiuiSynergySdk") { + name == "isSupportSendApp" + }.hookAfter { + it.result = true } } - } \ No newline at end of file diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/reardisplay/RearDisplayWeather.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/reardisplay/RearDisplayWeather.kt index 942697f5..d81c505e 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/hook/app/reardisplay/RearDisplayWeather.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/reardisplay/RearDisplayWeather.kt @@ -17,89 +17,86 @@ import com.lt2333.simplicitytools.view.WeatherView object RearDisplayWeather : HookRegister() { - override fun init() { - hasEnable("rear_show_weather") { - findMethod("com.xiaomi.misubscreenui.light.aod.view.VerticalClockView") { - name == "onFinishInflate" - }.hookAfter { - val viewGroup = it.thisObject as ViewGroup - val context = viewGroup.context + override fun init() = hasEnable("rear_show_weather") { + findMethod("com.xiaomi.misubscreenui.light.aod.view.VerticalClockView") { + name == "onFinishInflate" + }.hookAfter { + val viewGroup = it.thisObject as ViewGroup + val context = viewGroup.context - //获取原组件 - val gradientLayoutID = - context.resources.getIdentifier("gradient_layout", "id", context.packageName) - val gradientLayout: ViewGroup = viewGroup.findViewById(gradientLayoutID) - val dateID = context.resources.getIdentifier("date", "id", context.packageName) - val date: TextView = viewGroup.findViewById(dateID) + //获取原组件 + val gradientLayoutID = + context.resources.getIdentifier("gradient_layout", "id", context.packageName) + val gradientLayout: ViewGroup = viewGroup.findViewById(gradientLayoutID) + val dateID = context.resources.getIdentifier("date", "id", context.packageName) + val date: TextView = viewGroup.findViewById(dateID) - //创建天气组件 - val mWeatherView = WeatherView(context, false).apply { - gravity = Gravity.END - setTextAppearance( - context.resources.getIdentifier( - "Sub_Screen_Aod_date_s", - "style", - context.packageName - ) + //创建天气组件 + val mWeatherView = WeatherView(context, false).apply { + gravity = Gravity.END + setTextAppearance( + context.resources.getIdentifier( + "Sub_Screen_Aod_date_s", + "style", + context.packageName ) - typeface = Typeface.create("mipro-medium", Typeface.NORMAL) - setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12f) - } - gradientLayout.addView(mWeatherView, (gradientLayout.indexOfChild(date) + 1)) + ) + typeface = Typeface.create("mipro-medium", Typeface.NORMAL) + setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12f) } + gradientLayout.addView(mWeatherView, (gradientLayout.indexOfChild(date) + 1)) + } - findMethod("com.xiaomi.misubscreenui.light.aod.view.HorizontalClockView") { - name == "onFinishInflate" - }.hookBefore { param -> - val viewGroup = param.thisObject as ViewGroup - val context = viewGroup.context + findMethod("com.xiaomi.misubscreenui.light.aod.view.HorizontalClockView") { + name == "onFinishInflate" + }.hookBefore { param -> + val viewGroup = param.thisObject as ViewGroup + val context = viewGroup.context - //获取原组件 - val gradientLayoutID = - context.resources.getIdentifier("gradient_layout", "id", context.packageName) - val gradientLayout: RelativeLayout = viewGroup.findViewById(gradientLayoutID) - val dateID = context.resources.getIdentifier("date", "id", context.packageName) - val date: TextView = viewGroup.findViewById(dateID) - val dateParentLayout: ViewGroup = date.parent as ViewGroup + //获取原组件 + val gradientLayoutID = + context.resources.getIdentifier("gradient_layout", "id", context.packageName) + val gradientLayout: RelativeLayout = viewGroup.findViewById(gradientLayoutID) + val dateID = context.resources.getIdentifier("date", "id", context.packageName) + val date: TextView = viewGroup.findViewById(dateID) + val dateParentLayout: ViewGroup = date.parent as ViewGroup - //创建天气组件 - val mWeatherView = WeatherView(context, false).apply { - id = View.generateViewId() - gravity = Gravity.CENTER - maxLines = 1 - setTextAppearance( - context.resources.getIdentifier( - "Sub_Screen_Aod_date_s_horizontal", - "style", - context.packageName - ) + //创建天气组件 + val mWeatherView = WeatherView(context, false).apply { + id = View.generateViewId() + gravity = Gravity.CENTER + maxLines = 1 + setTextAppearance( + context.resources.getIdentifier( + "Sub_Screen_Aod_date_s_horizontal", + "style", + context.packageName ) - typeface = Typeface.create("mipro-medium", Typeface.NORMAL) - layoutParams = RelativeLayout.LayoutParams( - RelativeLayout.LayoutParams.WRAP_CONTENT, - dp2px(context, 30f) - ).also { - it.addRule(RelativeLayout.END_OF, dateID) - it.marginStart = dp2px(context, 3f) - it.marginEnd = dp2px(context, 3f) - } - } - dateParentLayout.addView(mWeatherView, (dateParentLayout.indexOfChild(date) + 1)) - - //电池位置 - val batteryID = - context.resources.getIdentifier("battery_container", "id", context.packageName) - val battery: ViewGroup = viewGroup.findViewById(batteryID) - - battery.layoutParams = RelativeLayout.LayoutParams( + ) + typeface = Typeface.create("mipro-medium", Typeface.NORMAL) + layoutParams = RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, dp2px(context, 30f) ).also { - it.addRule(RelativeLayout.END_OF, mWeatherView.id) + it.addRule(RelativeLayout.END_OF, dateID) + it.marginStart = dp2px(context, 3f) + it.marginEnd = dp2px(context, 3f) } - gradientLayout.setPadding(0, dp2px(context, 5f), 0, 0) } + dateParentLayout.addView(mWeatherView, (dateParentLayout.indexOfChild(date) + 1)) + + //电池位置 + val batteryID = + context.resources.getIdentifier("battery_container", "id", context.packageName) + val battery: ViewGroup = viewGroup.findViewById(batteryID) + + battery.layoutParams = RelativeLayout.LayoutParams( + RelativeLayout.LayoutParams.WRAP_CONTENT, + dp2px(context, 30f) + ).also { + it.addRule(RelativeLayout.END_OF, mWeatherView.id) + } + gradientLayout.setPadding(0, dp2px(context, 5f), 0, 0) } } - } \ No newline at end of file diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/ControlCenterWeather.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/ControlCenterWeather.kt index ae30aeee..e5d302a7 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/ControlCenterWeather.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/ControlCenterWeather.kt @@ -29,9 +29,8 @@ object ControlCenterWeather : HookRegister() { val context = viewGroup.context // MIUI编译时间大于 2022-03-12 00:00:00 且为内测版 - if (SystemProperties[context, "ro.build.date.utc"]!!.toInt() >= 1647014400 && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith( - "DEV" - ) && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith("XM") + if (SystemProperties[context, "ro.build.date.utc"]!!.toInt() >= 1647014400 && + !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith("XM") ) { //获取原组件 val big_time_ID = diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/HideStatusBarNetworkSpeedSecond.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/HideStatusBarNetworkSpeedSecond.kt index fe5de021..ac5b9f7c 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/HideStatusBarNetworkSpeedSecond.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/HideStatusBarNetworkSpeedSecond.kt @@ -23,5 +23,4 @@ object HideStatusBarNetworkSpeedSecond : HookRegister() { } } } - } \ No newline at end of file diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NotificationWeather.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NotificationWeather.kt index cc4618b5..51516e11 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NotificationWeather.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NotificationWeather.kt @@ -29,9 +29,8 @@ object NotificationWeather : HookRegister() { val context = viewGroup.context // MIUI编译时间大于 2022-03-12 00:00:00 且为内测版 - if (SystemProperties[context, "ro.build.date.utc"]!!.toInt() >= 1647014400 && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith( - "DEV" - ) && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith("XM") + if (SystemProperties[context, "ro.build.date.utc"]!!.toInt() >= 1647014400 && + !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith("XM") ) { //获取原组件 val big_time_ID = diff --git a/blockmiui b/blockmiui index dc018183..a02e4a13 160000 --- a/blockmiui +++ b/blockmiui @@ -1 +1 @@ -Subproject commit dc0181838354be184c553b2a901830362f4735bd +Subproject commit a02e4a13b339efe8c3965cb985e2b8d09f86c1f8