Compare commits

4 Commits

Author SHA1 Message Date
LittleTurtle2333
179c82d563 Update README.md 2023-02-14 23:17:52 +08:00
LittleTurtle2333
6d1aa2e824 更新版本号至1.7.0 2023-02-14 22:39:13 +08:00
LittleTurtle2333
5c12c0aa56 修复A13中大移动类型图标 2023-02-14 22:36:02 +08:00
LittleTurtle2333
e63b9a861d UI细节优化 2023-02-14 21:15:56 +08:00
9 changed files with 44 additions and 91 deletions

View File

@@ -42,6 +42,7 @@ Xposed仓库下载[点击此处下载最新发行版](https://github.com/Xpos
[qqlittleice/MiuiHome](https://github.com/qqlittleice/MiuiHome) [qqlittleice/MiuiHome](https://github.com/qqlittleice/MiuiHome)
[yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming) [yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming)
[Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer) [Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer)
[MonwF/customiuizer](https://github.com/MonwF/customiuizer)
##### GNU General Public License v2.0 ##### GNU General Public License v2.0
[LSPosed/CorePatch](https://github.com/LSPosed/CorePatch) [LSPosed/CorePatch](https://github.com/LSPosed/CorePatch)
##### GNU Lesser General Public License v2.1 ##### GNU Lesser General Public License v2.1

View File

@@ -34,7 +34,8 @@ Xposed Repo[Click here to download the latest release](https://github.com/Xpo
##### GNU General Public License v3.0 ##### GNU General Public License v3.0
[qqlittleice/MiuiHome](https://github.com/qqlittleice/MiuiHome) [qqlittleice/MiuiHome](https://github.com/qqlittleice/MiuiHome)
[yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming) [yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming)
[Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer) [Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer)
[MonwF/customiuizer](https://github.com/MonwF/customiuizer)
##### GNU General Public License v2.0 ##### GNU General Public License v2.0
[LSPosed/CorePatch](https://github.com/LSPosed/CorePatch) [LSPosed/CorePatch](https://github.com/LSPosed/CorePatch)
##### GNU Lesser General Public License v2.1 ##### GNU Lesser General Public License v2.1

View File

@@ -11,8 +11,8 @@ android {
applicationId = "com.lt2333.simplicitytools" applicationId = "com.lt2333.simplicitytools"
minSdk = 31 minSdk = 31
targetSdk = 33 targetSdk = 33
versionCode = 69 versionCode = 70
versionName = "1.6.9" versionName = "1.7.0"
buildConfigField("String", "BUILD_TIME", "\"${System.currentTimeMillis()}\"") buildConfigField("String", "BUILD_TIME", "\"${System.currentTimeMillis()}\"")
} }

View File

@@ -18,7 +18,7 @@ class MainPageForS : BasePage() {
TextSummaryWithSwitch( TextSummaryWithSwitch(
TextSummaryV( TextSummaryV(
textId = R.string.main_switch, textId = R.string.main_switch,
colorId = R.color.purple_700 colorId = R.color.blue
), SwitchV("main_switch", true) ), SwitchV("main_switch", true)
) )
TextSummaryWithSwitch( TextSummaryWithSwitch(

View File

@@ -599,7 +599,7 @@ class SystemUIPageForS : BasePage() {
TextSummaryWithSwitch( TextSummaryWithSwitch(
TextSummaryV( TextSummaryV(
textId = R.string.show_weather_main_switch, textId = R.string.show_weather_main_switch,
colorId = R.color.purple_700 colorId = R.color.blue
), ),
SwitchV( SwitchV(
"notification_weather", "notification_weather",
@@ -636,7 +636,7 @@ class SystemUIPageForS : BasePage() {
TextSummaryWithSwitch( TextSummaryWithSwitch(
TextSummaryV( TextSummaryV(
textId = R.string.show_weather_main_switch, textId = R.string.show_weather_main_switch,
colorId = R.color.purple_700, colorId = R.color.blue,
tipsId = R.string.control_center_weather_summary tipsId = R.string.control_center_weather_summary
), ),
SwitchV( SwitchV(
@@ -703,7 +703,7 @@ class SystemUIPageForS : BasePage() {
TextSummaryWithSwitch( TextSummaryWithSwitch(
TextSummaryV( TextSummaryV(
textId = R.string.old_qs_custom_switch, textId = R.string.old_qs_custom_switch,
colorId = R.color.purple_700 colorId = R.color.blue
), ),
SwitchV( SwitchV(
"old_qs_custom_switch", "old_qs_custom_switch",

View File

@@ -18,7 +18,7 @@ class MainPageForT : BasePage() {
TextSummaryWithSwitch( TextSummaryWithSwitch(
TextSummaryV( TextSummaryV(
textId = R.string.main_switch, textId = R.string.main_switch,
colorId = R.color.purple_700 colorId = R.color.blue
), SwitchV("main_switch", true) ), SwitchV("main_switch", true)
) )
TextSummaryWithSwitch( TextSummaryWithSwitch(

View File

@@ -599,7 +599,7 @@ class SystemUIPageForT : BasePage() {
TextSummaryWithSwitch( TextSummaryWithSwitch(
TextSummaryV( TextSummaryV(
textId = R.string.show_weather_main_switch, textId = R.string.show_weather_main_switch,
colorId = R.color.purple_700 colorId = R.color.blue
), ),
SwitchV( SwitchV(
"notification_weather", "notification_weather",
@@ -636,7 +636,7 @@ class SystemUIPageForT : BasePage() {
TextSummaryWithSwitch( TextSummaryWithSwitch(
TextSummaryV( TextSummaryV(
textId = R.string.show_weather_main_switch, textId = R.string.show_weather_main_switch,
colorId = R.color.purple_700, colorId = R.color.blue,
tipsId = R.string.control_center_weather_summary tipsId = R.string.control_center_weather_summary
), ),
SwitchV( SwitchV(
@@ -703,7 +703,7 @@ class SystemUIPageForT : BasePage() {
TextSummaryWithSwitch( TextSummaryWithSwitch(
TextSummaryV( TextSummaryV(
textId = R.string.old_qs_custom_switch, textId = R.string.old_qs_custom_switch,
colorId = R.color.purple_700 colorId = R.color.blue
), ),
SwitchV( SwitchV(
"old_qs_custom_switch", "old_qs_custom_switch",

View File

@@ -9,10 +9,7 @@ import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.github.kyuubiran.ezxhelper.utils.*
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
import com.github.kyuubiran.ezxhelper.utils.putObject
import com.lt2333.simplicitytools.utils.XSPUtils import com.lt2333.simplicitytools.utils.XSPUtils
import com.lt2333.simplicitytools.utils.hasEnable import com.lt2333.simplicitytools.utils.hasEnable
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
@@ -27,97 +24,50 @@ object StatusBarBigMobileTypeIconForT : HookRegister() {
private val size = XSPUtils.getFloat("big_mobile_type_icon_size", 12.5f) private val size = XSPUtils.getFloat("big_mobile_type_icon_size", 12.5f)
override fun init() = hasEnable("big_mobile_type_icon") { override fun init() = hasEnable("big_mobile_type_icon") {
// TODO: Android13大移动类型图标不可用 //使网络类型单独显示
findMethod("com.android.systemui.statusbar.StatusBarMobileView"){
name == "applyMobileState"
}.hookBefore {
val mobileIconState = it.args[0]
mobileIconState.putObject("showMobileDataTypeSingle",true)
}
findMethod("com.android.systemui.statusbar.StatusBarMobileView") { findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
name == "init" name == "init"
}.hookAfter { param -> }.hookAfter {
val statusBarMobileView = param.thisObject as ViewGroup val statusBarMobileView = it.thisObject as ViewGroup
val context: Context = statusBarMobileView.context val context: Context = statusBarMobileView.context
val res: Resources = context.resources val res: Resources = context.resources
//获取组件 //获取组件
val mobileContainerLeftId: Int = val mobileContainerLeftId: Int =
res.getIdentifier("mobile_container_left", "id", "com.android.systemui") res.getIdentifier("mobile_container_left", "id", "com.android.systemui")
val mobileContainerLeft = val mobileContainerLeft =
statusBarMobileView.findViewById<ViewGroup>(mobileContainerLeftId) statusBarMobileView.findViewById<ViewGroup>(mobileContainerLeftId)
val mobileTypeId: Int = val mobileGroupId: Int =
res.getIdentifier("mobile_type", "id", "com.android.systemui") res.getIdentifier("mobile_group", "id", "com.android.systemui")
val mobileType = statusBarMobileView.findViewById<TextView>(mobileTypeId) val mobileGroup =
statusBarMobileView.findViewById<ViewGroup>(mobileGroupId)
val mobileLeftMobileInoutId: Int = res.getIdentifier( val mobileTypeSingleId: Int =
"mobile_left_mobile_inout", res.getIdentifier("mobile_type_single", "id", "com.android.systemui")
"id", val mobileTypeSingle = statusBarMobileView.findViewById<TextView>(mobileTypeSingleId)
"com.android.systemui"
)
val mobileLeftMobileInout =
statusBarMobileView.findViewById<ImageView>(mobileLeftMobileInoutId)
//更改顺序
mobileGroup.removeView(mobileTypeSingle)
mobileGroup.addView(mobileTypeSingle)
mobileGroup.removeView(mobileContainerLeft)
mobileGroup.addView(mobileContainerLeft)
//获取插入位置 //更改样式
val mobileContainerRightId: Int = res.getIdentifier( mobileTypeSingle.textSize = size
"mobile_container_right", if (isBold){
"id", mobileTypeSingle.typeface = Typeface.DEFAULT_BOLD
"com.android.systemui"
)
val mobileContainerRight =
statusBarMobileView.findViewById<ViewGroup>(mobileContainerRightId)
val rightParentLayout = mobileContainerRight.parent as ViewGroup
val mobileContainerRightIndex =
rightParentLayout.indexOfChild(mobileContainerRight)
//创建新布局
val newLinearLayoutLP = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.MATCH_PARENT
)
val newLinearlayout = LinearLayout(context).also {
it.layoutParams = newLinearLayoutLP
it.id = mobileContainerLeftId
it.setPadding(leftAndRightMargin, 0, leftAndRightMargin, 0)
} }
param.thisObject.putObject("mMobileLeftContainer", newLinearlayout) mobileTypeSingle.setPadding(leftAndRightMargin, upAndDownPosition,
rightParentLayout.addView( leftAndRightMargin,0)
newLinearlayout,
mobileContainerRightIndex
)
//将组件插入新的布局
(mobileType.parent as ViewGroup).removeView(mobileType)
(mobileLeftMobileInout.parent as ViewGroup).removeView(mobileLeftMobileInout)
(mobileContainerLeft.parent as ViewGroup).removeView(mobileContainerLeft)
newLinearlayout.addView(mobileType) //类型
val mobileTypeLp = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
).also {
it.gravity = Gravity.CENTER_VERTICAL
it.topMargin = upAndDownPosition
}
mobileType.also {
it.setTextSize(TypedValue.COMPLEX_UNIT_DIP, size)
if (isBold) {
it.typeface = Typeface.DEFAULT_BOLD
}
it.layoutParams = mobileTypeLp
}
newLinearlayout.addView(mobileLeftMobileInout) //箭头
val mobileLeftMobileInoutLp = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.MATCH_PARENT
)
mobileLeftMobileInout.also {
it.layoutParams = mobileLeftMobileInoutLp
}
//屏蔽更新布局
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
name == "updateMobileTypeLayout" && parameterTypes[0] == String::class.java
}.hookReturnConstant(null)
} }
} }

View File

@@ -8,4 +8,5 @@
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="red">#FF0000</color> <color name="red">#FF0000</color>
<color name="blue">#0d84ff</color>
</resources> </resources>