• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Guide-Lollipop]Clock center status bar.

Search This thread

thanhfhuongf

Senior Member
Aug 26, 2011
383
1,118
Viet Nam
www.tinhte.vn
screenshot_2014-12-31-12-43-47-jpg.4329

For android 5.0
SystemUI.apk\res\layout\status_bar.xml
search
PHP:
        <com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
            <include layout="@layout/system_icons" />
            <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:alpha="0.74" android:paddingStart="7.0dip" />
        </com.android.keyguard.AlphaOptimizedLinearLayout>
Change to
PHP:
		<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:alpha="0.74" android:paddingStart="7.0dip" />
        <LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true" android:alpha="0.8">
			<com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent">
				<include layout="@layout/system_icons" />
			</com.android.keyguard.AlphaOptimizedLinearLayout>
        </LinearLayout>
 

etheryli

Senior Member
Apr 20, 2014
52
33
Thank you for the great steps! Do you know how to remove AM/PM from the clock like AOSP?
And since the new Lollipop status bar icons are drawn by xml codes as seen in AOSP SystemUI drawables, how do we make those codes work on our Touchwiz Lollipop status bar, so we can have the beautiful AOSP Lollipop status bar icons as opposed to the old TW ones?
Cam on! Thank you!

can you make file and upload it
The steps are for your own DIY modding of your SystemUI.apk. You have to decompile it, mod the files he had shown above, compile it, then push into your system/priv-app/SystemUI/ and reboot. Voila!
To decompile/compile stuffs, just follow the Theming 101 Guide by Bubbajoe40356 in this subforum.
 
Last edited:

drlupinxx

Senior Member
Nov 17, 2011
72
9
you can put off screen clock button?
PHP:
<FrameLayout android:gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerInParent="true">
            <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:ellipsize="none" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
            <com.android.systemui.statusbar.policy.KeyButtonView android:gravity="center" android:id="@id/back" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/bloqueo" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" />
        </FrameLayout>


I got it as well but I moved a little clock on the left
if you could center the clock inside the box would be great because they put button next to the battery mars multiwindow

I put the full code if you see something wrong

PHP:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/system_bar_background"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <FrameLayout android:id="@id/call_background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
    <ImageView android:id="@id/notification_lights_out" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:paddingStart="6.0dip" />
    <LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="6.0dip" android:paddingEnd="8.0dip">
        <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:alpha="0.74">
            <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
                <TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                <ImageView android:id="@id/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />
                <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" 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.policy.KeyButtonView android:id="@id/home" android:paddingLeft="0.0dip" android:paddingRight="0.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/gi_icono_off" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_home" systemui:keyCode="187" />
                <com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" />
            </com.android.keyguard.AlphaOptimizedLinearLayout>
        </com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
        <FrameLayout android:gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerInParent="true">
            <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:ellipsize="none" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
            <com.android.systemui.statusbar.policy.KeyButtonView android:gravity="center" android:id="@id/back" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/bloqueo" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" />
        </FrameLayout>
        <com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="center|right" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
            <include layout="@layout/system_icons" />
        </com.android.keyguard.AlphaOptimizedLinearLayout>
    </LinearLayout>
    <ViewStub android:id="@id/ticker_stub" android:layout="@layout/status_bar_ticker" android:inflatedId="@id/ticker" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>

hopefully you can help
Merry Christmas and Happy New Year
 
Last edited:

thanhfhuongf

Senior Member
Aug 26, 2011
383
1,118
Viet Nam
www.tinhte.vn
you can put off screen clock button?
PHP:
<FrameLayout android:gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerInParent="true">
            <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:ellipsize="none" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
            <com.android.systemui.statusbar.policy.KeyButtonView android:gravity="center" android:id="@id/back" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/bloqueo" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" />
        </FrameLayout>


I got it as well but I moved a little clock on the left
if you could center the clock inside the box would be great because they put button next to the battery mars multiwindow

I put the full code if you see something wrong

