[Guide]4.2.2 Statusbar For Jellybean 4.1.2 Roms [COOL][JB]

Search This thread

SpaceCaker

Senior Member
Mar 26, 2011
13,545
10,904
netherlands
www.youtube.com
How to add 4.2.2 Statusbar to youre Jellybean rom :D

In this guide i will show u how to add 4.2.2 statusbar


Note:!!!!!!!
If u are new to modifying apps Dont try this Please.. u must know how to mod first before u gonna try as u will definetly end up in some errors or possible FCs
Read the thread/OP/first 1/2 posts FULLY! if u dont read it fully i wont provide support as u are to lazy to even read in the first place. if u read full 1st page i can help u
do add logcats if FC * how to do this is also described here!*. Thanks

Next is
Statusbar.xml

make sure it looks like this below

Code:
 <?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/status_bar_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <com.android.systemui.statusbar.StatusBarServiceLRPull android:layout_width="fill_parent" android:layout_height="wrap_content">
        <ImageView android:id="@id/notification_lights_out" android:paddingLeft="6.0dip" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" />
        <LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <LinearLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
                <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
                <com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
            </LinearLayout>
            <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
            <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
                <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
                <TextView android:layout_gravity="left|center" android:id="@id/battery_text" android:paddingLeft="4.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_settings_settings_button" android:singleLine="true" style="@style/StatusBarNotificationText" />
                <ImageView android:id="@id/battery" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            </LinearLayout>
            <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="@touchwiz:dimen/tw_softkey_textsize_singleline" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
        </LinearLayout>
    </com.android.systemui.statusbar.StatusBarServiceLRPull>
    <LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
        </ImageSwitcher>
        <com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.phone.TickerView>
    </LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>


Now we are going to modify
Status_bar_expanded.xml

Make sure it looks something like this


Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/notification_panel" android:background="@drawable/notification_panel_bg" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network" android:gravity="center" android:layout_gravity="bottom" android:id="@id/carrier_label" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="@dimen/carrier_label_height" android:layout_marginBottom="@dimen/close_handle_height" />
    <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
        <include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
        <include layout="@layout/brightness" />
        <TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network.EmergencyOnly" android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />
        <ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:overScrollMode="ifContentScrolls">
            <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_row_min_height" />
        </ScrollView>
    </LinearLayout>
    <com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="vertical" android:id="@id/close" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height">
        <ImageView android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height" android:src="@drawable/status_bar_close" android:scaleType="fitXY" />
    </com.android.systemui.statusbar.phone.CloseDragHandle>
</FrameLayout>

change it to

RED - Add BLUE - moved


Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/notification_panel" android:background="@drawable/notification_panel_bg" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">      
	[COLOR="Blue"]<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
	    <include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
	</LinearLayout>[/COLOR]
	<TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network" android:gravity="center" android:layout_gravity="bottom" android:id="@id/carrier_label" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="@dimen/carrier_label_height" android:layout_marginBottom="@dimen/close_handle_height" />	
	[COLOR="red"]<com.spacecaker.SpaceLayOut android:layout_width="fill_parent" android:layout_height="fill_parent">[/COLOR] 
	  [COLOR="Red"]<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <include layout="@layout/quickpanel_quick_settings_space" />
      </LinearLayout>[/COLOR]
	<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" [COLOR="red"]android:layout_marginTop="@dimen/notification_panel_header_height"[/COLOR] android:layout_marginBottom="@dimen/close_handle_underlap">       
        <TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network.EmergencyOnly" android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />
        <ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:overScrollMode="ifContentScrolls">
            <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_row_min_height" />
        </ScrollView>
    </LinearLayout>
	[COLOR="red"]</com.spacecaker.SpaceLayOut>[/COLOR]
    <com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="vertical" android:id="@id/close" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height">
        <ImageView android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height" android:src="@drawable/status_bar_close" android:scaleType="fitXY" />
    </com.android.systemui.statusbar.phone.CloseDragHandle>
</FrameLayout>

What i have done is adding new
Code:
<com.spacecaker.SpaceLayOut android:layout_width="fill_parent" android:layout_height="fill_parent"> 
</com.spacecaker.SpaceLayOut>
lines + use other xml to load Quickpanel and JB header
to make it look much cleaner


Next up is moddifying
StatusBar_Expanded_Header.xml

