[PORT][MOD][Deprecated] Notification Menu Power Control Widgets for Sense based ROMs

Status
Not open for further replies.
Search This thread
Jun 2, 2009
17
0
Update: This thread has been deprecated in favor of v2.0 with 4G toggle and other fixes. See Here for updated version.

As some of you who were following the progress thread know, over the past few weeks, I have been working on porting the CyanogenMod set of power control widgets, embedded into the notification window, over to Sense based ROMs (Fresh 3.4.0.1 is my base, confirmed working on fresh install, YMMV on other ROMS). While I hit a number of roadblocks, and while I've spent more time on this mod/port than I care to ever admit (I wouldn't be exaggerating in saying I probably have 100+ hours of dev time in this one), I am pleased to announce that Houston, we have lift-off :p. Thanks to the CyanogenMod team for the original creation that this is based upon.

So, what does this look like you say? Below is a screen shot of the default widgets that this mod comes with:

pc_widget_6_default.png


The 6 default widgets, from left-to-right are:

toggleGPS | toggleWifi | toggleBluetooth | toggleMobileData| toggleFlashlight | toggleSound

What's great about this mod, however, is that you can override this set of default widgets in favor of any of the 13 currently available widgets through a process I've built into the mod (explained later).

The power control bar allows for up to 6 different widgets to be specified. You can have less, but no more than 6. As mentioned, there are a total of 13 widgets that I've ported successfully so far. Here are a few more screen captures of the 7 remaining available widgets, shown in a set of 4, and a set of 3:

pc_widget_4.png


The 4 widgets, from left-to-right are:

toggleAirplane | toggleAutoRotate (disable landscape mode) | toggleBrightness (3 tiers) | toggleScreenTimeout (prevent screen from going black)

And the 3 remaining available widgets, from left-to-right are:

pc_widget_3.png


toggleSleepMode (put phone to sleep) | toggleSync | toggleLockScreen (disable lockscreen)

Take note of the naming convention I've used above for each widget. This is how Android, internally, is referencing each widget for use / display in the power control bar. This is important, since, as mentioned, you can override the 6 widgets this mod provides out of the box.

How you ask?

By creating a pipe delimited list (|) of widgets in a one-line text file named widget.txt, and dropping this file into the '/system/customize/' folder on your phone.

So, say you want your power control bar to contain 4 widgets for Airplane Mode, Wifi, Bluetooth, and Sync. You would create a one-line file using the following syntax:

Code:
toggleAirplane|toggleWifi|toggleBluetooth|toggleSync

Note: there CANNOT be any spaces between each widget defined, and the pipe delimiter is only placed between each instance, but not at the beginning or end. The syntax has to be EXACT, and case must match EXACTLY. If you have an error in your list, the slot / position where the error exists will result in an empty slot on your power control bar. If you fubar it bad enough, you'll probably bootloop your phone, so please use caution and check your work.

Once you've created your file, again, named widget.txt, all lower-case, using adb, push to your phone (the following commands assume your widget.txt file is in the same folder where you are issuing the adb commands):

Code:
adb remount
adb push widget.txt /system/customize/
adb reboot

Alternatively, drop your 'widget.txt' file on your sdcard, and use root explorer to copy the file to your clipboard, navigate to your '/system/customize/' folder, mount as r/w, paste the file in place, make sure permissions on the new file are set to 'read', at a minimum, and reboot.

If you are not comfortable with either of these options, post what you want in the thread, and I can whip up a flashable zip for you that will do the same, automatically.

Want to go back to the default widget setting? Simply rename or delete the 'widget.txt' file in your '/system/customize/' folder and reboot.

