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

Search This thread

Shoarma1998

Senior Member
Apr 3, 2008
819
108
Rotterdam
Yes it is possible but not easy to use. Really, try it yourself. Touch the status bar twice, like a double mouse click, at same place were button is (L,C,R). At the first touch, move your finger just enough down the status bar to lower it, then press again. Remember, like a double mouse click. I'm using the right one, which works best en fastest for me.



systemui:keyCode="26"

Hi Mihave! Your mod rocks! but I've got a question though... Is the value you mention also for the time-out of 'screen off' apps... It would be awesome to have a button (app or widget) on my homescreen, which doesn't have a time period before the screen turns off?... is this possible?
 

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