[MOD][14 jan] - Instant screen off / Power menu in notification dropdown + How to

Search This thread

♀Mivahe

Member
Jan 10, 2013
42
89
e71iqd.png


First of all, a big thanks to kurniawan77 for letting me port his brilliant mod. (Original mod)

333yj35.png



Mod info

4 versions regarding placement; left, center right and bottom
All versions available with battery %
All versions available with AOSP style recent apps (thanks hassan89)
Based on 3.14.401.31 SystemUI.apk
Compatible with de-odexed and odexed ROMs (3.14.xxx.xx)
De-odexed and zipaligned
Instant screen off button integrated in notification header or bottom
Longpress button and APM / Power menu shows up

Bottom version note:

You can touch the bottom anywhere between the dots for instant screen off and power menu.
Pressing the dots, left and right, will give you stock bottom behaviour.


How to include this mod in your project
Assuming you know how to decompile and recompile SystemUI.apk, you'll need to do following;

Add ic_sysbar_lock.png to drawable-xhdpi
Open ids.xml and add green colored
Code:
    <item type="id" name="recent_inspect_item">false</item>
[COLOR="Green"]    <item type="id" name="screen_lock_button">false</item>[/COLOR]
</resources>

Now you'll need to open status_bar_expanded_header.xml (left, center and right) or status_bar_expanded.xml (bottom)
You may need to remove some margins depending your desired placement.

Add green colored (status_bar_expanded_header) left, center or right

Code:
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    [COLOR="green"]<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/screen_lock_button" android:layout_width="50.0dip" android:layout_height="50.0dip" android:layout_marginTop="1.0dip" android:src="@drawable/ic_sysbar_lock" android:scaleType="center" systemui:keyCode="26" />[/COLOR]
    <com.android.systemui.statusbar.policy.Clock android:textSize="36.0dip" android:textColor="@*android:color/white" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10.0dip" android:singleLine="true" />

Code:
    <com.android.systemui.statusbar.policy.Clock android:textSize="36.0dip" android:textColor="@*android:color/white" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10.0dip" android:singleLine="true" />
    [COLOR="green"]<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/screen_lock_button" android:layout_width="50.0dip" android:layout_height="50.0dip" android:layout_marginTop="1.0dip" android:src="@drawable/ic_sysbar_lock" android:scaleType="center" systemui:keyCode="26" />[/COLOR]
    <com.android.systemui.statusbar.policy.DateView android:id="@id/date" android:layout_width="0.0px" android:layout_height="wrap_content" android:layout_marginLeft="10.0dip" android:layout_marginRight="10.0dip" android:maxLines="2" android:layout_weight="1.0" android:lineSpacingExtra="0.0dip" style="@com.htc:style/title_secondary_m" />

Code:
    <com.android.systemui.statusbar.policy.DateView android:id="@id/date" android:layout_width="0.0px" android:layout_height="wrap_content" android:layout_marginLeft="10.0dip" android:layout_marginRight="10.0dip" android:maxLines="2" android:layout_weight="1.0" android:lineSpacingExtra="0.0dip" style="@com.htc:style/title_secondary_m" />
    [COLOR="Green"]<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/screen_lock_button" android:layout_width="50.0dip" android:layout_height="50.0dip" android:layout_marginTop="1.0dip" android:src="@drawable/ic_sysbar_lock" android:scaleType="center" systemui:keyCode="26" />[/COLOR]
    <com.android.systemui.statusbar.RotationToggle android:id="@id/rotation_lock_button" android:visibility="gone"

Remove red colored, then add green colored (status_bar_expanded) bottom

Code:
    <com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="horizontal" android:id="@id/close" android:background="@drawable/status_bar_close_on" android:layout_width="fill_parent" android:layout_height="wrap_content">
[COLOR="Red"]        <com.android.systemui.statusbar.phone.CarrierLabel android:gravity="center" android:id="@id/carrier" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <TextView android:textAppearance="@com.htc:style/title_secondary_m" android:ellipsize="end" android:gravity="center" android:id="@id/plmnLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@com.htc:style/title_secondary_m" android:ellipsize="end" android:gravity="center" android:id="@id/spnLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.phone.CarrierLabel>[/COLOR]
    </com.android.systemui.statusbar.phone.CloseDragHandle>
Code:
    <com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="horizontal" android:id="@id/close" android:background="@drawable/status_bar_close_on" android:layout_width="fill_parent" android:layout_height="wrap_content">
[COLOR="Green"]        <com.android.systemui.statusbar.policy.KeyButtonView android:gravity="center" android:id="@id/screen_lock_button" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="5.0dip" android:layout_marginBottom="5.0dip" android:src="@drawable/ic_sysbar_lock" android:scaleType="center" systemui:keyCode="26" />[/COLOR]
    </com.android.systemui.statusbar.phone.CloseDragHandle>

If you are running a ROM with signatures check enabled you'll need to do the following after you compiled your mod:
Drag META-INF folder and AndroidManifest.xml from stock SystemUI.apk to your modded SystemUI.apk.

How to make your own centered clock version
Because there are 24 versions to maintain now, i'll not add centered clock versions. I'll share with you how you can do it yourself easily.
This method doesn't cause SystemUI FC's when playing videos in landscape.
Assuming you know how to decompile and recompile SystemUI.apk, you'll need to open res\layout\status_bar.xml

Add green colored
Code:
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    [B][COLOR="Red"][COLOR="red"][COLOR="red"][COLOR="Green"]<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0">
        <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="@*android:color/white" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
    </LinearLayout>[/COLOR][/COLOR][/COLOR][/COLOR][/B]
    <ImageView android:id="@id/notification_lights_out" android:paddingLeft="6.0dip" 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" />

Remove red colored
Code:
    </LinearLayout>
[COLOR="Red"]    <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="@*android:color/white" 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" />[/COLOR]
</LinearLayout>

If you are running a ROM with signatures check enabled you'll need to do the following after you compiled your mod:
Drag META-INF folder and AndroidManifest.xml from stock SystemUI.apk to your modded SystemUI.apk.

Download links

Stock: Left, Center, Right, Bottom
Including battery %: Left, Center, Right, Bottom
Including battery % blue: Left, Center, Right, Bottom
Including AOSP style recent apps: Left, Center, Right, Bottom
Including AOSP style recent apps + battery %: Left, Center, Right, Bottom
Including AOSP style recent apps + battery % blue: Left, Center, Right, Bottom


 

Attachments

  • L.jpg
    L.jpg
    10.5 KB · Views: 1,901
  • C.jpg
    C.jpg
    10.4 KB · Views: 1,796
  • R.jpg
    R.jpg
    10.4 KB · Views: 1,773
  • B.jpg
    B.jpg
    32.9 KB · Views: 1,830
  • BC.jpg
    BC.jpg
    33.5 KB · Views: 1,689
  • BB.jpg
    BB.jpg
    44 KB · Views: 1,445
  • BBC.jpg
    BBC.jpg
    44.2 KB · Views: 1,437
  • Bottom.jpg
    Bottom.jpg
    10.2 KB · Views: 1,308
  • ARA.jpg
    ARA.jpg
    23.4 KB · Views: 1,336
Last edited:

hassan89

Senior Member
May 15, 2012
668
551
6f8rc5.png



First of all, i want to thank kurniawan77 for letting me port his brilliant mod. (Original mod)

The original mod was made for 4.2.1 AOKP ROM and because i found his mod brilliant, i started my first project, porting it to a 4.1.1 Sense 4+ ROM.
It took me a few hours to figure out what to do and understanding the changes i had to make. Now i can proudly present you my first ported mod.

Mod info

* Softbutton for Screen Off integrated in header of notification dropdown
* Longpress button and Power Menu shows up
* Resized time, date and icon margins so it looks better
* Based on 3.14.401.31 SystemUI
* Compatible with de-odexed and odexed ROMs
* 3 versions available: left,center or right


Download links: Left, Center, Right

Wow this is amazing :) Does this have battery percentage?
 
Last edited:
  • Like
Reactions: ♀Mivahe

hassan89

Senior Member
May 15, 2012
668
551
A tutorial for how to do this would be really helpful mate :) Using your logic we might be able to port all the notification bar toggles from AOSP roms . :good::good:
 

SeBoLeX

Senior Member
Sep 15, 2008
165
28
Wrocław
Thanks for your mod.

Im dreaming about one mod with this one, long press back button to kill app, APM and "Menu at Rosie" in one package :) That would be great.
 
Last edited:
  • Like
Reactions: ♀Mivahe

♀Mivahe

Member
Jan 10, 2013
42
89
Very Useful mod, thank you ^^

Thanks


Thanks, hope you enjoy my mod :cowboy:

