[TUT] How To Center The Clock On The Statusbar..And Other XML Mods As Well!

Status
Not open for further replies.

Ticklefish

Recognized Themer
Oct 27, 2011
6,743
8,534
263
Hampshire, UK
@Ticklefish

Just thought i'd let you know whats coming up :good:

status bar xml from android Lollipop. Going to try do left sided clock :good:

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.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
            <include layout="@layout/system_icons" />
            <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="start|center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingStart="7.0dip" />
        </com.android.keyguard.AlphaOptimizedLinearLayout>
    </LinearLayout>
    <ViewStub android:id="@id/ticker_stub" android:layout="@layout/status_bar_ticker" android:inflatedId="@id/ticker" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
So the Lollipop status bar is split into two sections:

  • The notification icon area -
    Code:
            <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>
  • The system icon area -
    Code:
            <com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
                <include layout="@layout/system_icons" />
                <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="start|center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingStart="7.0dip" />
            </com.android.keyguard.AlphaOptimizedLinearLayout>

The Best Method treats the statusbar as two areas so centering the clock in Lollipop shouldn't be a problem at all! :D
 

22sl22

Senior Member
May 21, 2012
3,530
3,277
0
London
So the Lollipop status bar is split into two sections:

  • The notification icon area -
    Code:
            <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>
  • The system icon area -
    Code:
            <com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
                <include layout="@layout/system_icons" />
                <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="start|center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingStart="7.0dip" />
            </com.android.keyguard.AlphaOptimizedLinearLayout>

The Best Method treats the statusbar as two areas so centering the clock in Lollipop shouldn't be a problem at all! :D
Wow, someone's been busy :)

Already got it sorted, I'll be sure to test once a new apktool comes out :good:

Once it does, just gotta make a few tweaks for left clock :)

Once again, thanks :good:
 

Ticklefish

Recognized Themer
Oct 27, 2011
6,743
8,534
263
Hampshire, UK
Wow, someone's been busy :)

Already got it sorted, I'll be sure to test once a new apktool comes out :good:

Once it does, just gotta make a few tweaks for left clock :)

Once again, thanks :good:
Left clock shouldn't be a problem at all.

By the looks of this, xml modding in Lollipop should be just as simple as it is now. The bit I'm interested in is editing smali. The Developer Preview is odexed and nobody seems to know if it can be deodexed. I'm curious to see if the arm folder can be deleted....hmm...

Anyway, centering the clock (as well as all the other fun things we like to do with our xml) should be more than possible. :D
 

22sl22

Senior Member
May 21, 2012
3,530
3,277
0
London
Left clock shouldn't be a problem at all.

By the looks of this, xml modding in Lollipop should be just as simple as it is now. The bit I'm interested in is editing smali. The Developer Preview is odexed and nobody seems to know if it can be deodexed. I'm curious to see if the arm folder can be deleted....hmm...

Anyway, centering the clock (as well as all the other fun things we like to do with our xml) should be more than possible. :D
I actually didn't know art roms could be deodexed until I saw an L ROM in the N5 forum that says deodex. I'll see if I can get a link. I haven't looked in smali yet but I'll do a bit of digging :good:
 

Ticklefish

Recognized Themer
Oct 27, 2011
6,743
8,534
263
Hampshire, UK
I actually didn't know art roms could be deodexed until I saw an L ROM in the N5 forum that says deodex. I'll see if I can get a link. I haven't looked in smali yet but I'll do a bit of digging :good:
The smali will be the same sort of thing we're used to. It's still converted from the machine code the same way. But there's no point doing it if we can't deodex the rom. What I want to know is can the odex file be deleted on its own or does the arm folder have to be deleted as well to avoid a FC?

It's a little thing but it's these small details that make all the difference.
 
  • Like
Reactions: Dzepar

Ticklefish

Recognized Themer
Oct 27, 2011
6,743
8,534
263
Hampshire, UK

VinceOjela

Member
Oct 31, 2014
10
8
0
Marquee(RunningText)problem

Sir can you help me?
I modded my lockscreen and removed the clock and replaced it with a running text but had a problem... My android os is 4.2.2 jb
-----------------