For your reference, when creating your 'widget.txt' file, here is the complete list of available widgets with correct syntax that you can copy / paste into your file (don't forget to pipe delimit them):

Code:
toggleAirplane
toggleAutoRotate
toggleBluetooth
toggleBrightness
toggleFlashlight
toggleGPS
toggleLockScreen
toggleMobileData
toggleScreenTimeout
toggleSleepMode
toggleSound
toggleSync
toggleWifi

FYI, I've added in toast notification messages when toggling WiFi and Bluetooth, so as to acknowledge your button press, as these two options take a bit to instantiate.

This port / mod involves massive edits to your framework files, including framework.jar, services.jar, and framework-res.apk. As such, by flashing this mod, you will undo most mods / themes you have applied to your phone. There is no choice in the matter. Consider this your new / base / stock set of framework files if you wish to use, and modify to incorporate your own themes / mods accordingly. Or, if you don't want to lose your customizations, wait for your ROM dev, or themer to grab this port as a starting point to apply their changes.

You CANNOT flash this mod to implement the power control widget, and then flash a theme back over top it, if the theme replaces the framework-res.apk file (most likely do), as it will likely completely bork your phone, resulting in bootloops, as the theme will partially undo this mod, resulting in breaking both the mod and your phone

If the theme is a MetaMorph file, assuming the MetaMorph does not change any of the XML or other files that this mod does, and only changes images, etc, you should be safe in applying.

It should be noted that in the framework files provided in the flashable zip at the end of this post, the following additional mods have been included by default in the services.jar & framework.jar file:

  • Allow for transparent notification menu background (xeudoxus & fxn)
  • Remove USB Debugging icon
  • Remove GPS off reticle icon, retain GPS on reticle
  • USB Tether Fix (Calkulin)
  • Browser back button FC Fix (aamikam)

Quirk: If you toggle on/off any of the settings you have specified in your widget bar via a mechanism other than the widget bar itself, the state of that icon may become out of sync with the actual state of the feature you have toggled. By either waiting for the change to be picked up, or simply toggling any widget in your power control bar, all icons will be immediately updated to reflect their correct state. This does not affect functionality in any way. Remember, this is a port, I didn't code this from source, that would have been much easier ;).

Download Notification Window Power Control Widget for Sense ROMs <--- Flash via Recovery*

*Since this replaces framework files, your initial boot will take some time. Please be patient and NANDROID before flashing. I've also seen it take 2 boots, rather than one, to come up fully after the initial install. This is a major rework to the included files and it is certainly possible that it is incompatible with your specific setup. YMMV.

**This is provided stock. If you want a different look, colors, icons, etc, this is up to you and/or your favorite dev to have at it :cool:.

EDIT: See Here if, after flashing the above, you want to apply the super circle battery mod shown here, and See Here if, after flashing the above, you want to apply the super rectangle battery mod shown here.

EDIT 2: See Here to apply battery or clock removal mods after flashing the above.

EDIT 3: Want it in RED instead of blue? See Here.

What I released above is stock, intentionally, to be consistent with the original design from CM. This can be themed and "prettied up" as desired. For example, here's what I've done for my own phone to "buttonize" each widget and add a little more height / spacing between each (icons courtesy of djmcnz):

pc_buttons_crop.png


Download Buttonized Notification Window Power Control Widget for Sense ROMs <--- Flash via Recovery

Want buttonized with super circle? Flash the above, then See Here.
Hey, I"m wondering if you can help me? : ) I have this on my rooted G1 and LOVE it. I recently got a G2 (unrooted for now) and would love to put it on, is there any way or do you know of any other app that does this? I've searched for a few days now and cant seem to find anything thing but, I might have missed it?

Thanks for your time~
Julie
 

rudie del rude

New member
Feb 4, 2011
2
0
This was one of my favorite parts of cyanogen. I can't get this to work though, I've got a blank square where the power controls should be, and I've got the widgets.txt file in the resources folder. Any ideas? I've got HTC sense frozen in titanium backup, I tried unfreezing it thinking that might be messing with it, rebooted and it still doesnt work.
 
This was one of my favorite parts of cyanogen. I can't get this to work though, I've got a blank square where the power controls should be, and I've got the widgets.txt file in the resources folder. Any ideas? I've got HTC sense frozen in titanium backup, I tried unfreezing it thinking that might be messing with it, rebooted and it still doesnt work.

If I'm not mistaken, the widget.txt file is supposed to be in the "customize" folder, not "resources". That's probably the issue right there.
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    Update: This thread has been deprecated in favor of v2.0 with 4G toggle and other fixes. See Here for updated version.

    As some of you who were following the progress thread know, over the past few weeks, I have been working on porting the CyanogenMod set of power control widgets, embedded into the notification window, over to Sense based ROMs (Fresh 3.4.0.1 is my base, confirmed working on fresh install, YMMV on other ROMS). While I hit a number of roadblocks, and while I've spent more time on this mod/port than I care to ever admit (I wouldn't be exaggerating in saying I probably have 100+ hours of dev time in this one), I am pleased to announce that Houston, we have lift-off :p. Thanks to the CyanogenMod team for the original creation that this is based upon.

    So, what does this look like you say? Below is a screen shot of the default widgets that this mod comes with:

    pc_widget_6_default.png


    The 6 default widgets, from left-to-right are:

    toggleGPS | toggleWifi | toggleBluetooth | toggleMobileData| toggleFlashlight | toggleSound

    What's great about this mod, however, is that you can override this set of default widgets in favor of any of the 13 currently available widgets through a process I've built into the mod (explained later).

    The power control bar allows for up to 6 different widgets to be specified. You can have less, but no more than 6. As mentioned, there are a total of 13 widgets that I've ported successfully so far. Here are a few more screen captures of the 7 remaining available widgets, shown in a set of 4, and a set of 3:

    pc_widget_4.png


    The 4 widgets, from left-to-right are:

    toggleAirplane | toggleAutoRotate (disable landscape mode) | toggleBrightness (3 tiers) | toggleScreenTimeout (prevent screen from going black)

    And the 3 remaining available widgets, from left-to-right are:

    pc_widget_3.png


    toggleSleepMode (put phone to sleep) | toggleSync | toggleLockScreen (disable lockscreen)

    Take note of the naming convention I've used above for each widget. This is how Android, internally, is referencing each widget for use / display in the power control bar. This is important, since, as mentioned, you can override the 6 widgets this mod provides out of the box.

    How you ask?

    By creating a pipe delimited list (|) of widgets in a one-line text file named widget.txt, and dropping this file into the '/system/customize/' folder on your phone.

    So, say you want your power control bar to contain 4 widgets for Airplane Mode, Wifi, Bluetooth, and Sync. You would create a one-line file using the following syntax:

    Code:
    toggleAirplane|toggleWifi|toggleBluetooth|toggleSync

    Note: there CANNOT be any spaces between each widget defined, and the pipe delimiter is only placed between each instance, but not at the beginning or end. The syntax has to be EXACT, and case must match EXACTLY. If you have an error in your list, the slot / position where the error exists will result in an empty slot on your power control bar. If you fubar it bad enough, you'll probably bootloop your phone, so please use caution and check your work.

    Once you've created your file, again, named widget.txt, all lower-case, using adb, push to your phone (the following commands assume your widget.txt file is in the same folder where you are issuing the adb commands):

    Code:
    adb remount
    adb push widget.txt /system/customize/
    adb reboot

    Alternatively, drop your 'widget.txt' file on your sdcard, and use root explorer to copy the file to your clipboard, navigate to your '/system/customize/' folder, mount as r/w, paste the file in place, make sure permissions on the new file are set to 'read', at a minimum, and reboot.

    If you are not comfortable with either of these options, post what you want in the thread, and I can whip up a flashable zip for you that will do the same, automatically.

    Want to go back to the default widget setting? Simply rename or delete the 'widget.txt' file in your '/system/customize/' folder and reboot.

    For your reference, when creating your 'widget.txt' file, here is the complete list of available widgets with correct syntax that you can copy / paste into your file (don't forget to pipe delimit them):

    Code:
    toggleAirplane
    toggleAutoRotate
    toggleBluetooth
    toggleBrightness
    toggleFlashlight
    toggleGPS
    toggleLockScreen
    toggleMobileData
    toggleScreenTimeout
    toggleSleepMode
    toggleSound
    toggleSync
    toggleWifi

    FYI, I've added in toast notification messages when toggling WiFi and Bluetooth, so as to acknowledge your button press, as these two options take a bit to instantiate.

    This port / mod involves massive edits to your framework files, including framework.jar, services.jar, and framework-res.apk. As such, by flashing this mod, you will undo most mods / themes you have applied to your phone. There is no choice in the matter. Consider this your new / base / stock set of framework files if you wish to use, and modify to incorporate your own themes / mods accordingly. Or, if you don't want to lose your customizations, wait for your ROM dev, or themer to grab this port as a starting point to apply their changes.

    You CANNOT flash this mod to implement the power control widget, and then flash a theme back over top it, if the theme replaces the framework-res.apk file (most likely do), as it will likely completely bork your phone, resulting in bootloops, as the theme will partially undo this mod, resulting in breaking both the mod and your phone

    If the theme is a MetaMorph file, assuming the MetaMorph does not change any of the XML or other files that this mod does, and only changes images, etc, you should be safe in applying.

    It should be noted that in the framework files provided in the flashable zip at the end of this post, the following additional mods have been included by default in the services.jar & framework.jar file:

    • Allow for transparent notification menu background (xeudoxus & fxn)
    • Remove USB Debugging icon
    • Remove GPS off reticle icon, retain GPS on reticle
    • USB Tether Fix (Calkulin)
    • Browser back button FC Fix (aamikam)

    Quirk: If you toggle on/off any of the settings you have specified in your widget bar via a mechanism other than the widget bar itself, the state of that icon may become out of sync with the actual state of the feature you have toggled. By either waiting for the change to be picked up, or simply toggling any widget in your power control bar, all icons will be immediately updated to reflect their correct state. This does not affect functionality in any way. Remember, this is a port, I didn't code this from source, that would have been much easier ;).

    Download Notification Window Power Control Widget for Sense ROMs <--- Flash via Recovery*

    *Since this replaces framework files, your initial boot will take some time. Please be patient and NANDROID before flashing. I've also seen it take 2 boots, rather than one, to come up fully after the initial install. This is a major rework to the included files and it is certainly possible that it is incompatible with your specific setup. YMMV.

    **This is provided stock. If you want a different look, colors, icons, etc, this is up to you and/or your favorite dev to have at it :cool:.

    EDIT: See Here if, after flashing the above, you want to apply the super circle battery mod shown here, and See Here if, after flashing the above, you want to apply the super rectangle battery mod shown here.

    EDIT 2: See Here to apply battery or clock removal mods after flashing the above.

    EDIT 3: Want it in RED instead of blue? See Here.

    What I released above is stock, intentionally, to be consistent with the original design from CM. This can be themed and "prettied up" as desired. For example, here's what I've done for my own phone to "buttonize" each widget and add a little more height / spacing between each (icons courtesy of djmcnz):

    pc_buttons_crop.png


    Download Buttonized Notification Window Power Control Widget for Sense ROMs <--- Flash via Recovery

    Want buttonized with super circle? Flash the above, then See Here.
    3
    Oh no come on. Who's our favorite dev? You are! The entire evo board, and I'm going to guess the entire world, waits on your releases. Everything you give us is so ground breaking that it makes us wonder why HTC makes money off this and you only do it as a hobby. Keep doing what youre doing and make the world a better place! Go JsChiSurf!

    P.S. no homo! :)

    Swyped from my HTC Evo 4G on the MetroPCS 1X network!
    Thanks man. I honestly think I needed that. It gets a little old when you spend countless hours on stuff, and rather than a thank you, you get whiners and complainers instead...

    Back on topic, I have huge news that I am going to incorporate into the 4G release, whenever the hell I get to this.

    I have that widget bar automatically updating / refreshing each time the notification panel is opened & closed, meaning all buttons in my testing, be it a change in volume to vibrate from the widget, then silent via the rocker bar, or wifi enabled via the widget, and disabled via system settings, etc, are now reflecting their current state (update happens extremely quick, before you can usually see the widgets) accurately as a result of this change.
    2
    FYI, spent this morning moving my borrowed 4G toggle classes (I stole GPS toggle and overwrote with 4G methods to test) to their own new set of classes, etc, and got all of that working so that a new 'toggleWimax' string will instantiate 4G toggle in the widget bar.

    So, I've packaged all this up into the current framework and have flashed and am testing now. A few minor issues to work out, mostly related to having to back out some of my own custom modifications to the services.jar file that should not be there. It's certainly feasible something may slip through, but I'm sure you all will let me know :)

    I hope to release this today / tonight, and then will move on to the latest OTA based off the soon to be released Fresh ROM. This puts a delay on me being able to release the customization settings apk next, but that will come down the line, after the port to the new OTA.

    What is honestly taking me the longest right now is getting the new 4G icon to display nicely, in both states, on various background colors in the status bar window. I prefer coding, not graphical editing!

    Stay tuned...
    1
    Awesome work! If I install this will it delete your rosie remap mod?
    This will have no affect on Rosie at all. Give it a shot and let me now how it goes...
    1
    I was hoping someone could help me with this...

    I am trying to replace the Super Circle (Version A, I think) found here with Version C found here but am having trouble.

    I went to res/drawable-hdpi and replaced the stat_sys_battery_0.png through stat_sys_battery_100.png files and the stat_sys_battery_charge_anim_0.png through stat_sys_battery_charge_animfull.png files from a fully working UOT framework. It was a direct swap with one exception. The original framework file had 3 additional .png images (stat_sys_battery_charge_anim3b, stat_sys_battery_charge_anim6b and stat_sys_battery_charge_anim10b). I just deleted those images (which I think must have something to do with my problem)

    Everything is fine when the phone is not charging, but when I charge it through my USB the battery icon disappears.

    Any thoughts on what else I might need to swap out to make it work? Any help would be greatly appreciated.

    There is a file stat_sys_battery_charge.xml files in the drawable folder that is looking for those 3 additional png files.