[Guides & Links] TOUCHWIZ UNIFIED MODS THREAD

Martillero

Senior Member
Sep 4, 2012
723
1,587
0
Córdoba
Adding seconds in clock on lockscreen.
In SystemUI/res/values/strings.xml
replace next strings:

All credits to sagitt67.
http://4pda.ru/forum/index.php?showtopic=626493&view=findpost&p=46232715
I love toggling things, so i was working on a way to toggle this too, that way we can turn it on/off as we like. So i have come up with this way to do it.
Toggle For secons in LockScreen Clock

First of all, there are probably several ways to do this, maybe better or simpler but as i always say this is what it works fo me.
Screenshot_2016-01-20-18-54-23.png
1) Xml changes

On res/layout/ (the layout folder could be different accordind device, mine was layout-sw360dp-xxxhdpi)
sec_keyguard_clock_single_view.xml

Code:
<LinearLayout android:gravity="bottom" android:orientation="horizontal" android:id="@id/keyguard_single_clock_container" android:focusable="true" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/kg_singleclock_container_margin_start">
            <com.android.keyguard.sec.SecKeyguardTextClock android:textSize="@dimen/kg_singleclock_time_text_size_normal" android:textColor="@color/theme_textclock_color" android:id="@id/keyguard_single_clock_time" android:clickable="false" android:layout_width="wrap_content" android:layout_height="82.0dip" android:shadowColor="#cc000000" android:fontFamily="SNumCond-3T" android:format12Hour="@string/status_view_12_hours_format" android:format24Hour="@string/status_view_24_hours_format" style="@style/keyguard_text_shadow" />
[COLOR="Blue"]            <com.android.keyguard.sec.SecKeyguardTextClock android:textSize="22.0sp" android:textColor="@color/theme_textclock_color" android:id="@id/keyguard_single_clock_seconds" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:shadowColor="#cc000000" android:textAllCaps="true" android:fontFamily="SNumCond-3T" android:layout_marginStart="1.0dip" android:format12Hour="@string/seconds" android:format24Hour="@string/seconds" style="@style/keyguard_text_shadow" />
[/COLOR]            <com.android.keyguard.sec.SecKeyguardTextClock android:textSize="@dimen/kg_singleclock_ampm_text_size" android:textColor="@color/theme_textclock_color" android:id="@id/keyguard_single_clock_ampm" android:clickable="false" android:layout_width="wrap_content" android:layout_height="21.0dip" android:layout_marginBottom="1.0dip" android:shadowColor="#cc000000" android:textAllCaps="true" android:fontFamily="roboto-regular" android:layout_marginStart="@dimen/kg_singleclock_ampm_margin_start" android:format12Hour="@string/status_view_ampm_for_12_hours" android:format24Hour="@string/status_view_ampm_for_24_hours" style="@style/keyguard_text_shadow" />
On res/values/strings.xml

Add new line at the end:

Code:
[COLOR="blue"]    <string name="seconds">:ss</string>
[/COLOR]
On res/values/ids.xml

Add new line at the end:
Code:
[COLOR="blue"]    <item type="id" name="keyguard_single_clock_seconds">false</item>
[/COLOR]
Compile/decompile systemUI to get public.xml value for new id created (keyguard_single_clock_seconds)

That's it for the xml changes.
Additional notes:
As you can see i have added a new text clock view for seconds (separated from the clock), so it will be like the am/pm text. We add the new id so we can have a reference for the toggle, and have use the same text color as other clock elements so if you have themes color will match. You can change seconds text size if you want too, i have used 22sp.

2) The smali part.
We are going to modify two files R$id.smali and SecKeyguardClockSingleView

First we will add the new id (the value we get from public.xml). So open:
smali/com/android/keyguard/R$id.smali

and add this:

Code:
.field public static final keyguard_single_clock_image_time:I = 0x7f0d0369

[COLOR="blue"].field public static final keyguard_single_clock_seconds:I =[/COLOR]
 [COLOR="Green"]0x7f0d043c[/COLOR]

.field public static final keyguard_single_clock_time:I = 0x7f0d0371
keyguard_single_clock_seconds value will be the one provided from your public.xml (keyguard_single_clock_seconds id).
So, change the value in green, with the value you got on public.xml

Now, open com/android/keyguard/sec/SecKeyguardClockSingleView.smali

Add after # instance fields

