[GUIDE]4.2.2 Statusbar for Samsung 4.1.2 ROM with Live Tiles

Search This thread

BOOTMGR

Senior Member
Aug 3, 2010
728
3,395
anoobdevsdiary.blogspot.in
4.2.2 Style Stausbar for Samsung 4.1.2 ROM


(This tutorial is originally made for SGSA but it should work with all samsung 4.1.2 ROMs)

Before we begin let me give credit to original author of this mod @SpaceCaker i'm just gonna tell you how to port it to Samsung JB 4.1.2 ROM.
(SpaceCaker's original Thread here)

Note: Throughout the tutorial we'll travel sequentially, i mean when i ask you to search for something and you find more than two matches, then choose the immediate one which comes after previous modification.
So let's begin

- Decompile SystemUI.apk
- Navigate to res/layout
- tw_status_bar.xml
search for
Code:
<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">
Add this below it
Code:
<com.android.systemui.statusbar.StatusBarServiceLRPull android:layout_width="fill_parent" android:layout_height="wrap_content">
- Now search for
Code:
<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">
Add this above it
Code:
</com.android.systemui.statusbar.StatusBarServiceLRPull>
- Save file
- tw_status_bar_expanded.xml
replace
Code:
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/tw_close_handle_underlap">
with
Code:
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
below it there will be <include /> clause add this line below it
Code:
</LinearLayout>
below it there'll be <TextView /> add these lines below it
Code:
<com.spacecaker.SpaceLayOut android:layout_width="fill_parent" android:layout_height="fill_parent">
        <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <include layout="@layout/quickpanel_quick_settings_space" />
        </LinearLayout>
        <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/tw_close_handle_underlap">
- Now search for
Code:
<com.android.systemui.statusbar.phone.CloseDragHandle
and add this code above it
Code:
</com.spacecaker.SpaceLayOut>
- Save file
- tw_status_bar_expanded_header.xml
search for
Code:
<RelativeLayout android:id="@id/settings_button" android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="visible" android:layout_width="@dimen/status_bar_expanded_setting_width" android:layout_height="39.0dip">
replace it with below code
Code:
<RelativeLayout android:id="@id/settings_button" android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="invisible" android:layout_width="0.100000024dip" android:layout_height="0.100000024dip">
        <ImageView android:id="@id/settings_button_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_quickpanel_icon_settings" android:scaleType="center" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:contentDescription="@string/accessibility_settings_button" />
    </RelativeLayout>
    <RelativeLayout android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="visible" android:layout_width="@dimen/status_bar_expanded_setting_width" android:layout_height="39.0dip">
- Search below for
Code:
android:contentDescription="@string/accessibility_settings_button"
and add this above it
Code:
android:onClick="mOpenSettings"
- Below after </RelativeLayout> add this code
Code:
<com.spacecaker.ButtonBurst android:id="@id/spacebuttonburst" android:layout_width="31.0dip" android:layout_height="34.0dip" android:scaleType="center" />
- Save file.
- Navigate to /res/values and add these lines to ids.xml
Code:
<item type="id" name="spaceybeaneyheader">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>
- Add these lines to end of the file Styles.xml
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>
- Save files
- Download attached files and extract them in the directory where apk is decompiled.Now compile and again decompile APK.
- Go to /res/values/public.xml and search these
Code:
<public type="drawable" name="btn_tg"
    <public type="drawable" name="btn_toggles_normal"
- Open smali/com/spacecaker/ButtonBurst.smali and search this
Code:
const v3, 0x7f020180
replace red part with id you got from
Code:
<public type="drawable" name="btn_toggles_normal"

- Now find this
Code:
const v3, 0x7f02017f
replace red part with id you got from
Code:
<public type="drawable" name="btn_tg"
- Open smali/com/android/systemui/SystemUIService.smali and add this to end of file
Code:
.method public mOpenSettings(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 camera_tile(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.sec.android.app.camera"

    const-string v2, "com.sec.android.app.camera.Camera"

    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 turn_off_light(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, "turn.off.the.lights"

    const-string v2, "turn.off.the.lights.LockerActivity"

    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 torch_toggle(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.teslacoilsw.flashlight"

    const-string v2, "com.teslacoilsw.flashlight.TeslaLEDToggle"

    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 dormant_toggle(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.dormantmode.DormantmodeSettings"

    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 tether_toggle(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.TetherSettings"

    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 app_toggle(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.RunningServices"

    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 bat_toggle(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.fuelgauge.PowerUsageSummary"

    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

That's all compile apk and push it to device.
(Torch and Sleep tiles won't work unless you install TeslaLED and Turn Off the Lights app from market)
You can refer to SpaceCaker's thread for more info and tutorial for how to add new tiles.
If you get any errors/FCs report here along with full log.
(i won't quote posts without logcat and ask for logcat, i'll simply ignore them)
 

Attachments

  • harsh_files_v2.zip
    79.3 KB · Views: 2,119
Last edited:

BOOTMGR

Senior Member
Aug 3, 2010
728
3,395
anoobdevsdiary.blogspot.in
How to add Live Tiles

So now you've setup layout for 4.2 statusbar.Now its time to add some live tiles here.

What you'll get
At the moment i've only created live tiles for Battery and WiFi (those are the only ones which are fairly noticeable and widely used).Live tile for battery shows battery level and WiFi tile shows AP name and signal level when connected.See below screenshot for more info.
(More tiles will be added later when i'll get some time)


So let's begin
- Add thses lines to res/values/ids.xml
Code:
<item type="id" name="harsh_batt">false</item>
    <item type="id" name="harsh_wifi">false</item>
    <item type="id" name="harsh_bat_img">false</item>
    <item type="id" name="harsh_wifi_img">false</item>
- Now open \res\layout\quickpanel_quick_settings_space.xml
- Every tile here is wrapped up within <FrameLayout></FrameLayout>.So now select one of frameLayout which will be your battery tile.This framelayout will include one ImageView (for indication of battery tile) and one TextView (for showing battery in %).Create them if you haven't.
- Now remove
Code:
android:src="@drawable/set"
or whatever drawable you've associated to that ImageView.
- Add
Code:
android:id="@id/harsh_bat_img"
for same ImageView.
- We'll do the same for TextView.Remove
Code:
android:text="Battery"
and add
Code:
android:id="@id/harsh_batt"
for that TextView.

- Now let's do the same for WiFi tile.Select FrameLayout for that tile and do following changes for that FrameLayout
- Remove
Code:
android:src="@drawable/set"
for the <ImageView> and add
Code:
android:id="@id/harsh_wifi_img"
- Now for <TextView>, remove
Code:
android:text="xxx"
and add
Code:
android:id="@id/harsh_wifi"
- Thats all.Save the files.
- Download the attached file and extract it to decompiled directory.
- Compile APK and decompiled it back so that public ids get generated.
- Now keep you res/values/public.xml open.
- Open smali\com\spacecaker\SpaceLayOut.smali
- Add
Code:
.field draw:Landroid/graphics/drawable/Drawable;

.field iv:Landroid/widget/ImageView;
before .field private mContext:Landroid/content/Context;
- Add
Code:
.field res:Landroid/content/res/Resources;

.field t:Landroid/widget/TextView;

.field userName:Ljava/lang/String;
after .field private mUpdating:Z
- Now search for .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V and add following lines before return-void
Code:
invoke-virtual {p0}, Lcom/spacecaker/SpaceLayOut;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    iput-object v0, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
- search for .method private update(Z)V and add this below .line 46 (i.e. at the starting of the method)
Code:
invoke-virtual {p0}, Lcom/spacecaker/SpaceLayOut;->getBatteryState()V

    .line 256
    invoke-virtual {p0}, Lcom/spacecaker/SpaceLayOut;->getWifiInfo()V
- Now add the following lines after # virtual methods.
Code:
.method public getBatteryState()V
    .locals 13

    .prologue
    .line 31
    const v10, 0x7f0d012c

    invoke-virtual {p0, v10}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;

    move-result-object v10

    check-cast v10, Landroid/widget/TextView;

    iput-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;

    .line 32
    const v10, 0x7f0d012e

    invoke-virtual {p0, v10}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;

    move-result-object v10

    check-cast v10, Landroid/widget/ImageView;

    iput-object v10, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;

    .line 33
    new-instance v3, Landroid/content/IntentFilter;

    const-string v10, "android.intent.action.BATTERY_CHANGED"

    invoke-direct {v3, v10}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    .line 34
    .local v3, ifilter:Landroid/content/IntentFilter;
    iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->mContext:Landroid/content/Context;

    const/4 v11, 0x0

    invoke-virtual {v10, v11, v3}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    move-result-object v1

    .line 35
    .local v1, batteryStatus:Landroid/content/Intent;
    const-string v10, "level"

    const/4 v11, -0x1

    invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v5

    .line 36
    .local v5, level:I
    const-string v10, "scale"

    const/4 v11, -0x1

    invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v7

    .line 37
    .local v7, scale:I
    const-string v10, "status"

    const/4 v11, -0x1

    invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v8

    .line 38
    .local v8, status:I
    const/4 v10, 0x2

    if-eq v8, v10, :cond_0

    const/4 v10, 0x5

    if-eq v8, v10, :cond_0

    const/4 v4, 0x0

    .line 39
    .local v4, isCharging:Z
    :goto_0
    const-string v10, "plugged"

    const/4 v11, -0x1

    invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v2

    .line 40
    .local v2, chargePlug:I
    const/4 v10, 0x2

    if-ne v2, v10, :cond_1

    const/4 v9, 0x1

    .line 41
    .local v9, usbCharge:Z
    :goto_1
    int-to-float v10, v5

    int-to-float v11, v7

    div-float v6, v10, v11

    .line 42
    .local v6, net_battery:F
    const/high16 v10, 0x42c8

    mul-float/2addr v10, v6

    invoke-static {v10}, Ljava/lang/Math;->round(F)I

    move-result v0

    .line 43
    .local v0, batteryPct:I
    if-eqz v4, :cond_3

    .line 44
    if-eqz v9, :cond_2

    .line 45
    iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;

    new-instance v11, Ljava/lang/StringBuilder;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v12

    invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v12, "%"

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    const-string v12, " (USB)"

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 52
    :goto_2
    :try_start_0
    iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;

    iget-object v11, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;

    const v12, 0x7f0202ff

    invoke-virtual {v11, v12}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;

    move-result-object v11

    invoke-static {v10, v11}, Landroid/graphics/drawable/Drawable;->createFromXml(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;)Landroid/graphics/drawable/Drawable;

    move-result-object v10

    iput-object v10, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 55
    :goto_3
    iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v10, v0}, Landroid/graphics/drawable/Drawable;->setLevel(I)Z

    .line 56
    iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;

    iget-object v11, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v10, v11}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V

    .line 57
    return-void

    .line 38
    .end local v0           #batteryPct:I
    .end local v2           #chargePlug:I
    .end local v4           #isCharging:Z
    .end local v6           #net_battery:F
    .end local v9           #usbCharge:Z
    :cond_0
    const/4 v4, 0x1

    goto :goto_0

    .line 40
    .restart local v2       #chargePlug:I
    .restart local v4       #isCharging:Z
    :cond_1
    const/4 v9, 0x0

    goto :goto_1

    .line 47
    .restart local v0       #batteryPct:I
    .restart local v6       #net_battery:F
    .restart local v9       #usbCharge:Z
    :cond_2
    iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;

    new-instance v11, Ljava/lang/StringBuilder;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v12

    invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v12, "%"

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    const-string v12, " (AC)"

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_2

    .line 49
    :cond_3
    iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;

    new-instance v11, Ljava/lang/StringBuilder;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v12

    invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v12, "%"

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_2

    .line 53
    :catch_0
    move-exception v10

    goto :goto_3
.end method

.method public getWifiInfo()V
    .locals 7

    .prologue
    .line 59
    const v4, 0x7f0d012d

    invoke-virtual {p0, v4}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/TextView;

    iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;

    .line 60
    const v4, 0x7f0d012f

    invoke-virtual {p0, v4}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/ImageView;

    iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;

    .line 61
    iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->mContext:Landroid/content/Context;

    const-string v5, "wifi"

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

    move-result-object v3

    check-cast v3, Landroid/net/wifi/WifiManager;

    .line 62
    .local v3, wm:Landroid/net/wifi/WifiManager;
    invoke-virtual {v3}, Landroid/net/wifi/WifiManager;->getWifiState()I

    move-result v2

    .line 63
    .local v2, wifiState:I
    packed-switch v2, :pswitch_data_0

    .line 86
    iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;

    const-string v5, "Error"

    invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 89
    :goto_0
    return-void

    .line 67
    :pswitch_0
    iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;

    const-string v5, "Wi-Fi"

    invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 69
    :try_start_0
    iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;

    iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;

    const v6, 0x7f020322

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;

    move-result-object v5

    invoke-static {v4, v5}, Landroid/graphics/drawable/Drawable;->createFromXml(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;)Landroid/graphics/drawable/Drawable;

    move-result-object v4

    iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 72
    :goto_1
    iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;

    iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V

    goto :goto_0

    .line 75
    :pswitch_1
    invoke-virtual {v3}, Landroid/net/wifi/WifiManager;->getConnectionInfo()Landroid/net/wifi/WifiInfo;

    move-result-object v1

    .line 76
    .local v1, wifiInfo:Landroid/net/wifi/WifiInfo;
    iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;

    invoke-virtual {v1}, Landroid/net/wifi/WifiInfo;->getSSID()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 77
    invoke-virtual {v1}, Landroid/net/wifi/WifiInfo;->getRssi()I

    move-result v4

    const/4 v5, 0x5

    invoke-static {v4, v5}, Landroid/net/wifi/WifiManager;->calculateSignalLevel(II)I

    move-result v0

    .line 79
    .local v0, signalLevel:I
    :try_start_1
    iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;

    iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;

    const v6, 0x7f020300

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;

    move-result-object v5

    invoke-static {v4, v5}, Landroid/graphics/drawable/Drawable;->createFromXml(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;)Landroid/graphics/drawable/Drawable;

    move-result-object v4

    iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 82
    :goto_2
    iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v4, v0}, Landroid/graphics/drawable/Drawable;->setLevel(I)Z

    .line 83
    iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;

    iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V

    goto :goto_0

    .line 80
    :catch_0
    move-exception v4

    goto :goto_2

    .line 70
    .end local v0           #signalLevel:I
    .end local v1           #wifiInfo:Landroid/net/wifi/WifiInfo;
    :catch_1
    move-exception v4

    goto :goto_1

    .line 63
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method
- Search for
Code:
const v15, 0x7f0d012c
change public id which you get from
Code:
<public type="id" name="harsh_batt"
in public.xml
- Search for
Code:
const v15, 0x7f0d012e
change public id which you get from
Code:
<public type="id" name="harsh_bat_img"
- Search for
Code:
const v15, 0x7f0202ff
change public id which you get from
Code:
<public type="drawable" name="harsh_stat_battery"
- Search for
Code:
const v8, 0x7f0d012d
change public id which you get from
Code:
<public type="id" name="harsh_wifi"
- Search for
Code:
const v8, 0x7f0d012f
change public id which you get from
Code:
<public type="id" name="harsh_wifi_img"
- Search for
Code:
const v8, 0x7f020322
change public id which you get from
Code:
<public type="drawable" name="wifi_tile"
- Search for
Code:
const v8, 0x7f020300
change public id which you get from
Code:
<public type="drawable" name="harsh_stat_wifi"

- Thats it.Now save your file and compile APK and push it to device.
 

Attachments

  • Live_tiles_files.zip
    66 KB · Views: 1,012
Last edited:

BOOTMGR

Senior Member
Aug 3, 2010
728
3,395
anoobdevsdiary.blogspot.in
Tips,Tricks & FAQs

Changelog:
  • 13/12/13 --> Initial Release
  • 27/12/13 --> Optimized code.Reduced lags when live tiles are implemented.Live tiles will update only when statusbar is pulled down.
Tips, Tricks & FAQs:
  • If battery indicator or any other image don't look in center, define paddings like android:layout_marginTop="30.0dip"
  • If you've added more than 3 rows, then you need to enclose it in <ScrollView> in order to make it scrollable.
  • Even though i've named them Live tiles, they're not actually live like original 4.2.2 statusbar. They'll update only when tile layout is drawn (i mean expanded).But this has one advantage that addition overhead to system is gone.
  • Associate android: onClick="foobar" attribute to FrameLayout instead of ImageView so that clicking anywhere on the tile can execute defined method.
  • Each <LinearLayout> shows one row which have 3 FrameLayout by default.If you'll add/remove FrameLayout then width of tiles will be set accordingly.
 
Last edited:

ildar2099

Senior Member
Apr 24, 2013
55
4
Code:
pkTools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_july' has no default translation in C:\ApkT
ools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_june' has no default translation in C:\ApkT
ools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_march' has no default translation in C:\Apk
Tools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_may' has no default translation in C:\ApkTo
ols152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_november' has no default translation in C:\
ApkTools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_october' has no default translation in C:\A
pkTools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_september' has no default translation in C:
\ApkTools152\SystemUI\res; found: mk
aapt: warning: string 'no_such_item' has no default translation in C:\ApkTools152
\SystemUI\res; found: bg cs da de el en_US es_ES es_US et fi fr ga hr hu is it kk
 ko lt lv mk nb nl pl pt_PT ro ru sk sl sr sv tr uk
aapt: warning: string 'pm' has no default translation in C:\ApkTools152\SystemUI\
res; found: mk
aapt: warning: string 'quickpanel_data_roaming_disable_toast' has no default tran
slation in C:\ApkTools152\SystemUI\res; found: bg cs da de el en_US es_ES es_US e
t fi fr ga hr hu is it kk ko lt lv mk nb nl pl pt_PT ro ru sk sl sr sv tr uk
aapt: warning: string 'quickpanel_data_roaming_enable_toast' has no default trans
lation in C:\ApkTools152\SystemUI\res; found: bg cs da de el en_US es_ES es_US et
 fi fr ga hr hu is it kk ko lt lv mk nb nl pl pt_PT ro ru sk sl sr sv tr uk
aapt: warning: string 'today' has no default translation in C:\ApkTools152\System
UI\res; found: mk
aapt: warning: string 'tomorrow' has no default translation in C:\ApkTools152\Sys
temUI\res; found: mk
aapt: warning: string 'twelve_hour_time_format' has no default translation in C:\
ApkTools152\SystemUI\res; found: mk
aapt: warning: string 'yesterday' has no default translation in C:\ApkTools152\Sy
stemUI\res; found: mk
I: Building apk file...
   SystemUI - complete

 All done!

My original SystemUI.apk
 

Attachments

  • SystemUI.apk
    1.8 MB · Views: 510

Goldie

Inactive Recognized Developer
Oct 16, 2010
9,965
22,760
They're just apktool warnings. You need a logcat of the system ui fc not the compile log :)

Sent from my GT-I9305 using Tapatalk
 

Kamy

Senior Member
Aug 29, 2012
5,335
19,307
Beijing
Great tutorial, I would like to try this on Note but one question , is the zip file same for xhdpi phones?
 
Last edited:

mjz2cool

Senior Member
Jun 20, 2010
1,167
125
31
hardenberg
www.facebook.com
got it working, but there's 1 problem, when not charging, there's no icons in the statusbar, and i can only use the last used dropdown.
when it is charging, i can use both (left and right) and the statusbar looks normal. any idea what that could be? i'll upload the logcat later, unless you know what this problem is.

-edit- it seems that the statusbar and mod work like expected when in the lockscreen, and when there is a notification (when charging over usb there is a notification, so that's why it also works the way it should when charging, it also doesn't work when charging normally). because of this i can't upload a logcat, cause when using my pc (via usb) the statusbar works normally, and when using terminal emulator there is a notification, so then it also works normally.

---------- Post added at 11:47 PM ---------- Previous post was at 11:05 PM ----------

nevermind, i disabled the clock with some xml editing, and apparently that causes the disappearing of the icons and the functionality of the left/right pull.
so for anybody that for some reason removed the clock, it causes this bug (maybe it isn't a bug, i don't know yet) to happen.
 
Last edited:

BOOTMGR

Senior Member
Aug 3, 2010
728
3,395
anoobdevsdiary.blogspot.in
My original SystemUI.apk

Yep, as Goldie told they're just warnings, if statusbar has disappeared then you must have done something wrong.Post logcat here.
(Here is a tut about how to take logcat: http://xdaforums.com/showthread.php?t=2303834 )

Great tutorial, I would like to try this on Note but one question , is the zip file same for xhdpi phones?
You'll need to replace icons in drawable-hdpi folder else they'll look too small.But if you're gonna test it then try with those icons then you'll just need to replace those icons by better icons.
got it working, but there's 1 problem, when not charging, there's no icons in the statusbar, and i can only use the last used dropdown.
when it is charging, i can use both (left and right) and the statusbar looks normal. any idea what that could be? i'll upload the logcat later, unless you know what this problem is.

-edit- it seems that the statusbar and mod work like expected when in the lockscreen, and when there is a notification (when charging over usb there is a notification, so that's why it also works the way it should when charging, it also doesn't work when charging normally). because of this i can't upload a logcat, cause when using my pc (via usb) the statusbar works normally, and when using terminal emulator there is a notification, so then it also works normally.

---------- Post added at 11:47 PM ---------- Previous post was at 11:05 PM ----------

nevermind, i disabled the clock with some xml editing, and apparently that causes the disappearing of the icons and the functionality of the left/right pull.
so for anybody that for some reason removed the clock, it causes this bug (maybe it isn't a bug, i don't know yet) to happen.

Have you modified statusbar before?
Anyways i'm glad that you got it working..

can be more?

Sent from my GT-I8160 using xda app-developers app

http://xdaforums.com/showthread.php?t=2303834
 
  • Like
Reactions: ildar2099

abdoel_046

Senior Member
May 23, 2012
127
78
Indonesia
4.2.2 Style Stausbar for Samsung 4.1.2 ROM


(This tutorial is originally made for SGSA but it should work with all samsung 4.1.2 ROMs)

Before we begin let me give credit to original author of this mod @SpaceCaker i'm just gonna tell you how to port it to Samsung JB 4.1.2 ROM.
(SpaceCaker's original Thread here)

Note: Throughout the tutorial we'll travel sequentially, i mean when i ask you to search for something and you find more than two matches, then choose the immediate one which comes after previous modification.
So let's begin

- Decompile SystemUI.apk
- Navigate to res/layout









That's all compile apk and push it to device.
(Torch and Sleep tiles won't work unless you install TeslaLED and Turn Off the Lights app from market)
You can refer to SpaceCaker's thread for more info and tutorial for how to add new tiles.
If you get any errors/FCs report here along with full log.

thanks b4 for your guide:good: but after i try this guide not work for me my systemUI FC i hope you help me.. (sorry for bad my English)

Edit: SOLVED my mistake incorrect one line to edit :D
 
Last edited:

mjz2cool

Senior Member
Jun 20, 2010
1,167
125
31
hardenberg
www.facebook.com
is there a way to add actual toggles? i tried using the guides to add lidroid toggles, and then the guide to get them in a grid, but i can't seem to get the lidroid toggles to work.
 

BOOTMGR

Senior Member
Aug 3, 2010
728
3,395
anoobdevsdiary.blogspot.in
thanks b4 for your guide:good: but after i try this guide not work for me my systemUI FC i hope you help me.. (sorry for bad my English)

No log = No help

is there a way to add actual toggles? i tried using the guides to add lidroid toggles, and then the guide to get them in a grid, but i can't seem to get the lidroid toggles to work.

You need to override methods in such a way that they toggles the state of wifi/bluetooth etc instead of launching activity.I did it but problem was that tiles won't get updated after toggling state.SpaceCaker has made update() method private/ non-static (of course there was reason to do so) so we can't call is after changing state.To make it work in that i'll need to code whole things again but i don't have such time.May be in future i'll do that...:)
BTW, lidroid toggles are easy to port and arrange them in grid.
 

abdoel_046

Senior Member
May 23, 2012
127
78
Indonesia
No log = No help



You need to override methods in such a way that they toggles the state of wifi/bluetooth etc instead of launching activity.I did it but problem was that tiles won't get updated after toggling state.SpaceCaker has made update() method private/ non-static (of course there was reason to do so) so we can't call is after changing state.To make it work in that i'll need to code whole things again but i don't have such time.May be in future i'll do that...:)
BTW, lidroid toggles are easy to port and arrange them in grid.

already solved.. sorry mr.harsh i wrong edit one line it is make systemUI FC..
 

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    4.2.2 Style Stausbar for Samsung 4.1.2 ROM


    (This tutorial is originally made for SGSA but it should work with all samsung 4.1.2 ROMs)

    Before we begin let me give credit to original author of this mod @SpaceCaker i'm just gonna tell you how to port it to Samsung JB 4.1.2 ROM.
    (SpaceCaker's original Thread here)

    Note: Throughout the tutorial we'll travel sequentially, i mean when i ask you to search for something and you find more than two matches, then choose the immediate one which comes after previous modification.
    So let's begin

    - Decompile SystemUI.apk
    - Navigate to res/layout
    - tw_status_bar.xml
    search for
    Code:
    <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">
    Add this below it
    Code:
    <com.android.systemui.statusbar.StatusBarServiceLRPull android:layout_width="fill_parent" android:layout_height="wrap_content">
    - Now search for
    Code:
    <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">
    Add this above it
    Code:
    </com.android.systemui.statusbar.StatusBarServiceLRPull>
    - Save file
    - tw_status_bar_expanded.xml
    replace
    Code:
    <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/tw_close_handle_underlap">
    with
    Code:
    <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
    below it there will be <include /> clause add this line below it
    Code:
    </LinearLayout>
    below it there'll be <TextView /> add these lines below it
    Code:
    <com.spacecaker.SpaceLayOut android:layout_width="fill_parent" android:layout_height="fill_parent">
            <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
                <include layout="@layout/quickpanel_quick_settings_space" />
            </LinearLayout>
            <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/tw_close_handle_underlap">
    - Now search for
    Code:
    <com.android.systemui.statusbar.phone.CloseDragHandle
    and add this code above it
    Code:
    </com.spacecaker.SpaceLayOut>
    - Save file
    - tw_status_bar_expanded_header.xml
    search for
    Code:
    <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="visible" android:layout_width="@dimen/status_bar_expanded_setting_width" android:layout_height="39.0dip">
    replace it with below code
    Code:
    <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="invisible" android:layout_width="0.100000024dip" android:layout_height="0.100000024dip">
            <ImageView android:id="@id/settings_button_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_quickpanel_icon_settings" android:scaleType="center" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:contentDescription="@string/accessibility_settings_button" />
        </RelativeLayout>
        <RelativeLayout android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="visible" android:layout_width="@dimen/status_bar_expanded_setting_width" android:layout_height="39.0dip">
    - Search below for
    Code:
    android:contentDescription="@string/accessibility_settings_button"
    and add this above it
    Code:
    android:onClick="mOpenSettings"
    - Below after </RelativeLayout> add this code
    Code:
    <com.spacecaker.ButtonBurst android:id="@id/spacebuttonburst" android:layout_width="31.0dip" android:layout_height="34.0dip" android:scaleType="center" />
    - Save file.
    - Navigate to /res/values and add these lines to ids.xml
    Code:
    <item type="id" name="spaceybeaneyheader">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>
    - Add these lines to end of the file Styles.xml
    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>
    - Save files
    - Download attached files and extract them in the directory where apk is decompiled.Now compile and again decompile APK.
    - Go to /res/values/public.xml and search these
    Code:
    <public type="drawable" name="btn_tg"
        <public type="drawable" name="btn_toggles_normal"
    - Open smali/com/spacecaker/ButtonBurst.smali and search this
    Code:
    const v3, 0x7f020180
    replace red part with id you got from
    Code:
    <public type="drawable" name="btn_toggles_normal"

    - Now find this
    Code:
    const v3, 0x7f02017f
    replace red part with id you got from
    Code:
    <public type="drawable" name="btn_tg"
    - Open smali/com/android/systemui/SystemUIService.smali and add this to end of file
    Code:
    .method public mOpenSettings(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 camera_tile(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.sec.android.app.camera"
    
        const-string v2, "com.sec.android.app.camera.Camera"
    
        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 turn_off_light(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, "turn.off.the.lights"
    
        const-string v2, "turn.off.the.lights.LockerActivity"
    
        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 torch_toggle(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.teslacoilsw.flashlight"
    
        const-string v2, "com.teslacoilsw.flashlight.TeslaLEDToggle"
    
        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 dormant_toggle(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.dormantmode.DormantmodeSettings"
    
        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 tether_toggle(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.TetherSettings"
    
        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 app_toggle(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.RunningServices"
    
        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 bat_toggle(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.fuelgauge.PowerUsageSummary"
    
        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

    That's all compile apk and push it to device.
    (Torch and Sleep tiles won't work unless you install TeslaLED and Turn Off the Lights app from market)
    You can refer to SpaceCaker's thread for more info and tutorial for how to add new tiles.
    If you get any errors/FCs report here along with full log.
    (i won't quote posts without logcat and ask for logcat, i'll simply ignore them)
    11
    How to add Live Tiles

    So now you've setup layout for 4.2 statusbar.Now its time to add some live tiles here.

    What you'll get
    At the moment i've only created live tiles for Battery and WiFi (those are the only ones which are fairly noticeable and widely used).Live tile for battery shows battery level and WiFi tile shows AP name and signal level when connected.See below screenshot for more info.
    (More tiles will be added later when i'll get some time)


    So let's begin
    - Add thses lines to res/values/ids.xml
    Code:
    <item type="id" name="harsh_batt">false</item>
        <item type="id" name="harsh_wifi">false</item>
        <item type="id" name="harsh_bat_img">false</item>
        <item type="id" name="harsh_wifi_img">false</item>
    - Now open \res\layout\quickpanel_quick_settings_space.xml
    - Every tile here is wrapped up within <FrameLayout></FrameLayout>.So now select one of frameLayout which will be your battery tile.This framelayout will include one ImageView (for indication of battery tile) and one TextView (for showing battery in %).Create them if you haven't.
    - Now remove
    Code:
    android:src="@drawable/set"
    or whatever drawable you've associated to that ImageView.
    - Add
    Code:
    android:id="@id/harsh_bat_img"
    for same ImageView.
    - We'll do the same for TextView.Remove
    Code:
    android:text="Battery"
    and add
    Code:
    android:id="@id/harsh_batt"
    for that TextView.

    - Now let's do the same for WiFi tile.Select FrameLayout for that tile and do following changes for that FrameLayout
    - Remove
    Code:
    android:src="@drawable/set"
    for the <ImageView> and add
    Code:
    android:id="@id/harsh_wifi_img"
    - Now for <TextView>, remove
    Code:
    android:text="xxx"
    and add
    Code:
    android:id="@id/harsh_wifi"
    - Thats all.Save the files.
    - Download the attached file and extract it to decompiled directory.
    - Compile APK and decompiled it back so that public ids get generated.
    - Now keep you res/values/public.xml open.
    - Open smali\com\spacecaker\SpaceLayOut.smali
    - Add
    Code:
    .field draw:Landroid/graphics/drawable/Drawable;
    
    .field iv:Landroid/widget/ImageView;
    before .field private mContext:Landroid/content/Context;
    - Add
    Code:
    .field res:Landroid/content/res/Resources;
    
    .field t:Landroid/widget/TextView;
    
    .field userName:Ljava/lang/String;
    after .field private mUpdating:Z
    - Now search for .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V and add following lines before return-void
    Code:
    invoke-virtual {p0}, Lcom/spacecaker/SpaceLayOut;->getResources()Landroid/content/res/Resources;
    
        move-result-object v0
    
        iput-object v0, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
    - search for .method private update(Z)V and add this below .line 46 (i.e. at the starting of the method)
    Code:
    invoke-virtual {p0}, Lcom/spacecaker/SpaceLayOut;->getBatteryState()V
    
        .line 256
        invoke-virtual {p0}, Lcom/spacecaker/SpaceLayOut;->getWifiInfo()V
    - Now add the following lines after # virtual methods.
    Code:
    .method public getBatteryState()V
        .locals 13
    
        .prologue
        .line 31
        const v10, 0x7f0d012c
    
        invoke-virtual {p0, v10}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;
    
        move-result-object v10
    
        check-cast v10, Landroid/widget/TextView;
    
        iput-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
    
        .line 32
        const v10, 0x7f0d012e
    
        invoke-virtual {p0, v10}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;
    
        move-result-object v10
    
        check-cast v10, Landroid/widget/ImageView;
    
        iput-object v10, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;
    
        .line 33
        new-instance v3, Landroid/content/IntentFilter;
    
        const-string v10, "android.intent.action.BATTERY_CHANGED"
    
        invoke-direct {v3, v10}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
    
        .line 34
        .local v3, ifilter:Landroid/content/IntentFilter;
        iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->mContext:Landroid/content/Context;
    
        const/4 v11, 0x0
    
        invoke-virtual {v10, v11, v3}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
    
        move-result-object v1
    
        .line 35
        .local v1, batteryStatus:Landroid/content/Intent;
        const-string v10, "level"
    
        const/4 v11, -0x1
    
        invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
    
        move-result v5
    
        .line 36
        .local v5, level:I
        const-string v10, "scale"
    
        const/4 v11, -0x1
    
        invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
    
        move-result v7
    
        .line 37
        .local v7, scale:I
        const-string v10, "status"
    
        const/4 v11, -0x1
    
        invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
    
        move-result v8
    
        .line 38
        .local v8, status:I
        const/4 v10, 0x2
    
        if-eq v8, v10, :cond_0
    
        const/4 v10, 0x5
    
        if-eq v8, v10, :cond_0
    
        const/4 v4, 0x0
    
        .line 39
        .local v4, isCharging:Z
        :goto_0
        const-string v10, "plugged"
    
        const/4 v11, -0x1
    
        invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
    
        move-result v2
    
        .line 40
        .local v2, chargePlug:I
        const/4 v10, 0x2
    
        if-ne v2, v10, :cond_1
    
        const/4 v9, 0x1
    
        .line 41
        .local v9, usbCharge:Z
        :goto_1
        int-to-float v10, v5
    
        int-to-float v11, v7
    
        div-float v6, v10, v11
    
        .line 42
        .local v6, net_battery:F
        const/high16 v10, 0x42c8
    
        mul-float/2addr v10, v6
    
        invoke-static {v10}, Ljava/lang/Math;->round(F)I
    
        move-result v0
    
        .line 43
        .local v0, batteryPct:I
        if-eqz v4, :cond_3
    
        .line 44
        if-eqz v9, :cond_2
    
        .line 45
        iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
    
        new-instance v11, Ljava/lang/StringBuilder;
    
        invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
    
        move-result-object v12
    
        invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
    
        const-string v12, "%"
    
        invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    
        move-result-object v11
    
        const-string v12, " (USB)"
    
        invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    
        move-result-object v11
    
        invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    
        move-result-object v11
    
        invoke-virtual {v10, v11}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    
        .line 52
        :goto_2
        :try_start_0
        iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
    
        iget-object v11, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
    
        const v12, 0x7f0202ff
    
        invoke-virtual {v11, v12}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;
    
        move-result-object v11
    
        invoke-static {v10, v11}, Landroid/graphics/drawable/Drawable;->createFromXml(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;)Landroid/graphics/drawable/Drawable;
    
        move-result-object v10
    
        iput-object v10, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
        :try_end_0
        .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    
        .line 55
        :goto_3
        iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
    
        invoke-virtual {v10, v0}, Landroid/graphics/drawable/Drawable;->setLevel(I)Z
    
        .line 56
        iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;
    
        iget-object v11, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
    
        invoke-virtual {v10, v11}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V
    
        .line 57
        return-void
    
        .line 38
        .end local v0           #batteryPct:I
        .end local v2           #chargePlug:I
        .end local v4           #isCharging:Z
        .end local v6           #net_battery:F
        .end local v9           #usbCharge:Z
        :cond_0
        const/4 v4, 0x1
    
        goto :goto_0
    
        .line 40
        .restart local v2       #chargePlug:I
        .restart local v4       #isCharging:Z
        :cond_1
        const/4 v9, 0x0
    
        goto :goto_1
    
        .line 47
        .restart local v0       #batteryPct:I
        .restart local v6       #net_battery:F
        .restart local v9       #usbCharge:Z
        :cond_2
        iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
    
        new-instance v11, Ljava/lang/StringBuilder;
    
        invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
    
        move-result-object v12
    
        invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
    
        const-string v12, "%"
    
        invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    
        move-result-object v11
    
        const-string v12, " (AC)"
    
        invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    
        move-result-object v11
    
        invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    
        move-result-object v11
    
        invoke-virtual {v10, v11}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    
        goto :goto_2
    
        .line 49
        :cond_3
        iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
    
        new-instance v11, Ljava/lang/StringBuilder;
    
        invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
    
        move-result-object v12
    
        invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
    
        const-string v12, "%"
    
        invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    
        move-result-object v11
    
        invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    
        move-result-object v11
    
        invoke-virtual {v10, v11}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    
        goto :goto_2
    
        .line 53
        :catch_0
        move-exception v10
    
        goto :goto_3
    .end method
    
    .method public getWifiInfo()V
        .locals 7
    
        .prologue
        .line 59
        const v4, 0x7f0d012d
    
        invoke-virtual {p0, v4}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;
    
        move-result-object v4
    
        check-cast v4, Landroid/widget/TextView;
    
        iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
    
        .line 60
        const v4, 0x7f0d012f
    
        invoke-virtual {p0, v4}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;
    
        move-result-object v4
    
        check-cast v4, Landroid/widget/ImageView;
    
        iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;
    
        .line 61
        iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->mContext:Landroid/content/Context;
    
        const-string v5, "wifi"
    
        invoke-virtual {v4, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
    
        move-result-object v3
    
        check-cast v3, Landroid/net/wifi/WifiManager;
    
        .line 62
        .local v3, wm:Landroid/net/wifi/WifiManager;
        invoke-virtual {v3}, Landroid/net/wifi/WifiManager;->getWifiState()I
    
        move-result v2
    
        .line 63
        .local v2, wifiState:I
        packed-switch v2, :pswitch_data_0
    
        .line 86
        iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
    
        const-string v5, "Error"
    
        invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    
        .line 89
        :goto_0
        return-void
    
        .line 67
        :pswitch_0
        iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
    
        const-string v5, "Wi-Fi"
    
        invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    
        .line 69
        :try_start_0
        iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
    
        iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
    
        const v6, 0x7f020322
    
        invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;
    
        move-result-object v5
    
        invoke-static {v4, v5}, Landroid/graphics/drawable/Drawable;->createFromXml(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;)Landroid/graphics/drawable/Drawable;
    
        move-result-object v4
    
        iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
        :try_end_0
        .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
    
        .line 72
        :goto_1
        iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;
    
        iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
    
        invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V
    
        goto :goto_0
    
        .line 75
        :pswitch_1
        invoke-virtual {v3}, Landroid/net/wifi/WifiManager;->getConnectionInfo()Landroid/net/wifi/WifiInfo;
    
        move-result-object v1
    
        .line 76
        .local v1, wifiInfo:Landroid/net/wifi/WifiInfo;
        iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
    
        invoke-virtual {v1}, Landroid/net/wifi/WifiInfo;->getSSID()Ljava/lang/String;
    
        move-result-object v5
    
        invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    
        .line 77
        invoke-virtual {v1}, Landroid/net/wifi/WifiInfo;->getRssi()I
    
        move-result v4
    
        const/4 v5, 0x5
    
        invoke-static {v4, v5}, Landroid/net/wifi/WifiManager;->calculateSignalLevel(II)I
    
        move-result v0
    
        .line 79
        .local v0, signalLevel:I
        :try_start_1
        iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
    
        iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
    
        const v6, 0x7f020300
    
        invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;
    
        move-result-object v5
    
        invoke-static {v4, v5}, Landroid/graphics/drawable/Drawable;->createFromXml(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;)Landroid/graphics/drawable/Drawable;
    
        move-result-object v4
    
        iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
        :try_end_1
        .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    
        .line 82
        :goto_2
        iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
    
        invoke-virtual {v4, v0}, Landroid/graphics/drawable/Drawable;->setLevel(I)Z
    
        .line 83
        iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;
    
        iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
    
        invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V
    
        goto :goto_0
    
        .line 80
        :catch_0
        move-exception v4
    
        goto :goto_2
    
        .line 70
        .end local v0           #signalLevel:I
        .end local v1           #wifiInfo:Landroid/net/wifi/WifiInfo;
        :catch_1
        move-exception v4
    
        goto :goto_1
    
        .line 63
        nop
    
        :pswitch_data_0
        .packed-switch 0x0
            :pswitch_0
            :pswitch_0
            :pswitch_0
            :pswitch_1
        .end packed-switch
    .end method
    - Search for
    Code:
    const v15, 0x7f0d012c
    change public id which you get from
    Code:
    <public type="id" name="harsh_batt"
    in public.xml
    - Search for
    Code:
    const v15, 0x7f0d012e
    change public id which you get from
    Code:
    <public type="id" name="harsh_bat_img"
    - Search for
    Code:
    const v15, 0x7f0202ff
    change public id which you get from
    Code:
    <public type="drawable" name="harsh_stat_battery"
    - Search for
    Code:
    const v8, 0x7f0d012d
    change public id which you get from
    Code:
    <public type="id" name="harsh_wifi"
    - Search for
    Code:
    const v8, 0x7f0d012f
    change public id which you get from
    Code:
    <public type="id" name="harsh_wifi_img"
    - Search for
    Code:
    const v8, 0x7f020322
    change public id which you get from
    Code:
    <public type="drawable" name="wifi_tile"
    - Search for
    Code:
    const v8, 0x7f020300
    change public id which you get from
    Code:
    <public type="drawable" name="harsh_stat_wifi"

    - Thats it.Now save your file and compile APK and push it to device.
    7
    :fingers-crossed:
    6
    Tips,Tricks & FAQs

    Changelog:
    • 13/12/13 --> Initial Release
    • 27/12/13 --> Optimized code.Reduced lags when live tiles are implemented.Live tiles will update only when statusbar is pulled down.
    Tips, Tricks & FAQs:
    • If battery indicator or any other image don't look in center, define paddings like android:layout_marginTop="30.0dip"
    • If you've added more than 3 rows, then you need to enclose it in <ScrollView> in order to make it scrollable.
    • Even though i've named them Live tiles, they're not actually live like original 4.2.2 statusbar. They'll update only when tile layout is drawn (i mean expanded).But this has one advantage that addition overhead to system is gone.
    • Associate android: onClick="foobar" attribute to FrameLayout instead of ImageView so that clicking anywhere on the tile can execute defined method.
    • Each <LinearLayout> shows one row which have 3 FrameLayout by default.If you'll add/remove FrameLayout then width of tiles will be set accordingly.
    2
    Sorry for that because I was fed up doing that ! I am learning the basics first like modding androidpolicy.jar for ink effect ! Anyways, here is my ids.xml Here

    Code:
    <item type="id" name="spacebuttonburst">false</item>
    	<item type="id" name="recent_app_button">false</item[B][COLOR="Red"]>[/COLOR][/B]
    </resources>


    See what is wrong here.

    Tip: you miss one ">".


    If you want to do stuff like that you need to learn to debug. Get some editor with tag colorin. Like Sublime Text (it is payed, but you can use it) or Notepad++.

    I accidently put your xml to Google Chrome, and look what it gave me (all explained where error was and how to fix it).