Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Thread Closed

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

OP JsChiSurf

11th November 2010, 08:53 PM   |  #1  
JsChiSurf's Avatar
OP Recognized Developer
Hacksville
Thanks Meter: 1,256
 
2,334 posts
Join Date:Joined: Feb 2010
Donate to Me
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 . 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:



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:



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:



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 .

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):



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 by JsChiSurf; 17th December 2010 at 05:40 PM.
The Following 10 Users Say Thank You to JsChiSurf For This Useful Post: [ View ]
11th November 2010, 09:00 PM   |  #2  
chas123's Avatar
Senior Member
Thanks Meter: 501
 
431 posts
Join Date:Joined: Oct 2008
Donate to Me
Awesome work! If I install this will it delete your rosie remap mod?
11th November 2010, 09:01 PM   |  #3  
JsChiSurf's Avatar
OP Recognized Developer
Hacksville
Thanks Meter: 1,256
 
2,334 posts
Join Date:Joined: Feb 2010
Donate to Me
Quote:
Originally Posted by chas123

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...
Last edited by JsChiSurf; 11th November 2010 at 09:15 PM.
The Following User Says Thank You to JsChiSurf For This Useful Post: [ View ]
11th November 2010, 09:16 PM   |  #4  
EVOlvedAndroid's Avatar
Senior Member
Flag Los Angeles
Thanks Meter: 473
 
533 posts
Join Date:Joined: Oct 2010
More
Awesome, this is awesome.
11th November 2010, 09:23 PM   |  #5  
synisterwolf's Avatar
Recognized Contributor
Thanks Meter: 2,256
 
6,542 posts
Join Date:Joined: Sep 2010
More
Holy **** it works on my incredible!!!



I will be sending you a donation tonight! Awesome work man

Sent from my slutty assistant. (HTC incredible)
11th November 2010, 09:25 PM   |  #6  
JsChiSurf's Avatar
OP Recognized Developer
Hacksville
Thanks Meter: 1,256
 
2,334 posts
Join Date:Joined: Feb 2010
Donate to Me
Quote:
Originally Posted by synisterwolf

Holy **** it works on my incredible!!!

Wow, thanks for the confirmation. That's good to know. I'm a little surprised though, given the number of changes .
11th November 2010, 09:27 PM   |  #7  
Senior Member
Thanks Meter: 1
 
200 posts
Join Date:Joined: Nov 2009
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.
11th November 2010, 09:29 PM   |  #8  
JsChiSurf's Avatar
OP Recognized Developer
Hacksville
Thanks Meter: 1,256
 
2,334 posts
Join Date:Joined: Feb 2010
Donate to Me
Quote:
Originally Posted by MJStephens

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 by JsChiSurf; 11th November 2010 at 09:36 PM.
11th November 2010, 09:37 PM   |  #9  
Senior Member
Orlando, FL
Thanks Meter: 34
 
944 posts
Join Date:Joined: Sep 2010
Great job my friend. I am running Cyanogen and my favorite feature was the power control widget in there. Amazing work for getting this to work on Sense!
11th November 2010, 09:55 PM   |  #10  
Member
Thanks Meter: 0
 
42 posts
Join Date:Joined: Oct 2010
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.

Thread Closed Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes