[MOD][TUT]How To Add Seconds To The Statusbar Clock

Did you find this tutorial useful?

  • Yes

    Votes: 35 87.5%
  • No

    Votes: 5 12.5%

  • Total voters
    40

avirale123

Senior Member
Aug 26, 2012
278
20
0
santa marta
it must be very busy but would appreciate your help
center the clock method 3
add the second but the clock ran all the way left
but I liked more so
Now the problem is the overlapping icons
know how to put it more to the right
further questions
remove AM: PM
to put the second appears again AM:pM
 

Ticklefish

Recognized Themer
Oct 27, 2011
6,743
8,534
263
Hampshire, UK
it must be very busy but would appreciate your help
center the clock method 3
add the second but the clock ran all the way left
but I liked more so
Now the problem is the overlapping icons
know how to put it more to the right
further questions
remove AM: PM
to put the second appears again AM:pM
I'm not sure I follow you. Can you provide a screenshot or two of what you want to fix?

Sent from my SK17i using xda premium
 

avirale123

Senior Member
Aug 26, 2012
278
20
0
santa marta
I'm not sure I follow you. Can you provide a screenshot or two of what you want to fix?

Sent from my SK17i using xda premium
as you see the icons overlap would throw to the right
and remove the AM: PM
when I put the second the AM: PM again appears

Code:
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <RelativeLayout 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" android:layout_alignParentLeft="true" />
            <com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_toRightOf="@id/moreIcon" />
            <DigitalClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
            <ImageView android:id="@id/battery" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" />
            <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/battery" layout="@layout/signal_cluster_view" />
            <ImageView android:layout_gravity="center_vertical" android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/signal_cluster" />
            <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_toLeftOf="@id/stat_no_sim" />
        </RelativeLayout>
    </LinearLayout>
 

Attachments

Last edited:
  • Like
Reactions: Ticklefish

Ticklefish

Recognized Themer
Oct 27, 2011
6,743
8,534
263
Hampshire, UK
as you see the icons overlap would throw to the right
and remove the AM: PM
when I put the second the AM: PM again appears
Can you share your xml please? If you can copy and paste it into your reply, that'd be really handy.

With the DigitalClock widget (Google calls it a widget), the only way to remove am/pm is to make it a 24 hour clock, not 12 hour clock.

Sent from my SK17i using xda premium
 

whalesplaho

Senior Member
Feb 1, 2012
10,653
2,655
253
Treasure Island
Pretty much. The Carrier Label code is already in the tracking.xml. All you need to do is copy it into status_bar_expanded_header.xml and adjust the code to fit.

> yur battery icon i cant found dem in drawable-mdpi, can yhu help with it please. a lil bit differs to mine
Ah..but I don't have a battery icon. I just use the battery text. But I have used the battery icon for something on the statusbar..
I'm going to make this a little test. See if you work out what I've used the battery icon for.. :D

> is it possible to move only network bar to tha left & also notifications still there
You mean have the signal icon on the left with the notifications and the WiFi icon on the right with the battery icon/text? It's definitely possible. Have a look at..okay, I can't remember what it's called but something like signal_cluster.xml.

> yur background image shows digital/analog clock, how?
Actually very easily. AnalogClock is hardcoded into Android itself. You just need to get the parameters right.

> recent apps please....
That was very, very easy. The code is already in the stock Sony apk.

Feel free to look at my code if you need help. The best thing to do is to go through it line by line and work out what each line does. You don't have to understand every last detail, just get an idea of what's going on.
And just try stuff. Do it slowly, take your time and if something doesn't work, see if you can work out why.
For your homework (lol) I want you to try to get the signal and WiFi icons on different sides of the statusbar. If you can work it out, you'll be in a much better position. :)


QUOTE=whalesplaho;37327189] i guess its okay now right?
Nope. Try it and you'll see what it does. ;)

With a RelativeLayout, there's nothing to stop children (technical term) from being on top of each other. You need to have a quick think about where all the parts are in relation to each other and the whole statusbar. Sketch it out on a piece of paper if you want.
I can tell you precisely what to code but it'll be good for you if you can work it out yourself. But I will if you can't get it. :)

However, bearing in mind the size of a phone's statusbar, if you have a centered clock and the notifications on the right along with the battery icon and WiFi icon and various status icons..you could be looking at having overlapping notifications before very long. You may be better off using Method 2.5. It'll certainly be easier to code!

Can you post about this in the other thread please? I confuse easily!



Sent from my SK17i using xda premium


1. When yhu tap on clock, it will open settings?

2. Yhu know i dont know much, its yhu putting me through. i need help on Recent Apps

3. Help me with tha right parameters for Analog & Digital backgroud

4. Damn yur status_bar.xml is fully coded. i sober when i saw it!





my date doesnt show full, just tha weekday only & also can tha date & network be big a little... help please!
 

Ticklefish

Recognized Themer
Oct 27, 2011
6,743
8,534
263
Hampshire, UK
1. When yhu tap on clock, it will open settings?

2. Yhu know i dont know much, its yhu putting me through. i need help on Recent Apps

3. Help me with tha right parameters for Analog & Digital backgroud

4. Damn yur status_bar.xml is fully coded. i sober when i saw it!





my date doesnt show full, just tha weekday only & also can tha date & network be big a little... help please!
When I asked to have this posted in the other thread, I meant the thread about my serajr mod! lol :p

Anyway...

The AnalogClock doesn't do anything if you press on it. It's just there to look at. I'm an artistic fellow.

I've used the same recent apps code that's in the stock xml. All I've done is adjust a few parameters to fit on the right side of the statusbar and I've changed the icon to a transparent one. Have a look at the statusbar.xml

Have a look at my tracking.xml to see what parameters I've used. It's really just a case of making sure everything's spaced out and centered correctly. I'd paste the code here except I'm in the middle of theming my tablet..or trying to, at least.

And my xml isn't that bad! It's just a little...busy...lol
 
  • Like
Reactions: whalesplaho

whalesplaho

Senior Member
Feb 1, 2012
10,653
2,655
253
Treasure Island
When I asked to have this posted in the other thread, I meant the thread about my serajr mod! lol :p

Anyway...

The AnalogClock doesn't do anything if you press on it. It's just there to look at. I'm an artistic fellow.

I've used the same recent apps code that's in the stock xml. All I've done is adjust a few parameters to fit on the right side of the statusbar and I've changed the icon to a transparent one. Have a look at the statusbar.xml

Have a look at my tracking.xml to see what parameters I've used. It's really just a case of making sure everything's spaced out and centered correctly. I'd paste the code here except I'm in the middle of theming my tablet..or trying to, at least.

And my xml isn't that bad! It's just a little...busy...lol

i dnt know about recent apps, maybe yhu should just gimme tha codes to add to status_bar.xml please.

yhu didnt say anything about tha picture, my date aint showing full in status bar expanded. please help on dat!

i was talking about tha Digital & Analog clock wallpaper shown when status bar is drop down.


Sorry for posting here, i didnt want to litter tha thread since its for yur mod not tutorial.
 

Pawel_pecet20

Member
Feb 26, 2010
35
7
38
i have real ics r6 and how decompiles systemui.apk I have files in *.smali format : (

modified by someone for me? in the Annex is my original systemui.apk

I'm sorry for my English but I use a translator :)
 

Attachments

Last edited: