[MOD][GUIDE] Clock Statusbar Mod v2.0

Search This thread

cbucz24

Senior Member
Jan 31, 2011
2,757
2,897
Central Florida
They aren't exactly the same, but they are very close. You'll just need to make minor edits

Sent from my HTC One_M8 using Tapatalk

Ehh, a lot of the touchwiz is similar. I've been using the mods from intl note 2, s3, s4, etc. They all work with playing a bit.
That's why I always make a flashable stock backup first. so when I break things I can still fix it. :D

Sent from my SM-G900T using Tapatalk 2
 

sbreen94

Inactive Recognized Developer / Contributor
Apr 18, 2012
5,292
22,656
Ehh, a lot of the touchwiz is similar. I've been using the mods from intl note 2, s3, s4, etc. They all work with playing a bit.
That's why I always make a flashable stock backup first. so when I break things I can still fix it. :D

Sent from my SM-G900T using Tapatalk 2

Exactly what I said :D [emoji108][emoji106]

Sent from my HTC One_M8 using Tapatalk
 

Fissleboot

Senior Member
May 1, 2014
87
26
Thanks, I have ported this to a non Samsung 4.1.2 device and believe it will work with most aosp based devices, I was wondering if the op cared if I wrote a tutorial for aosp based devices using his code as a base

Sent from my N800 using Tapatalk
 

upndwn4par

Inactive Recognized Developer
Jan 22, 2012
3,640
10,375
New Jersey
Thanks, I have ported this to a non Samsung 4.1.2 device and believe it will work with most aosp based devices, I was wondering if the op cared if I wrote a tutorial for aosp based devices using his code as a base

Sent from my N800 using Tapatalk
There is little difference between TW and AOSP for this mod, so why create a new thread when you can just share your changes here?
 

Fissleboot

Senior Member
May 1, 2014
87
26
I have ported this mod to the ZTE awe which is an AOSP based device running 4.1.2
My edits should work for all AOSP based devices running 4.1.2 or lower

I recommend using Advanced APK Tool to work with apks

We will be editing:
SystemUI.apk
Settings.apk

Decompile Settings

Navigate to res/values/arrays and add to end
Code:
<string-array name="clock_style_entries">
        <item>Right clock</item>
        <item>Center clock</item>
        <item>No clock</item>
    </string-array>
    <string-array name="clock_style_values">
        <item>1</item>
        <item>2</item>
        <item>0</item>
    </string-array>
    <string-array name="clock_ampm_entries">
        <item>"Don't show"</item>
        <item>Small AM/PM</item>
        <item>Regular AM/PM</item>
    </string-array>
    <string-array name="clock_ampm_values">
        <item>2</item>
        <item>1</item>
        <item>0</item>
    </string-array>
    <string-array name="clock_weekday_entries">
        <item>"Don't show"</item>
        <item>Small weekday</item>
        <item>Regular weekday</item>
    </string-array>
    <string-array name="clock_weekday_values">
        <item>0</item>
        <item>1</item>
        <item>2</item>
    </string-array>

Navigate to res/values/strings and add to end
Code:
<string name="enable_clock_weekday">Day of the week</string>
    <string name="enable_clock_weekday_summary">Abbreviated day of the week in statusbar</string>
    <string name="clock_cat">Clock options</string>
    <string name="clock_title_enable">Clock style</string>
    <string name="title_clock_ampm_entries">AM/PM style</string>

Navigate to res/xml/date_time_prefs.xml add RED code below BLUE code
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/date_and_time"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <CheckBoxPreference android:title="@string/date_time_auto" android:key="auto_time" android:summaryOn="@string/date_time_auto_summaryOn" android:summaryOff="@string/date_time_auto_summaryOff" />
    <CheckBoxPreference android:title="@string/zone_auto" android:key="auto_zone" android:summaryOn="@string/zone_auto_summaryOn" android:summaryOff="@string/zone_auto_summaryOff" />
    <Preference android:title="@string/date_time_set_date" android:key="date" android:summary="03/10/2008" />
    [COLOR="Blue"]<Preference android:title="@string/date_time_set_time" android:key="time" android:summary="12:00am" />[/COLOR]
    [COLOR="Red"]<PreferenceCategory android:title="@string/clock_cat" android:key="clock_category">
        <ListPreference android:entries="@array/clock_style_entries" android:title="@string/clock_title_enable" android:key="clock_style" android:entryValues="@array/clock_style_values" />
        <ListPreference android:entries="@array/clock_ampm_entries" android:title="@string/title_clock_ampm_entries" android:key="clock_am_pm_style" android:entryValues="@array/clock_ampm_values" />
	<ListPreference android:entries="@array/clock_weekday_entries" android:title="@string/enable_clock_weekday" android:key="clock_weekday" android:summary="@string/enable_clock_weekday_summary" android:entryValues="@array/clock_weekday_values" />
    </PreferenceCategory>[/COLOR]
	<PreferenceScreen android:title="@string/date_time_set_timezone" android:key="timezone" android:summary="GMT-8:00" android:fragment="com.android.settings.ZonePicker" />
    <CheckBoxPreference android:title="@string/date_time_24hour" android:key="24 hour" android:summaryOn="@string/date_time_24_hour_sample" android:summaryOff="@string/date_time_12_hour_sample" />
    <ListPreference android:title="@string/date_time_date_format" android:key="date_format" android:summary="mm/dd/yyyy" />
