Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
opt: systemui-statusbar-clock-fixcolor
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Mar 26, 2024
1 parent 88d836f commit 2a7c195
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,12 @@
package com.sevtinge.hyperceiler.module.hook.systemui.statusbar.clock;

import android.graphics.Color;
import android.widget.Toast;

import com.sevtinge.hyperceiler.module.base.BaseHook;
import com.sevtinge.hyperceiler.ui.fragment.settings.development.DevelopmentDebugInfoFragment;
import com.sevtinge.hyperceiler.utils.MathUtils;

import java.util.ArrayList;
import java.util.Objects;

import de.robv.android.xposed.XC_MethodReplacement;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;

public class FixColor extends BaseHook {
Expand All @@ -38,15 +33,14 @@ public void init() throws NoSuchMethodException {
findAndHookMethod("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock", "updateHeaderColor", new MethodHook(){
@Override
protected void before(MethodHookParam param) {
/*Object bigTime = XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "bigTime");
Color bigTimeColor = (Color) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "bigTimeColor");
Color tintColor = (Color) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mTint");
Color lightColor = (Color) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mLightColor");
Color darkColor = (Color) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mDarkColor");
float whiteFraction = (float) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mWhiteFraction");
ArrayList<?> areas = (ArrayList<?>) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mAreas");
float darkIntensity = (float) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mDarkIntensity");
boolean useTint = (boolean) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mUseTint");
Color bigTimeColor = (Color) XposedHelpers.getObjectField(param.thisObject, "bigTimeColor");
Color tintColor = Color.valueOf((int) XposedHelpers.getObjectField(param.thisObject, "mTint"));
Color lightColor = Color.valueOf((int) XposedHelpers.getObjectField(param.thisObject, "mLightColor"));
Color darkColor = Color.valueOf((int) XposedHelpers.getObjectField(param.thisObject, "mDarkColor"));
float whiteFraction = (float) XposedHelpers.getObjectField(param.thisObject, "mWhiteFraction");
ArrayList<?> areas = (ArrayList<?>) XposedHelpers.getObjectField(param.thisObject, "mAreas");
float darkIntensity = (float) XposedHelpers.getObjectField(param.thisObject, "mDarkIntensity");
boolean useTint = (boolean) XposedHelpers.getObjectField(param.thisObject, "mUseTint");
int inTintColor = Color.argb(
MathUtils.lerp(tintColor.alpha(), bigTimeColor.alpha(), whiteFraction),
MathUtils.lerp(tintColor.red(), bigTimeColor.red(), whiteFraction),
Expand All @@ -65,8 +59,8 @@ protected void before(MethodHookParam param) {
MathUtils.lerp(darkColor.green(), bigTimeColor.green(), whiteFraction),
MathUtils.lerp(darkColor.blue(), bigTimeColor.blue(), whiteFraction)
);
logI(String.valueOf(darkIntensity));
if (whiteFraction <= 0.01f) XposedHelpers.callMethod(bigTime, "onDarkChanged", areas, darkIntensity, inTintColor, inLightColor, inDarkColor, useTint);*/
Object getBigTime = XposedHelpers.callMethod(param.thisObject, "getBigTime");
XposedHelpers.callMethod(getBigTime, "onDarkChanged", areas, darkIntensity, inTintColor, inLightColor, inDarkColor, useTint);
param.setResult(null);
}
});
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-es-rES/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,6 @@
<string name="system_ui_statusbar_clock_double_size">Tamaño del reloj de dos filas</string>
<string name="system_ui_statusbar_clock_double_spacing_desc">Funciona solo cuando se muestra en dos filas</string>
<string name="system_ui_statusbar_clock_fix_color">Corregir color</string>
<string name="system_ui_statusbar_clock_fix_color_desc">Características experimentales</string>
<string name="system_ui_disable_clock_anim">Deshabilite la animación de transición del reloj deslizante en el Centro de notificaciones</string>
<string name="system_ui_statusbar_indicator_battery_title">Potencia relacionada</string>
<string name="system_ui_statusbar_indicator_temperature_title">Temperatura relacionada</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-in-rID/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@
<string name="system_ui_statusbar_clock_double_size">Ukuran jam baris ganda</string>
<string name="system_ui_statusbar_clock_double_spacing_desc">Hanya valid jika ditampilkan dalam dua baris</string>
<string name="system_ui_statusbar_clock_fix_color">Perbaiki warna</string>
<string name="system_ui_statusbar_clock_fix_color_desc">Fitur eksperimental</string>
<string name="system_ui_disable_clock_anim">Nonaktifkan animasi transisi jam slide di Pusat Pemberitahuan</string>
<string name="system_ui_disable_clock_synch">Pengaturan jam bilah status tidak disinkronkan</string>
<string name="system_ui_disable_clock_synch_desc">Jam bilah notifikasi besar tidak lagi disinkronkan dengan format jam bilah status</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ja-rJP/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@
<string name="system_ui_statusbar_clock_double_size">二行の時計のサイズ</string>
<string name="system_ui_statusbar_clock_double_spacing_desc">2 行で表示されている場合にのみ有効です</string>
<string name="system_ui_statusbar_clock_fix_color">色を修正</string>
<string name="system_ui_statusbar_clock_fix_color_desc">実験的機能です</string>
<string name="system_ui_disable_clock_anim">通知センターでのスライド時計遷移アニメーションを無効化</string>
<string name="system_ui_disable_clock_synch">ステータスバーの時計設定が同期されていません</string>
<string name="system_ui_disable_clock_synch_desc">大きな通知バーの時計はステータスバーの時計形式と同期されなくなりました</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@
<string name="system_ui_statusbar_clock_double_size">Tamanho do relógio de duas linhas</string>
<string name="system_ui_statusbar_clock_double_spacing_desc">Válido somente quando exibido em duas linhas</string>
<string name="system_ui_statusbar_clock_fix_color">Corrigir cor</string>
<string name="system_ui_statusbar_clock_fix_color_desc">Recurso experimental</string>
<string name="system_ui_disable_clock_anim">Desativar animação de transição do relógio na central de notificações</string>
<string name="system_ui_disable_clock_synch">Configurações do relógio da barra de status não sincronizadas</string>
<string name="system_ui_disable_clock_synch_desc">O grande relógio da barra de notificação não está mais sincronizado com o formato do relógio da barra de status</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-vi-rVN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ Chức năng này là chức năng thử nghiệm có độ ổn định cao</st
<string name="system_ui_statusbar_clock_double_size">Kích thước hàng đôi (0 là giá trị gốc)</string>
<string name="system_ui_statusbar_clock_double_spacing_desc">Chỉ hợp lệ khi hiển thị ở hai hàng</string>
<string name="system_ui_statusbar_clock_fix_color">Cố định màu</string>
<string name="system_ui_statusbar_clock_fix_color_desc">Tính năng thử nghiệm</string>
<string name="system_ui_disable_clock_anim">Tắt hoạt ảnh chuyển tiếp đồng hồ trong trung tâm thông báo</string>
<string name="system_ui_disable_clock_synch">Cài đặt đồng hồ trên thanh trạng thái không được đồng bộ hóa</string>
<string name="system_ui_disable_clock_synch_desc">Đồng hồ trên thanh thông báo lớn không còn đồng bộ với định dạng đồng hồ trên thanh trạng thái</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,6 @@
<string name="system_ui_disable_clock_synch">不同步状态栏时钟设置</string>
<string name="system_ui_disable_clock_synch_desc">通知中心大时钟不再同步状态栏时钟格式</string>
<string name="system_ui_statusbar_clock_fix_color">修复时钟反色时颜色异常</string>
<string name="system_ui_statusbar_clock_fix_color_desc">实验性功能</string>

<string name="system_ui_statusbar_clock_show">显示</string>
<string name="system_ui_statusbar_clock_big_bold">通知中心大时钟加粗</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-zh-rHK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@
<string name="system_ui_statusbar_clock_double_size">雙排時鐘大小</string>
<string name="system_ui_statusbar_clock_double_spacing_desc">僅在雙排顯示下生效</string>
<string name="system_ui_statusbar_clock_fix_color">修復時鐘反色時的顏色異常</string>
<string name="system_ui_statusbar_clock_fix_color_desc">實驗性功能</string>
<string name="system_ui_disable_clock_anim">停用通知中心下滑時鐘過渡動畫</string>
<string name="system_ui_disable_clock_synch">狀態欄時鐘設定不同步</string>
<string name="system_ui_disable_clock_synch_desc">大通知欄時鐘不再與狀態欄時鐘格式同步</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@
<string name="system_ui_statusbar_clock_double_size">雙排時鐘大小</string>
<string name="system_ui_statusbar_clock_double_spacing_desc">僅在雙排顯示下生效</string>
<string name="system_ui_statusbar_clock_fix_color">修復時鐘反色時的顏色異常</string>
<string name="system_ui_statusbar_clock_fix_color_desc">實驗性功能</string>
<string name="system_ui_disable_clock_anim">停用通知中心下滑時鐘過渡動畫</string>
<string name="system_ui_disable_clock_synch">狀態欄時鐘設定不同步</string>
<string name="system_ui_disable_clock_synch_desc">大通知欄時鐘不再與狀態欄時鐘格式同步</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,6 @@
<string name="system_ui_statusbar_clock_double_size">Double row clock size</string>
<string name="system_ui_statusbar_clock_double_spacing_desc">Valid only when displayed in two rows</string>
<string name="system_ui_statusbar_clock_fix_color">Fix color</string>
<string name="system_ui_statusbar_clock_fix_color_desc">Experimental features</string>
<string name="system_ui_disable_clock_anim">Disable the slide clock transition animation in Notification Center</string>
<string name="system_ui_disable_clock_synch">Status bar clock settings not synchronized</string>
<string name="system_ui_disable_clock_synch_desc">The big notification bar clock is no longer synchronized with the status bar clock format</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_system_ui_statusbar_clock_fix_color"
android:summary="@string/system_ui_statusbar_clock_fix_color_desc"
android:title="@string/system_ui_statusbar_clock_fix_color" />

</PreferenceCategory>
Expand Down

0 comments on commit 2a7c195

Please sign in to comment.