From 3fe7c8bc0fc286591fa07bb63d19eb11e6f40c10 Mon Sep 17 00:00:00 2001 From: YuKongA <1348547200@qq.com> Date: Sat, 12 Mar 2022 16:58:06 +0800 Subject: [PATCH] Update ShowBatteryTemperature.kt --- .../app/securitycenter/ShowBatteryTemperature.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/securitycenter/ShowBatteryTemperature.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/securitycenter/ShowBatteryTemperature.kt index ac5b569a..9791ce8e 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/hook/app/securitycenter/ShowBatteryTemperature.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/securitycenter/ShowBatteryTemperature.kt @@ -37,22 +37,22 @@ class ShowBatteryTemperature: IXposedHookLoadPackage { field.isAccessible = true val view = field.get(it.thisObject) as View val textView = view.findViewById(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).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) tempView.layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, dp2px(context, 49.099983f)) (tempView.layoutParams as LinearLayout.LayoutParams).marginStart = dp2px(context, 3.599976f) 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.text = "℃" - tempView.setTextColor(Color.parseColor(if (isDarkMode) "#e6e6e6" else "#333333")) - tempView.typeface = Typeface.create(null, 400, false) + tempView.typeface = Typeface.create(null, 500, false) tempView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START val tempeValueContainer = context.resources.getIdentifier("tempe_value_container", "id", "com.miui.securitycenter") val linearLayout = view.findViewById(tempeValueContainer)