PHP:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/system_bar_background"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <FrameLayout android:id="@id/call_background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
    <ImageView android:id="@id/notification_lights_out" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:paddingStart="6.0dip" />
    <LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="6.0dip" android:paddingEnd="8.0dip">
        <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:alpha="0.74">
            <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
                <TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                <ImageView android:id="@id/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />
                <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" 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.policy.KeyButtonView android:id="@id/home" android:paddingLeft="0.0dip" android:paddingRight="0.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/gi_icono_off" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_home" systemui:keyCode="187" />
                <com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" />
            </com.android.keyguard.AlphaOptimizedLinearLayout>
        </com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
        <FrameLayout android:gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerInParent="true">
            <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:ellipsize="none" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
            <com.android.systemui.statusbar.policy.KeyButtonView android:gravity="center" android:id="@id/back" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/bloqueo" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" />
        </FrameLayout>
        <com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="center|right" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
            <include layout="@layout/system_icons" />
        </com.android.keyguard.AlphaOptimizedLinearLayout>
    </LinearLayout>
    <ViewStub android:id="@id/ticker_stub" android:layout="@layout/status_bar_ticker" android:inflatedId="@id/ticker" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>

hopefully you can help
Merry Christmas and Happy New Year
add this code
Code:
    <FrameLayout android:id="@id/call_background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
    <ImageView android:id="@id/notification_lights_out" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:paddingStart="6.0dip" />
    <LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="6.0dip" android:paddingEnd="8.0dip">
        <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:alpha="0.74">
            <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
                <TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                <ImageView android:id="@id/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />
                <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" 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:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" />
            </com.android.keyguard.AlphaOptimizedLinearLayout>
        </com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
		<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:alpha="0.74" android:paddingStart="7.0dip" />
        <LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true" android:alpha="0.8">
			<com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent">
				<include layout="@layout/system_icons" />
			</com.android.keyguard.AlphaOptimizedLinearLayout>
        </LinearLayout>
    </LinearLayout>
 [COLOR="Red"]   <com.android.systemui.statusbar.policy.KeyButtonView android:layout_gravity="center" android:id="@id/back" android:layout_width="60.0dip" android:layout_height="fill_parent" android:src="#00000000" android:layout_toRightOf="@id/recent_apps" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" systemui:keyRepeat="false" androidundefinedrientation="vertical" />[/COLOR]
    <ViewStub android:id="@id/ticker_stub" android:layout="@layout/status_bar_ticker" android:inflatedId="@id/ticker" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
you can move to left or right
Code:
android:layout_gravity="center"
 

thanhfhuongf

Senior Member
Aug 26, 2011
383
1,118
Viet Nam
www.tinhte.vn
  • Like
Reactions: kevp75

teraherz

Senior Member
Apr 27, 2011
101
12
viña del mar
For android 5.0
SystemUI.apk\res\layout\status_bar.xml

Can you help?
I extracted the systemui and framework of Rom civato 1.5 lollipop, install the framework and decompile the systemui no problem,
Seeking the status bar.xml and modify the lines without problems, but recompililing throws me an error, probe the 4 options and is the same
Here is the log to see if you can tell me what's wrong.
 

kevp75

Recognized Contributor
screenshot_2014-12-31-12-43-47-jpg.4329

For android 5.0
SystemUI.apk\res\layout\status_bar.xml
search

Hey bud, tried this out, but I'm getting a couple issues.
#1 The clock isn't centered for me, but it is to the left of all the right side icons.
#2 Keep getting the 'ol "System has stopped, Wait OK"

any thought?
My code block is:

Code:
        <com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" 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:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:alpha="0.74" android:paddingStart="7.0dip" /> 
			<LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true" android:alpha="0.8"> 
				<com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent"> 
					<include layout="@layout/system_icons" /> 
				</com.android.keyguard.AlphaOptimizedLinearLayout> 
			</LinearLayout>
		</com.android.keyguard.AlphaOptimizedLinearLayout>
 
Last edited:

sawixso81

Senior Member
Jan 25, 2015
708
911
@kevp75 we can help on other people thread and if so I used the ops same settings but I set mine up this way running on your rom and it looks pretty good I think PM me and I can send you my statusbar.xml for you to have a look I dont have enough post counts post a link and Im a noob when it comes to forums and how things work lol
 

dollar7

Senior Member
Apr 18, 2012
199
27
Cracow
Hey bud, tried this out, but I'm getting a couple issues.
#1 The clock isn't centered for me, but it is to the left of all the right side icons.
#2 Keep getting the 'ol "System has stopped, Wait OK"

any thought?
My code block is:

