FORUMS
Remove All Ads from XDA

XML 101 - XML Modding Made Easy!

6,616 posts
Thanks Meter: 8,423
 
By Ticklefish, Recognized Themer on 5th November 2014, 04:01 PM
Post Reply Email Thread
4th December 2018, 08:40 PM |#681  
Senior Member
Thanks Meter: 2,932
 
More
I love you @Spannaa @niaboc79 @Ticklefish guys, thanks to your help/hints I was able to centre my clock and show date in status bar in my Oreo install (Sony xz2c)

using 7zip and copying modified files to original systemUI apk did the trick

now I can wait until drmfix for pie will be released and then flash exisenz rom to get all sweetes

only small problem is that this way (I don't know if it is because of centre clock edit or textclock) the clock is not automatically changing colour when background changes, it stays always white, see attachment, so with light backgrounds i can't see it

also, Nova feature that hides clock in home screen doesn't work anymore, means the clock is always shown... but the biggest hiccup is the colour not changing.. any suggestions maybe?

thanks in any case to you all for all your help, really appreciate my friends and wish you the best for helping me hopeless as I was
Attached Thumbnails
Click image for larger version

Name:	_20181204_212512.JPG
Views:	92
Size:	16.0 KB
ID:	4658410  
The Following 2 Users Say Thank You to FcukBloat For This Useful Post: [ View ] Gift FcukBloat Ad-Free
 
 
6th December 2018, 01:10 PM |#682  
Quote:
Originally Posted by FcukBloat

I love you @Spannaa @niaboc79 @Ticklefish guys, thanks to your help/hints I was able to centre my clock and show date in status bar in my Oreo install (Sony xz2c)

using 7zip and copying modified files to original systemUI apk did the trick

now I can wait until drmfix for pie will be released and then flash exisenz rom to get all sweetes

only small problem is that this way (I don't know if it is because of centre clock edit or textclock) the clock is not automatically changing colour when background changes, it stays always white, see attachment, so with light backgrounds i can't see it

also, Nova feature that hides clock in home screen doesn't work anymore, means the clock is always shown... but the biggest hiccup is the colour not changing.. any suggestions maybe?

thanks in any case to you all for all your help, really appreciate my friends and wish you the best for helping me hopeless as I was

Wow, it's been busy here the last few days!

I'm glad you were able to get your clock centered. The colour changing is possibly due to the use of TextClock but that's a bit beyond my skills, sorry.

Big thanks to @niaboc79 for all his help here. You're a superstar as always!
The Following 2 Users Say Thank You to Ticklefish For This Useful Post: [ View ] Gift Ticklefish Ad-Free
21st December 2018, 12:59 AM |#683  
Junior Member
Thanks Meter: 1
 
More
Android XML conversion to JSON or other?
So, Mac OS X Apple products heavily rely on XML in a very similar way in the form of text-or-binary 'plist's , but thankfully, it is structured in a way that its also possible to render the XML as JSON:
Code:
plutil -convert json -o - < foo.plist
yields a serialized format I find much easier to parse and modify, and then the reverse can be done
Code:
plutil -convert xml1 -o foo.plist < ...
). Is there any such functionality in the standard Android toolkit, or am I finally gonna have to buck up and learn me some xsltproc (or something like that)?
The Following User Says Thank You to geoff-codes For This Useful Post: [ View ] Gift geoff-codes Ad-Free
1st January 2019, 08:16 PM |#684  
Quote:
Originally Posted by geoff-codes

So, Mac OS X Apple products heavily rely on XML in a very similar way in the form of text-or-binary 'plist's , but thankfully, it is structured in a way that its also possible to render the XML as JSON:
yields a serialized format I find much easier to parse and modify, and then the reverse can be done ). Is there any such functionality in the standard Android toolkit, or am I finally gonna have to buck up and learn me some xsltproc (or something like that)?

There's nothing I know of, sorry.

The best thing I can suggest is using a program like Notepad++. It helps to make the code a lot clearer so you can more easily see what's going on.

Sent from my Sony Xperia XA1 using XDA Labs
10th February 2019, 10:24 PM |#685  
Senior Member
Flag Wolverhampton
Thanks Meter: 718
 
Donate to Me
More
Hi all does anyone have any idea how to center the status bar clock on samsungs latest pie update. It seems diffrent to oreo. Thanks in advanced. Here is a copy of my status bar xml if someone can help at all. Thanks

