[Android Software/Hacking General [Developers Only]] jaggyjags:
Center clock for Htc phones

:cool:VICTORY!! :cool:

I finally got it working. I have to say it hasn't been easy dough...

The clock array had to be inside the "@id/icons" parent for it to hide, and after knowing this I played a bit with the configurations and with the help of some guides from the internet I ended up with the correct configuration.

Here is the status_bar.xml to place the clock at the center of the status bar. It should work on all Gingerbread HTC phones.

<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.StatusBarView android:orientation="vertical" android:background="@drawable/statusbar_background" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:paddingLeft="6.0dip" android:layout_width="0.0dip" android:layout_weight="1.0" android:layout_height="fill_parent" android:layout_alignParentLeft="true">
<TextView android:textColor="#ffffffff" android:id="@id/plmnLabel" android:paddingTop="3.0sp" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</com.android.systemui.statusbar.IconMerger>
<com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="16.0sp" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerInParent="true" android:singleLine="true" />
<LinearLayout android:gravity="right" android:orientation="horizontal" android:id="@id/statusIcons" android:paddingRight="6.0dip" android:layout_height="fill_parent" android:layout_width="0.0dip" android:layout_weight="1.0" android:layout_alignParentRight="true" />
</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="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="8.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" />
</ImageSwitcher>
<com.android.systemui.statusbar.TickerView android:layout_gravity="center_vertical" android:id="@id/tickerText" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@android:style/TextAppearance.StatusBar.Ticker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
<TextView android:textAppearance="@android:style/TextAppearance.StatusBar.Ticker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
</com.android.systemui.statusbar.TickerView>
</LinearLayout>
<com.android.systemui.statusbar.DateView android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="16.0sp" android:gravity="left|center" android:id="@id/date" android:background="@drawable/statusbar_background" android:paddingLeft="6.0px" android:paddingRight="6.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</com.android.systemui.statusbar.StatusBarView>

Hope I help somebody with this... :)