</PreferenceScreen>

Navigate to smali/com/android/settings/DateTimeSettings.smali and add the following code

At end of # interfaces
Code:
.implements Landroid/preference/Preference$OnPreferenceChangeListener;

At end of #static fields
Code:
.field private static resources:Landroid/content/res/Resources;

At end of # instance fields
Code:
.field mClockAmPmstyle:Landroid/preference/ListPreference;

.field mClockStyle:Landroid/preference/ListPreference;

.field mClockWeekday:Landroid/preference/ListPreference;


Find ".method public onCreate(Landroid/os/Bundle;)V" and replace entire method with the following 2 methods

Replace BLUE id with your <public type="xml" name="date_time_prefs" in public.xml
Code:
.method public onCreate(Landroid/os/Bundle;)V
    .locals 4
    .param p1    # Landroid/os/Bundle;

    invoke-super {p0, p1}, Lcom/android/settings/SettingsPreferenceFragment;->onCreate(Landroid/os/Bundle;)V

    invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;

    move-result-object v0

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

    move-result-object v3

    const v0, [COLOR=Blue]0x7f05000b[/COLOR]

    invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->addPreferencesFromResource(I)V

    const-string v0, "clock_style"

    invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    check-cast v0, Landroid/preference/ListPreference;

    iput-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;

    const-string v0, "clock_style"

    const/4 v1, 0x0

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

    move-result v0

    iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v2, v1}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;

    invoke-virtual {v2, p0}, Landroid/preference/SwitchPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v0, "clock_am_pm_style"

    invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    check-cast v0, Landroid/preference/ListPreference;

    iput-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;

    const-string v0, "clock_am_pm_style"

    const/4 v1, 0x0

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

    move-result v0

    iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v2, v1}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;

    invoke-virtual {v2, p0}, Landroid/preference/SwitchPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v0, "clock_weekday"

    invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    check-cast v0, Landroid/preference/ListPreference;

    iput-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;

    const-string v0, "clock_weekday"

    const/4 v1, 0x0

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

    move-result v0

    iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v2, v1}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;

    invoke-virtual {v2, p0}, Landroid/preference/SwitchPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    sput-object v0, Lcom/android/settings/DateTimeSettings;->resources:Landroid/content/res/Resources;

    invoke-direct {p0}, Lcom/android/settings/DateTimeSettings;->initUI()V

    return-void
.end method

.method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z
    .locals 3
    .param p1    # Landroid/preference/Preference;
    .param p2    # Ljava/lang/Object;

    iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;

    if-ne p1, v0, :cond_17

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v1

    invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v2, "clock_style"

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

    :cond_17
    iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;

    if-ne p1, v0, :cond_2e

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v1

    invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v2, "clock_am_pm_style"

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

    :cond_2e
    iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;

    if-ne p1, v0, :cond_45

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v1

    invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v2, "clock_weekday"

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

    :cond_45
    const/4 v0, 0x1

    return v0
.end method

Thats it for settings.apk recompile and sign

Decompile SystemUI.apk

Navigate to res/values/ids.xml and add to end
Code:
<item type="id" name="center_clock">false</item>
    <item type="id" name="center_clock_layout">false</item>
	<item type="id" name="clockhead">false</item>

