[Galaxy S6 General] aljee77:
How to add ROM Control toggles "Next alarm on lock screen/text color" and "Quicklauncher in recents app"

Next alarm on lock screen original guide

Decompile SystemUI.apk:

Add at end of res/values/ids.xml

<item type="id" name="next_alarm_toggle">false</item>

In res/layout/sec_keyguard_clock_view.xml change the line from the original mod:

<LinearLayout android:gravity="bottom" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content">

in:

<LinearLayout android:layout_gravity="center" android:id="@id/next_alarm_toggle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true">

Recompile and decompile SystemUI.apk to get "<public type="id" name="next_alarm_toggle" id="0x7f0e0378" />" (may be different with you)

Go to \smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali, search for the following method and add BLUE line:

.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
-
-
-
const-string v5, "display_battery_percentage"

invoke-static {v5}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v5

const/4 v6, 0x0

move-object/from16 v0, p0

iget-object v8, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryTextObserver:Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;

invoke-virtual {v4, v5, v6, v8}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

.line 1520
move-object/from16 v0, p0

iget-object v4, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryTextObserver:Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;

const/4 v5, 0x0

invoke-virtual {v4, v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;->onChange(Z)V

move-object/from16 v0, p0

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setQuickConnectColor()V

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setEditColor()V

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateSignalPosition()V

move-object/from16 v0, p0

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->HideStockBattery()V

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->HideKeyguardStockBattery()V

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->Settings_on_off_toggles()V

[COLOR=Blue]invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateNextAlarmView()V[/COLOR]

move-object/from16 v0, p0
-
-

Add new method to bottom of smali. Notice that the public id complies with your:

.method updateNextAlarmView()V
.locals 7

iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

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

move-result-object v1

const-string v2, "next_alarm_toggle"

const/4 v3, 0x0

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

move-result v1

if-eqz v1, :cond_0

const v3, 0x3

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const v6, [COLOR=MediumTurquoise]0x7f0e0378[/COLOR] [COLOR=Red]### <public type="id" name="next_alarm_toggle"[/COLOR]

invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v4

invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setVisibility(I)V

goto/16 :goto_0

:cond_0
const v3, 0x8

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const v6, [COLOR=MediumTurquoise]0x7f0e0378[/COLOR] [COLOR=Red]### <public type="id" name="next_alarm_toggle"[/COLOR]

invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v4

invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setVisibility(I)V

:goto_0
return-void

.end method

For NextAlarm text color must be changed and replaced BLUE lines at following method of smali/com/android/keyguard/nextalarm/GetNextAlarmTimeText.smali

# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
-
-
-

invoke-virtual {v6, v7}, Lcom/android/keyguard/nextalarm/GetNextAlarmTimeText;->findViewById(I)Landroid/view/View;

move-result-object v6

check-cast v6, Landroid/widget/TextView;

iput-object v6, v5, Lcom/android/keyguard/nextalarm/GetNextAlarmTimeText;->alarmText:Landroid/widget/TextView;

[COLOR=Blue][B]move-object/from16 v0, p0

invoke-virtual {v0, v6}, Lcom/android/keyguard/nextalarm/GetNextAlarmTimeText;->setTextColor(Landroid/widget/TextView;)V[/B]

move-object v5, v0

iget-object v5, v5, Lcom/android/keyguard/nextalarm/GetNextAlarmTimeText;->alarmText:Landroid/widget/TextView;

const v6, [COLOR=MediumTurquoise]0x7f020754 [/COLOR][/COLOR][COLOR=Blue][COLOR=MediumTurquoise][COLOR=Red]### <public type="id" name="ic_qs_alarm_on"[/COLOR][/COLOR]

const/4 v7, 0x0

const/4 v8, 0x0

const/4 v9, 0x0

invoke-virtual {v5, v6, v7, v8, v9}, Landroid/widget/TextView;->setCompoundDrawablesWithIntrinsicBounds(IIII)V

move-object v5, v0

iget-object v5, v5, Lcom/android/keyguard/nextalarm/GetNextAlarmTimeText;->alarmText:Landroid/widget/TextView;

const/16 v6, 0x19

invoke-virtual {v5, v6}, Landroid/widget/TextView;->setCompoundDrawablePadding(I)V[/COLOR]

move-object v5, v0

iget-object v5, v5, Lcom/android/keyguard/nextalarm/GetNextAlarmTimeText;->alarmText:Landroid/widget/TextView;
-
-

and add following method at the end of the same smali

# virtual methods
.method setTextColor(Landroid/widget/TextView;)V
.locals 3

invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;

move-result-object v0

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

move-result-object v0

const-string v1, "next_alarm_color"

const v2, -0x1

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

move-result v0

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

return-void
.end method

ROM Control:

<SwitchPreference android:title="Next Alarm" android:key="next_alarm_toggle" android:summaryOn="Show" android:summaryOff="Hide" />
<com.wubydax.romcontrol.prefs.ColorPickerPreference android:title="Next Alarm Text Color" android:key="next_alarm_color" android:summary="Choose color" android:defaultValue="-1" alphaSlider="true" hexValue="true" />

Quicklauncher in recents app original guide

Decompile SystemUI.apk:

Add at end of res/values/ids.xml

<item type="id" name="recents_quick_launch_toggle">false</item>

In res/layout/recents.xml change the line from the original mod:

<LinearLayout android:gravity="center" android:layout_gravity="center" android:orientation="horizontal" android:background="#80000000" android:layout_width="fill_parent" android:layout_height="75.0dip">

in:

<LinearLayout android:gravity="center" android:layout_gravity="center" android:orientation="horizontal" android:id="@id/recents_quick_launch_toggle" android:background="#80000000" android:layout_width="fill_parent" android:layout_height="75.0dip">

Recompile and decompile SystemUI.apk to get "<public type="id" name="recents_quick_launch" id="0x7f0e0379" />" (may be different with you)

Go to \smali\com\android\systemui\recents\RecentsActivity.smali, search for the following method and add BLUE line:

.method protected onStart()V
-
-
-
.line 1132
:cond_1
iget-object v4, p0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;

iget-boolean v4, v4, Lcom/android/systemui/recents/RecentsConfiguration;->launchedHasConfigurationChanged:Z

if-nez v4, :cond_2

.line 1133
iget-object v4, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;

invoke-virtual {v4}, Lcom/android/systemui/recents/views/RecentsView;->disableLayersForOneFrame()V

.line 1135
:cond_2
[COLOR=Blue]invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->updateQuickLaunchView()V[/COLOR]

return-void

.end local v3 # "wasLaunchedByAm":Z
:cond_3
move v3, v4

.line 1127
goto :goto_0
.end method

Add new method to bottom of smali. Notice that the public id complies with your:

.method updateQuickLaunchView()V
.registers 6

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

move-result-object v0

const-string v1, "recents_quick_launch_toggle"

const/4 v2, 0x0

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

move-result v0

if-nez v0, :cond_1c

const v2, 0x8

const v3, [COLOR=MediumTurquoise]0x7f0e0379[/COLOR] [COLOR=Red]### <public type="id" name="recents_quick_launch_toggle"[/COLOR]

invoke-virtual {p0, v3}, Lcom/android/systemui/recents/RecentsActivity;->findViewById(I)Landroid/view/View;

move-result-object v4

invoke-virtual {v4, v2}, Landroid/widget/RelativeLayout;->setVisibility(I)V

goto/16 :goto_29

:cond_1c
const v2, 0x3

const v3, [COLOR=MediumTurquoise]0x7f0e0379[/COLOR] [COLOR=Red]### <public type="id" name="recents_quick_launch_toggle"[/COLOR]

invoke-virtual {p0, v3}, Lcom/android/systemui/recents/RecentsActivity;->findViewById(I)Landroid/view/View;

move-result-object v4

invoke-virtual {v4, v2}, Landroid/widget/RelativeLayout;->setVisibility(I)V

:goto_29
return-void
.end method

ROM Control:

<PreferenceCategory android:title="RECENT PANEL OPTIONS">
<SwitchPreference android:title="Recent Panel Quick Launch" android:key="recents_quick_launch_toggle" android:defaultValue="false" android:summaryOn="Quick Launch is shown" android:summaryOff="Quick Launch is hidden" />
</PreferenceCategory>