Code:
        <com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" 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:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:alpha="0.74" android:paddingStart="7.0dip" /> 
			<LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true" android:alpha="0.8"> 
				<com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent"> 
					<include layout="@layout/system_icons" /> 
				</com.android.keyguard.AlphaOptimizedLinearLayout> 
			</LinearLayout>
		</com.android.keyguard.AlphaOptimizedLinearLayout>



Send your "clean" SystemUI. I mean before you changed anything.

@thread: Anyone knows how to remove AM/PM?
 

intxeon

Senior Member
Aug 8, 2013
255
95
With the dafult status_bar.xml the clock on the status bar isn't shown in the lockscreen.It's possible to get the clock centered and hidden from lockscreen at the same time?

I think that the solution is in this string:
android:id="@id/system_icon_area"

but I don't know how to properly edit status_bar.xml

Could someone help me?
 
Last edited:

thanhfhuongf

Senior Member
Aug 26, 2011
383
1,118
Viet Nam
www.tinhte.vn
With the dafult status_bar.xml the clock on the status bar isn't shown in the lockscreen.It's possible to get the clock centered and hidden from lockscreen at the same time?

I think that the solution is in this string:
android:id="@id/system_icon_area"

but I don't know how to properly edit status_bar.xml

Could someone help me?
Code:
    <LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="2.0dip" android:paddingEnd="2.0dip">
        <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:alpha="1.0">
            <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
                <TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                <ImageView android:id="@id/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />
                <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginLeft="0.0dip" android:layout_marginBottom="0.0dip" layout="@layout/signal_cluster_view" />
                <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" 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:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" />
            </com.android.keyguard.AlphaOptimizedLinearLayout>
        </com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
        [COLOR="Red"]<com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/system_icon_area" 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:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:alpha="1.0" android:paddingStart="7.0dip" />
        </com.android.keyguard.AlphaOptimizedLinearLayout>[/COLOR]
        <LinearLayout android:gravity="center|right" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true" android:alpha="1.0">
            <com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent">
                <include layout="@layout/system_icons" />
            </com.android.keyguard.AlphaOptimizedLinearLayout>
        </LinearLayout>
    </LinearLayout>
7ezdfkl.jpg

znLnnym.jpg
 
Last edited:
  • Like
Reactions: intxeon

asc1977

Senior Member
Apr 15, 2012
5,330
6,989
Schwetzingen
center clock

please help me before i become crazy :)
i want to Center my clock at darklord Rom v1.5 but no code is working for me. now i hope i become help here and post my Status_bar.xml for asking what i must Change


<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:eek:rientation="vertical" android:id="@id/status_bar" android:background="@drawable/system_bar_background"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:id="@id/call_background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<ImageView android:id="@id/notification_lights_out" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:paddingStart="6.0dip" />
<LinearLayout android:eek:rientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="6.0dip" android:paddingEnd="8.0dip">
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:eek:rientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:alpha="1.0">
<com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
<TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
<ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
<ImageView android:id="@id/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" 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:gravity="center_vertical" android:eek:rientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
<com.android.keyguard.AlphaOptimizedLinearLayout android:eek:rientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include layout="@layout/system_icons" />
<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:alpha="1.0" android:paddingStart="7.0dip" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</LinearLayout>
<ViewStub android:id="@id/ticker_stub" android:layout="@layout/status_bar_ticker" android:inflatedId="@id/ticker" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>

