XML 101 - XML Modding Made Easy!

Ticklefish

Recognized Themer
Oct 27, 2011
6,741
8,536
263
Hampshire, UK
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 :eek:

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 ;) :good:
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!
 

geoff-codes

Member
Sep 7, 2016
7
1
0
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)?
 
  • Like
Reactions: Ticklefish

Ticklefish

Recognized Themer
Oct 27, 2011
6,741
8,536
263
Hampshire, UK
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
 

steha

Senior Member
Jan 16, 2011
746
718
113
Wolverhampton
Last edited:
  • Like
Reactions: Ticklefish

Ticklefish

Recognized Themer
Oct 27, 2011
6,741
8,536
263
Hampshire, UK
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/1A0JdiYmPJaq1B4F3Rf8OEe2ZxmbbBb6x/view?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. :)
 
  • Like
Reactions: steha and cerj

steha

Senior Member
Jan 16, 2011
746
718
113
Wolverhampton
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
 

steha

Senior Member
Jan 16, 2011
746
718
113
Wolverhampton
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
 

HassanMirza01

Senior Member
Jul 9, 2014
3,344
6,464
263
26
Islamabad
HassanMirza01.blogspot.com
very well explained... Hats off bro @Ticklefish

i have a small doubt... i tried hard but can't achieve it so writing here... issue is my MIUI 11 have dual status bar... it was single in stock MIUI 11 but some devs enabled dual status bar like a top one and one below it... top one shows clock on left and signals, wifi and battery on right... the 2nd statusbar beneath it shows notification icons on left, below clock and shows mic, bluetooth etc on right, below wifi, signals..

Now issue side, i just wanna increase size of notification icons which are on 2nd status bar, below clock... i dont know which files to send... sending statusbar.xml from res/layout/ and dimens.xml from res/values/
ask me if you wanna see any other file. i have unpacked everything :)

Cheers
 

Attachments

  • Like
Reactions: Ticklefish

Ticklefish

Recognized Themer
Oct 27, 2011
6,741
8,536
263
Hampshire, UK
very well explained... Hats off bro @Ticklefish

i have a small doubt... i tried hard but can't achieve it so writing here... issue is my MIUI 11 have dual status bar... it was single in stock MIUI 11 but some devs enabled dual status bar like a top one and one below it... top one shows clock on left and signals, wifi and battery on right... the 2nd statusbar beneath it shows notification icons on left, below clock and shows mic, bluetooth etc on right, below wifi, signals..

Now issue side, i just wanna increase size of notification icons which are on 2nd status bar, below clock... i dont know which files to send... sending statusbar.xml from res/layout/ and dimens.xml from res/values/
ask me if you wanna see any other file. i have unpacked everything :)

Cheers
Thanks for your kind words. :good:

The notification icon height is normally stored inside framework-res.apk. This being MIUI it's possible there are some other framework files in your system/framework folder as well. It's worth checking them as well.
 

HassanMirza01

Senior Member
Jul 9, 2014
3,344
6,464
263
26
Islamabad
HassanMirza01.blogspot.com
Thanks for your kind words. :good:

The notification icon height is normally stored inside framework-res.apk. This being MIUI it's possible there are some other framework files in your system/framework folder as well. It's worth checking them as well.
well, i can unpack all of them, and yes for MIUI, we need to add miui.apk, miuisystem.apk with both framework apks, one more question, before this, one of our dev enabled dual status bar without adding any option in settings and without modding any framework file, he just provided us miuisystemui.apk file which was doing all job and notification icons were kinda big too in that... but now he left support, so now a russian dev doing all this with adding enable/disable button for dual status bar in settings...

Can you tell me if i have to change any dip size for icons or i have to use "fill_parent" instead of "wrap_contents" like that stuff ?? i tried to modify 2 settings related to dip in res/layout but they didn't affect icons... i have no idea how to check or see name/resource id of those notification icons... any other file you need ??

i found this media_notification_icon_size has difference of 2dip w.r.t original icons framework file... is this the culprit ??

<dimen name="status_bar_height_portrait">24.0dip</dimen>
<dimen name="status_bar_icon_size">24.0dip</dimen>
<dimen name="status_bar_system_icon_intrinsic_size">17.0dip</dimen>
<dimen name="status_bar_system_icon_size">15.0dip</dimen>
<dimen name="subtitle_corner_radius">2.0dip</dimen>

the original framework just has 1st and 2nd line with 32.3dip and same icons size in 2nd line... i think last 3 lines are for 2nd status bar aka dual status bar and 2nd one is size of icons and statusbar, am right ?? gonna change them...
 
Last edited:

Ticklefish

Recognized Themer
Oct 27, 2011
6,741
8,536
263
Hampshire, UK
well, i can unpack all of them, and yes for MIUI, we need to add miui.apk, miuisystem.apk with both framework apks, one more question, before this, one of our dev enabled dual status bar without adding any option in settings and without modding any framework file, he just provided us miuisystemui.apk file which was doing all job and notification icons were kinda big too in that... but now he left support, so now a russian dev doing all this with adding enable/disable button for dual status bar in settings...

Can you tell me if i have to change any dip size for icons or i have to use "fill_parent" instead of "wrap_contents" like that stuff ?? i tried to modify 2 settings related to dip in res/layout but they didn't affect icons... i have no idea how to check or see name/resource id of those notification icons... any other file you need ??

i found this media_notification_icon_size has difference of 2dip w.r.t original icons framework file... is this the culprit ??

<dimen name="status_bar_height_portrait">24.0dip</dimen>
<dimen name="status_bar_icon_size">24.0dip</dimen>
<dimen name="status_bar_system_icon_intrinsic_size">17.0dip</dimen>
<dimen name="status_bar_system_icon_size">15.0dip</dimen>
<dimen name="subtitle_corner_radius">2.0dip</dimen>

the original framework just has 1st and 2nd line with 32.3dip and same icons size in 2nd line... i think last 3 lines are for 2nd status bar aka dual status bar and 2nd one is size of icons and statusbar, am right ?? gonna change them...
Without having your device and rom to play with, all I can suggest is experimenting with changing different values and seeing what happens.
In stock Android the notification icon height is set in dimens.xml inside framework-res.apk, if I remember correctly. In your rom I'd hope it'd be something similar.
 

HassanMirza01

Senior Member
Jul 9, 2014
3,344
6,464
263
26
Islamabad
HassanMirza01.blogspot.com
Without having your device and rom to play with, all I can suggest is experimenting with changing different values and seeing what happens.
In stock Android the notification icon height is set in dimens.xml inside framework-res.apk, if I remember correctly. In your rom I'd hope it'd be something similar.
i would investigate that file then... and compare it will stock one...

last question, how that dev able to do things i want just by modifying systemui.apk ?? icons were fine too, he used frame_layout as i saw his editings...
 

Ticklefish

Recognized Themer
Oct 27, 2011
6,741
8,536
263
Hampshire, UK
  • Like
Reactions: FunSucker

HassanMirza01

Senior Member
Jul 9, 2014
3,344
6,464
263
26
Islamabad
HassanMirza01.blogspot.com
@Ticklefish bro, i played with xml's alot... Stucked at 1 point... If there is a xml file in layout, let say dual_status_bar.xml, but i didn't find this name used anywhere in whole miuisystemui.apk folder... Thats possible ?? If yes, is the settings app triggering it ?? 2nd, is there any guide which tells me that which xml related to which part ?? Like i have a super status bar xml but i dont know whats super status bar... Many other xmls... Any guide there ?? Except android.com

Thanks :)