Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
wanam
Old
(Last edited by wanam; 8th September 2012 at 01:30 PM.)
#1  
wanam's Avatar
Recognized Developer - OP
Thanks Meter 13790
Posts: 3,493
Join Date: Jan 2011
Location: Temara
Cool [How To] Add Customizable 15 Statusbar Toggle Buttons to ICS Roms

A new Jelly bean how to was posted here.

This mod was built by Lidroid so all credits goes to him
.




Lidroid ported his toggles to LF2 Roms, but sadly it depend on his toolbox framework.

I managed to get the needed packages from his framework, i included all toggles source code in SystemUI, to make it easy to port on next updates.

Let start, you need to decompile SystemUI.apk (use my repacked Apk_Manager if you get any issue with ICS files).
  • Edit "SystemUI.apk\res\layout\tw_status_bar_expanded.xm l" and make these changes, this will hide the stock status bar and use the new one:
Code:
-- <HorizontalScrollView  android:id="@id/quicksetting_scroller"  android:scrollbars="none"  android:layout_width="wrap_content"  android:layout_height="wrap_content"
++ <com.wanam.systemui.quickpanel.PowerWidget   android:id="@id/exp_power_stat" android:layout_width="fill_parent"   android:layout_height="wrap_content" />
++ <HorizontalScrollView android:id="@id/quicksetting_scroller"   android:visibility="gone" android:scrollbars="none"   android:layout_width="wrap_content" android:layout_height="wrap_content"
  • Edit "SystemUI.apk\res\values\ids.xml" and add this Id:
Code:
++ <item type="id" name="exp_power_stat">false</item>
  • Edit "SystemUI.apk\smali\com\android\systemui\statusbar \phone\PhoneStatusBar.smali" and make these changes :
Code:
.field mPostCollapseCleanup:Ljava/lang/Runnable;

++ .field mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;

.field mQueueLock:Ljava/lang/Object;
Method "addIcon" :
Code:
invoke-virtual {v1, v0, p3,  v2},   Landroid/widget/LinearLayout;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V

++ iget-object v1, p0,   Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;

++ invoke-virtual {v1}, Lcom/wanam/systemui/quickpanel/PowerWidget;->updateWidget()V

    return-void
Method "makeStatusBarView"
Code:
iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;

++ const v18, 0x7f0f00d9

++ move/from16 v0, v18

++ invoke-virtual {v6, v0}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;

++ move-result-object v18

++ check-cast v18, Lcom/wanam/systemui/quickpanel/PowerWidget;

++ move-object/from16 v0, v18

++ move-object/from16 v1, p0

++ iput-object v0, v1,   Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;

sget-boolean v18, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->useTouchWizGUI:Z
Code:
iput-boolean v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mUseStatusBarMarquee:Z

invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->tw_loadNotificationShade()V

++ move-object/from16 v0, p0

++ iget-object v0, v0,   Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;

++ invoke-virtual {v0}, Lcom/wanam/systemui/quickpanel/PowerWidget;->setupWidget()V

return-object v13
Extract attached "wanam.zip" and copy "wanam" folder to your "SystemUI.apk\smali\com".

That's all, recompile your SystemUI.

After building, make sure your Id "exp_power_stat" got the public id "0x7f0f00d9", if you got a different Id, change the public Id in the "makeStatusBarView" method.

Download this file , you need to copy Toggle buttons resources "lidroid-res.apk" to "system/framework", and "QuickPanelSettings.apk" to "/system/app" (with permissions 644) to customize your toggles.

You will need to mod lidroid-res.apk to get rid of "WanamLite Rom" label while trying to reboot, i posted a how to here .
Attached Files
File Type: zip wanam.zip - [Click for QR Code] (52.4 KB, 1636 views)
WanamLite Roms :
Adam Kernel :
App : Language Enabler
Blog : WanamLite.com
Follow : GooglePlus, FaceBook - Twitter

The Following 45 Users Say Thank You to wanam For This Useful Post: [ Click to Expand ]
 
Cristiano Matos
Old
#2  
Cristiano Matos's Avatar
Senior Member
Thanks Meter 2164
Posts: 1,260
Join Date: Feb 2012
Location: Rio Bonito
Nice Wanam!

Thank you for sharing stuffs so cool like that.

A really great developer you are.
Google Nexus 4
crDroid AOSP [4.2.2][CM10.1 + Features]


Galaxy S3 i9300
crDroid v17.1 XXEMC3 [AROMA]



Think i helped you? hit thanks!

-------------------------------
PayPal Donate
-------------------------------

 
::indie::
Old
#3  
::indie::'s Avatar
Recognized Developer
Thanks Meter 27479
Posts: 4,634
Join Date: May 2010
Thank you for porting lidroids mod wanam,
and thank you for sharing with us!

