[Android Themes] out of ideas:
Hi everybody. :D

So the origin of this issue is, I had a GB ROM that I gave an ICS style makeover too. I spent months looking for a simple way to move the clock from the middle left side over to the top right side. Never found one.

I did about a dozen other mods I found guides over here for, but never a simple clock mover. I finished up my ROM, and just used Holo Locker to give it an ICS look. I hadn't done anything to the ROM in a while and broke it back out, in the meantime I was learning actual app development, so I picked up a few things.

This is how I moved the clock and hopefully it helps someone else out. This was on a modified STOCK GB for the ZTE Merit, but the logic should be similar for other phones.

Things You Need

1. 7-zip

2. Notepad++

3. APK tool of your choice (I use Apk Multi-Tool)

4. Knowledge of how to Decompile/Recompile apks.(I cant help you through that process, and there are lots of good guides right here about how to do that.

Ok here we go.

first, get your framework-res.apk from your ROM. decompile it.

Navigate your way for /res/layout/keyguard_screen_tab_unlock.xml

It should look something like this(may vary on touchwiz/htc/non stock roms)

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:gravity="center_horizontal" android:id="@id/root" android:background="#70000000" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tabunlock="http://schemas.android.com/apk/res/com.android.tabunlock">
<TextView android:textAppearance="?textAppearanceMedium" android:gravity="bottom|right|center" android:id="@id/carrier" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10.0dip" android:layout_marginRight="8.0dip" android:layout_alignParentTop="true" android:layout_alignParentRight="true" />
<TextView android:textAppearance="?textAppearanceSmall" android:textColor="@color/white" android:id="@id/emergencyCallText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="0.0dip" android:layout_marginRight="8.0dip" android:text="@string/emergency_calls_only" android:layout_below="@id/carrier" android:layout_alignParentRight="true" />
<com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20.0dip" android:layout_marginTop="52.0dip" android:layout_marginBottom="8.0dip" android:layout_below="@id/carrier">
<TextView android:textAppearance="?textAppearanceMedium" android:textSize="72.0sp" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10.0dip" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" />
<TextView android:textAppearance="?textAppearanceMedium" android:textSize="22.0sp" android:ellipsize="none" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" android:layout_toRightOf="@id/timeDisplay" android:layout_alignBaseline="@id/timeDisplay" />
</com.android.internal.widget.DigitalClock>
<TextView android:textAppearance="?textAppearanceMedium" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="24.0dip" android:layout_below="@id/time" />
<TextView android:textAppearance="?textAppearanceMedium" android:id="@id/status1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="24.0dip" android:layout_marginTop="4.0dip" android:drawablePadding="4.0dip" android:layout_below="@id/date" />
<TextView android:textAppearance="?textAppearanceMedium" android:id="@id/status2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="24.0dip" android:layout_marginTop="4.0dip" android:drawablePadding="4.0dip" android:layout_below="@id/status1" />
<TextView android:textAppearance="?textAppearanceMedium" android:id="@id/screenLocked" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="24.0dip" android:layout_marginTop="12.0dip" android:drawablePadding="4.0dip" android:layout_below="@id/status2" />
<com.android.internal.widget.SlidingTab android:orientation="horizontal" android:id="@id/tab_selector" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="80.0dip" android:layout_alignParentBottom="true" />
<Button android:id="@id/emergencyCallButton" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="2.0dip" android:drawableLeft="@drawable/ic_emergency" android:drawablePadding="8.0dip" android:layout_alignParentBottom="true" android:layout_centerInParent="true" style="@style/Widget.Button.Transparent" />
</RelativeLayout>

The part we are concerned with is the

<com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20.0dip" android:layout_marginTop="52.0dip" android:layout_marginBottom="8.0dip" android:layout_below="@id/carrier">
<TextView android:textAppearance="?textAppearanceMedium" android:textSize="72.0sp" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10.0dip" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" />
<TextView android:textAppearance="?textAppearanceMedium" android:textSize="22.0sp" android:ellipsize="none" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" android:layout_toRightOf="@id/timeDisplay" android:layout_alignBaseline="@id/timeDisplay" />
</com.android.internal.widget.DigitalClock>
<TextView android:textAppearance="?textAppearanceMedium" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="24.0dip" android:layout_below="@id/time" />

bit.

<com.android.internal.widget.DigitalClock> section is our clock. The first textview is the clock itself, the second is the am/pm part.

The next textview AFTER </com.android...> is the date part.

If you want, you can remove the am/pm or the date by taking out those lines.

i played around with a few options, but what im currently working with is this

<com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20.0dip" [B]android:layout_marginTop="15.0dip"[/B] android:layout_marginBottom="8.0dip" [B]android:layout_alignParentRight="true"[/B]>
<TextView android:textAppearance="?textAppearanceMedium" android:textSize="70.0sp" 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="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" />
<TextView android:textAppearance="?textAppearanceMedium" android:textSize="20.0sp" android:ellipsize="none" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" android:layout_toRightOf="@id/timeDisplay" android:layout_alignBaseline="@id/timeDisplay" />
</com.android.internal.widget.DigitalClock>
<TextView android:textAppearance="?textAppearanceMedium" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" [B]android:layout_alignParentRight="true" [/B]android:layout_below="@id/time" />

the bolded parts are the important ones. I have set "android:layout_alignParentRight="true"". this means it sets up the text to go all the way to the right hand side of the "parent"(basically the invisible container in xml)

This bring everything over to the right hand side of the screen.

I have Also set "android:layout_marginTop="15dip", where it used to be 52 dip. This is basically how many pixels, or how far, down the screen from the top the text will now appear. this part will vary on different devices, but I have settled on those numbers for now.

Next, Save your file, then re-compile.

push to your device and try it out. You may have to play around with different numbers, but alignParentRight will always put it to the right side.

Similar procedure to change the different lockscreens with pin locks or passwords. For those I have to edit

keygaurd_screen_portrait

keygaurd_screen_sim_pin_unlock.

etc.

My ROM did not have different landscape modes for lockscreen, even though the XML is there, so it was pointless to change those for me, maybe not for you.

So basically it was pretty simple, If I figure out how to make the GB slide tabs to be the ICS style(This involves editing the drawable folder), Ill share that too.

Hope it helps somebody.

Random Tip- When re-compiling System APKs, I found the quickest way is to do my edits, then sign it as System APK. Open my new apk in 7-zip, delete the META-INF folder and the Manifest(these are the signature you may have heard about) then open a backed up copy for the working APK in another 7-ZIP window, and drag and drop them back into the new one.