Code:
.field private mOldClockText:Ljava/lang/String;

[COLOR="blue"][COLOR="blue"].field protected mSecondsTime:Lcom/android/keyguard/sec/SecKeyguardTextClock;
[/COLOR][/COLOR]
.field private mShadowImageView:Landroid/widget/ImageView;

.field private mSingleAmpmKor:Lcom/android/keyguard/sec/SecKeyguardTextClock;

.field private mSingleAmpmOpen:Lcom/android/keyguard/sec/SecKeyguardTextClock;

Then in same smali add new method:

Code:
[COLOR="blue"].method ClockSeconds()V
    .locals 5

    iget-object v0, p0, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->mContext:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "lock_seconds"

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v0

    if-nez v0, :cond_0

    const v2, 0x8

    sget v3, Lcom/android/keyguard/R$id;->keyguard_single_clock_seconds:I

    invoke-virtual {p0, v3}, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->findViewById(I)Landroid/view/View;

    move-result-object v4

    invoke-virtual {v4, v2}, Lcom/android/keyguard/sec/SecKeyguardTextClock;->setVisibility(I)V

    goto/16 :goto_0

    :cond_0
    const v2, 0x3

    sget v3, Lcom/android/keyguard/R$id;->keyguard_single_clock_seconds:I

    invoke-virtual {p0, v3}, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->findViewById(I)Landroid/view/View;

    move-result-object v4

    invoke-virtual {v4, v2}, Lcom/android/keyguard/sec/SecKeyguardTextClock;->setVisibility(I)V

    :goto_0
    return-void
.end method
[/COLOR]
Then, in this method:
.method protected onFinishInflate()V

Add this
Code:
    sget v1, Lcom/android/keyguard/R$id;->keyguard_single_clock_container:I

    invoke-virtual {p0, v1}, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->findViewById(I)Landroid/view/View;

    move-result-object v1

    iput-object v1, p0, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->mSingleClockContainer:Landroid/view/View;

    sget v1, Lcom/android/keyguard/R$id;->keyguard_single_clock_time:I

    invoke-virtual {p0, v1}, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Lcom/android/keyguard/sec/SecKeyguardTextClock;

    iput-object v1, p0, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->mSingleTime:Lcom/android/keyguard/sec/SecKeyguardTextClock;

[COLOR="blue"]    sget v1, Lcom/android/keyguard/R$id;->keyguard_single_clock_seconds:I

    invoke-virtual {p0, v1}, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Lcom/android/keyguard/sec/SecKeyguardTextClock;

    iput-object v1, p0, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->mSecondsTime:Lcom/android/keyguard/sec/SecKeyguardTextClock;
[/COLOR]
    sget v1, Lcom/android/keyguard/R$id;->keyguard_single_clock_ampm:I

    invoke-virtual {p0, v1}, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Lcom/android/keyguard/sec/SecKeyguardTextClock;

    iput-object v1, p0, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->mSingleAmpmOpen:Lcom/android/keyguard/sec/SecKeyguardTextClock;

    sget v1, Lcom/android/keyguard/R$id;->keyguard_single_clock_ampm_kor:I

    invoke-virtual {p0, v1}, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Lcom/android/keyguard/sec/SecKeyguardTextClock;

    iput-object v1, p0, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->mSingleAmpmKor:Lcom/android/keyguard/sec/SecKeyguardTextClock;
And finally in the same method a few lines below add this:

Code:
    :cond_3
    iget-object v1, p0, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->mContext:Landroid/content/Context;

    invoke-static {v1}, Lcom/android/keyguard/sec/SecKeyguardStatusUtils;->isShowClockAndDate(Landroid/content/Context;)Z

    move-result v1

    if-eqz v1, :cond_9

    .line 207
    invoke-virtual {p0}, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->setClockStyle()V

[COLOR="blue"]    invoke-virtual {p0}, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->ClockSeconds()V
[/COLOR]
    .line 208
    invoke-direct {p0}, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->setClockContentDesciption()V

    .line 212
    :goto_3
    invoke-direct {p0}, Lcom/android/keyguard/sec/SecKeyguardClockSingleView;->isShowDateOn()Z

    move-result v1

    if-nez v1, :cond_4
Done :good:

Now in RomControl or CustomSettings use this switch:

Code:
    <SwitchPreference android:key="lock_seconds" android:summaryOff="Off" android:summaryOn="On" android:title="Add Clock Seconds" />