Navigate to res/layout/status_bar_expanded_header.xml and add code in RED
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:background="#40000000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <RelativeLayout android:id="@id/datetime" android:layout_width="fill_parent" android:layout_height="48.0dip">
        <com.android.systemui.statusbar.policy.Clock[COLOR=Red]head[/COLOR] android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" android:id="@id/clock[COLOR=Red]head[/COLOR]" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:singleLine="true" />
        <com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:layout_marginTop="8.0dip" android:layout_marginRight="8.0dip" android:layout_marginBottom="8.0dip" android:layout_toRightOf="@id/clock[COLOR=Red]head[/COLOR]" />
        <LinearLayout android:id="@id/buttons_bar" android:layout_width="wrap_content" android:layout_height="wrap_content">
            <com.android.systemui.statusbar.RotationToggle android:id="@id/rotation_lock_button" android:clickable="true" android:layout_width="32.0dip" android:layout_height="32.0dip" android:layout_margin="8.0dip" android:button="@drawable/ic_notify_rotation" android:contentDescription="@string/accessibility_rotation_lock_off" />
        </LinearLayout>
        <Space android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_weight="1.0" />
        <ViewFlipper android:id="@id/header_flipper" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="2.0dip" android:layout_alignParentRight="true"
          xmlns:android="http://schemas.android.com/apk/res/android">
            <RelativeLayout android:layout_width="wrap_content" android:layout_height="fill_parent">
                <ImageView android:id="@id/flip_to_quickpanel_button" android:layout_width="50.0dip" android:layout_height="50.0dip" android:src="@drawable/ic_notify_quicksettings" android:scaleType="center" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_desc_quick_settings" />
                <ImageView android:id="@id/clear_all_button" android:layout_width="50.0dip" android:layout_height="50.0dip" android:src="@drawable/ic_notify_clear" android:scaleType="center" android:layout_toLeftOf="@id/flip_to_quickpanel_button" android:contentDescription="@string/accessibility_clear_all" />
            </RelativeLayout>
            <RelativeLayout android:layout_width="wrap_content" android:layout_height="fill_parent">
                <ImageView android:id="@id/flip_to_notifications_button" android:layout_width="50.0dip" android:layout_height="50.0dip" android:src="@drawable/ic_notifications" android:scaleType="center" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_notifications_button" />
            </RelativeLayout>
        </ViewFlipper>
    </RelativeLayout>
</LinearLayout>

Navigate to res/layout/status_bar.xml and replace entire file with code below
Code:
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/status_bar_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <com.android.systemui.statusbar.policy.ClockCenter android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/center_clock" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
    </LinearLayout>
    <ImageView android:id="@id/notification_lights_out" android:paddingLeft="6.0dip" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" />
    <LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <com.android.systemui.statusbar.BarLabel android:textAppearance="@style/TextAppearance.StatusBar.Sim" android:ellipsize="marquee" android:layout_gravity="center_vertical" android:id="@id/barlabel" android:focusable="true" android:focusableInTouchMode="true" android:visibility="gone" android:addStatesFromChildren="true" android:layout_width="50.0dip" android:layout_height="fill_parent" android:scrollHorizontally="true" android:singleLine="true" android:marqueeRepeatLimit="1" />
        <LinearLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
            <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
            <com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
        </LinearLayout>
        <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
        <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
            <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
            <ImageView android:id="@id/battery" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
        </LinearLayout>
        <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/clock" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
    </LinearLayout>
    <LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:background="#ff000000" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
        </ImageSwitcher>
        <com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.phone.TickerView>
    </LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>

Navigate to res/values/ids and add to end
Code:
<item type="id" name="center_clock">false</item>
    <item type="id" name="center_clock_layout">false</item>

Navigate to smali/com/android/systemui/phone/PhoneStatusBar.smali and add the following code

At end of # instance fields
Code:
.field mCenterClockLayout:Landroid/widget/LinearLayout;

Find BLUE code below and add RED code above it "pay attention to GREEN register numbers and adapt"

Code:
[COLOR="Red"]iget-object [COLOR="Green"]v0, p0,[/COLOR] Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

    const [COLOR="Green"]v5,[/COLOR] 0x7f0d00e6

    invoke-virtual [COLOR="Green"]{v0, v5},[/COLOR] Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;

    move-result-object [COLOR="Green"]v0[/COLOR]

    check-cast [COLOR="Green"]v0,[/COLOR] /widget/LinearLayout;

    iput-object [COLOR="Green"]v0, p0,[/COLOR] Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;[/COLOR]

    .line 464
   [COLOR="Blue"]iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

    const v5, 0x7f0d002e

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

    move-result-object v0

    iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerView:Landroid/view/View;[/COLOR]

Find ".method public showClock(Z)V" and replace entire method
Code:
.method public showClock(Z)V
    .locals 8

    const/16 v3, 0x8

    const/4 v2, 0x0

    const/4 v1, 0x1

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

    const v4, 0x7f0d002d

    invoke-virtual {v0, v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;

    move-result-object v4

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

    const v5, 0x7f0d00e5

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

    move-result-object v5

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

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

    move-result-object v0

    const-string v6, "clock_style"

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

    move-result v0

    if-ne v0, v1, :cond_3

    move v0, v1

    :goto_1
    iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

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

    move-result-object v6

    const-string v7, "clock_style"

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

    move-result v6

    const/4 v7, 0x2

    if-ne v6, v7, :cond_4

    :goto_2
    if-eqz v0, :cond_2

    if-eqz v4, :cond_2

    if-eqz p1, :cond_5

    move v0, v2

    :goto_3
    invoke-virtual {v4, v0}, Landroid/view/View;->setVisibility(I)V

    :cond_2
    if-eqz v1, :cond_0

    if-eqz v5, :cond_0

    if-eqz p1, :cond_6

    :goto_4
    invoke-virtual {v5, v2}, Landroid/view/View;->setVisibility(I)V

    goto :goto_0

    :cond_3
    move v0, v2

    goto :goto_1

    :cond_4
    move v1, v2

    goto :goto_2

    :cond_5
    move v0, v3

    goto :goto_3

    :cond_6
    move v2, v3

    goto :goto_4
.end method

Add attached files in zip to smali folder

Compile and decompile SystemUI.apk open attached uipublic.txt and public.xml of newly decompiled SystemUI.apk
Search ids in added smali and added code in phonestatusbar.smali and replace as necessary

Decompile your Framework-res.apk open attached framepublic.txt and your decompile framework public.xml
Search ids in added smali and replace as necessary

After changing all ids recompile and push/copy to system/app and set proper permissions rw-r-r

 

Attachments

  • statusbarclockmod.zip
    8.4 KB · Views: 48
  • framepublic.txt
    486 KB · Views: 41
  • uipublic.txt
    84.5 KB · Views: 51
Last edited:

dec0der

Senior Member
Mar 11, 2013
1,440
759
iloilo city
Hey mate, can you pls help me with the last 2 parts in editing systemui.apk? Seems that I can't find the right code to place the additional codes in red. Thanks in advance.
 

Attachments

  • SystemUI.apk
    2.3 MB · Views: 3

Didact74

Senior Member
Sep 2, 2010
609
1,877
Lake Shore, MD
I don't have a problem sharing here:) just was asking permission. I will get together my code changes and post guide here

Sent from my N800 using Tapatalk

Guys, as always anyone is welcome to use my stuff for whatever they want. All I ask is to throw me a few Thanks and give credit in any new posts or threads referencing whatever you want to use. Technically "my stuff" is everyones stuff anyway considering i read other peoples stuff to figure out how to do my stuff. Does any of the stuff I just said make sense? LOL :)
 

Fissleboot

Senior Member
May 1, 2014
87
26
Guys, as always anyone is welcome to use my stuff for whatever they want. All I ask is to throw me a few Thanks and give credit in any new posts or threads referencing whatever you want to use. Technically "my stuff" is everyones stuff anyway considering i read other peoples stuff to figure out how to do my stuff. Does any of the stuff I just said make sense? LOL :)
Makes perfect sense, [emoji3] i have since ported the left clock mod, not color or transparent status bar as i already have gradient, check out my rom for my device AWE Inspired Moonshine currently working on an L themed rom also
e3usa8up.jpg
 

Fissleboot

Senior Member
May 1, 2014
87
26
will this work ona any cm9 roms? :confused:
Should just give it a shot... May need some improvising... As i had to with my device

---------- Post added at 09:53 PM ---------- Previous post was at 09:06 PM ----------

Im actually gonna write my own guide when i get time that uses a seperate statusbar.smali in settings to make things easier:) its similar to didacts rom control setup
 

eyesore123

Senior Member
Apr 29, 2013
337
49
Philippines
Should just give it a shot... May need some improvising... As i had to with my device

---------- Post added at 09:53 PM ---------- Previous post was at 09:06 PM ----------

Im actually gonna write my own guide when i get time that uses a seperate statusbar.smali in settings to make things easier:) its similar to didacts rom control setup

pls post it if you have..
i had problems decompiling after following this guide :(
 

Top Liked Posts

  • There are no posts matching your filters.
  • 78
    I have been working on this MOD for a long time now and can finally say I got it working 100%!

    What Does this MOD do?
    - This is a much improved version of the older time and am/pm mod that allowed you to remove time and/or am/pm from the statusbar. This new version introduces a list preference UI with several new options the older MOD did not have. See attached Pictures.

    This new MOD will allow you to:

    Code:
    [B][COLOR="DarkRed"][CENTER]Remove time
    Center the clock in statusbar
    move the clock to stock location
    remove clock from statusbar
    remove am/pm
    change am/pm to small size
    change am/pm to large size
    add abbreviated day of week to status bar small size
    add abbreviated day of week to status bar large size
    remove abbreviated day of week from the status bar[/CENTER]
    [/COLOR][/B]

    All these changes will work on the fly with no reboot necessary.

    There are a few new smali files that had to be created and extensive changes to some existing smali files. Due to the large amount of changes needed this guide will only cover the changes that are semi-easy to show/explain. For the new files and the files with large amounts of changes I will be uploading a zip with the entire smali file and notes on where they need to be placed.

    I used a lot of examples from the CM team to code this MOD and it would have been very difficult without those examples so big props go to them !!

    There is a lot to do here so lets get started....


    We will be working with several system files. They include:

    SystemUI
    SecSettings
    framework-res

    Lets begin with SecSettings.

    Decompile SecSettings and navigate to res/values/arrays

    Add the following at the end of the file
    Code:
        <string-array name="clock_style_entries">
            <item>Right clock</item>
            <item>Center clock</item>
            <item>No clock</item>
        </string-array>
        <string-array name="clock_style_values">
            <item>1</item>
            <item>2</item>
            <item>0</item>
        </string-array>
        <string-array name="clock_ampm_entries">
            <item>"Don't show"</item>
            <item>Small AM/PM</item>
            <item>Regular AM/PM</item>
        </string-array>
        <string-array name="clock_ampm_values">
            <item>2</item>
            <item>1</item>
            <item>0</item>
        </string-array>
        <string-array name="clock_weekday_entries">
            <item>"Don't show"</item>
            <item>Small weekday</item>
            <item>Regular weekday</item>
        </string-array>
        <string-array name="clock_weekday_values">
            <item>0</item>
            <item>1</item>
            <item>2</item>
        </string-array>

    Navigate to res/values/strings and add the following
    Code:
        <string name="enable_clock_weekday">Day of the week</string>
        <string name="enable_clock_weekday_summary">Abbreviated day of the week in statusbar</string>
        <string name="clock_cat">Clock options</string>
        <string name="clock_title_enable">Clock style</string>
        <string name="title_clock_ampm_entries">AM/PM style</string>

    Navigate to res/xml/date_time_prefs.xml and replace all code with the following
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <PreferenceScreen android:title="@string/date_and_time"
      xmlns:android="http://schemas.android.com/apk/res/android">
        <CheckBoxPreference android:title="@string/date_time_auto" android:key="auto_time" android:summaryOn="@string/date_time_auto_summaryOn" android:summaryOff="@string/date_time_auto_summaryOff" />
        <Preference android:title="@string/date_time_set_date" android:key="date" android:summary="03/10/2008" android:widgetLayout="@layout/round_more_icon" />
        <Preference android:title="@string/date_time_set_time" android:key="time" android:summary="12:00am" android:widgetLayout="@layout/round_more_icon" />
        <PreferenceCategory android:title="@string/clock_cat" android:key="clock_category">
            <ListPreference android:entries="@array/clock_style_entries" android:title="@string/clock_title_enable" android:key="clock_style" android:entryValues="@array/clock_style_values" />
            <ListPreference android:entries="@array/clock_ampm_entries" android:title="@string/title_clock_ampm_entries" android:key="clock_am_pm_style" android:entryValues="@array/clock_ampm_values" />
    		<ListPreference android:entries="@array/clock_weekday_entries" android:title="@string/enable_clock_weekday" android:key="clock_weekday" android:summary="@string/enable_clock_weekday_summary" android:entryValues="@array/clock_weekday_values" />
        </PreferenceCategory>
        <CheckBoxPreference android:title="@string/zone_auto" android:key="auto_zone" android:summaryOn="@string/zone_auto_summaryOn" android:summaryOff="@string/zone_auto_summaryOff" />
        <PreferenceScreen android:title="@string/date_time_set_timezone" android:key="timezone" android:summary="GMT-8:00" android:fragment="com.android.settings.ZonePicker" />
        <CheckBoxPreference android:title="@string/date_time_24hour" android:key="24 hour" android:summaryOn="@string/date_time_24_hour_sample" android:summaryOff="@string/date_time_12_hour_sample" />
        <ListPreference android:title="@string/date_time_date_format" android:key="date_format" android:summary="mm/dd/yyyy" android:widgetLayout="@layout/round_more_icon" />
    </PreferenceScreen>

    Navigate to smali/com/android/settings/DateTimeSettings.smali and add the following in RED
    Code:
    # instance fields
    .field private mAutoTimePref:Landroid/preference/CheckBoxPreference;
    
    .field private mAutoTimeZonePref:Landroid/preference/CheckBoxPreference;
    
    [COLOR="Red"].field mClockAmPmstyle:Landroid/preference/ListPreference;
    
    .field mClockStyle:Landroid/preference/ListPreference;
    
    .field mClockWeekday:Landroid/preference/ListPreference;
    [/COLOR]
    .field private mDateFormat:Landroid/preference/ListPreference;
    
    .field private mDatePref:Landroid/preference/Preference;

    Code:
    # interfaces
    .implements Landroid/app/DatePickerDialog$OnDateSetListener;
    .implements Landroid/app/TimePickerDialog$OnTimeSetListener;
    [COLOR="Red"].implements Landroid/preference/Preference$OnPreferenceChangeListener;[/COLOR]
    .implements Landroid/content/SharedPreferences$OnSharedPreferenceChangeListener;

    Find the following method
    Code:
    .method public onCreate(Landroid/os/Bundle;)V

    Replace that entire method with the following code
    Code:
    .method public onCreate(Landroid/os/Bundle;)V
        .locals 4
        .parameter "savedInstanceState"
    
        .prologue
        .line 132
        invoke-super {p0, p1}, Lcom/android/settings/SettingsPreferenceFragment;->onCreate(Landroid/os/Bundle;)V
    
        invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;
    
        move-result-object v0
    
        invoke-virtual {v0}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v3
    
        .line 134
        const v0, 0x7f07001c
    
        invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->addPreferencesFromResource(I)V
    
        const-string v0, "clock_style"
    
        invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
    
        move-result-object v0
    
        check-cast v0, Landroid/preference/ListPreference;
    
        iput-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;
    
        const-string v0, "clock_style"
    
        const/4 v1, 0x0
    
        invoke-static {v3, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v0
    
        iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;
    
        invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
    
        move-result-object v1
    
        invoke-virtual {v2, v1}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
    
        iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;
    
        invoke-virtual {v2, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
    
        const-string v0, "clock_am_pm_style"
    
        invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
    
        move-result-object v0
    
        check-cast v0, Landroid/preference/ListPreference;
    
        iput-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
    
        const-string v0, "clock_am_pm_style"
    
        const/4 v1, 0x0
    
        invoke-static {v3, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v0
    
        iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
    
        invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
    
        move-result-object v1
    
        invoke-virtual {v2, v1}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
    
        iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
    
        invoke-virtual {v2, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
    	
    	const-string v0, "clock_weekday"
    
        invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
    
        move-result-object v0
    
        check-cast v0, Landroid/preference/ListPreference;
    
        iput-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;
    
        const-string v0, "clock_weekday"
    
        const/4 v1, 0x0
    
        invoke-static {v3, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v0
    
        iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;
    
        invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
    
        move-result-object v1
    
        invoke-virtual {v2, v1}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
    
        iget-object v2, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;
    
        invoke-virtual {v2, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
    
        .line 135
        invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getResources()Landroid/content/res/Resources;
    
        move-result-object v0
    
        sput-object v0, Lcom/android/settings/DateTimeSettings;->resources:Landroid/content/res/Resources;
    
        .line 136
        invoke-direct {p0}, Lcom/android/settings/DateTimeSettings;->initUI()V
    
        .line 139
        new-instance v0, Lcom/android/settings/DateTimeSettings$SettingsObserver;
    
        new-instance v1, Landroid/os/Handler;
    
        invoke-direct {v1}, Landroid/os/Handler;-><init>()V
    
        invoke-direct {v0, p0, v1}, Lcom/android/settings/DateTimeSettings$SettingsObserver;-><init>(Lcom/android/settings/DateTimeSettings;Landroid/os/Handler;)V
    
        iput-object v0, p0, Lcom/android/settings/DateTimeSettings;->mSettingsObserver:Lcom/android/settings/DateTimeSettings$SettingsObserver;
    
        .line 141
        return-void
    .end method

    You will now create the following new method by pasting the following code right after the "oncreate" method you just pasted
    Code:
    .method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z
        .locals 3
        .parameter "preference"
        .parameter "objValue"
    
        iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockStyle:Landroid/preference/ListPreference;
    
        if-ne p1, v0, :cond_0
    
        check-cast p2, Ljava/lang/String;
    
        invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
    
        move-result-object v0
    
        invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
    
        move-result v1
    
        invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v0
    
        const-string v2, "clock_style"
    
        invoke-static {v0, v2, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
    
        :cond_0
        iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
    
        if-ne p1, v0, :cond_1
    
        check-cast p2, Ljava/lang/String;
    
        invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
    
        move-result-object v0
    
        invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
    
        move-result v1
    
        invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v0
    
        const-string v2, "clock_am_pm_style"
    
        invoke-static {v0, v2, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
    
        :cond_1
    	iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mClockWeekday:Landroid/preference/ListPreference;
    
        if-ne p1, v0, :cond_2
    
        check-cast p2, Ljava/lang/String;
    
        invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
    
        move-result-object v0
    
        invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
    
        move-result v1
    
        invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v0
    
        const-string v2, "clock_weekday"
    
        invoke-static {v0, v2, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
    	
    	:cond_2
        const/4 v0, 0x1
    
        return v0
    .end method

    Thats it for SecSettings, recompile and set it aside.

    Decompile SystemUI and navigate to res/values/layout/tw_status_bar.xml

    Replace the entire file with the following code
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/status_bar_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
      <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/center_clock_layout" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <com.android.systemui.statusbar.policy.ClockCenter android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/center_clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
        </LinearLayout>
        <ImageView android:id="@id/notification_lights_out" android:paddingLeft="6.0dip" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" />
        <LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="0.0dip" android:paddingRight="2.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <LinearLayout android:orientation="horizontal" android:id="@id/left_icons" android:paddingLeft="4.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
                <TextView android:textSize="15.0dip" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                <ImageView android:id="@id/doNotDisturbIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_dnd" android:alpha="0.7" android:scaleX="0.85" android:scaleY="0.85" />
                <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
                <com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
            </LinearLayout>
            <LinearLayout android:orientation="horizontal" android:id="@id/right_icons" android:paddingRight="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true">
                <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
                <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
                    <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/tw_signal_cluster_view" />
                    <TextView android:textSize="12.0dip" android:textColor="#ffa6a6a6" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" />
                    <ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                </LinearLayout>
                <com.android.systemui.statusbar.policy.Clock android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#ff959595" android:ellipsize="none" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
            </LinearLayout>
        </LinearLayout>
        <LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
                <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
                <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
            </ImageSwitcher>
            <com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
                <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_old" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
                <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_new" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            </com.android.systemui.statusbar.phone.TickerView>
        </LinearLayout>
    </com.android.systemui.statusbar.phone.PhoneStatusBarView>

    Navigate to res/values/ids

    Paste the following somewhere in the file
    Code:
        <item type="id" name="center_clock">false</item>
        <item type="id" name="center_clock_layout">false</item>

    Navigate to smali/com/android/systemui/phone/PhoneStatusBar.smali

    Find the following method
    Code:
    .method public showClock(Z)V

    Replace the entire method with the following code
    Code:
    .method public showClock(Z)V
        .locals 8
        .parameter
    
        .prologue
        const/16 v3, 0x8
    
        const/4 v2, 0x0
    
        const/4 v1, 0x1
    
        .line 1151
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
    
        if-nez v0, :cond_1
    
        .line 1162
        :cond_0
        :goto_0
        return-void
    
        .line 1152
        :cond_1
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
    
        const v4, 0x7f0d003d
    
        invoke-virtual {v0, v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
    
        move-result-object v4
    
        .line 1153
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
    
        const v5, 0x7f0d011f
    
        invoke-virtual {v0, v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
    
        move-result-object v5
    
        .line 1154
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
    
        invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v0
    
        const-string v6, "clock_style"
    
        invoke-static {v0, v6, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v0
    
        if-ne v0, v1, :cond_3
    
        move v0, v1
    
        .line 1155
        :goto_1
        iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
    
        invoke-virtual {v6}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v6
    
        const-string v7, "clock_style"
    
        invoke-static {v6, v7, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v6
    
        const/4 v7, 0x2
    
        if-ne v6, v7, :cond_4
    
        .line 1156
        :goto_2
        if-eqz v0, :cond_2
    
        if-eqz v4, :cond_2
    
        .line 1157
        if-eqz p1, :cond_5
    
        move v0, v2
    
        :goto_3
        invoke-virtual {v4, v0}, Landroid/view/View;->setVisibility(I)V
    
        .line 1159
        :cond_2
        if-eqz v1, :cond_0
    
        if-eqz v5, :cond_0
    
        .line 1160
        if-eqz p1, :cond_6
    
        :goto_4
        invoke-virtual {v5, v2}, Landroid/view/View;->setVisibility(I)V
    
        goto :goto_0
    
        :cond_3
        move v0, v2
    
        .line 1154
        goto :goto_1
    
        :cond_4
        move v1, v2
    
        .line 1155
        goto :goto_2
    
        :cond_5
        move v0, v3
    
        .line 1157
        goto :goto_3
    
        :cond_6
        move v2, v3
    
        .line 1160
        goto :goto_4
    .end method

    Find the following method
    Code:
    .method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

    Find the following code in the method and add the parts in RED
    Code:
    invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
    
        move-result-object v9
    
        check-cast v9, Landroid/widget/LinearLayout;
    
        iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIcons:Landroid/widget/LinearLayout;
    	
        [COLOR="red"]iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
    
        const v10, 0x7f0d0120
    
        invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
    
        move-result-object v9
    
        check-cast v9, Landroid/widget/LinearLayout;
    
        iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
    [/COLOR]
        .line 627
        iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
    
        const v10, 0x7f0d003e
    
        invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
    
        move-result-object v9
    
        iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerView:Landroid/view/View;


    Now comes the part where we have ALOT of changes. I am going to attach a zip file that will contain the following files

    Code:
    -PhoneStatusBar$MyTicker.smali -  this file goes in smali/com/android/systemui/phone
    -Clock.smali                                   -  this file goes in smali/com/android/systemui/policy
    -Clock$1.smali                               -  this file goes in smali/com/android/systemui/policy
    -Clock$SettingsObserver.smali      -  this file goes in smali/com/android/systemui/policy
    -ClockCenter.smali                         -  this file goes in smali/com/android/systemui/policy
    -ClockStock$1.smali                       -  this file goes in smali/com/android/systemui/policy
    -ClockStock.smali                           -  this file goes in smali/com/android/systemui/policy

    Add and/or replace the existing files with the new ones above

    I mentioned we will be working with framework-res and while we are not modifying any files in framework-res you will need to refer to res/values/public if you run into issues with copy and pasting the new code/files. There are quite a few unique ID's that need to match those in the "public" xml both in SystemUI and framework-res. If you have issues getting this working, you will need to verify you have the right IDs in the new and revised files. Like I said, its a tough MOD with a lot involved. I will be posting up a flashable zip later tomorrow but it will have other MODs built into it in addition to this time MOD.

    Good luck, enjoy and feel free to ask questions if you have them. There is an outside chance I forgot something in this guide but I am sure we will figure it out once DEVs get going with it.


    DEVs, feel free to use this MOD, just shoot me some credit and hit the thanks button.

    I have completed another MOD that involves 7 new selectable lockscreens similar to the Alliance MOD. I will be releasing this soon. See the attached pic for a preview.

    You will find a download in the thread link right below this instruction that covers this MOD plus many more for download. You must be
    running a stock deodex blk3 rom. The flash will break your theme if you are running one.


    MULTI-MOD

    Have fun!!

    http://www.youtube.com/watch?v=XaKrGmEymF4
    7
    So I see the option for lack screens. So will this add the aosp lock screen to a ROM that doesn't have it??

    sent from my blue police box flying through time!!!

    Awesome! Greatly appreciated.

    Edit: Do you plan on making a flashable version? I don't fully understand how to get this to work.

    Sent from my SCH-I535 using Tapatalk 2

    Enjoy!

    MULTI MOD
    6
    :fingers-crossed:
    5
    :victory::victory::victory::victory::good::good::good::good::laugh::laugh::laugh::laugh:

    Awesome!

    Now that's what you call teamwork to get it done.

    Great job guys!
    5
    I don't have a problem sharing here:) just was asking permission. I will get together my code changes and post guide here

    Sent from my N800 using Tapatalk

    Guys, as always anyone is welcome to use my stuff for whatever they want. All I ask is to throw me a few Thanks and give credit in any new posts or threads referencing whatever you want to use. Technically "my stuff" is everyones stuff anyway considering i read other peoples stuff to figure out how to do my stuff. Does any of the stuff I just said make sense? LOL :)