RED - Add BLUE - moved

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:background="@drawable/notification_header_bg" android:layout_width="fill_parent" android:layout_height="wrap_content"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">   
       <View android:background="@drawable/status_bar_hr" android:layout_width="fill_parent" android:layout_height="2.0dip" android:visibility="gone" />
    <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:background="@drawable/notification_header_bg" android:layout_width="fill_parent" android:layout_height="52.0dip" android:baselineAligned="false">
        <ImageView android:id="@id/quickpanelsettings_button" android:paddingLeft="5.0dip" android:paddingRight="5.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quickpanelsettings" android:layout_alignParentLeft="true" />
        <ImageView android:id="@id/quicksettings_button" android:paddingLeft="5.0dip" android:paddingRight="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:layout_alignParentLeft="true" />
        <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" android:id="@id/clock_expanded" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:singleLine="true" />
        <com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" android:textColor="@com.sonyericsson.uxp:color/semc_theme_accent_color" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:layout_marginRight="8.0dip" />
        <com.android.systemui.statusbar.RotationToggle android:id="@id/rotation_lock_button" android:clickable="true" android:layout_width="32.0dip" android:layout_height="32.0dip" android:layout_margin="8.0dip" android:button="@drawable/ic_notify_rotation" android:contentDescription="@string/accessibility_rotation_lock_off" />
        <ImageView android:id="@id/settings_button" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/ic_notify_quicksettings" android:scaleType="center" android:contentDescription="@string/accessibility_settings_button" />
        <Space android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_weight="1.0" />
        <com.spacecaker.ButtonBurst android:id="@id/spacebuttonburst" android:layout_width="40.0dip" android:layout_height="40.0dip" android:layout_alignParentRight="true" />
		[COLOR="red"]<Button android:id="@id/clear_all_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="80.0dip" android:layout_height="wrap_content" android:text="@string/status_bar_clear_all_button" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_clear_all" /> [/COLOR]      
	</LinearLayout>	
</LinearLayout>

Now we are going to
res/values/ids.xml
and we are going to add these ids


Code:
 	<item type="id" name="spaceybeaneyheader">false</item>
    <item type="id" name="settings_button">false</item>
    <item type="id" name="jbclock">false</item>
    <item type="id" name="spacebuttonburst">false</item>	
    <item type="id" name="recent_app_button">false</item>


Now go to
res/values/strings.xml and we add these lines

Code:
    <string name="accessibility_clear_all">Clear</string>
    <string name="accessibility_settings_button">System settings.</string>

Now go to
res/values/Styles.xml
and add
this to the end of file

Code:
    <style name="S3.Clear" parent="@*android:style/Widget.Button">
        <item name="android:textAppearance">?android:textAppearanceSmallInverse</item>
        <item name="android:textColor">#ffffffff</item>
        <item name="android:gravity">center</item>
        <item name="android:background">@drawable/tw_btn_default_small</item>
        <item name="android:focusable">true</item>
        <item name="android:clickable">true</item>
    </style>


now add a dimens.xml or edit ur dimens.xml

and add this line


Code:
    <dimen name="status_bar_expanded_notification_clear_button_text_size">17.0dip</dimen>
    <dimen name="status_bar_expanded_notification_category_text_size">17.0dip</dimen>
    <dimen name="status_bar_expanded_clear_button_width">123.0dip</dimen>

now change this line in dimens.xml from

[CODE}]<dimen name="notification_panel_header_height">111.0dip</dimen>[/CODE]

to

Code:
<dimen name="notification_panel_header_height">52.0dip</dimen>

Now add all the Files i have given in the attachement *Space_Adds.zip*
and compile the apk
if u get a error do describe it in xda post so i can help u to fix


Now delete the Directory of ur decompiled apk
and
Decompiled the apk again * this is for the public IDS * sothey are added
Now

go to
res/values/public.xml and find these


Code:
    <public type="drawable" name="btn_tg"
    <public type="drawable" name="btn_toggles_normal"

Now goto
smali/com/spacecaker/ButtonBurst.smali

and find this

Code:
     const v3, 0x7f020180
change it to the Public ID code u got from
Code:
<public type="drawable" name="btn_toggles_normal"

Now find this

Code:
    const v3, 0x7f02017f
change it to the public id u got from
Code:
<public type="drawable" name="btn_tg"

and now We are done for this part

now lets add the
  • Settings
  • Display
  • and
  • Prof/Contact button

goto
smali/com/android/systemui/SystemUIService.smali


and aadd these to end of the file

Code:
.method public BrightnessButton(Landroid/view/View;)V
    .locals 3
    .parameter "v"

    .prologue
    .line 2431
    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    .line 2432
    const-string v1, "com.android.settings"

    const-string v2, "com.android.settings.Settings"

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const/high16 v2, 0x1000

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    move-result-object v0

    .line 2433
    invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    const-string v1, "statusbar"

    invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/StatusBarManager;

    invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V

    .line 1720
    return-void
.end method

.method public ProfileButton(Landroid/view/View;)V
    .locals 3
    .parameter "v"

    .prologue
    .line 2431
    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    .line 2432
    const-string v1, "com.android.contacts"

    const-string v2, "com.android.contacts.activities.PeopleActivity"

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const/high16 v2, 0x1000

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    move-result-object v0

    .line 2433
    invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    const-string v1, "statusbar"

    invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/StatusBarManager;

    invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V

    .line 1720
    return-void
.end method

.method public SpaceCakerButton(Landroid/view/View;)V
    .locals 3
    .parameter "v"

    .prologue
    .line 2431
    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    .line 2432
    const-string v1, "com.android.settings"

    const-string v2, "com.android.settings.Settings"

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const/high16 v2, 0x1000

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    move-result-object v0

    .line 2433
    invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    const-string v1, "statusbar"

    invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/StatusBarManager;

    invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V

    .line 1720
    return-void
.end method

now compile the apk and it should work now :D

if it doesn't work please take a logcat * A full logcat with ADB and not with catlog or logcat apps on phone if preferable use this command adb logcat -v long > logcat.txt this way i can help also dont cut the logcat just keep it full as there are more parts that are needed to see instead of only a E/androidruntime error
Special Thanks to
Matz69
DCSMS
auliaYF
marinalin
and everyone who helped :)
SpaceCaker
xda.agm
if i am missing credits or whatsoever PM me and i will set
 

Attachments

  • Space_adds_JB2.zip
    121 KB · Views: 4,987
Last edited:

SpaceCaker

Senior Member
Mar 26, 2011
13,545
10,904
netherlands
www.youtube.com
How to add new/change toggles ?


As u can see i highlighted some stuff with pink color
Code:
[COLOR="Magenta"][I]const-string v2, "com.android.settings"[/I][/COLOR]
Packagename
Code:
[COLOR="Magenta"][I]const-string v2, "com.android.settings.Settings"[/I][/COLOR]
Activity
As u can see it has this tag inside
Code:
com.android.settings
packagename
Code:
com.android.settings.Settings
Activity
this is the package/action name of a app / option inside settings.apk
u can change this to any thin u want like
taskmanager it will be like this

Code:
const-string v2, "com.sec.android.app.controlpanel"
this is packagename, and

Code:
const-string v2, "com.sec.android.app.controlpanel.activity.JobManagerActivity"
this is activity,

now if u add it to a new Onclick method it will look like this

Code:
.method public [COLOR="RoyalBlue"]SpaceCakerButton[/COLOR](Landroid/view/View;)V
    .locals 5
    .parameter "view"

    .prologue
    .line 99
    .line 100
    :try_start_0
    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    .line 102
    .local v1, intent:Landroid/content/Intent;
    const-string v2, "android.intent.action.MAIN"

    invoke-virtual {v1, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    .line 105
    const/high16 v2, 0x1000

    invoke-virtual {v1, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    .line 107
    [COLOR="RoyalBlue"]const-string v2, "com.android.settings"[/COLOR]

    [COLOR="RoyalBlue"]const-string v3, "com.android.settings.Settings"[/COLOR]

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    invoke-virtual {p0, v1}, Lcom/android/systemui/SystemUIService;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 109
    .line 112
    .end local v1           #intent:Landroid/content/Intent;
    :goto_0
    return-void

    .line 115
    :catch_0
    move-exception v0

    .line 117
    .local v0, e:Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

this is a new method

of course it wont work yet as u need to add it to the layout

goto res/layout/quickpanel_quick_settings_space.xml

add something like this

Code:
                    <FrameLayout android:id="@id/settings_button" android:background=        [user=3944923]@drawab[/user]le/tile_toggle" android:layout_width="106.0px" android:layout_height="100.0px" android:layout_weight="1.0">
                        <ImageView android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" [COLOR="Red"]android:src  [user=3944923]@drawab[/user]le/taskmanagerpng"[/COLOR][COLOR="Red"]android:onClick="SpaceCakerButton"[/COLOR] />
                        <TextView android:textSize="12.0dip" android:textColor="#ffffffff" android:gravity="center" android:layout_gravity="bottom" android:background="#00000000" android:layout_width="106.0px" android:layout_height="wrap_content" android:layout_marginBottom="15.0px" [COLOR="Red"]android:text="TaskManager"[/COLOR] />
                    </FrameLayout>

the red stuff u need to edit to the app/ icon / text /
Code:
 .method public SpaceCakerButton
u used
@drawable/taskmanagerpng u need to add a png that has the name taskmanagerpng to drawable-mdpi

Code:
android:onClick="[COLOR="Magenta"]SpaceCakerButton[/COLOR]"
noticed the pink part ?
this is the text i used after .method public
this makes the button actually work


And ofcourse
Code:
android:text="[COLOR="Magenta"]TaskManager[/COLOR]"
this is what the text needs to say under the app :D
 
Last edited:

thirdzcee

Senior Member
May 13, 2012
1,745
589
Bacolod City
Omg you did the guide for jellybean... Thank you thank you thank you so much man... Gonna try this method later.. I'm just gonna wait till my uncle leaves so I won't be disturbed in the computer:D

Sent from my H100 using xda app-developers app
 

thirdzcee

Senior Member
May 13, 2012
1,745
589
Bacolod City
so now carrying after my succes with getting this to work i have added the method to systemuiservice now i can click the toggles but they wont launch anything
 

thirdzcee

Senior Member
May 13, 2012
1,745
589
Bacolod City
I understand that too much to ask, but could you at leisure to try to port this guide? I tried to do it, but I have some errors in the id's and .smali

You can do it... Took me a while as well to get it to work on jb, this guide was posted just after 3 of us with same mediatek devices got it to work using same GB guide, all it takes is analyzing the build errors and checking the logcats if you get fc but in the end the errors can just be fixed by a view work arounds... Just don't give up on it :thumbup::thumbup::thumbup:

Sent from my H100 using xda app-developers app
 
  • Like
Reactions: SpaceCaker

akash akya

Senior Member
May 14, 2012
734
1,307
Bangalore
trickytipss.blogspot.in
I GOT EVERYTHING WORKING.... ALL THREE TOGGLES WORKING... YOU CAN ADD TOGGLES AS MUCH YOU WANT.... NO MORE FC.....
to get working lots of layout changes needed.... :victory::victory::victory::victory:
my device : mt6577 4.1.1
just took 6 hours.... :p
ss:
 

Attachments

  • Screenshot_2013-07-17-14-28-41.jpg
    Screenshot_2013-07-17-14-28-41.jpg
    12.6 KB · Views: 2,100

thirdzcee

Senior Member
May 13, 2012
1,745
589
Bacolod City
I GOT EVERYTHING WORKING.... ALL THREE TOGGLES WORKING... YOU CAN ADD TOGGLES AS MUCH YOU WANT.... NO MORE FC.....
to get working lots of layout changes needed.... :victory::victory::victory::victory:
my device : mt6577 4.1.1
just took 6 hours.... :p
ss:

To switch to quick panel view do have to tap on the quick panel button once or twice??? Mine I have to tap on it twice:confused:

Sent from my H100 using xda app-developers app
 
  • Like
Reactions: lericaxda143

Top Liked Posts

  • There are no posts matching your filters.
  • 47
    How to add 4.2.2 Statusbar to youre Jellybean rom :D

    In this guide i will show u how to add 4.2.2 statusbar


    Note:!!!!!!!
    If u are new to modifying apps Dont try this Please.. u must know how to mod first before u gonna try as u will definetly end up in some errors or possible FCs
    Read the thread/OP/first 1/2 posts FULLY! if u dont read it fully i wont provide support as u are to lazy to even read in the first place. if u read full 1st page i can help u
    do add logcats if FC * how to do this is also described here!*. Thanks

    Next is
    Statusbar.xml

    make sure it looks like this below

    Code:
     <?xml version="1.0" encoding="utf-8"?>
    <com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/status_bar_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
        <com.android.systemui.statusbar.StatusBarServiceLRPull android:layout_width="fill_parent" android:layout_height="wrap_content">
            <ImageView android:id="@id/notification_lights_out" android:paddingLeft="6.0dip" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" />
            <LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
                <LinearLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
                    <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
                    <com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
                </LinearLayout>
                <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
                <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
                    <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
                    <TextView android:layout_gravity="left|center" android:id="@id/battery_text" android:paddingLeft="4.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_settings_settings_button" android:singleLine="true" style="@style/StatusBarNotificationText" />
                    <ImageView android:id="@id/battery" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                </LinearLayout>
                <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="@touchwiz:dimen/tw_softkey_textsize_singleline" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
            </LinearLayout>
        </com.android.systemui.statusbar.StatusBarServiceLRPull>
        <LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
                <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
                <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
            </ImageSwitcher>
            <com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
                <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
                <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            </com.android.systemui.statusbar.phone.TickerView>
        </LinearLayout>
    </com.android.systemui.statusbar.phone.PhoneStatusBarView>


    Now we are going to modify
    Status_bar_expanded.xml

    Make sure it looks something like this


    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <FrameLayout android:id="@id/notification_panel" android:background="@drawable/notification_panel_bg" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
        <TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network" android:gravity="center" android:layout_gravity="bottom" android:id="@id/carrier_label" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="@dimen/carrier_label_height" android:layout_marginBottom="@dimen/close_handle_height" />
        <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
            <include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
            <include layout="@layout/brightness" />
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network.EmergencyOnly" android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />
            <ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:overScrollMode="ifContentScrolls">
                <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_row_min_height" />
            </ScrollView>
        </LinearLayout>
        <com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="vertical" android:id="@id/close" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height">
            <ImageView android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height" android:src="@drawable/status_bar_close" android:scaleType="fitXY" />
        </com.android.systemui.statusbar.phone.CloseDragHandle>
    </FrameLayout>

    change it to

    RED - Add BLUE - moved


    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <FrameLayout android:id="@id/notification_panel" android:background="@drawable/notification_panel_bg" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">      
    	[COLOR="Blue"]<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
    	    <include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
    	</LinearLayout>[/COLOR]
    	<TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network" android:gravity="center" android:layout_gravity="bottom" android:id="@id/carrier_label" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="@dimen/carrier_label_height" android:layout_marginBottom="@dimen/close_handle_height" />	
    	[COLOR="red"]<com.spacecaker.SpaceLayOut android:layout_width="fill_parent" android:layout_height="fill_parent">[/COLOR] 
    	  [COLOR="Red"]<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
                <include layout="@layout/quickpanel_quick_settings_space" />
          </LinearLayout>[/COLOR]
    	<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" [COLOR="red"]android:layout_marginTop="@dimen/notification_panel_header_height"[/COLOR] android:layout_marginBottom="@dimen/close_handle_underlap">       
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network.EmergencyOnly" android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />
            <ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:overScrollMode="ifContentScrolls">
                <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_row_min_height" />
            </ScrollView>
        </LinearLayout>
    	[COLOR="red"]</com.spacecaker.SpaceLayOut>[/COLOR]
        <com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="vertical" android:id="@id/close" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height">
            <ImageView android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height" android:src="@drawable/status_bar_close" android:scaleType="fitXY" />
        </com.android.systemui.statusbar.phone.CloseDragHandle>
    </FrameLayout>

    What i have done is adding new
    Code:
    <com.spacecaker.SpaceLayOut android:layout_width="fill_parent" android:layout_height="fill_parent"> 
    </com.spacecaker.SpaceLayOut>
    lines + use other xml to load Quickpanel and JB header
    to make it look much cleaner


    Next up is moddifying
    StatusBar_Expanded_Header.xml

    RED - Add BLUE - moved

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout android:orientation="vertical" android:background="@drawable/notification_header_bg" android:layout_width="fill_parent" android:layout_height="wrap_content"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">   
           <View android:background="@drawable/status_bar_hr" android:layout_width="fill_parent" android:layout_height="2.0dip" android:visibility="gone" />
        <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:background="@drawable/notification_header_bg" android:layout_width="fill_parent" android:layout_height="52.0dip" android:baselineAligned="false">
            <ImageView android:id="@id/quickpanelsettings_button" android:paddingLeft="5.0dip" android:paddingRight="5.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quickpanelsettings" android:layout_alignParentLeft="true" />
            <ImageView android:id="@id/quicksettings_button" android:paddingLeft="5.0dip" android:paddingRight="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:layout_alignParentLeft="true" />
            <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" android:id="@id/clock_expanded" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:singleLine="true" />
            <com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" android:textColor="@com.sonyericsson.uxp:color/semc_theme_accent_color" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:layout_marginRight="8.0dip" />
            <com.android.systemui.statusbar.RotationToggle android:id="@id/rotation_lock_button" android:clickable="true" android:layout_width="32.0dip" android:layout_height="32.0dip" android:layout_margin="8.0dip" android:button="@drawable/ic_notify_rotation" android:contentDescription="@string/accessibility_rotation_lock_off" />
            <ImageView android:id="@id/settings_button" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/ic_notify_quicksettings" android:scaleType="center" android:contentDescription="@string/accessibility_settings_button" />
            <Space android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_weight="1.0" />
            <com.spacecaker.ButtonBurst android:id="@id/spacebuttonburst" android:layout_width="40.0dip" android:layout_height="40.0dip" android:layout_alignParentRight="true" />
    		[COLOR="red"]<Button android:id="@id/clear_all_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="80.0dip" android:layout_height="wrap_content" android:text="@string/status_bar_clear_all_button" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_clear_all" /> [/COLOR]      
    	</LinearLayout>	
    </LinearLayout>

    Now we are going to
    res/values/ids.xml
    and we are going to add these ids


    Code:
     	<item type="id" name="spaceybeaneyheader">false</item>
        <item type="id" name="settings_button">false</item>
        <item type="id" name="jbclock">false</item>
        <item type="id" name="spacebuttonburst">false</item>	
        <item type="id" name="recent_app_button">false</item>


    Now go to
    res/values/strings.xml and we add these lines

    Code:
        <string name="accessibility_clear_all">Clear</string>
        <string name="accessibility_settings_button">System settings.</string>

    Now go to
    res/values/Styles.xml
    and add
    this to the end of file

    Code:
        <style name="S3.Clear" parent="@*android:style/Widget.Button">
            <item name="android:textAppearance">?android:textAppearanceSmallInverse</item>
            <item name="android:textColor">#ffffffff</item>
            <item name="android:gravity">center</item>
            <item name="android:background">@drawable/tw_btn_default_small</item>
            <item name="android:focusable">true</item>
            <item name="android:clickable">true</item>
        </style>


    now add a dimens.xml or edit ur dimens.xml

    and add this line


    Code:
        <dimen name="status_bar_expanded_notification_clear_button_text_size">17.0dip</dimen>
        <dimen name="status_bar_expanded_notification_category_text_size">17.0dip</dimen>
        <dimen name="status_bar_expanded_clear_button_width">123.0dip</dimen>

    now change this line in dimens.xml from

    [CODE}]<dimen name="notification_panel_header_height">111.0dip</dimen>[/CODE]

    to

    Code:
    <dimen name="notification_panel_header_height">52.0dip</dimen>

    Now add all the Files i have given in the attachement *Space_Adds.zip*
    and compile the apk
    if u get a error do describe it in xda post so i can help u to fix


    Now delete the Directory of ur decompiled apk
    and
    Decompiled the apk again * this is for the public IDS * sothey are added
    Now

    go to
    res/values/public.xml and find these


    Code:
        <public type="drawable" name="btn_tg"
        <public type="drawable" name="btn_toggles_normal"

    Now goto
    smali/com/spacecaker/ButtonBurst.smali

    and find this

    Code:
         const v3, 0x7f020180
    change it to the Public ID code u got from
    Code:
    <public type="drawable" name="btn_toggles_normal"

    Now find this

    Code:
        const v3, 0x7f02017f
    change it to the public id u got from
    Code:
    <public type="drawable" name="btn_tg"

    and now We are done for this part

    now lets add the
    • Settings
    • Display
    • and
    • Prof/Contact button

    goto
    smali/com/android/systemui/SystemUIService.smali


    and aadd these to end of the file

    Code:
    .method public BrightnessButton(Landroid/view/View;)V
        .locals 3
        .parameter "v"
    
        .prologue
        .line 2431
        new-instance v0, Landroid/content/Intent;
    
        invoke-direct {v0}, Landroid/content/Intent;-><init>()V
    
        .line 2432
        const-string v1, "com.android.settings"
    
        const-string v2, "com.android.settings.Settings"
    
        invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
    
        const/high16 v2, 0x1000
    
        invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
    
        move-result-object v0
    
        .line 2433
        invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    
        const-string v1, "statusbar"
    
        invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
    
        move-result-object v0
    
        check-cast v0, Landroid/app/StatusBarManager;
    
        invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
    
        .line 1720
        return-void
    .end method
    
    .method public ProfileButton(Landroid/view/View;)V
        .locals 3
        .parameter "v"
    
        .prologue
        .line 2431
        new-instance v0, Landroid/content/Intent;
    
        invoke-direct {v0}, Landroid/content/Intent;-><init>()V
    
        .line 2432
        const-string v1, "com.android.contacts"
    
        const-string v2, "com.android.contacts.activities.PeopleActivity"
    
        invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
    
        const/high16 v2, 0x1000
    
        invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
    
        move-result-object v0
    
        .line 2433
        invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    
        const-string v1, "statusbar"
    
        invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
    
        move-result-object v0
    
        check-cast v0, Landroid/app/StatusBarManager;
    
        invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
    
        .line 1720
        return-void
    .end method
    
    .method public SpaceCakerButton(Landroid/view/View;)V
        .locals 3
        .parameter "v"
    
        .prologue
        .line 2431
        new-instance v0, Landroid/content/Intent;
    
        invoke-direct {v0}, Landroid/content/Intent;-><init>()V
    
        .line 2432
        const-string v1, "com.android.settings"
    
        const-string v2, "com.android.settings.Settings"
    
        invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
    
        const/high16 v2, 0x1000
    
        invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
    
        move-result-object v0
    
        .line 2433
        invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    
        const-string v1, "statusbar"
    
        invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
    
        move-result-object v0
    
        check-cast v0, Landroid/app/StatusBarManager;
    
        invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
    
        .line 1720
        return-void
    .end method

    now compile the apk and it should work now :D

    if it doesn't work please take a logcat * A full logcat with ADB and not with catlog or logcat apps on phone if preferable use this command adb logcat -v long > logcat.txt this way i can help also dont cut the logcat just keep it full as there are more parts that are needed to see instead of only a E/androidruntime error
    Special Thanks to
    Matz69
    DCSMS
    auliaYF
    marinalin
    and everyone who helped :)
    SpaceCaker
    xda.agm
    if i am missing credits or whatsoever PM me and i will set
    26
    How to add new/change toggles ?


    As u can see i highlighted some stuff with pink color
    Code:
    [COLOR="Magenta"][I]const-string v2, "com.android.settings"[/I][/COLOR]
    Packagename
    Code:
    [COLOR="Magenta"][I]const-string v2, "com.android.settings.Settings"[/I][/COLOR]
    Activity
    As u can see it has this tag inside
    Code:
    com.android.settings
    packagename
    Code:
    com.android.settings.Settings
    Activity
    this is the package/action name of a app / option inside settings.apk
    u can change this to any thin u want like
    taskmanager it will be like this

    Code:
    const-string v2, "com.sec.android.app.controlpanel"
    this is packagename, and

    Code:
    const-string v2, "com.sec.android.app.controlpanel.activity.JobManagerActivity"
    this is activity,

    now if u add it to a new Onclick method it will look like this

    Code:
    .method public [COLOR="RoyalBlue"]SpaceCakerButton[/COLOR](Landroid/view/View;)V
        .locals 5
        .parameter "view"
    
        .prologue
        .line 99
        .line 100
        :try_start_0
        new-instance v1, Landroid/content/Intent;
    
        invoke-direct {v1}, Landroid/content/Intent;-><init>()V
    
        .line 102
        .local v1, intent:Landroid/content/Intent;
        const-string v2, "android.intent.action.MAIN"
    
        invoke-virtual {v1, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
    
        .line 105
        const/high16 v2, 0x1000
    
        invoke-virtual {v1, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
    
        .line 107
        [COLOR="RoyalBlue"]const-string v2, "com.android.settings"[/COLOR]
    
        [COLOR="RoyalBlue"]const-string v3, "com.android.settings.Settings"[/COLOR]
    
        invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
    
        invoke-virtual {p0, v1}, Lcom/android/systemui/SystemUIService;->startActivity(Landroid/content/Intent;)V
        :try_end_0
        .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    
        .line 109
        .line 112
        .end local v1           #intent:Landroid/content/Intent;
        :goto_0
        return-void
    
        .line 115
        :catch_0
        move-exception v0
    
        .line 117
        .local v0, e:Ljava/lang/Exception;
        invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    
        goto :goto_0
    .end method

    this is a new method

    of course it wont work yet as u need to add it to the layout

    goto res/layout/quickpanel_quick_settings_space.xml

    add something like this

    Code:
                        <FrameLayout android:id="@id/settings_button" android:background=        [user=3944923]@drawab[/user]le/tile_toggle" android:layout_width="106.0px" android:layout_height="100.0px" android:layout_weight="1.0">
                            <ImageView android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" [COLOR="Red"]android:src  [user=3944923]@drawab[/user]le/taskmanagerpng"[/COLOR][COLOR="Red"]android:onClick="SpaceCakerButton"[/COLOR] />
                            <TextView android:textSize="12.0dip" android:textColor="#ffffffff" android:gravity="center" android:layout_gravity="bottom" android:background="#00000000" android:layout_width="106.0px" android:layout_height="wrap_content" android:layout_marginBottom="15.0px" [COLOR="Red"]android:text="TaskManager"[/COLOR] />
                        </FrameLayout>

    the red stuff u need to edit to the app/ icon / text /
    Code:
     .method public SpaceCakerButton
    u used
    @drawable/taskmanagerpng u need to add a png that has the name taskmanagerpng to drawable-mdpi

    Code:
    android:onClick="[COLOR="Magenta"]SpaceCakerButton[/COLOR]"
    noticed the pink part ?
    this is the text i used after .method public
    this makes the button actually work


    And ofcourse
    Code:
    android:text="[COLOR="Magenta"]TaskManager[/COLOR]"
    this is what the text needs to say under the app :D
    9
    Add animation between in change

    How to add animation when change statusbar

    This guide will add animations in change to your 4.2 StatusBar. It's supossed that you have already a working 4.2 statusbar following the OP.
    It will not help you to add toggles or layout your xml. All the credits goes to @SpaceCaker.

    1) Adding resources

    Download the attached files and copy to your SystemUI.apk, except the folder smali.
    Then, open res/values/ids.xml and add the following:
    Code:
        <item type="id" name="spacelayoutbar">false</item>
        <item type="id" name="date_panel">false</item>
        <item type="id" name="panelflipper">false</item>
        <item type="id" name="flipper">false</item>

    2) Getting public ids

    Compile your SystemUI and then decompile it another time to get public ids. Now, copy the folder smali to your new SystemUI.

    3) Matching ids

    Now, open all the new smali we have add and look for #public .... . Open res/values/public.xml. Now, you have to copy all the #public... and search it in public.xml. Something like this:
    Code:
    <public type="id" name="spacelayoutbar" id="0x7f0d0146" />

    Copy the new id (0x7f0d0146) and paste in the smali. So
    Code:
    const v5, 0x7f0d0141 #public type="id" name="spacelayoutbar"
    has to be
    Code:
    const v5, 0x7f0d0146 #public type="id" name="spacelayoutbar"

    Be carefull and revise ALL THE NEW SMALI FILES.

    4) Editing the StatusBar XMLs

    Now it's time to add the animation code to the xml.
    Open tw_status_bar_expanded/status_bar_expanded and look for this:
    Code:
    <com.spacecaker.SpaceLayOut android:layout_width="fill_parent" android:layout_height="fill_parent">
    and add this under it:
    Code:
    <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/tw_close_handle_underlap">
                <com.spacecaker.DatePanel android:orientation="vertical" android:id="@id/date_panel" android:layout_width="fill_parent" android:layout_height="wrap_content">
                    <com.spacecaker.PageView android:id="@id/panelflipper" android:layout_width="fill_parent" android:layout_height="0.0dip">
                        <include android:layout_width="fill_parent" android:layout_height="@dimen/tw_notification_panel_header_height" layout="@layout/tw_status_bar_expanded_header" />
                    </com.spacecaker.PageView>
                </com.spacecaker.DatePanel>
                <com.spacecaker.PageViewFlipper android:id="@id/flipper" android:layout_width="fill_parent" android:layout_height="wrap_content">

    Now find this:
    Code:
    </com.spacecaker.SpaceLayOut>
    and add this above it
    Code:
                </com.spacecaker.PageViewFlipper>
    </LinearLayout>

    With this, you will have the animation when change the statusbar.

    IMPORTANT: I'm working in a TW 4.1.2 ROM, so if you are trying it in other ROM (not TW) , you have to remove tw_ in the code, for example:
    Code:
    tw_notification_panel_header_height
    has to be
    Code:
    notification_panel_header_height

    Change properties of the animation

    You can change the properties of the animation. To do it, open res/anim/flip_3d_quicker_anim.xml.
    Here you can change values to find your desired animation.

    I hope I've missed nothing. If you fail trying to follow this guide, please ask for help but ALWAYS with a logcat of the problem.
    @SpaceCaker, if you want to add to OP, feel free to do it.
    8
    Here i wrote tutorial for porting this mod to Samsung jellybean (4.1.2) ROMs. (actually i wrote it for SGSA but all samsung JB roms have same framework)

    I've also wrote there how to add Live Tiles for battery and WiFi in the 2nd post.



    Link to my thread

    http://xdaforums.com/showthread.php?p=48436671#post48436671

    Hope everybody will like it.
    8
    for 4.1.1 layout need lots of changes,
    to get this (12 toggles) :
    v1x39xcr500yat7fg.jpg


    in quickpanel_quicksettings_plane, edit to look like this :
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"
      xmlns:android="http://schemas.android.com/apk/res/android">
        <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <ScrollView android:id="@id/scroll" android:scrollbars="none" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="wrap_content"  android:layout_marginTop="@dimen/notification_panel_header_height" android:overScrollMode="never">
                <LinearLayout android:gravity="left" android:layout_marginTop="5.0dip" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
    			     <LinearLayout android:orientation="horizontal" android:layout_width="480.0px" android:layout_height="150.0px">
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:background="@drawable/btn_prof" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="3.0px" android:onClick="ProfileButton" />
                            <TextView android:textSize="14.0dip" android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="Contacts" android:singleLine="true" android:layout_alignParentBottom="true" />
                        </RelativeLayout>
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/ic_brightness" android:onClick="BrightnessButton" />
                            <TextView android:textSize="14.0dip"  android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="Brightness" android:layout_alignParentBottom="true" />
                         </RelativeLayout>
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/set" android:onClick="SpaceCakerButton" />
                            <TextView android:textSize="14.0dip" android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="Settings" android:singleLine="true" android:layout_alignParentBottom="true" />
                         </RelativeLayout>
                    </LinearLayout>
    				<LinearLayout android:orientation="horizontal" android:layout_width="480.0px" android:layout_height="150.0px">
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:background="@drawable/wifi" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="wifi" />
                            <TextView android:textSize="14.0dip" android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="Wifi" android:singleLine="true" android:layout_alignParentBottom="true" />
                        </RelativeLayout>
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/blu" android:onClick="blu" />
                            <TextView android:textSize="14.0dip"  android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="Bluetooth" android:layout_alignParentBottom="true" />
                         </RelativeLayout>
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/sound" android:onClick="sound" />
                            <TextView android:textSize="14.0dip" android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="Sound Profile" android:singleLine="true" android:layout_alignParentBottom="true" />
                         </RelativeLayout>
                    </LinearLayout>
    				<LinearLayout android:orientation="horizontal" android:layout_width="480.0px" android:layout_height="150.0px">
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:background="@drawable/task" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="task" />
                            <TextView android:textSize="14.0dip" android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="Task Manager" android:singleLine="true" android:layout_alignParentBottom="true" />
                        </RelativeLayout>
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/gps" android:onClick="gps" />
                            <TextView android:textSize="14.0dip"  android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="GPS" android:layout_alignParentBottom="true" />
                         </RelativeLayout>
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/data" android:onClick="data" />
                            <TextView android:textSize="14.0dip" android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="Data" android:singleLine="true" android:layout_alignParentBottom="true" />
                         </RelativeLayout>
    				   </LinearLayout>
    				<LinearLayout android:orientation="horizontal" android:layout_width="480.0px" android:layout_height="150.0px">
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:background="@drawable/teth" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="teth" />
                            <TextView android:textSize="14.0dip" android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="Tether" android:singleLine="true" android:layout_alignParentBottom="true" />
                        </RelativeLayout>
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/apps" android:onClick="apps" />
                            <TextView android:textSize="14.0dip"  android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="Apps" android:layout_alignParentBottom="true" />
                         </RelativeLayout>
                        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tile_toggle" android:layout_width="106.0px" android:layout_height="150.0px" android:layout_weight="1.0">
                            <Button android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/bat" android:onClick="bat" />
                            <TextView android:textSize="14.0dip" android:layout_marginBottom="3.0px" android:textColor="#ffffffff" android:gravity="center" android:background="#00000000" android:layout_width="240.0px" android:layout_height="wrap_content" android:text="Battery" android:singleLine="true" android:layout_alignParentBottom="true" />
                         </RelativeLayout>
                    </LinearLayout>
    			</LinearLayout>
            </ScrollView>
        </LinearLayout>
    </LinearLayout>


    add corresponding new drawebles (pngs + xmls) :-
    http://www.mediafire.com/?g1azey3y5hmn6g0

    Add corresponding methods to systemuiservicesmali. :
    compare with this one : http://www.mediafire.com/?42u6fi1yfplsm7c

    note : in quickpanel_quicksettings_plane.xml onclick tag should match with method name in systemuiservice.smali