[Android General] Carotix:
Guide to add Next Alarm in the lockscreen with toggle

original guide here and here

I put it in the middle and bottom like screen below and I have adapted the smiles for oreo

open SystemUI/res/layout/keyguard_bottom_shortcut_area.xml

add this look at my layout in the zip to locate it
<LinearLayout android:layout_gravity="bottom|center" android:orientation="vertical" android:id="@id/next_alarm_toggle" android:paddingBottom="20.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content">
<com.android.keyguard.nextalarm.GetNextAlarmTimeText android:id="@id/next_alarm_txt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="#7f000000" android:fontFamily="sec-roboto-light" style="@style/keyguard_text_shadow" />
</LinearLayout>
######################
then
<item type="id" name="next_alarm_toggle">false</item>
<item type="id" name="next_alarm_txt">false</item>

then add 1 to the last id to get your id without recompile/decompile
<public type="id" name="gid_battery" id="0x7f0a05a3" />

like this
<public type="id" name="next_alarm_toggle" id="0x7f0a05a4" />
######################
add in drawable ic_qs_alarm_on.png

then add 1 to the last drawable to get your id without recompile/decompile
<public type="drawable" name="ic_qs_alarm_on" id="0x7f0807d4" />

add the smalis in smali_classes2 and change the ids

################
smalis for RC toggle

SystemUI.apk\smali\com\android\systemui\statusbar\phone\StatusBar.smali

find .method protected makeStatusBarView()V
after
invoke-virtual {v2, v0}, Lcom/android/systemui/statusbar/preview/NotificationPreviewController;->setBar(Lcom/android/systemui/statusbar/phone/StatusBar;)V

add
move-object/from16 v0, p0

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

######################
add this method at the end and change ids

.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/StatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const v6, 0x7f0a05a4 ### <public type="id" name="next_alarm_toggle" />

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/StatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const v6, 0x7f0a05a4 ### <public type="id" name="next_alarm_toggle" />

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

# recompile/done

## RC 6th
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:title="Next Alarm" android:key="next_alarm_toggle" android:defaultValue="true" android:summaryOn="Show" android:summaryOff="Hide" app:packageNameToKill="com.android.systemui" />

## GrxSettings
<GrxSwitchPreference android:title="Next Alarm" android:key="next_alarm_toggle" android:defaultValue="true" android:summaryOn="Show" android:summaryOff="Hide" grx:confirmKillpackage="true" grx:killpackage="com.android.systemui" />

download guide and files