Great job as always
::indie's:: Omega Roms Series
Omega Files Pro app - Build and Customize your rom the way you like it!!
Samsung Galaxy S4 Samsung based I9505 - Samsung based I9500
Samsung Galaxy Note II N7100: Samsung based JB 4.1.2
Samsung Galaxy S III I9300: Samsung based: JB 4.1.2 - Omega AOKP - Android 4.2.2
Samsung Galaxy S II I9100 Android 4.1.2 - Android 4.2.2 AOKP
Samsung Galaxy Note 10.1: Samsung based JB 4.1.2
HTC HD2 + Tmous HD2 - Omega v30 - WM6.5.x Build 29022
:: User Friendly Developer ::

If you like my work please consider a donation!
Please use Omegas Threads for Support and Suggestions and don't sent me pm's!

The Following 2 Users Say Thank You to ::indie:: For This Useful Post: [ Click to Expand ]
 
sangosnip69
Old
#4  
sangosnip69's Avatar
Senior Member
Thanks Meter 347
Posts: 566
Join Date: Dec 2010
Location: Lyon

 
DONATE TO ME
Very nice work wanam!
Developer of SaNgO Vizion



If I've helped you, please press the thanks button!
This encourage me to continue my work!
 
GadgetCheck
Old
#5  
GadgetCheck's Avatar
Retired Forum Moderator / Recognized Developer
Thanks Meter 5203
Posts: 3,123
Join Date: Sep 2010
Location: India,Kerala,Trivandrum (God's own Country)
Already added it

Sent from my GT-I9300 using Tapatalk 2

www.checkrom.com
Where support gets refined as social networking
Founder and Developer of CheckROM™ for Samsung Phone's
 
m33ts4k0z
Old
#6  
Senior Member
Thanks Meter 72
Posts: 270
Join Date: Jul 2011
Location: Örebro
Hi wanam!

I'm using this mod along with your latest ROM. There is a minor issue regarding the Wifi/Data toggle.

It looks like when wifi is connected (it does work when WiFi is on but not connected), the data icon doesnt refresh when you toggle it. I think the problem is just that it doesn't refresh since it seems that it does respond to the toggle itself.

Any ideas?

Thanks in advance
 
gh.rohit
Old
#7  
gh.rohit's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 3394
Posts: 5,872
Join Date: Oct 2011
Location: Mumbai

 
DONATE TO ME
You are awesome
-------------------------------------------------------------------------------
My ROMs:-
For S2 :- RGUI_NDT MIUI | For S3 :- RGUI ROM
For S3 :- MIUI-INDIA ROM
| Note 2:- MIUI-INDIA ROM
Xtreamer Aiki 5":- Xtreamer Mobile Aiki 5" | Xtreamer Aiki 4":- Xtreamer Mobile Aiki 4"

-------------------------------------------------------------------------------

-------------------------------------------------------------------------------

www.rgui.net | www.miui-india.in
www.xtreamermobile.com

DONT PM ME FOR QUESTIONS RELATED TO ROM, Ask in thread
 
wanam
Old
#8  
wanam's Avatar
Recognized Developer - OP
Thanks Meter 13790
Posts: 3,493
Join Date: Jan 2011
Location: Temara
Quote:
Originally Posted by m33ts4k0z View Post
Hi wanam!

I'm using this mod along with your latest ROM. There is a minor issue regarding the Wifi/Data toggle.

It looks like when wifi is connected (it does work when WiFi is on but not connected), the data icon doesnt refresh when you toggle it. I think the problem is just that it doesn't refresh since it seems that it does respond to the toggle itself.

Any ideas?

Thanks in advance
I can't reproduce it now, but yes i used to get this issue sometimes with these toggles on my Galaxy S2, does it freeze too from the data ON/OFF settings?

I will investigate later.
WanamLite Roms :
Adam Kernel :
App : Language Enabler
Blog : WanamLite.com
Follow : GooglePlus, FaceBook - Twitter

 
m33ts4k0z
Old
#9  
Senior Member
Thanks Meter 72
Posts: 270
Join Date: Jul 2011
Location: Örebro
Quote:
Originally Posted by wanam View Post
I can't reproduce it now, but yes i used to get this issue sometimes with these toggles on my Galaxy S2, does it freeze too from the data ON/OFF settings?

I will investigate later.
Hi and thanks for your fast answer.

Actually it does toggle normally in the settings while using the bar's toggle button. It's just that the icon on the bar doesnt refresh. I flashed your 1.3 ROM over your 1.2 without wipe. Can this cause the issue?
 
djase
Old
#10  
djase's Avatar
Senior Member
Thanks Meter 82
Posts: 610
Join Date: May 2010
Location: Orléans - FRANCE -
Quote:
Originally Posted by ::indie:: View Post
Thank you for porting lidroids mod wanam,
and thank you for sharing with us!

Great job as always
waiting for omega v6.1 lol

 
Post Reply+
Tags
15 toggle, bar, customize, lidroid, status
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...