This is my original keyguard_status_view.xml:

Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame android:gravity="center_horizontal" android:id="@id/keyguard_status_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_maxHeight="@dimen/keyguard_security_height" android:layout_maxWidth="@dimen/keyguard_security_width"
  xmlns:android="h t t p ://schemas.android.com/apk/res/android">
    <com.android.internal.policy.impl.keyguard.KeyguardStatusView android:gravity="top|center" android:orientation="vertical" android:id="@id/keyguard_status_view_face_palm" android:layout_width="fill_parent" android:layout_height="fill_parent" android:contentDescription="@string/keyguard_accessibility_status">
        <LinearLayout android:layout_gravity="top|center" android:orientation="vertical" android:focusable="true" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <com.android.internal.policy.impl.keyguard.TinnoClockView android:layout_gravity="right" android:id="@id/clock_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/kg_status_line_font_right_margin">
                <LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content">
                    <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/kg_status_clock_font_size" android:textColor="#ffffffff" android:ellipsize="none" android:id="@id/clock_text" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:drawablePadding="2.0dip" />
                    <ImageView android:id="@id/clock_hour_first" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                    <ImageView android:id="@id/clock_hour_two" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                    <ImageView android:id="@id/clock_separator" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tcv_separator" />
                    <ImageView android:id="@id/clock_minute_first" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                    <ImageView android:id="@id/clock_minute_two" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                    <TextView android:textSize="18.0sp" android:ellipsize="none" android:gravity="bottom" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                </LinearLayout>
            </com.android.internal.policy.impl.keyguard.TinnoClockView>
            <include layout="@layout/keyguard_status_area" />
        </LinearLayout>
    </com.android.internal.policy.impl.keyguard.KeyguardStatusView>
</com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame>

And I made it like this so I can recompile successfully without fc or error I guess so..
This is now my present keyguard_status_view.xml:

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_horizontal" android:id="@id/keyguard_status_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_maxHeight="@dimen/keyguard_security_height" android:layout_maxWidth="@dimen/keyguard_security_width"
  xmlns:android="h t t p ://schemas.android.com/apk/res/android">
    <LinearLayout android:gravity="top|center" android:orientation="vertical" android:id="@id/keyguard_status_view_face_palm" android:layout_width="fill_parent" android:layout_height="fill_parent" android:contentDescription="@string/keyguard_accessibility_status">
        <LinearLayout android:layout_gravity="top|center" android:orientation="vertical" android:focusable="true" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <TextView android:text="Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt" android:layout_gravity="end" android:ellipsize="marquee" android:id="@id/status1" android:textSize="35.0dip" android:gravity="top|center" android:textColor="#ffffffff" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:layout_marginEnd="0.0dip" android:drawablePadding="2.0dip" android:layout_alignParentTop="true" />
            <include layout="@layout/keyguard_status_area" />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
As I said it recompiled but the problem is the marquee text I put,it shows only "Jeaη Viηceηt" on my lockscreen and doesn't move or run?
Did I put a wrong running text code? please help me sir so that the text would run... :confused: :confused:
 

Attachments

Last edited:
  • Like
Reactions: Ticklefish

Ticklefish

Recognized Themer
Oct 27, 2011
6,743
8,534
263
Hampshire, UK
Sir can you help me?
I modded my lockscreen and removed the clock and replaced it with a running text but had a problem... My android os is 4.2.2 jb
-----------------

This is my original keyguard_status_view.xml:

Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame android:gravity="center_horizontal" android:id="@id/keyguard_status_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_maxHeight="@dimen/keyguard_security_height" android:layout_maxWidth="@dimen/keyguard_security_width"
  xmlns:android="h t t p ://schemas.android.com/apk/res/android">
    <com.android.internal.policy.impl.keyguard.KeyguardStatusView android:gravity="top|center" android:orientation="vertical" android:id="@id/keyguard_status_view_face_palm" android:layout_width="fill_parent" android:layout_height="fill_parent" android:contentDescription="@string/keyguard_accessibility_status">
        <LinearLayout android:layout_gravity="top|center" android:orientation="vertical" android:focusable="true" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <com.android.internal.policy.impl.keyguard.TinnoClockView android:layout_gravity="right" android:id="@id/clock_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/kg_status_line_font_right_margin">
                <LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content">
                    <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/kg_status_clock_font_size" android:textColor="#ffffffff" android:ellipsize="none" android:id="@id/clock_text" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:drawablePadding="2.0dip" />
                    <ImageView android:id="@id/clock_hour_first" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                    <ImageView android:id="@id/clock_hour_two" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                    <ImageView android:id="@id/clock_separator" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tcv_separator" />
                    <ImageView android:id="@id/clock_minute_first" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                    <ImageView android:id="@id/clock_minute_two" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                    <TextView android:textSize="18.0sp" android:ellipsize="none" android:gravity="bottom" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                </LinearLayout>
            </com.android.internal.policy.impl.keyguard.TinnoClockView>
            <include layout="@layout/keyguard_status_area" />
        </LinearLayout>
    </com.android.internal.policy.impl.keyguard.KeyguardStatusView>
</com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame>

