[Android General] AbrahamGC:
HOW TO COLOR LOCKSCREEN CLOCK & DATE WITH ROMCONTROL

Hi guys i only see old guide for this but isn't working on (at least) Nougat 7.1.1 so here is how i doed :

NOTE : I ALSO INCLUDED A KEY FOR USE CUSTOM COLORS OR STOCK

Decompile SystemUI (only smali needed so u can baksmali better)

Go to smali\com\android\keyguard\servicebox\pages\clock and open KeyguardSingleClockView.smali

Search for .method public updateChildViewsLook()V and before return-void (at the end) add this :

invoke-virtual {p0}, Lcom/android/keyguard/servicebox/pages/clock/KeyguardSingleClockView;->agcSetKeyguardColors()V

Now do the same with .method protected onFinishInflate()V , before return-void add previous line

Now add this method at the end of smali :

[LEFT].method public agcSetKeyguardColors()V
.locals 4

iget-object v0, p0, Lcom/android/keyguard/servicebox/pages/clock/KeyguardSingleClockView;->mContext:Landroid/content/Context;

invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v3

const-string v1, "use_custom_keyguard_colors"

const/4 v2, 0x0

invoke-static {v3, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v0

if-nez v0, :cond_custom

goto :goto_0

:cond_custom
const-string v1, "keyguard_hour_color"

const v2, -0xa

invoke-static {v3, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

iget-object v0, p0, Lcom/android/keyguard/servicebox/pages/clock/KeyguardSingleClockView;->mTimeHourView:Lcom/android/keyguard/KeyguardTextClockForUser;

invoke-virtual {v0, v2}, Landroid/widget/TextClock;->setTextColor(I)V

const-string v1, "keyguard_min_color"

const v2, -0xa

invoke-static {v3, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

iget-object v0, p0, Lcom/android/keyguard/servicebox/pages/clock/KeyguardSingleClockView;->mTimeMinView:Lcom/android/keyguard/KeyguardTextClockForUser;

invoke-virtual {v0, v2}, Landroid/widget/TextClock;->setTextColor(I)V

const-string v1, "keyguard_date_color"

const v2, -0xa

invoke-static {v3, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

iget-object v0, p0, Lcom/android/keyguard/servicebox/pages/clock/KeyguardSingleClockView;->mDateView:Lcom/android/keyguard/KeyguardTextClock;

invoke-virtual {v0, v2}, Lcom/android/keyguard/KeyguardTextClock;->setTextColor(I)V

const-string v1, "keyguard_colon_color"

const v2, -0xa

invoke-static {v3, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

iget-object v0, p0, Lcom/android/keyguard/servicebox/pages/clock/KeyguardSingleClockView;->mTimeColonView:Lcom/android/keyguard/KeyguardTextClockForUser;

invoke-virtual {v0, v2}, Lcom/android/keyguard/KeyguardTextClock;->setTextColor(I)V

:goto_0
return-void
.end method[/LEFT]

Now in same path open KeyguardSingleVerticalClockView.smali

Search .method public hangBackgroudImageOnTheClock()V and before return-void add :

invoke-virtual {p0}, Lcom/android/keyguard/servicebox/pages/clock/KeyguardSingleVerticalClockView;->agcSetKeyguardColors()V

Do the same wit these both methods :

.method protected onFinishInflate()V

.method public updateChildViewsLook()V

And add this to the end :

[LEFT].method public agcSetKeyguardColors()V
.locals 4

iget-object v0, p0, Lcom/android/keyguard/servicebox/pages/clock/KeyguardSingleVerticalClockView;->mContext:Landroid/content/Context;

invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v3

const-string v1, "use_custom_keyguard_colors"

const/4 v2, 0x0

invoke-static {v3, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v0

if-nez v0, :cond_custom

goto :goto_0

:cond_custom
const-string v1, "keyguard_hour_color"

const v2, -0xa

invoke-static {v3, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

iget-object v0, p0, Lcom/android/keyguard/servicebox/pages/clock/KeyguardSingleVerticalClockView;->mTimeHourView:Lcom/android/keyguard/KeyguardTextClockForUser;

invoke-virtual {v0, v2}, Landroid/widget/TextClock;->setTextColor(I)V

const-string v1, "keyguard_min_color"

const v2, -0xa

invoke-static {v3, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

iget-object v0, p0, Lcom/android/keyguard/servicebox/pages/clock/KeyguardSingleVerticalClockView;->mTimeMinView:Lcom/android/keyguard/KeyguardTextClockForUser;

invoke-virtual {v0, v2}, Landroid/widget/TextClock;->setTextColor(I)V

const-string v1, "keyguard_date_color"

const v2, -0xa

invoke-static {v3, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

iget-object v0, p0, Lcom/android/keyguard/servicebox/pages/clock/KeyguardSingleVerticalClockView;->mDateView:Lcom/android/keyguard/KeyguardTextClock;

invoke-virtual {v0, v2}, Lcom/android/keyguard/KeyguardTextClock;->setTextColor(I)V

:goto_0
return-void
.end method
[/LEFT]

Done with SystemUI :good: Recompile/smali and push to phone

Now, anywhere u want on RomControl, add this :

<com.wubydax.romcontrol.v2.prefs.MySwitchPreference
android:title="Use custom colors"
android:summaryOn="Using custom colors"
android:summaryOff="Using STOCK colors"
android:key="use_custom_keyguard_colors"
app:packageNameToKill="com.android.systemui"
app:isSilent="false" />
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:title="Hours"
android:key="keyguard_hour_color"
android:defaultValue="-1"
android:dependency="use_custom_keyguard_colors"
android:summary="Pick color"
app:packageNameToKill="com.android.systemui"
app:isSilent="false" />
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:title="Minutes"
android:key="keyguard_min_color"
android:defaultValue="-1"
android:dependency="use_custom_keyguard_colors"
android:summary="Pick color"
app:packageNameToKill="com.android.systemui"
app:isSilent="false" />
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:title="Date"
android:key="keyguard_date_color"
android:defaultValue="-1"
android:dependency="use_custom_keyguard_colors"
android:summary="Pick color"
app:packageNameToKill="com.android.systemui"
app:isSilent="false" />
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:title="Colon (only used on small clock)"
android:key="keyguard_colon_color"
android:defaultValue="-1"
android:dependency="use_custom_keyguard_colors"
android:summary="Pick color"
app:packageNameToKill="com.android.systemui"
app:isSilent="false" />

Done :highfive:

​