[Sony Cross-Device Development Themes and Apps] venkat kamesh:
Systemui ( First part )

1. First Decompile Your Systemui.apk

2. Download this Attachment View attachment 3772584

3. Extract from zip and replace the smali codes

4. Now open SystemUI.apk/res/layout/status_bar.xml

In that find this line

<com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">

after that add this line

<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@+id/left_clock" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingEnd="4.0dip" />

Now look for this line

<include layout="@layout/system_icons" />

below you will find this

<com.android.systemui.statusbar.policy.Clock and soo on

delete that line and add this in that place

<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="start|center" android:id="@+id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingStart="3.0dip" />

now look for this line

</com.android.systemui.statusbar.phone.PhoneStatusBarView>

Before that add this line

<com.android.keyguard.AlphaOptimizedLinearLayout 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.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@+id/center_clock" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</com.android.keyguard.AlphaOptimizedLinearLayout>

save it

Compile and Decompile ( to get Public ids )

5. Now Open SystemUI.apk/smali/com/android/systemui/statusbar/phone/StatusBarIconController.smali

Look for this

# instance fields

After that add these

.field private mCenterClockLayout:Landroid/view/View;

.field private mClockController:Lcom/android/systemui/statusbar/phone/ClockController;

Now look for this line

iput v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mLightModeIconColorSingleTone:I

after that add these lines

new-instance v1, Lcom/android/systemui/statusbar/phone/ClockController;

iget-object v4, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mNotificationIcons:Lcom/android/systemui/statusbar/phone/IconMerger;

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mHandler:Landroid/os/Handler;

invoke-direct {v1, p2, v4, v5}, Lcom/android/systemui/statusbar/phone/ClockController;-><init>(Landroid/view/View;Lcom/android/systemui/statusbar/phone/IconMerger;Landroid/os/Handler;)V

iput-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mClockController:Lcom/android/systemui/statusbar/phone/ClockController;

.line 176
const v1, 0x7f1101be # <public type="id" name="center_clock_layout" id="0x7f1101be" />

invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

move-result-object v1

iput-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mCenterClockLayout:Landroid/view/View;

Replace this public id <public type="id" name="center_clock_layout" id="0x7f1101be" />

Look for this method

.method public hideNotificationIconArea(Z)V

in that method before .return-void

add these lines

.line 349
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mCenterClockLayout:Landroid/view/View;

invoke-direct {p0, v0, p1}, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->animateHide(Landroid/view/View;Z)V

Look for this method

.method public hideSystemIconArea(Z)V

in that method before .return-void

add these lines

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mCenterClockLayout:Landroid/view/View;

invoke-direct {p0, v0, p1}, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->animateHide(Landroid/view/View;Z)V

Find this method

.method public setClockVisibility(Z)V

replace complete method with this

.method public setClockVisibility(Z)V
.locals 1
.param p1, "visible" # Z

.prologue
.line 358
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mClockController:Lcom/android/systemui/statusbar/phone/ClockController;

invoke-virtual {v0, p1}, Lcom/android/systemui/statusbar/phone/ClockController;->setVisibility(Z)V

.line 357
return-void
.end method

Now look for this method

.method public showNotificationIconArea(Z)V

in that method before .return-void

add these lines

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mCenterClockLayout:Landroid/view/View;

invoke-direct {p0, v0, p1}, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->animateShow(Landroid/view/View;Z)V

Now look for this method

.method public showSystemIconArea(Z)V

in that method before .return-void

add these lines

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mCenterClockLayout:Landroid/view/View;

invoke-direct {p0, v0, p1}, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->animateShow(Landroid/view/View;Z)V

Done... save it

6. in these smali files you need to replace the ids

7. Compile and sign it

Replace the SystemUI

8. Now its time for Settings.apk got to next post (#3)