mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 19:31:17 +08:00
修改状态栏图标顺序(未实现)
This commit is contained in:
@@ -16,6 +16,7 @@ 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
|
||||||
|
|
||||||
|
|
||||||
object StatusBarLayoutForT : HookRegister() {
|
object StatusBarLayoutForT : HookRegister() {
|
||||||
|
|
||||||
private val getMode = XSPUtils.getInt("status_bar_layout_mode", 0)
|
private val getMode = XSPUtils.getInt("status_bar_layout_mode", 0)
|
||||||
@@ -67,9 +68,7 @@ object StatusBarLayoutForT : HookRegister() {
|
|||||||
val res: Resources = miuiPhoneStatusBarView.resources
|
val res: Resources = miuiPhoneStatusBarView.resources
|
||||||
val statusBarId: Int = res.getIdentifier("status_bar", "id", "com.android.systemui")
|
val statusBarId: Int = res.getIdentifier("status_bar", "id", "com.android.systemui")
|
||||||
val statusBarContentsId: Int = res.getIdentifier(
|
val statusBarContentsId: Int = res.getIdentifier(
|
||||||
"status_bar_contents",
|
"status_bar_contents", "id", "com.android.systemui"
|
||||||
"id",
|
|
||||||
"com.android.systemui"
|
|
||||||
)
|
)
|
||||||
val systemIconAreaId: Int = res.getIdentifier("system_icon_area", "id", "com.android.systemui")
|
val systemIconAreaId: Int = res.getIdentifier("system_icon_area", "id", "com.android.systemui")
|
||||||
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||||
@@ -117,9 +116,7 @@ object StatusBarLayoutForT : HookRegister() {
|
|||||||
//增加一个左对齐布局
|
//增加一个左对齐布局
|
||||||
mLeftLayout = LinearLayout(context)
|
mLeftLayout = LinearLayout(context)
|
||||||
val leftLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
|
val leftLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
|
||||||
0,
|
0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
|
||||||
1.0f
|
|
||||||
)
|
)
|
||||||
mLeftLayout!!.layoutParams = leftLp
|
mLeftLayout!!.layoutParams = leftLp
|
||||||
mLeftLayout!!.gravity = Gravity.START or Gravity.CENTER_VERTICAL
|
mLeftLayout!!.gravity = Gravity.START or Gravity.CENTER_VERTICAL
|
||||||
@@ -133,9 +130,7 @@ object StatusBarLayoutForT : HookRegister() {
|
|||||||
mCenterLayout!!.gravity = Gravity.CENTER or Gravity.CENTER_VERTICAL
|
mCenterLayout!!.gravity = Gravity.CENTER or Gravity.CENTER_VERTICAL
|
||||||
mRightLayout = LinearLayout(context)
|
mRightLayout = LinearLayout(context)
|
||||||
val rightLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
|
val rightLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
|
||||||
0,
|
0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
|
||||||
1.0f
|
|
||||||
)
|
)
|
||||||
mRightLayout!!.layoutParams = rightLp
|
mRightLayout!!.layoutParams = rightLp
|
||||||
mRightLayout!!.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
mRightLayout!!.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
||||||
@@ -223,9 +218,7 @@ object StatusBarLayoutForT : HookRegister() {
|
|||||||
val res: Resources = miuiPhoneStatusBarView.resources
|
val res: Resources = miuiPhoneStatusBarView.resources
|
||||||
val statusBarId: Int = res.getIdentifier("status_bar", "id", "com.android.systemui")
|
val statusBarId: Int = res.getIdentifier("status_bar", "id", "com.android.systemui")
|
||||||
val statusBarContentsId: Int = res.getIdentifier(
|
val statusBarContentsId: Int = res.getIdentifier(
|
||||||
"status_bar_contents",
|
"status_bar_contents", "id", "com.android.systemui"
|
||||||
"id",
|
|
||||||
"com.android.systemui"
|
|
||||||
)
|
)
|
||||||
val systemIconAreaId: Int = res.getIdentifier("system_icon_area", "id", "com.android.systemui")
|
val systemIconAreaId: Int = res.getIdentifier("system_icon_area", "id", "com.android.systemui")
|
||||||
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||||
@@ -301,9 +294,7 @@ object StatusBarLayoutForT : HookRegister() {
|
|||||||
//增加一个左对齐布局
|
//增加一个左对齐布局
|
||||||
mLeftLayout = LinearLayout(context)
|
mLeftLayout = LinearLayout(context)
|
||||||
val leftLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
|
val leftLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
|
||||||
0,
|
0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
|
||||||
1.0f
|
|
||||||
)
|
)
|
||||||
mLeftLayout!!.layoutParams = leftLp
|
mLeftLayout!!.layoutParams = leftLp
|
||||||
mLeftLayout!!.gravity = Gravity.START or Gravity.CENTER_VERTICAL
|
mLeftLayout!!.gravity = Gravity.START or Gravity.CENTER_VERTICAL
|
||||||
@@ -319,9 +310,7 @@ object StatusBarLayoutForT : HookRegister() {
|
|||||||
//增加一个右布局
|
//增加一个右布局
|
||||||
mRightLayout = LinearLayout(context)
|
mRightLayout = LinearLayout(context)
|
||||||
val rightLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
|
val rightLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
|
||||||
0,
|
0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
|
||||||
1.0f
|
|
||||||
)
|
)
|
||||||
mRightLayout!!.layoutParams = rightLp
|
mRightLayout!!.layoutParams = rightLp
|
||||||
mRightLayout!!.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
mRightLayout!!.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
||||||
@@ -388,6 +377,14 @@ object StatusBarLayoutForT : HookRegister() {
|
|||||||
statusBar1!!.visibility = View.VISIBLE
|
statusBar1!!.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//TODO: 修改图标的顺序
|
||||||
|
/*findConstructor("com.android.systemui.statusbar.phone.StatusBarIconList") {
|
||||||
|
parameterCount == 1
|
||||||
|
}.hookBefore {
|
||||||
|
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user