https://drive.google.com/file/d/1A0J...w?usp=drivesdk

Sent from my [device_name] using XDA-Developers Legacy app
The Following User Says Thank You to steha For This Useful Post: [ View ] Gift steha Ad-Free
16th February 2019, 09:42 AM |#686  
Quote:
Originally Posted by steha

Hi all does anyone have any idea how to center the status bar clock on samsungs latest pie update. It seems diffrent to oreo. Thanks in advanced. Here is a copy of my status bar xml if someone can help at all. Thanks

https://drive.google.com/file/d/1A0J...w?usp=drivesdk

Sent from my [device_name] using XDA-Developers Legacy app

Code:
<?xml version="1.0" encoding="utf-8" ?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/system_bar_background" android:focusable="false" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_height" android:accessibilityPaneTitle="@string/status_bar">
	<FrameLayout android:id="@id/background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
	<LinearLayout android:gravity="center" android:layout_gravity="center" android:orientation="horizontal" android:id="@id/middle_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
	<FrameLayout android:id="@id/status_bar_area" 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="@dimen/status_bar_padding_start" />
		<LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="@dimen/status_bar_padding_start" android:paddingEnd="@dimen/status_bar_padding_end">
			<ViewStub android:id="@id/operator_name" android:layout="@layout/operator_name" android:layout_width="wrap_content" android:layout_height="fill_parent" />
			<FrameLayout android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
				<include layout="@layout/heads_up_status_bar_layout" />
				<LinearLayout android:id="@id/status_bar_left_side" android:clipChildren="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
					<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/left_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent">
						<include android:layout_width="wrap_content" android:layout_height="fill_parent" layout="@layout/qs_status_bar_clock" />
					</LinearLayout>
					<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:clipChildren="false" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
				</LinearLayout>
			</FrameLayout>
			<android.widget.Space android:gravity="center" android:id="@id/cutout_space_view" android:layout_width="0.0dip" android:layout_height="fill_parent" />
			<com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="end|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
				<ViewStub android:id="@id/qs_knox_custom_statusbar_viewstub" android:layout="@layout/qs_knox_custom_statusbar_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
				<include layout="@layout/system_icons" />
				<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/right_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
			</com.android.keyguard.AlphaOptimizedLinearLayout>
		</LinearLayout>
		<ViewStub android:id="@id/emergency_cryptkeeper_text" android:layout="@layout/emergency_cryptkeeper_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
	</FrameLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Interesting. This is a bit different but it looks fairly logical. The curious bit is that you have a "left_clock_container" LinearLayout and a "right_clock_container" LinearLayout as well. Is there a setting to switch the clock from one side to the other?

The left clock container Layout contains this line:
Code:
<include android:layout_width="wrap_content" android:layout_height="fill_parent" layout="@layout/qs_status_bar_clock" />
This is pulling in another XML file to use. I'm guessing that XML file is the one that actually displays the clock. In theory you should be able to just put that line somewhere else and the clock will move.

This code here, for example:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/system_bar_background" android:focusable="false" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_height" android:accessibilityPaneTitle="@string/status_bar">
	<FrameLayout android:id="@id/background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
	<LinearLayout android:gravity="center" android:layout_gravity="center" android:orientation="horizontal" android:id="@id/middle_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
	<FrameLayout android:id="@id/status_bar_area" 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="@dimen/status_bar_padding_start" />
		<LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="@dimen/status_bar_padding_start" android:paddingEnd="@dimen/status_bar_padding_end">
			<ViewStub android:id="@id/operator_name" android:layout="@layout/operator_name" android:layout_width="wrap_content" android:layout_height="fill_parent" />
			<FrameLayout android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
				<include layout="@layout/heads_up_status_bar_layout" />
				<LinearLayout android:id="@id/status_bar_left_side" android:clipChildren="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
					<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/left_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
					<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:clipChildren="false" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
				</LinearLayout>
			</FrameLayout>
			<include android:layout_width="wrap_content" android:layout_height="fill_parent" layout="@layout/qs_status_bar_clock" />
			<android.widget.Space android:gravity="center" android:id="@id/cutout_space_view" android:layout_width="0.0dip" android:layout_height="fill_parent" />
			<com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="end|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
				<ViewStub android:id="@id/qs_knox_custom_statusbar_viewstub" android:layout="@layout/qs_knox_custom_statusbar_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
				<include layout="@layout/system_icons" />
				<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/right_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
			</com.android.keyguard.AlphaOptimizedLinearLayout>
		</LinearLayout>
		<ViewStub android:id="@id/emergency_cryptkeeper_text" android:layout="@layout/emergency_cryptkeeper_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
	</FrameLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Give that a try and, if the clock moves, you know you can adjust my Best Method to center your clock.
