Help request with center clock
@shaftenberg: Since you have done such a great job, I would like to use your SystemUI mods as a base. I am trying to change to be centered (changing /res/layout/status_bar.xml). I have tried a few different approaches, but none is quite right. Would you mind looking at what I am doing and pointing me in the right direction?
Method 1, "top level clock": added the following lines at the top, before the first LinearLayout. It works and looks just as I want, but the
clock does not disappear during ticker events:
Code:
<com.android.systemui.statusbar.policy.Clock
android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:id="@id/clock"
android:gravity="center" android:layout_width="fill_parent" android:layout_height="fill_parent" android:singleLine="true" />
Method 2, "RelativeLayout": find the first "LinearLayout Area", remove everything between the 2 LinearLayout tags (only the first one, not the ticker ones), and replace with the following lines. It works, but the right icon group is all
messed up, with the signal cluster having wrong vertical alignment and missing left and right padding. Is is because of the changes you made to the signal cluster?
Code:
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:layout_alignParentLeft="true"
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:id="@id/notificationIcons" android:layout_toRightOf="@id/moreIcon"
android:gravity="center_vertical" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
<ImageView android:id="@id/battery" android:layout_alignParentRight="true"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
<include android:id="@id/signal_cluster" android:layout_toLeftOf="@id/battery"
android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:layout_toLeftOf="@id/signal_cluster"
android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" />
</RelativeLayout>
Method 3, "new clock LinearLayout section": added the following lines, before the line with @id/statusIcons.
Clock is not centered, still part of the right icon block, but on the left of it.
Code:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.Clock
android:textAppearance="@style/TextAppearance.StatusBar.Clock"
android:gravity="center" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</LinearLayout>