[MOD] 4.4.2 TW Hidden power button

Search This thread

javaronz

Member
Aug 7, 2014
10
1
can you please help me to have this on my n9005XXUENC2, can you please give me step by step, im kinda confused and i am also new to android. thanks
 

JazonX

Senior Member
Any chance of doing this in Android 5.0.1 ?

The contents of the status_bar.xml is quoted below,

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"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <FrameLayout android:id="@id/call_background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
    <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" android:alpha="0.74">
            <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
                <TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                <ImageView android:id="@id/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />
                <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:alpha="0.74" 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>
 

JazonX

Senior Member
Edited as below


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"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <FrameLayout android:id="@id/call_background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
    <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" android:alpha="0.74">
            <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
                <TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                <ImageView android:id="@id/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />
                <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" />
			<FrameLayout android:gravity="center" android:orientation="horizontal" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerInParent="true">
            <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:alpha="0.74" android:paddingStart="7.0dip" />
			<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@null" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" />
             </FrameLayout>
		</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>


Works when replaced, But on a Factory Reset - Unfortunately stops for once and then I can continue setting up. On reboots nothing happens... Just once for the first time after a factory reset. Any idea why ?
 

evilvoice

Senior Member
May 4, 2008
923
569
Conyers GA
Edited as below


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"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <FrameLayout android:id="@id/call_background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
    <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" android:alpha="0.74">
            <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
                <TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                <ImageView android:id="@id/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />
                <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" />
			<FrameLayout android:gravity="center" android:orientation="horizontal" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerInParent="true">
            <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:alpha="0.74" android:paddingStart="7.0dip" />
			<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@null" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" />
             </FrameLayout>
		</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>


Works when replaced, But on a Factory Reset - Unfortunately stops for once and then I can continue setting up. On reboots nothing happens... Just once for the first time after a factory reset. Any idea why ?

I've successfully added this to Note 3 OC5 LP. The only important line is the KeyButtonView line. Remove the FrameLayout lines and leave KeyButtonView where it is. I used information from @thermax04 to figure this out, so credits to that person. It should be noted that you need an icon for LP, so android:src= needs to be something other than null. I tried to go back to null because I did not like the themed icon in @thermax04 mod, but I could never click on the location without the notification drop down and it would not work.

Here is the link to the mod and you can see in the pictures what the icon looks like. It doesn't really go with a stock TW layout, but hey, it works.


Code:
android:src="@drawable/sysbar_lock"
is what he uses for null, but I'm sure you can put anything. I would love to see something more in tune with stock TW if anyone can whip up an icon
 

thermax04

Senior Member
Nov 26, 2010
3,055
1,458
I've successfully added this to Note 3 OC5 LP. The only important line is the KeyButtonView line. Remove the FrameLayout lines and leave KeyButtonView where it is. I used information from @thermax04 to figure this out, so credits to that person. It should be noted that you need an icon for LP, so android:src= needs to be something other than null. I tried to go back to null because I did not like the themed icon in @thermax04 mod, but I could never click on the location without the notification drop down and it would not work.

Here is the link to the mod and you can see in the pictures what the icon looks like. It doesn't really go with a stock TW layout, but hey, it works.


Code:
android:src="@drawable/sysbar_lock"
is what he uses for null, but I'm sure you can put anything. I would love to see something more in tune with stock TW if anyone can whip up an icon

Its me you mentioned for the fix, if you need any icon instead of what i made (mine is colorful to suite my theme) i can help you that, just give me any guide line what you are looking for
 
  • Like
Reactions: evilvoice

evilvoice

Senior Member
May 4, 2008
923
569
Conyers GA
Hi @thermax04. I wasn't sure if it would be okay with you to post your information or not. If possible, I would like to find one that matches stock TW. A white with a transparent background would be awesome. I'm showing a screen shot for reference. Thank you so much. I've been looking at putting this mod in my rom, but it never worked. I had given up until I saw your thread.

uploadfromtaptalk1432600904199.jpg
 

thermax04

Senior Member
Nov 26, 2010
3,055
1,458
Hi @thermax04. I wasn't sure if it would be okay with you to post your information or not. If possible, I would like to find one that matches stock TW. A white with a transparent background would be awesome. I'm showing a screen shot for reference. Thank you so much. I've been looking at putting this mod in my rom, but it never worked. I had given up until I saw your thread.

View attachment 3331688

Hope you like this in attachment, of course it is not sky blue color, it is transparent as you requested
attachment.php
 

Attachments

  • ic_lock_power_off.zip
    940 bytes · Views: 29
  • Untitled.jpg
    Untitled.jpg
    9.6 KB · Views: 367
Last edited:

kmdangi

Senior Member
Jan 12, 2013
738
117
Pune, India
Hi @tkari4 , @thermax04,
I added the three line to statusbar.xml and rebuilt the app with apktool.
Now the invisible button works, but when the phone is rotated (autorotate) for any picture in gallery, systeui.apk FCs.
How to solve this problem ? Thanks in advance !
 

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    Hidden power button under the status bar clock.

    No visual changes looks like the stock status bar:
    Screenshot_2014-03-27-11-29-24.jpg


    Attention!

    After this changes an Xposed modul can't move, or hide the clock.


    Functions:
    - Short press on the clock turns off the screen
    - Long press, or swipe from the clock top to the bottom opens the power menu.

    Needed tools:
    Apktool
    Notepad++

    1. Decompile SystemUI.apk
    2. Navigate to \res\layout folder
    3. Open status_bar.xml

    Add BLUE lines.

    Code:
            <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" />
                    <TextView android:textSize="@dimen/status_bar_battery_text_size" android:textColor="#ffffffff" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" android:layout_marginStart="@dimen/status_bar_battery_text_marginStart" />
                    <com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="12.0dip" android:layout_height="18.0dip" android:layout_marginBottom="0.33000004dip" android:layout_marginStart="5.0dip" />
                </LinearLayout>
                 [COLOR="Blue"][B]<FrameLayout android:gravity="center" android:orientation="horizontal" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerInParent="true">[/B]
                  [/COLOR]<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:ellipsize="none" android:gravity="start|center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" android:paddingStart="6.0dip" systemui:ampmSmall="false" />
                  [COLOR="Blue"][B]<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@null" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" />
                 </FrameLayout>[/B][/COLOR]
            </LinearLayout>
        </LinearLayout>
        <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">

    4. Save your changes
    5. Build SystemUI.apk
    6. Push to your Phone, set permissions, reboot

    I did it already for the N9005XXUENC2 firmware: Download

    ;)
    4
    Yes it should work on latest ROM too.

    Who are not good with compiling here attached two version of hidden power
    1.Who are using stock battery
    2.Who are using modified Imaged battery
    Download according your SystemUI and flash from recovery.
    4
    @tkari4 Thanks for sharing your guids. I think Note 3 community is missing a development thread like the one in Note (by majdini). so as you have reasonable knowledge about smali things, that would be nice if you could open such thread so that everyone can add his mod/guide/tip to it and all can be found in the same thread.




    Sent from my SM-N9005
    2
    Do you have flashable zip? :)

    Flashable zip attached here: http://xdaforums.com/showpost.php?p=51305774&postcount=157

    Copy SystemUI.apk in system / priv-app folder, than you can flash it.

    Don't forget backup your current SystemUI.apk.
    2
    just usable on KK?
    noway for using on JB? :)

    I'm using this code on 4.1.2 too, so should work on JB.

    ;)