The Following 2 Users Say Thank You to Ticklefish For This Useful Post: [ View ] Gift Ticklefish Ad-Free
16th February 2019, 08:28 PM |#687  
Senior Member
Flag Wolverhampton
Thanks Meter: 718
 
Donate to Me
More
Quote:
Originally Posted by Ticklefish

Code:
<?xml version="1.0" encoding="utf-8" ?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/system_bar_background" android:focusable="false" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_height" android:accessibilityPaneTitle="@string/status_bar">
<FrameLayout android:id="@id/background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<LinearLayout android:gravity="center" android:layout_gravity="center" android:orientation="horizontal" android:id="@id/middle_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<FrameLayout android:id="@id/status_bar_area" 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="@dimen/status_bar_padding_start" />
<LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="@dimen/status_bar_padding_start" android:paddingEnd="@dimen/status_bar_padding_end">
<ViewStub android:id="@id/operator_name" android:layout="@layout/operator_name" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<FrameLayout android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<include layout="@layout/heads_up_status_bar_layout" />
<LinearLayout android:id="@id/status_bar_left_side" android:clipChildren="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/left_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include android:layout_width="wrap_content" android:layout_height="fill_parent" layout="@layout/qs_status_bar_clock" />
</LinearLayout>
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:clipChildren="false" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
</LinearLayout>
</FrameLayout>
<android.widget.Space android:gravity="center" android:id="@id/cutout_space_view" android:layout_width="0.0dip" android:layout_height="fill_parent" />
<com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="end|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
<ViewStub android:id="@id/qs_knox_custom_statusbar_viewstub" android:layout="@layout/qs_knox_custom_statusbar_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<include layout="@layout/system_icons" />
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/right_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</LinearLayout>
<ViewStub android:id="@id/emergency_cryptkeeper_text" android:layout="@layout/emergency_cryptkeeper_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
</FrameLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Interesting. This is a bit different but it looks fairly logical. The curious bit is that you have a "left_clock_container" LinearLayout and a "right_clock_container" LinearLayout as well. Is there a setting to switch the clock from one side to the other?

The left clock container Layout contains this line:
Code:
<include android:layout_width="wrap_content" android:layout_height="fill_parent" layout="@layout/qs_status_bar_clock" />
This is pulling in another XML file to use. I'm guessing that XML file is the one that actually displays the clock. In theory you should be able to just put that line somewhere else and the clock will move.

This code here, for example:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/system_bar_background" android:focusable="false" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_height" android:accessibilityPaneTitle="@string/status_bar">
<FrameLayout android:id="@id/background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<LinearLayout android:gravity="center" android:layout_gravity="center" android:orientation="horizontal" android:id="@id/middle_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<FrameLayout android:id="@id/status_bar_area" 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="@dimen/status_bar_padding_start" />
<LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="@dimen/status_bar_padding_start" android:paddingEnd="@dimen/status_bar_padding_end">
<ViewStub android:id="@id/operator_name" android:layout="@layout/operator_name" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<FrameLayout android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<include layout="@layout/heads_up_status_bar_layout" />
<LinearLayout android:id="@id/status_bar_left_side" android:clipChildren="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/left_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:clipChildren="false" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
</LinearLayout>
</FrameLayout>
<include android:layout_width="wrap_content" android:layout_height="fill_parent" layout="@layout/qs_status_bar_clock" />
<android.widget.Space android:gravity="center" android:id="@id/cutout_space_view" android:layout_width="0.0dip" android:layout_height="fill_parent" />
<com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="end|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
<ViewStub android:id="@id/qs_knox_custom_statusbar_viewstub" android:layout="@layout/qs_knox_custom_statusbar_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<include layout="@layout/system_icons" />
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/right_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</LinearLayout>
<ViewStub android:id="@id/emergency_cryptkeeper_text" android:layout="@layout/emergency_cryptkeeper_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
</FrameLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Give that a try and, if the clock moves, you know you can adjust my Best Method to center your clock.