Hope it works for you guys.
 
Last edited:

Goldie

Inactive Recognized Developer
Oct 16, 2010
9,967
22,758
0
Hey @_alex74_ ;)

Ok.. I asked because I wanted to know the extension of the issue.... I think I've found the solution...





This is using AOSP SystemUI for a S5 Hybrid ROM made for my own use but it should work for Touchwiz's SystemUI.

To tame this, first I've analyzed the issue... this must be a notification issue... not an application issue... besides.. I'm not touching Google Play apps... they should remain untouched for the sake of updates... anyways...

Using the invaluable knowledge of this thread as a starting point ( thanks @tdunham )... if we tried to set the TextColor through the RemoteView, the color remained untouched... so, after debugging the notification data I saw that the text wasn't a string, it was a CharSequence... this interface allows an "embedded" style... that's why we couldn't override the color.

To solve this, I came up with this approach: convert it to string ( so it losses it's style ) and then set the color as this guide teaches us:

Example:
Code:
    invoke-interface {p2}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p1, v0, v2}, Landroid/widget/RemoteViews;->setTextViewText(ILjava/lang/CharSequence;)V

    iget-object v5, p0, Landroid/app/Notification$InboxStyle;->mBuilder:Landroid/app/Notification$Builder;

    # getter for: Landroid/app/Notification$Builder;->mThemeSecondaryColor:I
    invoke-static {v5}, Landroid/app/Notification$Builder;->access$2600(Landroid/app/Notification$Builder;)I

    move-result v5

    invoke-virtual {p1, v0, v5}, Landroid/widget/RemoteViews;->setTextColor(II)V
Another approach: take the CharSequence into an SppannableStringBuilder so we can apply a ForegroundColorSpan with the text color of our choice.
Code:
    new-instance v1, Landroid/text/SpannableStringBuilder;

    invoke-direct {v1, p2}, Landroid/text/SpannableStringBuilder;-><init>(Ljava/lang/CharSequence;)V

    invoke-virtual {v1}, Landroid/text/SpannableStringBuilder;->length()I

    move-result v6

    const/16 v2, 0x0

    new-instance v3, Landroid/text/style/ForegroundColorSpan;

    iget-object v4, p0, Landroid/app/Notification$InboxStyle;->mBuilder:Landroid/app/Notification$Builder;

    # getter for: Landroid/app/Notification$Builder;->mThemeSecondaryColor:I
    invoke-static {v4}, Landroid/app/Notification$Builder;->access$2600(Landroid/app/Notification$Builder;)I

    move-result v4

    invoke-direct {v3, v4}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V

    const v4, 0x21

    invoke-virtual {v1, v3, v2, v6, v4}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

    invoke-virtual {p1, p3, v1}, Landroid/widget/RemoteViews;->setTextViewText(ILjava/lang/CharSequence;)V
This should be done in Notification$InboxStyle.smali and Notification$BigTextStyle.smali

And people.. don't be afraid to test, break, make mistakes or bootloops [emoji14]... I once started by simply changing png's.... now I'm still learning smali... FC by FC ;) but at the end... it gets done
Beautiful! ?

Sent from my SM-G925K using Tapatalk
 

_alex74_

Recognized Themer
Nov 11, 2012
1,316
3,006
0
FVG
Anyone please tell me the exact color hex code of the notification panel background. I mean that green background color code. Tried several combos but can't get the exact color..

if u search a little.... you will find a stock SystemUI of note 5, decompile it and u will find the right colors...
.... this is how i change pencil with edit text in dropdown menu.... :D

This is development thread, if u want to partecipate, show at least some power to do basics things by yourself.....:D:D:D:D:p
 

amtra

Senior Member
Jun 28, 2012
1,509
1,005
0
28
Chennai
if u search a little.... you will find a stock SystemUI of note 5, decompile it and u will find the right colors...
.... this is how i change pencil with edit text in dropdown menu.... :D

This is development thread, if u want to partecipate, show at least some power to do basics things by yourself.....:D:D:D:D:p
Even I have my systemui decompiled. I don't know wat string belongs to that color code..?
 

lucky_sidhu

Senior Member
Sep 13, 2011
996
1,395
133
New Delhi
all credits goes to @renzetti.s for the mod and he asked for a port to samsung.

Decompile SystemUI.apk and push the extracted folder "acer" from the attached zip to smali/com.

Open PhaneStatusBar.smali and put the blue lines

Code:
.method makeExpandedInvisible()V
    .locals 7
-
-
-
    const-string v1, "makeExpandedInvisible is called when notifications are fling"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStackScroller:Lcom/android/systemui/statusbar/stack/NotificationStackScrollLayout;

    invoke-virtual {v0}, Lcom/android/systemui/statusbar/stack/NotificationStackScrollLayout;->setScrollPositionToTop()V

    :cond_1
    iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

    if-nez v0, :cond_3

    :cond_2
    :goto_0
	
[COLOR="Blue"]    iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;

    const v1, 0x7f0e0473     [COLOR="Red"]#<public type="id" name="backgroundImageView"[/COLOR]

    invoke-virtual {v3, v1}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/ImageView;

    const/4 v3, 0x4

    invoke-virtual {v4, v3}, Landroid/widget/ImageView;->setVisibility(I)V
	[/COLOR]
    return-void

    :cond_3
    sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->upgradeLollipop:Z

    if-nez v0, :cond_5

    iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIsInQSEditMode:Z

    if-eqz v0, :cond_5
open NotificationPanelView.smali and put the blue lines

Code:
.method private updateHeaderShade()V
    .locals 3

    iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mHeaderAnimatingIn:Z

    if-nez v1, :cond_0

    invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->getPeekHeight()F

    move-result v0

    iget v1, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mExpandedHeight:F

    cmpg-float v1, v1, v0

    if-gtz v1, :cond_1

    const/4 v1, 0x1

    iput-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mHideHeader:Z

    iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mHeader:Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;

    iget v2, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mExpandedHeight:F

    sub-float/2addr v2, v0

    invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setTranslationY(F)V

    :cond_0
    :goto_0
    iget v1, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mQsExpansionHeight:F

    invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->setQsTranslation(F)V

[COLOR="Blue"]    const v1, 0x7f0e0473     [COLOR="Red"]#<public type="id" name="backgroundImageView"[/COLOR]

    invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setVisibility(I)V[/COLOR]

    return-void

    :cond_1
    const/4 v1, 0x0

    iput-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mHideHeader:Z

    goto :goto_0
.end method
Be sure the "v" is matching the surrounding code
These 2 methods are very different in S5 smalis

The method you posted in NotificationPanelView.smali is very short in my case.
Code:
.method private updateHeaderShade()V
    .locals 2

    iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mHeaderAnimatingIn:Z

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mHeader:Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;

    invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->getHeaderTranslation()F

    move-result v1

    invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setTranslationY(F)V

    :cond_0
    iget v0, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mQsExpansionHeight:F

    invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->setQsTranslation(F)V

    return-void
.end method
PhoneStaturBar.smali is also a bit different such as

sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->upgradeLollipop:Z is not there instead

sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mS5MR:Z is there

