mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
TODO
This commit is contained in:
@@ -56,6 +56,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
|
||||||
//API
|
//API
|
||||||
compileOnly("de.robv.android.xposed:api:82")
|
compileOnly("de.robv.android.xposed:api:82")
|
||||||
//UI
|
//UI
|
||||||
|
|||||||
@@ -49,6 +49,12 @@ class SystemUI : IXposedHookLoadPackage {
|
|||||||
StatusBarNetworkSpeedRefreshSpeed().handleLoadPackage(lpparam)
|
StatusBarNetworkSpeedRefreshSpeed().handleLoadPackage(lpparam)
|
||||||
//状态栏时钟自定义
|
//状态栏时钟自定义
|
||||||
StatusBarTimeCustomization().handleLoadPackage(lpparam)
|
StatusBarTimeCustomization().handleLoadPackage(lpparam)
|
||||||
|
|
||||||
|
//TODO:状态栏天气
|
||||||
|
NotificationWeather().handleLoadPackage(lpparam)
|
||||||
|
//TODO:状态栏电流
|
||||||
|
//StatusBarCurrent().handleLoadPackage(lpparam)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.RelativeLayout
|
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
@@ -17,20 +17,25 @@ class NotificationWeather :IXposedHookLoadPackage {
|
|||||||
XposedHelpers.findAndHookMethod(classIfExists, "onFinishInflate", object : XC_MethodHook() {
|
XposedHelpers.findAndHookMethod(classIfExists, "onFinishInflate", object : XC_MethodHook() {
|
||||||
override fun afterHookedMethod(param: MethodHookParam) {
|
override fun afterHookedMethod(param: MethodHookParam) {
|
||||||
val viewGroup = param.thisObject as ViewGroup
|
val viewGroup = param.thisObject as ViewGroup
|
||||||
val layoutParams = RelativeLayout.LayoutParams(
|
|
||||||
RelativeLayout.LayoutParams.WRAP_CONTENT,
|
val layoutParams = ConstraintLayout.LayoutParams(
|
||||||
RelativeLayout.LayoutParams.WRAP_CONTENT
|
ConstraintLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
ConstraintLayout.LayoutParams.WRAP_CONTENT,
|
||||||
).also {
|
).also {
|
||||||
it.addRule(RelativeLayout.ABOVE)
|
it.bottomToTop = viewGroup.context.resources.getIdentifier("date_time","id",viewGroup.context.packageName)
|
||||||
it.addRule(RelativeLayout.START_OF)
|
it.startToEnd = viewGroup.context.resources.getIdentifier("big_time","id",viewGroup.context.packageName)
|
||||||
it.addRule(RelativeLayout.END_OF)
|
it.marginStart = viewGroup.context.resources.getIdentifier("notification_panel_time_date_space","dimen",viewGroup.context.packageName)
|
||||||
}
|
}
|
||||||
|
|
||||||
val textView = TextView(viewGroup.context).also {
|
val textView = TextView(viewGroup.context).also {
|
||||||
|
it.setTextAppearance(viewGroup.context.resources.getIdentifier("TextAppearance.QSControl.Date","style",viewGroup.context.packageName))
|
||||||
it.text = "This is a TextView"
|
it.text = "This is a TextView"
|
||||||
it.textSize=18F
|
//TODO:状态栏天气定位异常
|
||||||
it.layoutParams = layoutParams
|
it.layoutParams = layoutParams
|
||||||
}
|
}
|
||||||
|
|
||||||
viewGroup.addView(textView)
|
viewGroup.addView(textView)
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user