Should this move the clock to the right. I notice there is also a middle_clock_container i tried moving the clock line into that layout and ended up in bootloop.
Thanks for your time.

Sent from my [device_name] using XDA-Developers Legacy app
17th February 2019, 07:29 PM |#688  
Senior Member
Flag Wolverhampton
Thanks Meter: 718
 
Donate to Me
More
Quote:
Originally Posted by Ticklefish

Code:
<?xml version="1.0" encoding="utf-8" ?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/system_bar_background" android:focusable="false" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_height" android:accessibilityPaneTitle="@string/status_bar">
<FrameLayout android:id="@id/background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<LinearLayout android:gravity="center" android:layout_gravity="center" android:orientation="horizontal" android:id="@id/middle_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<FrameLayout android:id="@id/status_bar_area" 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="@dimen/status_bar_padding_start" />
<LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="@dimen/status_bar_padding_start" android:paddingEnd="@dimen/status_bar_padding_end">
<ViewStub android:id="@id/operator_name" android:layout="@layout/operator_name" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<FrameLayout android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<include layout="@layout/heads_up_status_bar_layout" />
<LinearLayout android:id="@id/status_bar_left_side" android:clipChildren="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/left_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include android:layout_width="wrap_content" android:layout_height="fill_parent" layout="@layout/qs_status_bar_clock" />
</LinearLayout>
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:clipChildren="false" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
</LinearLayout>
</FrameLayout>
<android.widget.Space android:gravity="center" android:id="@id/cutout_space_view" android:layout_width="0.0dip" android:layout_height="fill_parent" />
<com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="end|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
<ViewStub android:id="@id/qs_knox_custom_statusbar_viewstub" android:layout="@layout/qs_knox_custom_statusbar_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<include layout="@layout/system_icons" />
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/right_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</LinearLayout>
<ViewStub android:id="@id/emergency_cryptkeeper_text" android:layout="@layout/emergency_cryptkeeper_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
</FrameLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Interesting. This is a bit different but it looks fairly logical. The curious bit is that you have a "left_clock_container" LinearLayout and a "right_clock_container" LinearLayout as well. Is there a setting to switch the clock from one side to the other?

The left clock container Layout contains this line:
Code:
<include android:layout_width="wrap_content" android:layout_height="fill_parent" layout="@layout/qs_status_bar_clock" />
This is pulling in another XML file to use. I'm guessing that XML file is the one that actually displays the clock. In theory you should be able to just put that line somewhere else and the clock will move.

This code here, for example:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/system_bar_background" android:focusable="false" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_height" android:accessibilityPaneTitle="@string/status_bar">
<FrameLayout android:id="@id/background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<LinearLayout android:gravity="center" android:layout_gravity="center" android:orientation="horizontal" android:id="@id/middle_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<FrameLayout android:id="@id/status_bar_area" 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="@dimen/status_bar_padding_start" />
<LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="@dimen/status_bar_padding_start" android:paddingEnd="@dimen/status_bar_padding_end">
<ViewStub android:id="@id/operator_name" android:layout="@layout/operator_name" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<FrameLayout android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<include layout="@layout/heads_up_status_bar_layout" />
<LinearLayout android:id="@id/status_bar_left_side" android:clipChildren="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/left_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:clipChildren="false" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
</LinearLayout>
</FrameLayout>
<include android:layout_width="wrap_content" android:layout_height="fill_parent" layout="@layout/qs_status_bar_clock" />
<android.widget.Space android:gravity="center" android:id="@id/cutout_space_view" android:layout_width="0.0dip" android:layout_height="fill_parent" />
<com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="end|center" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
<ViewStub android:id="@id/qs_knox_custom_statusbar_viewstub" android:layout="@layout/qs_knox_custom_statusbar_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<include layout="@layout/system_icons" />
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/right_clock_container" android:layout_width="wrap_content" android:layout_height="fill_parent" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</LinearLayout>
<ViewStub android:id="@id/emergency_cryptkeeper_text" android:layout="@layout/emergency_cryptkeeper_text" android:layout_width="wrap_content" android:layout_height="fill_parent" />
</FrameLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Give that a try and, if the clock moves, you know you can adjust my Best Method to center your clock.

Ok tried this and again bootloop. I think it will take someone with far more experiance than a dimbo like me. Thanks for looking.

Sent from my [device_name] using XDA-Developers Legacy app
Post Reply Subscribe to Thread

Tags
center, clock, statusbar, tutorial, xml

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes