5th October 2011, 11:53 AM
(Last edited by lidroid; 16th October 2011 at 05:56 PM .)
Member -
OP
Thanks Meter
403
Posts: 98
Join Date: May 2011
Location: Xi'an
DONATE TO ME
[GUIDE]How to add customizable 14 statusbar toggle buttons for samsung ROM
I rebuild status bar power button in samsung rom in my national day holiday, now it has 14 buttons now, include all samsung buttons, wifi, data connection, gps, flashlight, sound, auto rotation, bluetooth, brightness, screen timeout, lock screen, sync, reboot and power down. Actually early time I coded some of those function in LidroidToolbox, but not included them in status bar. I actually rebuilt it with java, not just mod of samli.
This code can adapt to samsung i9000/i9100/i897/t959/m110s etc. I will port this in my new rom. The flashflight will display a white and brightest activity when the camera without flashlight, for example i9000/i897/t959/m110s etc.
Next I will explain how to adapt it to samsung 2.3 rom. There are 3 attachments QuickPanelSettings.apk, LidroidSystemUI.apk and lidroid-res.apk.
1. Download LidroidSystemUI.apk and decompile it whit apktool, then you get LidroidSystemUI dir.
2. Decompile SystemUI.apk, copy LidroidSystemUI/smali/* into SystemUI/smali.
3. Modify SystemUI/AndroidManifeset.xml, add this code before </Application>
Code:
<activity android:name="com.lidroid.systemui.quickpanel.FlashlightActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:clearTaskOnLaunch="true"
android:configChanges="orientation|keyboardHidden"
android:launchMode="singleTask" />
if your model has flashlight, you can skip this step.
4. Open SystemUI/smali/com/android/systemui/status/StatusBarService.smali. Find(Ctrl + F) QuickSettingsView, locate fellow codes
Code:
const v7, 0x7f030002
invoke-static {p1, v7, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v3
check-cast v3, Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
.line 379
.local v3, qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
modify
Code:
const v7, 0x3030003
invoke-static {p1, v7, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v3
check-cast v3, Lcom/lidroid/systemui/quickpanel/PowerWidget;
.line 394
.local v3, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v3}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
5. Compile SystemUI with apktool, Sign it if you have modify AndroidManifest.xml. Push it into /system/app/
6. push lidroid-res.apk in /system/framework/, push QuickPanelSettings.apk in /system/app, reboot.
Simplicity, no need to modify layout, id and Strings which is painful. If you know how to do it, you will know how simple it is. Any android/rom developer can download this code and add more buttons.
Enjoy!
Attached Thumbnails
Attached Files
The Following 244 Users Say Thank You to lidroid For This Useful Post: [ Click to Expand ]
1 (16th November 2011),
02ranger (7th October 2011),
1wildcat1 (19th January 2012),
3r41nl33n (16th May 2013),
89luca89 (5th October 2011),
::indie:: (5th October 2011),
aalupatti (7th October 2011),
Ace9876 (30th December 2011),
adamsuail (5th July 2012),
adba (5th June 2012),
aDEO (15th October 2011),
Adi Aisiteru Reborn (11th April 2013),
Aeonit (15th March 2012),
ahmedelhofy (31st October 2012),
AldoSebastian (9th February 2012),
alexejtka4 (9th March 2013),
alkhafaf (19th July 2012),
Andersondj (16th May 2012),
andrewxu (26th November 2011),
Androidnow (21st February 2013),
angiotell (2nd August 2012),
ApriliaM3 (26th March 2012),
Ardroid-xda (4th January 2013),
Argael (7th June 2013),
Arkaeris (29th January 2013),
arkerio (29th March 2012),
ArxDroid (16th January 2012),
Asmy Yuh (17th June 2013),
avkrules (26th April 2012),
BarJei (12th May 2013),
behnameb7 (18th May 2012),
bigfau (1st February 2012),
bionic24 (30th May 2012),
bitblaster (13th January 2012),
Black synergy (7th December 2012),
BlackHoleSlam (1st April 2012),
bladesuk1 (20th February 2012),
BlueArc (30th August 2012),
bluestarr (21st February 2012),
BohArie (15th January 2013),
boldman78 (3rd November 2011),
brieuwers (12th November 2011),
brolee93 (2nd May 2012),
bryman27 (8th November 2011),
bullonwheels (17th November 2012),
bumslayer (7th September 2012),
Catchpen (3rd March 2012),
chasemyass (6th January 2012),
cheewaca (12th January 2012),
ChikiBujia (2nd November 2011),
cmdrfrog (31st January 2012),
Cristiano Matos (25th July 2012),
crt60 (18th March 2012),
D-dy (23rd November 2011),
D.O.C (5th October 2011),
DangKid (29th February 2012),
danny 92 (29th July 2012),
Dan_Brutal (29th February 2012),
dbts25 (6th January 2013),
dcsms (24th March 2012),
DDNV (15th October 2011),
Deadboy2201 (3rd July 2012),
Deadly (15th February 2013),
DeadSOL (30th December 2011),
deezhemi (19th May 2012),
Dhanu@xdadev (20th February 2013),
diddsen (9th February 2012),
didhiy (23rd March 2012),
Diliban (18th August 2012),
Dinhodroid (31st August 2012),
djenis (24th April 2012),
Doky73 (1st February 2012),
dwitherell (8th January 2012),
eddjanier143 (30th March 2012),
emannxperia (8th August 2012),
emroozi (25th May 2012),
ExNeoDev (27th April 2013),
eybee1970 (14th May 2012),
F4bioo (12th February 2012),
fchowla (5th October 2011),
felipevsw (13th January 2012),
ferzag (19th January 2012),
Filipm95 (28th March 2012),
fonuza (19th May 2012),
freidel1 (11th April 2013),
fuloplori (9th November 2011),
Gawis (7th October 2011),
geva28 (4th April 2012),
ghostbusted (22nd November 2012),
gila2 (25th January 2012),
Grakel (5th January 2013),
greencode (1st March 2013),
gs2usr (19th December 2012),
Hagarza (5th June 2012),
HenriFred (30th December 2011),
henslo (6th June 2013),
HotMykeul (20th November 2011),
howsleyd (7th January 2012),
id10terror (8th December 2011),
iJimaniac (18th February 2013),
Ikonomi (5th October 2011),
ImbaWind (28th March 2012),
isaruku (25th January 2012),
iTK (2nd September 2012),
jackpham (5th October 2011),
Jamison904 (30th May 2012),
janarthanan.v (1st August 2012),
Jarrick (23rd November 2011),
Jason93 (5th October 2011),
jdt352 (24th February 2012),
Jeanxito (25th May 2012),
jerryhou85 (15th January 2013),
jkakkanad (30th September 2012),
Jodelaplaya (9th October 2011),
jscott30 (4th June 2012),
Jsmokey (16th December 2011),
JKan Co (5th March 2013),
kahvitahra (10th October 2011),
KhadeR86 (14th January 2012),
kk9999gada (8th November 2012),
kmarci (27th June 2012),
kobellza (5th October 2011),
kolo200 (5th October 2011),
kuroneko20v (12th October 2011),
kyrillos13 (20th November 2012),
l0lh4rd (17th April 2013),
lactardjosh (13th February 2012),
ladygagaLITE (7th October 2011),
lavadepa (12th November 2012),
lazy_ursache (2nd November 2011),
lbyao (2nd June 2012),
leodasal2 (12th June 2012),
like-p (9th February 2012),
lildoggs (21st December 2011),
machotecba (22nd June 2012),
manoranjan2050 (28th May 2012),
mansoordk (30th March 2012),
MarcoToo (26th July 2012),
mayanks_098 (16th October 2011),
mccmjoon76 (18th January 2012),
memento.mori (12th October 2011),
menewtoroot (20th February 2013),
Mevordel (27th June 2012),
mohcivil (4th May 2013),
Mohinkx (1st June 2013),
MonacoHias (16th October 2011),
Mr.wssn (8th October 2011),
M_J_Nazari (8th October 2011),
Nakamichi (15th February 2012),
NaTHaN_GT5830 (26th December 2012),
neodarklink (18th February 2012),
nguyenxuanhoa (30th January 2012),
NickDunn (15th October 2011),
Nobuga (27th May 2012),
noobtoob (28th December 2012),
NunHugger (1st November 2011),
nuox (15th May 2013),
nvt992 (8th February 2012),
OS_Hacking (21st March 2013),
pabreu (11th November 2011),
pantrif13 (23rd December 2011),
pauldiddy (1st November 2011),
pepemosca (30th March 2012),
pepot (9th October 2011),
Perka (16th December 2011),
Peteragent5 (2nd July 2012),
physcodelic (27th July 2012),
pitchblack5691 (24th November 2012),
plwalsh88 (19th May 2012),
pnbpnb (6th November 2011),
powerpuff1978 (20th March 2012),
pratyush.creed (15th November 2011),
Prawesome (16th February 2012),
prototype-U (23rd July 2012),
pwneman (10th February 2012),
qkster (30th December 2011),
Qobok (29th October 2011),
Quallenauge (30th July 2012),
quocsan (15th January 2012),
rafalense (7th November 2011),
ragepekr (7th February 2012),
rajaspidey (17th January 2012),
rajrocks (12th April 2012),
Ramdan2478 (5th August 2012),
Rawat (8th October 2011),
raycaster3 (1st January 2012),
rbhitter (4th October 2012),
Ricardo_Is (2nd June 2012),
rjunraj (12th April 2013),
rogerscrack (11th February 2012),
ron194 (30th January 2012),
Rushing (5th February 2013),
ryan_joshua (5th June 2013),
Ryuinferno (8th October 2012),
s2d4 (6th October 2011),
SadHeroXIII (17th September 2012),
samsoul16 (27th June 2012),
SArnab©® (18th January 2013),
saszseb (22nd October 2011),
scrosler (10th August 2012),
serajr (7th February 2012),
sheen_bebe (10th March 2013),
Shinrow (17th October 2011),
shryau (27th March 2012),
Siberian Tiger (9th February 2012),
sicopat (15th October 2011),
SignalX (12th December 2011),
Silvane (3rd March 2012),
Siyamand (24th March 2012),
Sot0 (5th January 2013),
sucro (22nd September 2012),
SunnyOK (15th December 2011),
TAMIM2007 (29th October 2011),
Tank9 (15th April 2013),
tazman171 (6th June 2012),
thachtunganh (20th March 2012),
Ticklefish (16th July 2012),
toadlife (12th December 2011),
tossan (24th January 2012),
trailblazer101 (19th October 2012),
travmofosho (8th April 2012),
Tricky103 (12th October 2011),
Tweakecho (26th July 2012),
uncle.baze (19th March 2012),
vaibhavpatil192 (22nd December 2011),
vavas (16th October 2012),
vell1969 (20th November 2012),
vishwanathptl (23rd December 2011),
whocares2 (17th March 2012),
willtryall (16th May 2013),
wish777 (20th September 2012),
x-dira (31st December 2012),
xl VipeR lx (12th February 2012),
xtremesv (30th December 2011),
xXFacusXx (22nd April 2013),
xXx~~~SHLOK~~~xXx (20th July 2012),
yeshwanthvshenoy (22nd December 2012),
yeye.phone (13th November 2012),
yousephahmed (18th October 2011),
zabihjan (6th October 2011),
zachlevi (25th November 2011),
Zen Arcade (11th May 2012),
_dan (28th October 2012)
5th October 2011, 12:23 PM
Recognized Developer
Thanks Meter
1380
Posts: 1,186
Join Date: Apr 2010
Location: Terracina (LT)
DONATE TO ME
thank you very much for this work!
I will study the code and try to develop also new toggles
Little question, the java source (god bless you! I HATE Smali! xD) is about systemUI, what about lildroid-res.apk?
Is it only a "complementar" framework for icons and string for the toggles? Or whatelse?
Just curiosity and little question to better understand the project!
Thx!
If you like my work, you can buy me a coffe if you want
>>>
THE GingerMOD (AOSPized XXKG&) for SGS2!
>>>
THE FroyoMOD (AOSP) For Milestone <<<
>>>
ROM:EclairMOD v0.3b For Milestone <<<
>>>
Androidiani OpenRecovery by ME & Azhad For Milestone! <<<
Samsung Galaxy S2 i9100, Rom TheGingerMOD
Motorola Milestone, Rom TheFroyoMOD, 1,1ghz LV
Nokia n97mini IoEsisto v8 CFW
Nokia e51 hacked
Nokia n800 Maemo/Android 1.6
The Following 3 Users Say Thank You to 89luca89 For This Useful Post: [ Click to Expand ]
5th October 2011, 02:43 PM
Member -
OP
Thanks Meter
403
Posts: 98
Join Date: May 2011
Location: Xi'an
DONATE TO ME
Quote:
Originally Posted by
89luca89
thank you very much for this work!
I will study the code and try to develop also new toggles
Little question, the java source (god bless you! I HATE Smali! xD) is about systemUI, what about lildroid-res.apk?
Is it only a "complementar" framework for icons and string for the toggles? Or whatelse?
Just curiosity and little question to better understand the project!
Thx!
I compiled all required images, strings and layout that toggle buttons into lidroid-res.apk to make the future ROM transplant work easier and finish the new ROM's mod work faster.
The Following 12 Users Say Thank You to lidroid For This Useful Post: [ Click to Expand ]
Arkaeris (29th January 2013),
Chaplain Dennis (22nd March 2012),
diddsen (9th February 2012),
geva28 (4th April 2012),
ladygagaLITE (7th October 2011),
NickDunn (15th October 2011),
Qobok (6th November 2011),
ragepekr (7th February 2012),
rajrocks (19th April 2012),
Sean-El (25th November 2011),
travmofosho (8th April 2012),
uncle.baze (19th March 2012)
5th October 2011, 03:56 PM
Senior Member
Thanks Meter
137
Posts: 393
Join Date: Aug 2011
Location: Muscat
Screenshots please...
5th October 2011, 04:09 PM
RC - RT Committee / Senior Moderator / Recognized Developer - The Android Surgeon
Thanks Meter
3515
Posts: 2,921
Join Date: Jun 2006
DONATE TO ME
Nice bro....this is what we need.....nice
5th October 2011, 04:45 PM
Member -
OP
Thanks Meter
403
Posts: 98
Join Date: May 2011
Location: Xi'an
DONATE TO ME
Quote:
Originally Posted by
akbarhash
Screenshots please...
I have uploaded screenshots as attachment.
The Following 6 Users Say Thank You to lidroid For This Useful Post: [ Click to Expand ]
5th October 2011, 05:42 PM
(Last edited by kolo200; 5th October 2011 at 05:44 PM .)
Junior Member
Thanks Meter
0
Posts: 23
Join Date: Jan 2008
This way you can add a shortcut to the application?
I know silly question
thank you very much
sorry for my English
5th October 2011, 05:55 PM
Senior Member
Thanks Meter
137
Posts: 393
Join Date: Aug 2011
Location: Muscat
Quote:
Originally Posted by
lidroid
I have uploaded screenshots as attachment.
Thanks.
Tip: Home Button + Power Button = Screenshot.
The Following 2 Users Say Thank You to akbarhash For This Useful Post: [ Click to Expand ]
5th October 2011, 07:18 PM
(Last edited by ephumuris; 5th October 2011 at 07:34 PM .)
Senior Member
Thanks Meter
283
Posts: 2,684
Join Date: Dec 2008
Location: Hull
This is disgustingly good work i'm really impressed...
Hmm the line numbers don't seem to match on my rom stock ki3 does that matter?
Very hungry. I want Gingerbread.
Join GiffGaff and earn Payback yourself. The mobile network run by YOU.
Most Thanked In This Thread
13 [GUIDE] How to add customizable 15 statusbar toggle buttons on a Stock ICS LPQ ROM 12 (quote)
I compiled all
required … 6 (quote)
after many
tries I've made … 6 (quote)
I have uploaded
screenshots … 5 (quote) APM + CRT +
Battery Hack : …