mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 19:31:17 +08:00
Update ShowBatteryTemperature.kt
This commit is contained in:
@@ -37,22 +37,22 @@ class ShowBatteryTemperature: IXposedHookLoadPackage {
|
|||||||
field.isAccessible = true
|
field.isAccessible = true
|
||||||
val view = field.get(it.thisObject) as View
|
val view = field.get(it.thisObject) as View
|
||||||
val textView = view.findViewById<TextView>(currentTemperatureValue)
|
val textView = view.findViewById<TextView>(currentTemperatureValue)
|
||||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 36.399998f)
|
|
||||||
textView.gravity = Gravity.NO_GRAVITY
|
|
||||||
textView.typeface = Typeface.create(null, 400, false)
|
|
||||||
textView.setPadding(0, 0, 0, 0)
|
|
||||||
textView.height = dp2px(context, 49.099983f)
|
|
||||||
textView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START
|
|
||||||
(textView.layoutParams as LinearLayout.LayoutParams).marginStart = dp2px(context, 25f)
|
(textView.layoutParams as LinearLayout.LayoutParams).marginStart = dp2px(context, 25f)
|
||||||
(textView.layoutParams as LinearLayout.LayoutParams).topMargin = 0
|
(textView.layoutParams as LinearLayout.LayoutParams).topMargin = 0
|
||||||
|
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 36.399998f)
|
||||||
|
textView.setPadding(0, 0, 0, 0)
|
||||||
|
textView.gravity = Gravity.NO_GRAVITY
|
||||||
|
textView.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
|
||||||
|
textView.height = dp2px(context, 49.099983f)
|
||||||
|
textView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START
|
||||||
val tempView = TextView(context)
|
val tempView = TextView(context)
|
||||||
tempView.layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, dp2px(context, 49.099983f))
|
tempView.layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, dp2px(context, 49.099983f))
|
||||||
(tempView.layoutParams as LinearLayout.LayoutParams).marginStart = dp2px(context, 3.599976f)
|
(tempView.layoutParams as LinearLayout.LayoutParams).marginStart = dp2px(context, 3.599976f)
|
||||||
tempView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13.099977f)
|
tempView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13.099977f)
|
||||||
|
tempView.setTextColor(Color.parseColor(if (isDarkMode) "#e6e6e6" else "#333333"))
|
||||||
tempView.setPadding(0, dp2px(context, 25f), 0, 0)
|
tempView.setPadding(0, dp2px(context, 25f), 0, 0)
|
||||||
tempView.text = "℃"
|
tempView.text = "℃"
|
||||||
tempView.setTextColor(Color.parseColor(if (isDarkMode) "#e6e6e6" else "#333333"))
|
tempView.typeface = Typeface.create(null, 500, false)
|
||||||
tempView.typeface = Typeface.create(null, 400, false)
|
|
||||||
tempView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START
|
tempView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START
|
||||||
val tempeValueContainer = context.resources.getIdentifier("tempe_value_container", "id", "com.miui.securitycenter")
|
val tempeValueContainer = context.resources.getIdentifier("tempe_value_container", "id", "com.miui.securitycenter")
|
||||||
val linearLayout = view.findViewById<LinearLayout>(tempeValueContainer)
|
val linearLayout = view.findViewById<LinearLayout>(tempeValueContainer)
|
||||||
|
|||||||
Reference in New Issue
Block a user