FORUMS
Remove All Ads from XDA

XML 101 - XML Modding Made Easy!

5,975 posts
Thanks Meter: 7,335
 
By Ticklefish, Recognized Themer on 5th November 2014, 04:01 PM
Post Reply Email Thread
16th November 2014, 02:48 PM |#21  
Quote:
Originally Posted by Ryo Kun(Momo)

I'm trying to make invisible button in legacy Xperia cm11, but the navigation bar xml is totally different, there is no @id/home, back etc, only @id/one,two. Any suggestions for me, sir.

You may have different id's but they should still do the same sort of thing. Can you share your xml please?
The Following User Says Thank You to Ticklefish For This Useful Post: [ View ] Gift Ticklefish Ad-Free
 
 
17th November 2014, 12:18 AM |#22  
Ryo Kyun(Momo)'s Avatar
Senior Member
Thanks Meter: 90
 
More
Quote:
Originally Posted by Ticklefish

You may have different id's but they should still do the same sort of thing. Can you share your xml please?

Here https://www.dropbox.com/s/g8p9quexve...ayout.zip?dl=0
The Following User Says Thank You to Ryo Kyun(Momo) For This Useful Post: [ View ] Gift Ryo Kyun(Momo) Ad-Free
17th November 2014, 10:37 AM |#23  
Junior Member
Thanks Meter: 8
 
More
Talking :)
Hello sir, sorry for the super late reply, here's is the video you requested for helping me out in your other thread... I thank you again for the running text code you gave for my lockscreen hope I'll have some problems again and like wise.. ask you again lol

I zipped the video because I don't know how to post a video here. PS the video is corny. haha More Power!
Attached Files
File Type: zip video_Nov_16_2014_9979.zip - [Click for QR Code] (1.14 MB, 18 views)
The Following User Says Thank You to VinceOjela For This Useful Post: [ View ] Gift VinceOjela Ad-Free
17th November 2014, 12:16 PM |#24  
Quote:
Originally Posted by Ryo Kun(Momo)

Here https://www.dropbox.com/s/g8p9quexve...ayout.zip?dl=0

So this is your 'mid_navigation_bar_port.xml':
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="horizontal" android:id="@id/nav_buttons" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/dpad_left" android:visibility="gone" android:layout_width="40.0dip" android:layout_height="fill_parent" android:scaleType="fitCenter" android:layout_weight="0.0" systemui:keyRepeat="true" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
    <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/one" android:layout_width="40.0dip" android:layout_height="fill_parent" android:scaleType="fitCenter" android:layout_weight="0.0" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
    <LinearLayout android:gravity="center_horizontal" android:layout_gravity="center_horizontal" android:id="@id/mid_nav_buttons" android:clipChildren="false" android:clipToPadding="false" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:animateLayoutChanges="true">
        <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/two" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:layout_weight="0.0" systemui:keyRepeat="true" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
        <View android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
        <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/three" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:layout_weight="0.0" systemui:keyRepeat="true" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
        <View android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
        <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/four" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:layout_weight="0.0" systemui:keyRepeat="true" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
        <View android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
        <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/five" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:layout_weight="0.0" systemui:keyRepeat="true" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
    </LinearLayout>
    <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/six" android:layout_width="40.0dip" android:layout_height="fill_parent" android:scaleType="fitCenter" android:layout_weight="0.0" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
    <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/dpad_right" android:visibility="gone" android:layout_width="40.0dip" android:layout_height="fill_parent" android:scaleType="fitCenter" android:layout_weight="0.0" systemui:keyRepeat="true" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
</LinearLayout>
Since CyanogenMod is a modder's rom, it's not unusual to find things in the XML that you wouldn't normally. But this code isn't too different from what you'd find in stock Android.

LinearLayouts work left to right. Whatever is at the top of Layout code is on the left of the Layout on your device.

So have a look at your navigation bar. Whatever softkey is on the far left is the one controlled by the '@id/one' line. The softkey to the right of that would be controlled by the '@id/two' line, and so on.

Quote:
Originally Posted by VinceOjela

