[NST/G] How is the status bar clock display controlled?

Search This thread

nmyshkin

Recognized Contributor
Nov 21, 2013
1,639
472
I've been working on a remodel of the overall UI of the NST/G for awhile, but as usual I did the easy stuff first, got cocky, and then got caught.

Here is the stock status bar:
stock_status.png

Here is the stock status bar in the stock Reader:
stock_reader_status.png

OK, just to be totally clear this is what the status bars look like after NookManager gets through with the device, with the "back" and "menu" buttons added in the main bar.

Now the problem. Here's what I've got:
new_status.png

So...the clock is missing. I'm pretty sure it's still there, but the text color is white and that won't show up against the white background. (none of my changes have any effect on the Reader status bar where, of course, the clock time is black. I don't want to do anything with the Reader status bar version).

All of my changes are really changes in icons. The clock is not an icon (a widget?). My reading suggests that the layout for the status bar should be in the framework-res.apk, specifically res/layout/status_bar.xml (attached zip), but unlike the many examples I've seen, there is no mention of the clock. In fact I'm not even sure the xml file attached is controlling the layout of the stock status bar.

I've gone through system apps and jars looking for references to the status bar clock. I skipped the B&N apps because I have a device with all the B&N apps removed and there is still a clock on the status bar.

There is no comparable layout file in the Reader app for the status bar, so no way to compare.

I'm still looking but if there is anyone with an insight into Android 2.1 and where something like the clock display might hide, I'd like to hear about it.
 

Attachments

  • stock_reader_status.png
    stock_reader_status.png
    2.1 KB · Views: 11
  • status_bar.zip
    960 bytes · Views: 9
Last edited:

Renate

Recognized Contributor / Inactive Recognized Dev
Feb 3, 2012
3,583
1,592
Boston
www.temblast.com
Nexus 7 (2013)
Moto E5
In framework-res.apk:
Code:
style/TextAppearance.StatusBarTitle
  textColor = ?textColorPrimary

textColorPrimary = @color/primary_text_dark

<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="true" android:color="@color/bright_foreground_dark" />
    <item android:state_enabled="false" android:color="@color/bright_foreground_dark_disabled" />
</selector>

color/bright_foreground_dark = #ffffffff
Just change it directly in the style: #ff000000
 
  • Like
Reactions: nmyshkin

nmyshkin

Recognized Contributor
Nov 21, 2013
1,639
472
In framework-res.apk:
Code:
style/TextAppearance.StatusBarTitle
  textColor = ?textColorPrimary

textColorPrimary = @color/primary_text_dark

<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="true" android:color="@color/bright_foreground_dark" />
    <item android:state_enabled="false" android:color="@color/bright_foreground_dark_disabled" />
</selector>

color/bright_foreground_dark = #ffffffff
Just change it directly in the style: #ff000000
OK, I understand the concept but not the execution. There is currently no style "TextAppearance.StatusBarTitle." Am I to create that? If so, wouldn't I need to refer to it in the status_bar.xml?

I do not understand the <selector> statement at all (except at face value). I have that "xmlns:android="http://schemas.android.com/apk/res/android" business at the top of the status_bar.xml but no "selector" tag. Maybe that's the reference I just mentioned in the previous paragraph.

Or.....should I just go into the colors and change "bright_foreground_dark" to #ff000000. That seems risky. That would then apply to everything governed by the framework-res.apk. I think.

Edit: nope, that last idea apparently does nothing.
 
Last edited:

nmyshkin

Recognized Contributor
Nov 21, 2013
1,639
472
This is in 1.2.2 FWR res/values/styles.xml TextAppearance.StatusBarTitle
res/color/primary_text_dark.xml is a selector
Wow... "Never use Windows Notepad for a search" appears to be the moral. Notepad++ went right to it. How embarrassing.

So this is the current entry:
Code:
<style name="TextAppearance.StatusBarTitle" parent="@style/TextAppearance">
        <item name="textAppearance">?textAppearanceSmall</item>
        <item name="textStyle">bold</item>
        <item name="textColor">?textColorPrimary</item>
    </style>