Installed on OrDroid and not working :(

Sent from my HTC One X using Tapatalk 2

My mod is based on a stock SystemUI, it does not include all the benefits and tweaks from OrDroid ROM, which is probably the reason why it's not working for you, though it should theoretical work as mod and ROM share same base. You could try it again and wipe cache and dalvik cache after flashing my mod. If it fails again plz ask your ROM dev to include this mod compatible with his ROM. I don't have the time to make my mod compatible with every ROM. Hope you understand.

To all devs: if you want to include this in your ROM plz pm me so i can share my changes and make it a bit easier for you to include my mod.
 
  • Like
Reactions: ricsonrainer

♀Mivahe

Member
Jan 10, 2013
42
89
Because I am not satisfied afterwards changing the margins i'm going to upload new mods with stock margins. Sorry for the inconvinience!

edit: New mods ready to download!
edit: Added back battery % versions
 
Last edited:

Shoarma1998

Senior Member
Apr 3, 2008
819
108
Rotterdam
Seems like a very useful mod! i've posted this before, but still don't know if it is possible:

Do you know how I can achieve the following: I'm running exchange policy (mandatory at my company). I've got an 'screen off and lock' button installed. When I use this screen off button, I always have to fill in my pin number, even when set on 30 minutes... I don't want to use the exchange disabler (which are found often in aroma installers), but would like to be able to use the phone as with gingerbread (just press the off button on your homescreen, The current screen off buttons/widgets all have a delay of some seconds... which is anoying... I can imagine that this is an app related thing, but if you know if there's a value which can be altered for the 'time out', that would be awesome!

Is there a way to achieve this, of your knowing?

many thanks in advance.

cheers
 

Top Liked Posts

  • There are no posts matching your filters.
  • 32
    e71iqd.png


    First of all, a big thanks to kurniawan77 for letting me port his brilliant mod. (Original mod)

    333yj35.png



    Mod info

    4 versions regarding placement; left, center right and bottom
    All versions available with battery %
    All versions available with AOSP style recent apps (thanks hassan89)
    Based on 3.14.401.31 SystemUI.apk
    Compatible with de-odexed and odexed ROMs (3.14.xxx.xx)
    De-odexed and zipaligned
    Instant screen off button integrated in notification header or bottom
    Longpress button and APM / Power menu shows up

    Bottom version note:

    You can touch the bottom anywhere between the dots for instant screen off and power menu.
    Pressing the dots, left and right, will give you stock bottom behaviour.


    How to include this mod in your project
    Assuming you know how to decompile and recompile SystemUI.apk, you'll need to do following;

    Add ic_sysbar_lock.png to drawable-xhdpi
    Open ids.xml and add green colored
    Code:
        <item type="id" name="recent_inspect_item">false</item>
    [COLOR="Green"]    <item type="id" name="screen_lock_button">false</item>[/COLOR]
    </resources>

    Now you'll need to open status_bar_expanded_header.xml (left, center and right) or status_bar_expanded.xml (bottom)
    You may need to remove some margins depending your desired placement.

    Add green colored (status_bar_expanded_header) left, center or right

    Code:
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
        [COLOR="green"]<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/screen_lock_button" android:layout_width="50.0dip" android:layout_height="50.0dip" android:layout_marginTop="1.0dip" android:src="@drawable/ic_sysbar_lock" android:scaleType="center" systemui:keyCode="26" />[/COLOR]
        <com.android.systemui.statusbar.policy.Clock android:textSize="36.0dip" android:textColor="@*android:color/white" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10.0dip" android:singleLine="true" />

    Code:
        <com.android.systemui.statusbar.policy.Clock android:textSize="36.0dip" android:textColor="@*android:color/white" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10.0dip" android:singleLine="true" />
        [COLOR="green"]<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/screen_lock_button" android:layout_width="50.0dip" android:layout_height="50.0dip" android:layout_marginTop="1.0dip" android:src="@drawable/ic_sysbar_lock" android:scaleType="center" systemui:keyCode="26" />[/COLOR]
        <com.android.systemui.statusbar.policy.DateView android:id="@id/date" android:layout_width="0.0px" android:layout_height="wrap_content" android:layout_marginLeft="10.0dip" android:layout_marginRight="10.0dip" android:maxLines="2" android:layout_weight="1.0" android:lineSpacingExtra="0.0dip" style="@com.htc:style/title_secondary_m" />

    Code:
        <com.android.systemui.statusbar.policy.DateView android:id="@id/date" android:layout_width="0.0px" android:layout_height="wrap_content" android:layout_marginLeft="10.0dip" android:layout_marginRight="10.0dip" android:maxLines="2" android:layout_weight="1.0" android:lineSpacingExtra="0.0dip" style="@com.htc:style/title_secondary_m" />
        [COLOR="Green"]<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/screen_lock_button" android:layout_width="50.0dip" android:layout_height="50.0dip" android:layout_marginTop="1.0dip" android:src="@drawable/ic_sysbar_lock" android:scaleType="center" systemui:keyCode="26" />[/COLOR]
        <com.android.systemui.statusbar.RotationToggle android:id="@id/rotation_lock_button" android:visibility="gone"

    Remove red colored, then add green colored (status_bar_expanded) bottom

    Code:
        <com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="horizontal" android:id="@id/close" android:background="@drawable/status_bar_close_on" android:layout_width="fill_parent" android:layout_height="wrap_content">
    [COLOR="Red"]        <com.android.systemui.statusbar.phone.CarrierLabel android:gravity="center" android:id="@id/carrier" android:layout_width="fill_parent" android:layout_height="fill_parent">
                <TextView android:textAppearance="@com.htc:style/title_secondary_m" android:ellipsize="end" android:gravity="center" android:id="@id/plmnLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" />
                <TextView android:textAppearance="@com.htc:style/title_secondary_m" android:ellipsize="end" android:gravity="center" android:id="@id/spnLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" />
            </com.android.systemui.statusbar.phone.CarrierLabel>[/COLOR]
        </com.android.systemui.statusbar.phone.CloseDragHandle>
    Code:
        <com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="horizontal" android:id="@id/close" android:background="@drawable/status_bar_close_on" android:layout_width="fill_parent" android:layout_height="wrap_content">
    [COLOR="Green"]        <com.android.systemui.statusbar.policy.KeyButtonView android:gravity="center" android:id="@id/screen_lock_button" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="5.0dip" android:layout_marginBottom="5.0dip" android:src="@drawable/ic_sysbar_lock" android:scaleType="center" systemui:keyCode="26" />[/COLOR]
        </com.android.systemui.statusbar.phone.CloseDragHandle>

    If you are running a ROM with signatures check enabled you'll need to do the following after you compiled your mod:
    Drag META-INF folder and AndroidManifest.xml from stock SystemUI.apk to your modded SystemUI.apk.

    How to make your own centered clock version
    Because there are 24 versions to maintain now, i'll not add centered clock versions. I'll share with you how you can do it yourself easily.
    This method doesn't cause SystemUI FC's when playing videos in landscape.
    Assuming you know how to decompile and recompile SystemUI.apk, you'll need to open res\layout\status_bar.xml

    Add green colored
    Code:
    xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
        [B][COLOR="Red"][COLOR="red"][COLOR="red"][COLOR="Green"]<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0">
            <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="@*android:color/white" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
        </LinearLayout>[/COLOR][/COLOR][/COLOR][/COLOR][/B]
        <ImageView android:id="@id/notification_lights_out" android:paddingLeft="6.0dip" 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" />

    Remove red colored
    Code:
        </LinearLayout>
    [COLOR="Red"]    <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="@*android:color/white" 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" />[/COLOR]
    </LinearLayout>

    If you are running a ROM with signatures check enabled you'll need to do the following after you compiled your mod:
    Drag META-INF folder and AndroidManifest.xml from stock SystemUI.apk to your modded SystemUI.apk.

    Download links

    Stock: Left, Center, Right, Bottom
    Including battery %: Left, Center, Right, Bottom
    Including battery % blue: Left, Center, Right, Bottom
    Including AOSP style recent apps: Left, Center, Right, Bottom
    Including AOSP style recent apps + battery %: Left, Center, Right, Bottom
    Including AOSP style recent apps + battery % blue: Left, Center, Right, Bottom


    5
    Updated OP with optional battery % for all versions, hope you'll like it, enjoy! :cowboy:
    4
    Updated OP, added battery % blue for all versions, enjoy! :cowboy:
    4
    Seems like a very useful mod! i've posted this before, but still don't know if it is possible:

    Do you know how I can achieve the following: I'm running exchange policy (mandatory at my company). I've got an 'screen off and lock' button installed. When I use this screen off button, I always have to fill in my pin number, even when set on 30 minutes... I don't want to use the exchange disabler (which are found often in aroma installers), but would like to be able to use the phone as with gingerbread (just press the off button on your homescreen, The current screen off buttons/widgets all have a delay of some seconds... which is anoying... I can imagine that this is an app related thing, but if you know if there's a value which can be altered for the 'time out', that would be awesome!

    Is there a way to achieve this, of your knowing?

    many thanks in advance.

    cheers

    My mod doesn't let you fill in your pin every wake when screen off by softbutton and the delay is 0.0 seconds, when you touch the lock icon the srceen goes off immediately! Sounds like this mod is perfect for you :angel:
    4
    @ ♀Mivahe

    nice mod ... any plans for this mod with a jb blue battery ... i think it's more readable as the green battery

    I'll add blue battery % version but i'm not going to add any more, i really don't like coloring all those images. :D