hope for help
best regards
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 40
    screenshot_2014-12-31-12-43-47-jpg.4329

    For android 5.0
    SystemUI.apk\res\layout\status_bar.xml
    search
    PHP:
            <com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
                <include layout="@layout/system_icons" />
                <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:alpha="0.74" android:paddingStart="7.0dip" />
            </com.android.keyguard.AlphaOptimizedLinearLayout>
    Change to
    PHP:
    		<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:alpha="0.74" android:paddingStart="7.0dip" />
            <LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true" android:alpha="0.8">
    			<com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent">
    				<include layout="@layout/system_icons" />
    			</com.android.keyguard.AlphaOptimizedLinearLayout>
            </LinearLayout>
    3
    thank for your guide mate.

    if anybody want edited file, use my attachment. its for n900xxuebnl4

    https://mega.co.nz/#!OlQACTSQ!82dDpu4Yao8Or9vUEV8Mzt2wFn4WpZ8LpajfmnPi8xQ
    2
    you can put off screen clock button?
    PHP:
    <FrameLayout android:gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerInParent="true">
                <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:ellipsize="none" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
                <com.android.systemui.statusbar.policy.KeyButtonView android:gravity="center" android:id="@id/back" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/bloqueo" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" />
            </FrameLayout>


    I got it as well but I moved a little clock on the left
    if you could center the clock inside the box would be great because they put button next to the battery mars multiwindow

    I put the full code if you see something wrong

    PHP:
    <?xml version="1.0" encoding="utf-8"?>
    <com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/system_bar_background"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
        <FrameLayout android:id="@id/call_background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
        <ImageView android:id="@id/notification_lights_out" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:paddingStart="6.0dip" />
        <LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="6.0dip" android:paddingEnd="8.0dip">
            <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:alpha="0.74">
                <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
                    <TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                    <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                    <ImageView android:id="@id/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />
                    <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" 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.policy.KeyButtonView android:id="@id/home" android:paddingLeft="0.0dip" android:paddingRight="0.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/gi_icono_off" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_home" systemui:keyCode="187" />
                    <com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" />
                </com.android.keyguard.AlphaOptimizedLinearLayout>
            </com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
            <FrameLayout android:gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerInParent="true">
                <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:ellipsize="none" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
                <com.android.systemui.statusbar.policy.KeyButtonView android:gravity="center" android:id="@id/back" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/bloqueo" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" />
            </FrameLayout>
            <com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="center|right" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
                <include layout="@layout/system_icons" />
            </com.android.keyguard.AlphaOptimizedLinearLayout>
        </LinearLayout>
        <ViewStub android:id="@id/ticker_stub" android:layout="@layout/status_bar_ticker" android:inflatedId="@id/ticker" android:layout_width="fill_parent" android:layout_height="fill_parent" />
    </com.android.systemui.statusbar.phone.PhoneStatusBarView>

    hopefully you can help
    Merry Christmas and Happy New Year
    add this code
    Code:
        <FrameLayout android:id="@id/call_background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
        <ImageView android:id="@id/notification_lights_out" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:paddingStart="6.0dip" />
        <LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="6.0dip" android:paddingEnd="8.0dip">
            <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:alpha="0.74">
                <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
                    <TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                    <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                    <ImageView android:id="@id/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />
                    <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" 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:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" />
                </com.android.keyguard.AlphaOptimizedLinearLayout>
            </com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
    		<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:alpha="0.74" android:paddingStart="7.0dip" />
            <LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true" android:alpha="0.8">
    			<com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent">
    				<include layout="@layout/system_icons" />
    			</com.android.keyguard.AlphaOptimizedLinearLayout>
            </LinearLayout>
        </LinearLayout>
     [COLOR="Red"]   <com.android.systemui.statusbar.policy.KeyButtonView android:layout_gravity="center" android:id="@id/back" android:layout_width="60.0dip" android:layout_height="fill_parent" android:src="#00000000" android:layout_toRightOf="@id/recent_apps" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" systemui:keyRepeat="false" androidundefinedrientation="vertical" />[/COLOR]
        <ViewStub android:id="@id/ticker_stub" android:layout="@layout/status_bar_ticker" android:inflatedId="@id/ticker" android:layout_width="fill_parent" android:layout_height="fill_parent" />
    </com.android.systemui.statusbar.phone.PhoneStatusBarView>
    you can move to left or right
    Code:
    android:layout_gravity="center"
    2
    33052a51972b730052a7ec659e4e07fb.jpg

    Thank you, now if i stay focused and works perfectly.
    Happy 2015!!!
    Thanks heart
    2
    anyone know what to add or remove or change to remove the am/pm and still have 12 hr clock (touchwiz lollipop) I already have the clock centered.
    When editing the SystemUI go to res/values/strings.xml and here's the edit;

    from:
    <string name="status_bar_date_formatter">%1$s %2$s</string>

    to:
    <string name="status_bar_date_formatter">%1$s</string>

    (It's line 453 if you're editing with Notepad++)

    Now if I could get this Alarm icon to disappear I'd be sooo flippin' happy.
    Maybe @thanhfhuongf could weigh in on this one since a couple people have asked about it now.