And I made it like this so I can recompile successfully without fc or error I guess so..
This is now my present keyguard_status_view.xml:

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_horizontal" android:id="@id/keyguard_status_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_maxHeight="@dimen/keyguard_security_height" android:layout_maxWidth="@dimen/keyguard_security_width"
  xmlns:android="h t t p ://schemas.android.com/apk/res/android">
    <LinearLayout android:gravity="top|center" android:orientation="vertical" android:id="@id/keyguard_status_view_face_palm" android:layout_width="fill_parent" android:layout_height="fill_parent" android:contentDescription="@string/keyguard_accessibility_status">
        <LinearLayout android:layout_gravity="top|center" android:orientation="vertical" android:focusable="true" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <TextView android:text="Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt" android:layout_gravity="end" android:ellipsize="marquee" android:id="@id/status1" android:textSize="35.0dip" android:gravity="top|center" android:textColor="#ffffffff" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:layout_marginEnd="0.0dip" android:drawablePadding="2.0dip" android:layout_alignParentTop="true" />
            <include layout="@layout/keyguard_status_area" />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
As I said it recompiled but the problem is the marquee text I put,it shows only "Jeaη Viηceηt" on my lockscreen and doesn't move or run?
Did I put a wrong running text code? please help me sir so that the text would run... :confused: :confused:
I think you need more attributes in your TextView line. Try this:

Code:
<TextView android:singleLine="true" android:marqueeRepeatLimit ="marquee_forever" android:scrollHorizontally="true" android:focusable="true" android:focusableInTouchMode="true" android:text="Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt" android:layout_gravity="end" android:ellipsize="marquee" android:id="@id/status1" android:textSize="35.0dip" android:gravity="top|center" android:textColor="#ffffffff" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:drawablePadding="2.0dip" />
I've added a few attributes and removed some that don't do anything..

how to add performance option in stettings?

Wysyłane z mojego WT19i za pomocą Tapatalk 2
There's a tutorial about adding things to your settings.apk by my good friend @Madaditya here:http://forum.xda-developers.com/showthread.php?t=2712474
 

VinceOjela

Member
Oct 31, 2014
10
8
0
Thank you :D

Ticklefish;56*468747 said:
I think you need more attributes in your TextView line. Try this:

Code:
<TextView android:singleLine="*true" android:marqueeRepea*tLimit ="marquee_forever" android:scrollHorizo*ntally="true" android:focusable="t*rue" android:focusableInT*ouchMode="true" android:text="Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt Jeaη Viηceηt" android:layout_gravi*ty="end" android:ellipsize="m*arquee" android:id="@id/*status1" android:textSize="35*.0dip" android:gravity="top*|center" android:textColor="#*ffffffff" android:layout_width*="fill_parent" android:layout_heigh*t="wrap_content" android:singleLine="*true" android:drawablePadd*ing="2.0dip" />
I've added a few attributes and removed some that don't do anything..
Thank you for the code sir, I just deleted the other duplicated android:singleLine="*true" the text are now running cool!! THANK YOU!! :good: :good: :good::good: :good: :good: :good: :good:
 
  • Like
Reactions: Ticklefish

Ticklefish

Recognized Themer
Oct 27, 2011
6,743
8,534
263
Hampshire, UK
*** thread closing ***

It's been nearly two and a half years since I started this thread.

And now it's time to close it.

But for a good reason!

I've just started a new thread over in xda University with this mod and others. From today, this is where I'll be answering questions about XML and doing everything I can to turn everybody here into expert modders.

Check it out here: http://forum.xda-developers.com/general/xda-university/xml-101-xml-modding-easy-t2929816.

If you have anything you want to ask me, any XML tricks or tips you want to share, or if you feel like returning the favour and helping others with XML issues, then you know what to do.
Just click on the link, hit the 'Subscribe' button and let the fun begin!

As for this thread, I'll be closing it in a day or two to give people enough time to head on over to the new one.
 

rastigo

Senior Member
Apr 28, 2013
953
1,184
0
Pune
No no no... Please @Ticklefish. Xda would feel something missing without you. We love you and your assistance which can be counted on at all times.
You have come to our rescue when there wasn't any hope. Don't leave us buddy.
 
  • Like
Reactions: Ticklefish

Ticklefish

Recognized Themer
Oct 27, 2011
6,743
8,534
263
Hampshire, UK
No no no... Please @Ticklefish. Xda would feel something missing without you. We love you and your assistance which can be counted on at all times.
You have come to our rescue when there wasn't any hope. Don't leave us buddy.
Don't worry, I wouldn't leave xda. I've just moved house...

Check out preview.tinyurl.com\xmlmadeeasy :)

-------------------------------
Sent Via Tapatalk
-----------------------------
 

adek89

Senior Member
Jan 27, 2012
403
70
48
Markuszowa
HELP !!!!!

I have a big request of me if he could redo my systemUI someone that looked (beyond the reach batweri icons etc) as that of an annex (NXT Update5 org)? It works very well on the gb but I prefer to have their icons and unfortunately as I give them as subtitles in the notifications they become black on a black background. I would be grateful for modifying my file to look like in ready mode
 
Status
Not open for further replies.