Merge remote-tracking branch 'origin/main'

This commit is contained in:
乌堆小透明
2022-03-12 18:25:25 +08:00
2 changed files with 10 additions and 9 deletions

View File

@@ -11,12 +11,13 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
class MaxWallpaperScale : IXposedHookLoadPackage { class MaxWallpaperScale : IXposedHookLoadPackage {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f)
"com.android.server.wm.WallpaperController".hookAfterMethod(lpparam.classLoader, "WallpaperController", Service::class.java, DisplayContext::class.java "com.android.server.wm.WallpaperController".hookAfterMethod(lpparam.classLoader, "WallpaperController", Service::class.java, DisplayContext::class.java
) { ) {
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f)
it.thisObject.setFloatField("mMaxWallpaperScale", value) it.thisObject.setFloatField("mMaxWallpaperScale", value)
} }
"com.android.server.wm.WallpaperController".hookBeforeMethod(lpparam.classLoader, "zoomOutToScale", Float::class.java) { "com.android.server.wm.WallpaperController".hookBeforeMethod(lpparam.classLoader, "zoomOutToScale", Float::class.java) {
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f)
it.thisObject.setFloatField("mMaxWallpaperScale", value) it.thisObject.setFloatField("mMaxWallpaperScale", value)
} }
} }

View File

@@ -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)