I've located color/primary_text_dark.xml and I see that it contains the selector. So far so good. I've changed colors/bright_foreground_dark to #ff000000.

Which leaves me with an extra puzzle piece:
Code:
textColorPrimary = @color/primary_text_dark
Is that substituted for "textColor"? Or is it an added line in the style?
 

nmyshkin

Recognized Contributor
Nov 21, 2013
1,639
472
There are four levels of indirection, each shown in its own chunk.
Truer words were never typed.

Edit: I see.
Code:
textColorPrimary = @color/primary_text_dark
is in /res/values/styles.

Therefore it seems the only thing to do is change the color value res/values/colors/bright_foreground_dark which I've done.

....And, it doesn't work. So I have misunderstood.
 
Last edited:

nmyshkin

Recognized Contributor
Nov 21, 2013
1,639
472
Apparently it's not there.
No, the whole thing is wonky. The examples I've seen (admittedly only back as far as ICS) all have explicit "clock" statements in the status bar layout xml. This has none. The clock just magically appears in that upper right hand corner.

In any case, I don't see how changing any of the things I've tried would do any good as I can't find any references to the style "TextAppearance.StatusBarTitle." So if no layout xml is referring to it, what good is changing it?

I'm close to "Uncle", but the illogic and obfuscation of the whole thing has inflamed my ire, so I'll keep poking around for something, although I have no idea what.

Edit: Oh boy....Changing that text color did have an effect, it just took me awhile to find it. Any system stuff that has a black background, like the App Manager, used to have white text. Now it has black text or "no" text for practical purposes. Cast too large a net.
 
Last edited:

Renate

Recognized Contributor / Inactive Recognized Dev
Feb 3, 2012
3,583
1,592
Boston
www.temblast.com
Nexus 7 (2013)
Moto E5
Would you settle for lime green? :p

limestatus.png


services.jar, smali/com/android/server/status/StatusBarIcon.smali

Code:
    const/high16 v6, 0x41800000    # 16.0f

    invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextSize(F)V

    const v7, 0xff00ff00 # Line added for lime green

    .line 46
    invoke-virtual {v4, v7}, Landroid/widget/TextView;->setTextColor(I)V
 
  • Like
Reactions: nmyshkin

nmyshkin

Recognized Contributor
Nov 21, 2013
1,639
472
Would you settle for lime green? :p

View attachment 5681603

services.jar, smali/com/android/server/status/StatusBarIcon.smali

Code:
    const/high16 v6, 0x41800000    # 16.0f

    invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextSize(F)V

    const v7, 0xff00ff00 # Line added for lime green

    .line 46
    invoke-virtual {v4, v7}, Landroid/widget/TextView;->setTextColor(I)V
I think that phenolphthalein pink would be my choice if the screen were colored :eek:

Now see, I had services.jar in my sights and even looked at the smali file in question. But it was just too obscure for me. So thank you.

This works (but you knew that) and I am, once again, in your debt. Now I can finish my project instead of setting it aside. For the rest I am on ground I know well.
 
  • Like
Reactions: aiamuzz and Renate

nmyshkin

Recognized Contributor
Nov 21, 2013
1,639
472
Yay !!!
another new project @nmyshkin ?
Yep. I managed to score a pristine BNRV350 from ebay for $20. Totally blind purchase, no response from the seller, but something made me push that button...

It turned out to be a unit from near the end of the run when much of the "grayness" of the background had been addressed and there are no light diffusion artifacts! Like night and day compared to the first NSTG I got. This one's a keeper. It will become my principal reader.

So....I thought....the NSTG is 10 years old this year. Maybe time for a little "makeover"?

The status bar was the first step. I'm almost done with the last part. Just some complications in programming due the non-functional media scanner on the device.

You'll see. Soon.
 
  • Like
Reactions: aiamuzz

aiamuzz

Senior Member
Dec 24, 2011
503
46
Yep. I managed to score a pristine BNRV350 from ebay for $20. Totally blind purchase, no response from the seller, but something made me push that button...

It turned out to be a unit from near the end of the run when much of the "grayness" of the background had been addressed and there are no light diffusion artifacts! Like night and day compared to the first NSTG I got. This one's a keeper. It will become my principal reader.