Hello sir, sorry for the super late reply, here's is the video you requested for helping me out in your other thread... I thank you again for the running text code you gave for my lockscreen hope I'll have some problems again and like wise.. ask you again lol

I zipped the video because I don't know how to post a video here. PS the video is corny. haha More Power!

That is very cool. Very cool indeed!

You can upload a video to YouTube and just embed it in your post.
The Following 3 Users Say Thank You to Ticklefish For This Useful Post: [ View ] Gift Ticklefish Ad-Free
17th November 2014, 12:49 PM |#25  
Ryo Kyun(Momo)'s Avatar
Senior Member
Thanks Meter: 90
 
More
Thanks, I'm already try with id/two, but all other icon (clock too) goes to left, except the invisible 20.0dip on the right edge side, and when i click it did nothing.
#your RelativeLayout in page 1 has double atribut "android:layout_width "

Edit: id/one. the result is same, when click on clock do nothing, I'm remove the parent right "true "the icon look normal position now
17th November 2014, 01:08 PM |#26  
Quote:
Originally Posted by Ryo Kun(Momo)

Thanks, I'm already try with id/two, but all other icon (clock too) goes to left, except the invisible 20.0dip on the right edge side, and when i click it did nothing.
#your RelativeLayout in page 1 has double atribut "android:layout_width "

Edit: id/one. the result is same, when click on clock do nothing, I'm remove the parent right "true "the icon look normal position now

Thanks, I'll edit the post.

Can you share your modded xml and a screenshot please?
The Following 2 Users Say Thank You to Ticklefish For This Useful Post: [ View ] Gift Ticklefish Ad-Free
17th November 2014, 01:15 PM |#27  
Aeyan Ashraf's Avatar
Senior Member
Flag ★◢↿ALIGARH↾◣★
Thanks Meter: 1,155
 
Donate to Me
More
Hello @Ticklefish ,
I have a Samsung Galaxy Tab 3 10.1 with 4.4.2 kitkat touchwiz ............ I have themed a ROM . Please see this screen shot -

I want either to make the auto brightness checkbox disappear which is in between the volume and brightness sliders or I want to fix that layout issue !!!!!! When my tab is without any mod it is fine . But I get this type of notification panel after I apply that ro.build.product and ro.build.name to SM-N900S trick in build.prop and then change dpi of sysyemui using app settings(xposed module ) to below 160 !!!!!!! If you can help me make it disappear then It'll be a great help ..... I know which xml to mod If I want to fix layout issue(not making it disappear) . The xml is.located in res/layout-sw600dp-mdpi/ statusbartoggleslider. But I don't know how to mod it and I personally want to make the checkbox disappear ........ But It will be fine If I find any one of the two ways !!!!!! And P.S. - I usually mod sw800dp-mdpi in systemui !!!!!
Please sir help me with this !!!!!!! I will be highly obliged

Sent from my GT-S6802 using XDA Free mobile app
17th November 2014, 01:16 PM |#28  
Ryo Kyun(Momo)'s Avatar
Senior Member
Thanks Meter: 90
 
More
Quote:
Originally Posted by Ticklefish

Thanks, I'll edit the post.

Can you share your modded xml and a screenshot please?

Here
https://www.dropbox.com/s/ry6u16dqka...s_bar.xml?dl=0
Attached Thumbnails
Click image for larger version

Name:	uploadfromtaptalk1416229995992.png
Views:	168
Size:	15.5 KB
ID:	3019770  
17th November 2014, 01:32 PM |#29  
Quote:
Originally Posted by Aeyan Ashraf

Hello @Ticklefish ,
I have a Samsung Galaxy Tab 3 10.1 with 4.4.2 kitkat touchwiz ............ I have themed a ROM . Please see this screen shot -


I want either to make the auto brightness checkbox disappear which is in between the volume and brightness sliders or I want to fix that layout issue !!!!!! When my tab is without any mod it is fine . But I get this type of notification panel after I apply that ro.build.product and ro.build.name to SM-N900S trick in build.prop and then change dpi of sysyemui using app settings(xposed module ) to below 160 !!!!!!! If you can help me make it disappear then It'll be a great help ..... I know which xml to mod If I want to fix layout issue(not making it disappear) . The xml is.located in res/layout-sw600dp-mdpi/ statusbartoggleslider. But I don't know how to mod it and I personally want to make the checkbox disappear ........ But It will be fine If I find any one of the two ways !!!!!! And P.S. - I usually mod sw800dp-mdpi in systemui !!!!!
Please sir help me with this !!!!!!! I will be highly obliged

Sent from my GT-S6802 using XDA Free mobile app

I'm certainly happy to take a look at it for you. Can you share your XML please?

Quote:
Originally Posted by Ryo Kun(Momo)

Here
https://www.dropbox.com/s/ry6u16dqka...s_bar.xml?dl=0

Hmm....try swapping the clock and the softkey around:

Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:id="@id/status_bar" android:background="@drawable/system_bar_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <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="6.0dip">
        <LinearLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
            <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" />
        </LinearLayout>
        <LinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
            <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
            <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
                <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
                <include android:id="@id/signal_cluster_text" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_text_view" />
                <com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="@dimen/status_bar_battery_width" android:layout_height="@dimen/status_bar_battery_height" android:layout_marginBottom="@dimen/status_bar_battery_bottom_padding" android:layout_marginStart="4.0dip" />
                <com.android.systemui.DockBatteryMeterView android:id="@id/dock_battery" android:visibility="gone" android:layout_width="@dimen/status_bar_battery_width" android:layout_height="@dimen/status_bar_battery_height" android:layout_marginBottom="@dimen/status_bar_battery_bottom_padding" android:layout_marginStart="4.0dip" />
            </LinearLayout>
                <RelativeLayout android:layout_width="wrap_content" android:layout_height="fill_parent">
                  <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/one" android:layout_width="20.0dip" android:layout_height="fill_parent" systemui:keyRepeat="true" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
                  <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="start|center" android:id="@id/clock" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingStart="6.0dip" />
                </RelativeLayout>
         </LinearLayout>
    </LinearLayout> 
    <RelativeLayout android:layout_width="wrap_content" android:layout_height="fill_parent">
      <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:layout_gravity="center" android:id="@id/center_clock" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
      <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/one" android:layout_width="20.0dip" android:layout_height="fill_parent" systemui:keyRepeat="true" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
    </RelativeLayout>
    <LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="6.0dip">
        <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginEnd="4.0dip">
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
        </ImageSwitcher>
        <com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0" android:paddingEnd="10.0dip">
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.phone.TickerView>
    </LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
The Following User Says Thank You to Ticklefish For This Useful Post: [ View ] Gift Ticklefish Ad-Free
17th November 2014, 06:54 PM |#30  
superdild's Avatar
Member
Thanks Meter: 29
 
More
thanks for all your tutorials, Ticklefish

this is my first attempt to make some mods to lollipop status bar following your guide



the only problem i have is that centerclock is displayed on the lockscreen

this is my status_bar.xml mod

Code:
<?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" android:focusable="true" android:descendantFocusability="afterDescendants"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <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">
            <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
                <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:paddingStart="7.0dip" />
        <com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="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>
saluti, mario
The Following 2 Users Say Thank You to superdild For This Useful Post: [ View ] Gift superdild Ad-Free
17th November 2014, 08:16 PM |#31  
Quote:
Originally Posted by superdild

thanks for all your tutorials, Ticklefish

this is my first attempt to make some mods to lollipop status bar following your guide



the only problem i have is that centerclock is displayed on the lockscreen

this is my status_bar.xml mod

Code:
<?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" android:focusable="true" android:descendantFocusability="afterDescendants"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <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">
            <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
                <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:paddingStart="7.0dip" />
        <com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="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>
saluti, mario

To make the status bar clock dissappear when your device is locked, you have to edit some smali. I can't link to the relevant post right not but have a look on my profiles for my post history. You should be able to spot one a post I did on a smali thread asking just this sort of question..

-----------------------------------------
SENT FROM TAPATALK
---------------------------------------
The Following User Says Thank You to Ticklefish For This Useful Post: [ View ] Gift Ticklefish Ad-Free
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