Quantcast
Channel: xda-developers - Android Themes
Viewing all articles
Browse latest Browse all 4090

[GUIDE][Mods][All Devices]How to add/ Change Clocks to Analog/ Digital with Seconds

$
0
0
Hi devs...
Today i will share to you How to add/ Change All Clocks to Analog nor even with Seconds Digital Clock... :D
This method only for you who have experiences or familiar with Apktool/ Apk Multy tool/ etc.
So, Let's do this;

Required:
  • PC
  • Apktool or similar Tools
  • NotePad++ for edit xmls files
  • WinRAR or 7z
  • A Cup of coffee (Yeaahh...)


1. Change your Clock Lockscreen (From framework or UxpNxtLockscreen)
Only need to change "Textview" to "DigitalClock" for it;

> Decompile your framework-res.apk
> Navigate to /res/layout/
> Open keyguard_screen_tab_unlock.xml (for normal lockscreen) or keyguard_screen_password_portrait.xml (for Password lockscreen)
> Search for this line:
Code:

<com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="12.0dip" android:layout_marginBottom="0.0dip">
            <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_clock_font_size" android:textColor="@color/lockscreen_clock_foreground" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="0.0dip" android:singleLine="true" android:shadowColor="@color/lockscreen_clock_background" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" android:layout_centerInParent="true" />
            <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_am_pm_font_size" android:textColor="@color/lockscreen_clock_am_pm" android:ellipsize="none" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:layout_marginBottom="0.0dip" android:singleLine="true" android:shadowColor="@color/lockscreen_clock_background" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" android:layout_toRightOf="@id/timeDisplay" android:layout_alignBottom="@id/timeDisplay" />
        </com.android.internal.widget.DigitalClock>

You just need to change the RED color text:
Code:

<TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_clock_font_size" android:textColor="@color/lockscreen_clock_foreground" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="0.0dip" android:singleLine="true" android:shadowColor="@color/lockscreen_clock_background" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" android:layout_centerInParent="true" />
to:
Code:

<DigitalClock
> That's it, now save and Recompile...

Do the same way for UxpNxtLockscreen.apk with open w_clock.xml on /res/layout/
And we got look like this:





2. Change your Status bar Clock and Status bar Expanded Clock

> Decompile your SystemUI.apk
> Navigate to /res/layout/
> Open status_bar.xml (for Status bar Clock) and status_bar_expanded_header.xml (for JB status bar expanded clock)
> On status_bar.xml, search for this line:
Code:

<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
> Change the RED code to:
Code:

<DigitalClock
Yeah, we know what it should be ;)
> Save and Recompile...

Now play with expanded clock;
> Open status_bar_expanded_header.xml
> Search for this line:
Code:

<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" android:id="@id/clock" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:singleLine="true" />
> I bet you already knew what you have to do... yep, change the RED code to:
Code:

<DigitalClock
> Save and Recompile...

> And we got look like this:





3. Change your lockscreen Clock to Analog Clock (from framework or UxpNxtLockScreen)

> Decompile framework-res.apk
> Navigate to /res/layout/
> Again, Open keyguard_screen_tab_unlock.xml (for normal lockscreen) or keyguard_screen_password_portrait.xml (for Password lockscreen)
> Search for this line:
Code:

<com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="12.0dip" android:layout_marginBottom="0.0dip">
            <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_clock_font_size" android:textColor="@color/lockscreen_clock_foreground" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="0.0dip" android:singleLine="true" android:shadowColor="@color/lockscreen_clock_background" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" android:layout_centerInParent="true" />
            <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_am_pm_font_size" android:textColor="@color/lockscreen_clock_am_pm" android:ellipsize="none" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:layout_marginBottom="0.0dip" android:singleLine="true" android:shadowColor="@color/lockscreen_clock_background" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" android:layout_toRightOf="@id/timeDisplay" android:layout_alignBottom="@id/timeDisplay" />
        </com.android.internal.widget.DigitalClock>

You just need to change the RED color text:
Code:

<TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_clock_font_size" android:textColor="@color/lockscreen_clock_foreground" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="0.0dip" android:singleLine="true" android:shadowColor="@color/lockscreen_clock_background" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" android:layout_centerInParent="true" />
> You need to HIDE these lines first (hide the Digital Clock) by add this code:
Code:

android:visibility="gone"
> Then, copy this line to show Analog Clock upside the above lines:
Code:

<AnalogClock android:layout_gravity="center_horizontal" android:id="@id/analogClock1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" />
> Now code lines should be look like this:
Code:

<AnalogClock android:layout_gravity="center_horizontal" android:id="@id/analogClock1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" />
    <LinearLayout android:layout_gravity="top" android:orientation="vertical" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="22.0dip">
        <com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="22.0dip" android:layout_marginBottom="3.0dip">
            <TextView android:textAppearance="?textAppearanceMedium" android:textSize="62.0dip" android:textColor="@color/lockscreen_clock_foreground" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="0.0dip" android:singleLine="true" android:shadowColor="@color/lockscreen_clock_background" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" android:layout_centerInParent="true" />
            <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_am_pm_font_size" android:textColor="@color/lockscreen_clock_am_pm" android:ellipsize="none" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:layout_marginBottom="0.0dip" android:singleLine="true" android:shadowColor="@color/lockscreen_clock_background" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" android:layout_toRightOf="@id/timeDisplay" android:layout_alignBottom="@id/timeDisplay" />
        </com.android.internal.widget.DigitalClock>

> Save it
> We have new id for now then,
> Navigate to /res/values/
> Open ids.xml and add this line at the end of ids (above </resource> code )
Code:

<item type="id" name="analogClock1">false</item>
> Save and Recompile...

Now play with UxpNxtLockScreen clock;

> After decompiling
> Navigate to /res/layout/
> Open w_clock.xml
> Search for this line:
Code:

<RelativeLayout android:layout_gravity="center_horizontal" android:orientation="horizontal" android:id="@id/timeRelativeLayout24h" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="-6.0dip">
                <TextView android:textAppearance="?android:textAppearanceMedium" android:textSize="76.0dip" android:textColor="@*android:color/white" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="2.0dip" android:singleLine="true" android:shadowColor="@color/clock_text_shadow_color" android:shadowDx="@integer/clock_text_shadow_dx" android:shadowDy="@integer/clock_text_shadow_dy" android:shadowRadius="@integer/clock_text_shadow_radius" android:layout_centerHorizontal="true" />
        <TextView android:textAppearance="?android:textAppearanceMedium" android:textSize="16.0dip" android:textColor="@*android:color/white" android:ellipsize="none" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="7.0dip" android:singleLine="true" android:shadowColor="@color/text_shadow_color" android:shadowDx="@integer/text_shadow_dx" android:shadowDy="@integer/text_shadow_dy" android:shadowRadius="@integer/text_shadow_radius" android:layout_toRightOf="@id/timeDisplay" android:layout_alignParentTop="true" />
    </RelativeLayout>

> Again, HIDE the Digital Clock before add the Analog Clock by add this line:
Code:

android:visibility="gone"
> Just like the way we made for framework-res.apk, add the Analog Clock lines mentioned above.
> It's should be look like this:
Code:

<AnalogClock android:layout_gravity="center_horizontal" android:id="@id/analogClock1" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_width="fill_parent" android:layout_height="wrap_content" />
        <RelativeLayout android:layout_gravity="center_horizontal" android:orientation="horizontal" android:id="@id/timeRelativeLayout24h" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="-6.0dip">
                <TextView android:textAppearance="?android:textAppearanceMedium" android:textSize="76.0dip" android:textColor="@*android:color/white" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="2.0dip" android:singleLine="true" android:shadowColor="@color/clock_text_shadow_color" android:shadowDx="@integer/clock_text_shadow_dx" android:shadowDy="@integer/clock_text_shadow_dy" android:shadowRadius="@integer/clock_text_shadow_radius" android:layout_centerHorizontal="true" />
        <TextView android:textAppearance="?android:textAppearanceMedium" android:textSize="16.0dip" android:textColor="@*android:color/white" android:ellipsize="none" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="7.0dip" android:singleLine="true" android:shadowColor="@color/text_shadow_color" android:shadowDx="@integer/text_shadow_dx" android:shadowDy="@integer/text_shadow_dy" android:shadowRadius="@integer/text_shadow_radius" android:layout_toRightOf="@id/timeDisplay" android:layout_alignParentTop="true" />
    </RelativeLayout>

> Wait, it's NOT perfect looks yet :cyclops:
> You need to make some MARGIN to the top of Clock, then:
> On second line, add the RED code and should be look like this:
Code:

<LinearLayout android:orientation="vertical" android:id="@id/clock_and_date" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="36.0dip" android:layout_alignParentTop="true" android:layout_centerHorizontal="true
> Margin should be differ for some Screen Sizes. Then look up for your self... :p
> Done, Save and Recompile...
> And we got look like this:




4. Add Analog Clock in expanded status bar layout

> Decompile your SystemUI.apk
> Navigate to /res/layout/
> Open status_bar_expanded.xml (for JB devices)
> Search for this line:
Code:

xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
> Below the code, add this line:
Code:

<AnalogClock android:layout_gravity="bottom" android:id="@id/analogClock1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="100.0dip" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" />
> See the RED code? That mean depends on your Screen Sizes,.... you know what you have to do... ;)
> And we got look like this:




One more simple guide for change the Analog Clock Style: CLICK ME!

That's it for the Guides, if you have some questions related to this method, just post here...
But, don't ask me for how to use apktool or bla..bla..bla... Try to use your Search Bar Engine or CLICK ME!...

If you had Xperia E Single SIM on your hands, i have those things already for ya... CLICK ME! :cool:

Original Thread on Xperia Miro, Tipo, J and E

CREDITS:
> XDA Developers Staff and Members
> Rizal Lovins for JB Apktool
> Google
> My Coffee...
> If someone forgotten by me, please PM then i will edit the Credits... Thanks


Give me a Motivate by Hit that THANKS button
or Help me for Upgrade my Damn Networking by DONATE to me:fingers-crossed:

Viewing all articles
Browse latest Browse all 4090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>