So....I thought....the NSTG is 10 years old this year. Maybe time for a little "makeover"?

The status bar was the first step. I'm almost done with the last part. Just some complications in programming due the non-functional media scanner on the device.

You'll see. Soon.
Congrats for the great deal.

Even after so many years, my attachment to this device has only gotten deeper, just can't let go, it's stood the test of time, throw any hack at it and it stands tall and strong ... The device may perish, but it's spirit stands unbroken and appealing, that's the reason I've always gone back to purchasing it.

Look forward to this redesign project ... @nmyshkin ... Were you managing the mods uptill now on a non glowlight NST ?
 

nmyshkin

Recognized Contributor
Nov 21, 2013
1,639
472
Look forward to this redesign project ... @nmyshkin ... Were you managing the mods uptill now on a non glowlight NST ?
It's all the same except for working around the glowlight function if you want to reassign a long-press of the "n" button. I solved that problem back with QuickTiles by synthesizing the sequence that turns on and off the light as well as the sequence that changes the status bar icon.

I've since come full circle and decided it's easier to stay with the hardware on that issue and use NTMM to arrange things the way I want.

But, no, my development device has been the older NSTG running FW 1.2.1 for some time. I chose that option because 1) I didn't like the look of the really gray screen for reading and 2) it is necessary to re-sign Tasker to get it to install on FW 1.2.2, but if you do, then none of the plugin options function properly and that makes it difficult to debug routines before compiling the app (where the plugins will work just fine on any FW).

So the older NSTG still has a very important purpose.
 
  • Like
Reactions: aiamuzz

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Would you settle for lime green? :p

    View attachment 5681603

    services.jar, smali/com/android/server/status/StatusBarIcon.smali

    Code:
        const/high16 v6, 0x41800000    # 16.0f
    
        invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextSize(F)V
    
        const v7, 0xff00ff00 # Line added for lime green
    
        .line 46
        invoke-virtual {v4, v7}, Landroid/widget/TextView;->setTextColor(I)V
    I think that phenolphthalein pink would be my choice if the screen were colored :eek:

    Now see, I had services.jar in my sights and even looked at the smali file in question. But it was just too obscure for me. So thank you.

    This works (but you knew that) and I am, once again, in your debt. Now I can finish my project instead of setting it aside. For the rest I am on ground I know well.
    1
    In framework-res.apk:
    Code:
    style/TextAppearance.StatusBarTitle
      textColor = ?textColorPrimary
    
    textColorPrimary = @color/primary_text_dark
    
    <selector
      xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:state_enabled="true" android:color="@color/bright_foreground_dark" />
        <item android:state_enabled="false" android:color="@color/bright_foreground_dark_disabled" />
    </selector>
    
    color/bright_foreground_dark = #ffffffff
    Just change it directly in the style: #ff000000
    1
    This is in 1.2.2 FWR res/values/styles.xml TextAppearance.StatusBarTitle
    res/color/primary_text_dark.xml is a selector
    1
    Would you settle for lime green? :p

    limestatus.png


    services.jar, smali/com/android/server/status/StatusBarIcon.smali

    Code:
        const/high16 v6, 0x41800000    # 16.0f
    
        invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextSize(F)V
    
        const v7, 0xff00ff00 # Line added for lime green
    
        .line 46
        invoke-virtual {v4, v7}, Landroid/widget/TextView;->setTextColor(I)V
    1
    Yay !!!
    another new project @nmyshkin ?
    Yep. I managed to score a pristine BNRV350 from ebay for $20. Totally blind purchase, no response from the seller, but something made me push that button...

    It turned out to be a unit from near the end of the run when much of the "grayness" of the background had been addressed and there are no light diffusion artifacts! Like night and day compared to the first NSTG I got. This one's a keeper. It will become my principal reader.

    So....I thought....the NSTG is 10 years old this year. Maybe time for a little "makeover"?

    The status bar was the first step. I'm almost done with the last part. Just some complications in programming due the non-functional media scanner on the device.

    You'll see. Soon.