Rabu, 29 Mei 2013

include settings


How to include settings in SystemUI

Assalamualaikum wr. wb.
Ane mau share nih cara include settings di SystemUI langsung aja
Langkah - langkahnya:

1. Buat satu gambar .png terserah gambar apa saja yg penting ukurannya 48x48 pixel, dan berinama ic_notify_quicksettings.png

2. Decompile SystemUI.apk dan cari file status_bar_expanded.xml Open with NotePad++

Cari kode ini:

<com.android.systemui.statusbar.CarrierLabel android:textSize="17.659973dip" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:orientation="vertical" android:paddingBottom="1.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_marginLeft="5.0dip" android:layout_marginTop="1.0dip" android:layout_weight="1.0" />

pastekan kode ini dibawah nya:

<ImageView android:layout_gravity="center_vertical" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:onClick="settingsButton" />

3. Lalu cari file StatusBarService.smali Open with notepad++
paste code dibawah string ini
# virtual methods

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

.prologue
.line 1717
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;

move-result-object v0

new-instance v1, Landroid/content/Intent;

const-string v2, "android.settings.SETTINGS"

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

const/high16 v2, 0x1000

invoke-virtual {v1, v2}, Landroid/content

move-result-object v1

invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

invoke-virtual {p0}, Lcom/android/systemui/statusbar/StatusBarService;->animateCollapse()V

.line 1720
return-void
.end method

4. Save kemudian compile SystemUI nya, Usahakan tidak terjadi eror
5. Move ke /system/ rubah permissionya menjadi rw.r.r lalu move ke /app/
5. Reboot Now!



Selamat mencoba semoga bermanfaat
Original thread: http://forum.xda-developers.com/showthread.php?t=2263520



Tidak ada komentar:

Posting Komentar