• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

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

Status
Not open for further replies.
Search This thread

JsChiSurf

Inactive Recognized Developer
Feb 5, 2010
2,416
1,396
Hacksville
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.
 
Last edited:

MJStephens

Senior Member
Nov 15, 2009
200
1
Dude.....this is fantastic. I'm running Calkulins EViO 1.5.1 and it installed and is running great. I had actually installed the clear lockscreen on my ROM, which also had changed some icons on the notification bar. When I installed this it looks like it left the clear lockscreen in tact but changed the notification bar icons.....which is actually great. I like these icons much better. Anyways, I'm actually pretty happy with the stock toggle selections so I dont know if I'll be creating my own file and pushing it tonight, but either way I think you did a fantastic job.
 

JsChiSurf

Inactive Recognized Developer
Feb 5, 2010
2,416
1,396
Hacksville
Dude.....this is fantastic. I'm running Calkulins EViO 1.5.1 and it installed and is running great. I had actually installed the clear lockscreen on my ROM, which also had changed some icons on the notification bar. When I installed this it looks like it left the clear lockscreen in tact but changed the notification bar icons.....which is actually great. I like these icons much better. Anyways, I'm actually pretty happy with the stock toggle selections so I dont know if I'll be creating my own file and pushing it tonight, but either way I think you did a fantastic job.
Great, thanks for the additional confirmation. This is a huge mod, so I'm feeling better knowing people are having success on different ROMs.

I tried to specify the default widgets that would be the most commonly used, so the customize option is there just for those who have a specific preferences...Plus, it's just fun to switch it up as well :).
 
Last edited:

bigfudge

Member
Oct 9, 2010
42
0
Just flashed over VirusAnthrax ROM. Other than the notification bar going back to stock and my lock screen now displaying "John's Phone" everything is normal. I can fix the banner with the method from your other posts no problem. Do you think notification menu/battery mods will break the Power Control feature? I guess I could just flash and find out.
 

TheMagicalSock

Senior Member
Aug 16, 2010
167
3
Brilliant stuff. If I weren't running Myn's Warm I would be all over this; I like my black notification bar. Really awesome work, though.

Sent from my PC36100 using XDA App
 

JsChiSurf

Inactive Recognized Developer
Feb 5, 2010
2,416
1,396
Hacksville
Yes. An as mentioned in the OP, this will undo your themes. I think it was pretty clear. Now, in terms of the lockscreen, my bad. As soon as I get home i'll fix that. Thanks for the heads up.

Sent from my PC36100 using XDA App
 

MJStephens

Senior Member
Nov 15, 2009
200
1
So I just flashed this over my STOCK EViO 1.5.1 ROM and it changed all the notification bar icons EXCEPT the GPS and "EvDo" (3G) icons........which are the 2 that I hate, lol. And is this supposed to have numbers on the battery icon? Because mine doesnt. Also, my lockscreen still reads "MJ's EVO" I wonder if mine retained that since I had already modified it with CDMA workshop. Either way, I think playing with this is going to occupy my evening until my wife gets home, lol.
 

bigfudge

Member
Oct 9, 2010
42
0
Ya, thought it was funny when my phone booted to the lockscreen and it said John's Phone. Id much rather have this than an android about the bottom of my notification tray, just hoping I can get a battery with %. Ill just flash some mods and see what happens. Either way, amazing work and in record time. You are dedicated to your craft and the Evo community is a greater place because of it.
 
S

signals23

Guest
Simply amazing Js. I can't believe you rewrote an entire smali file.... I get headaches from smali files. :) Once I go HDPI, I will be adding this and sending you a donation!
 

bigfudge

Member
Oct 9, 2010
42
0
The 4G toggle he said he was going to start worrying about AFTER the official launch of this mod. So, since this is the official launch, I suspect he will begin working on that soon (might be doing it as I type this).

Cant wait til he adds the 4G toggle though :p Currently using Widgetsoid, latest update added a functional 4G toggle to the switcher widget.
 
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.