Have a look at my complete method
Code:
.method makeExpandedInvisible()V
    .locals 8

    const/4 v7, 0x2

    const/high16 v6, 0x3f800000    # 1.0f

    const/16 v5, 0x8

    const/4 v4, 0x1

    const/4 v3, 0x0

    const-string v0, "PhoneStatusBar"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "makeExpandedInvisible: mExpandedVisible="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-boolean v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " mExpandedVisible="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-boolean v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStackScroller:Lcom/android/systemui/statusbar/stack/NotificationStackScrollLayout;

    invoke-virtual {v0}, Lcom/android/systemui/statusbar/stack/NotificationStackScrollLayout;->isBeingDragged()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStackScroller:Lcom/android/systemui/statusbar/stack/NotificationStackScrollLayout;

    invoke-virtual {v0}, Lcom/android/systemui/statusbar/stack/NotificationStackScrollLayout;->endDrag()V

    :cond_0
    iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

    if-nez v0, :cond_2

    :cond_1
    :goto_0
    return-void

    :cond_2
    sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mS5MR:Z

    if-nez v0, :cond_3

    iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIsInQSEditMode:Z

    if-eqz v0, :cond_3

    invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->removeQsEditPanel()V

    :cond_3
    iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mState:I

    if-eq v0, v7, :cond_4

    iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mState:I

    if-ne v0, v4, :cond_7

    :cond_4
    iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mState:I

    if-ne v0, v7, :cond_6

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarKeyguardViewManager:Lcom/android/systemui/statusbar/phone/StatusBarKeyguardViewManager;

    invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/StatusBarKeyguardViewManager;->isSecure()Z

    move-result v0

    if-eqz v0, :cond_5

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;

    invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->instantExpand()V

    invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->goToKeyguard()V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarKeyguardViewManager:Lcom/android/systemui/statusbar/phone/StatusBarKeyguardViewManager;

    invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/StatusBarKeyguardViewManager;->dismissIfInsecure()V

    goto :goto_0

    :cond_5
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarKeyguardViewManager:Lcom/android/systemui/statusbar/phone/StatusBarKeyguardViewManager;

    invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/StatusBarKeyguardViewManager;->dismissIfInsecure()V

    goto :goto_0

    :cond_6
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;

    invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->instantExpand()V

    invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->goToKeyguard()V

    goto :goto_0

    :cond_7
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

    invoke-virtual {v0, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->collapseAllPanels(Z)V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollViewAnim:Landroid/animation/Animator;

    if-eqz v0, :cond_8

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollViewAnim:Landroid/animation/Animator;

    invoke-virtual {v0}, Landroid/animation/Animator;->cancel()V

    :cond_8
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mClearButtonAnim:Landroid/animation/Animator;

    if-eqz v0, :cond_9

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mClearButtonAnim:Landroid/animation/Animator;

    invoke-virtual {v0}, Landroid/animation/Animator;->cancel()V

    :cond_9
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStackScroller:Lcom/android/systemui/statusbar/stack/NotificationStackScrollLayout;

    invoke-virtual {v0, v3}, Lcom/android/systemui/statusbar/stack/NotificationStackScrollLayout;->setVisibility(I)V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;

    invoke-virtual {v0, v5}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->setVisibility(I)V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQSPanel:Lcom/android/systemui/qs/QSPanel;

    if-eqz v0, :cond_a

    sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mS5MR:Z

    if-eqz v0, :cond_a

    invoke-direct {p0, v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateQSpanel(Z)V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHSView:Landroid/widget/HorizontalScrollView;

    if-eqz v0, :cond_a

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHSView:Landroid/widget/HorizontalScrollView;

    invoke-virtual {v0, v3, v3}, Landroid/widget/HorizontalScrollView;->scrollTo(II)V

    :cond_a
    sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mS5MR:Z

    if-eqz v0, :cond_e

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsButtonAnim:Landroid/animation/Animator;

    if-eqz v0, :cond_b

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsButtonAnim:Landroid/animation/Animator;

    invoke-virtual {v0}, Landroid/animation/Animator;->cancel()V

    :cond_b
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationButtonAnim:Landroid/animation/Animator;

    if-eqz v0, :cond_c

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationButtonAnim:Landroid/animation/Animator;

    invoke-virtual {v0}, Landroid/animation/Animator;->cancel()V

    :cond_c
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mEditButtonAnim:Landroid/animation/Animator;

    if-eqz v0, :cond_d

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mEditButtonAnim:Landroid/animation/Animator;

    invoke-virtual {v0}, Landroid/animation/Animator;->cancel()V

    :cond_d
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBasicSettingsButtonAnim:Landroid/animation/Animator;

    if-eqz v0, :cond_e

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBasicSettingsButtonAnim:Landroid/animation/Animator;

    invoke-virtual {v0}, Landroid/animation/Animator;->cancel()V

    :cond_e
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandSettingsButton:Landroid/widget/ImageView;

    if-eqz v0, :cond_f

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandSettingsButton:Landroid/widget/ImageView;

    invoke-virtual {v0, v6}, Landroid/widget/ImageView;->setAlpha(F)V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandSettingsButton:Landroid/widget/ImageView;

    invoke-virtual {v0, v3}, Landroid/widget/ImageView;->setVisibility(I)V

    :cond_f
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBasicSettingsButton:Landroid/widget/ImageView;

    if-eqz v0, :cond_10

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBasicSettingsButton:Landroid/widget/ImageView;

    invoke-virtual {v0, v6}, Landroid/widget/ImageView;->setAlpha(F)V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBasicSettingsButton:Landroid/widget/ImageView;

    invoke-virtual {v0, v3}, Landroid/widget/ImageView;->setVisibility(I)V

    :cond_10
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationButton:Landroid/widget/ImageView;

    if-eqz v0, :cond_11

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationButton:Landroid/widget/ImageView;

    invoke-virtual {v0, v5}, Landroid/widget/ImageView;->setVisibility(I)V

    :cond_11
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsEditButton:Landroid/widget/ImageView;

    if-eqz v0, :cond_12

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsEditButton:Landroid/widget/ImageView;

    invoke-virtual {v0, v5}, Landroid/widget/ImageView;->setVisibility(I)V

    :cond_12
    sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mPLMNIconDisplay:Z

    if-eqz v0, :cond_13

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationIcons:Lcom/android/systemui/statusbar/phone/IconMerger;

    invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/IconMerger;->getChildCount()I

    move-result v0

    if-nez v0, :cond_13

    const/high16 v0, 0x10a0000

    invoke-virtual {p0, v4, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setCarrierLabelVisibility(ZI)V

    :cond_13
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;

    invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->closeQs()V

    iput-boolean v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNavigationBarView:Lcom/android/systemui/statusbar/phone/NavigationBarView;

    if-eqz v0, :cond_14

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNavigationBarView:Lcom/android/systemui/statusbar/phone/NavigationBarView;

    invoke-virtual {v0, v3}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->setSlippery(Z)V

    :cond_14
    invoke-virtual {p0, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->visibilityChanged(Z)V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindowManager:Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;

    invoke-virtual {v0, v3}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->setStatusBarExpanded(Z)V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

    invoke-virtual {v0, v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->setFocusable(Z)V

    invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->dismissPopups()V

    invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->runPostCollapseRunnables()V

    invoke-virtual {p0, v4, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setInteracting(IZ)V

    iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisabledUnmodified:I

    invoke-virtual {p0, v0, v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->disable(IZ)V

    goto/16 :goto_0
.end method
Attaching both files to have a look
 

Attachments

Last edited:

amtra

Senior Member
Jun 28, 2012
1,509
1,005
0
28
Chennai
Search you will find it

Sent from my SM-N920T using Tapatalk
If I know Jonathan and someone ask me to search wre he is.. then I will search Were is Jonathan.. If I don't knw the name then wat I can search. BTW in I searched in colors.xml and didn't find the exact name.. is it something like notification_panel _ color like that?
 

_alex74_

Recognized Themer
Nov 11, 2012
1,316
3,006
0
FVG
Even I have my systemui decompiled. I don't know wat string belongs to that color code..?
BTW in I searched in colors.xml and didn't find the exact name.. is it something like notification_panel _ color like that?
cmon guys these are basics...... try to smash your heads on it..... you will learn a lot...

if not...send me a screenshot in png and stock systemUI..i will give you some light about...

i will be home in 10 hours from now...;):D
 
  • Like
Reactions: amtra

JonathanRAZ

Senior Member
Oct 29, 2015
1,242
475
113
31
Cabo Rojo
If I know Jonathan and someone ask me to search wre he is.. then I will search Were is Jonathan.. If I don't knw the name then wat I can search. BTW in I searched in colors.xml and didn't find the exact name.. is it something like notification_panel _ color like that?
Come on bro i am a noob but at least try the tutorials theres is many on op even says where to find what bro not trying to be rude but thats what we all get when we are noobs

Sent from my SM-N920T using Tapatalk
 
  • Like
Reactions: amtra

amtra

Senior Member
Jun 28, 2012
1,509
1,005
0
28
Chennai
cmon guys these are basics...... try to smash your heads on it..... you will learn a lot...

if not...send me a screenshot in png and stock systemUI..i will give you some light about...

i will be home in 10 hours from now...;):D
Come on bro i am a noob but at least try the tutorials theres is many on op even says where to find what bro not trying to be rude but thats what we all get when we are noobs

Sent from my SM-N920T using Tapatalk
All r right guyz.. and sorry if i am rude..

"notification_header_bg_tw" this is wat im looking for..
I thought it was "notification_material_background_color" and edited some values and messed up with systemui..
Really im noob so have to spend more and more time to learn some simple things..
 
  • Like
Reactions: JonathanRAZ

JonathanRAZ

Senior Member
Oct 29, 2015
1,242
475
113
31
Cabo Rojo
All r right guyz.. and sorry if i am rude..

"notification_header_bg_tw" this is wat im looking for..
I thought it was "notification_material_background_color" and edited some values and messed up with systemui..
Really im noob so have to spend more and more time to learn some simple things..
Dont worry bro you did good i even have too look for myself imagine i cant even get 3mintbatt working but still trying without help bro just good job did great finding it

Sent from my SM-N920T using Tapatalk
 
  • Like
Reactions: amtra

amtra

Senior Member
Jun 28, 2012
1,509
1,005
0
28
Chennai
Dont worry bro you did good i even have too look for myself imagine i cant even get 3mintbatt working but still trying without help bro just good job did great finding it

Sent from my SM-N920T using Tapatalk
Really sure i haven't do anything without help of these guyz guiding me always, BTW 3minit battery i followed the guide and even i added toggle working fine but my systemui force close when i tap to show the Stock battery, its not a greatdeal for me.
 

lucky_sidhu

Senior Member
Sep 13, 2011
996
1,395
133
New Delhi
Notification Panel Custom Carrier Text
Doing some changes in the post here by @tdunham

Attaching the original code as well
Blue - New Code
Green - Changes
Red - code to remove


SystemUI.apk smali edit:
\smali\com\android\systemui\statusbar\policy\NetworkControllerImpl.smali
Add new code in BLUE
Code:
# instance fields
[COLOR="blue"].field private mCarrierColor:I
[/COLOR]
.field LTE_ON_CDMA_FALSE:I

.field LTE_ON_CDMA_TRUE:I

.field LTE_ON_CDMA_UNKNOWN:I

Code:
.method private setCarrierText()V
    [COLOR="blue"].locals 6
[/COLOR]
    invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->updateCarrierText()V

    iget-object v2, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mMobileLabelViews:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iget-object v2, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mCarrierText:Ljava/lang/String;

[COLOR="Blue"]    iget-object v3, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mContext:Landroid/content/Context;

    invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "panel_custom_carrier"

    const v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    [COLOR="Red"]if-eqz v4, :cond_0[/COLOR]
    [COLOR="Lime"]if-eqz v4, :cond_td[/COLOR]

    iget-object v3, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mContext:Landroid/content/Context;

    invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "panel_carrier_label"

    invoke-static {v3, v4}, Landroid/provider/Settings$System;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2
    
    [COLOR="Red"]:cond_0[/COLOR]
    [COLOR="Lime"]:cond_td[/COLOR][/COLOR]

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    [COLOR="blue"]invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->updateCarrierTextColor()V

    iget v3, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mCarrierColor:I

    invoke-virtual {v1, v3}, Landroid/widget/TextView;->setTextColor(I)V
[/COLOR]
    goto :goto_0

    :cond_0
    return-void
.end method
Add new method to the bottom of the smali.
Code:
.method updateCarrierTextColor()V
    .locals 4

    iget-object v1, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "panel_carrier_color"

    const v3, -0x1

    invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    iput v1, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mCarrierColor:I

    return-void
.end method

CustomSettings lines:
Code:
<PreferenceScreen android:title="Notification Panel Carrier Text" android:summary="Text options and settings">
[COLOR="Red"]<SwitchPreference android:title="Use Custom Carrier Text" android:key="custom_carrier" android:summaryOn="Enabled" android:summaryOff="Disabled" />[/COLOR]
[COLOR="Lime"]<SwitchPreference android:title="Use Custom Carrier Text" android:key="panel_custom_carrier" android:summaryOn="Enabled" android:summaryOff="Disabled" />[/COLOR]
<EditTextPreference android:title="Carrier Custom Text" android:key="panel_carrier_label" android:summary="Leave BLANK to remove" android:dependency="panel_custom_carrier" android:dialogTitle="Set Custom Text" />
<com.ficeto.colorpicker.ColorPickerPreference android:title="Carrier Text" android:key="panel_carrier_color" android:summary="Choose carrier color" />
</PreferenceScreen>
 
Last edited:

Crussader

Senior Member
Jun 15, 2007
1,606
3,675
0
Anyone please tell me the exact color hex code of the notification panel background. I mean that green background color code. Tried several combos but can't get the exact color..
This is development thread, if u want to partecipate, show at least some power to do basics things by yourself.....:D:D:D:D:p
cmon guys these are basics...... try to smash your heads on it..... you will learn a lot...
Always smash the head ;)

This tool might help: https://play.google.com/store/apps/details?id=com.embermitre.pixolor.app&hl=en