[TUTORIAL] Mod SystemUI Menambahkan Battrey Bar
[TUTORIAL] Mod SystemUI Menambahkan Battrey Bar - Hallo sobat Jogja Android Blog, Pada Artikel yang sobat baca kali ini dengan judul [TUTORIAL] Mod SystemUI Menambahkan Battrey Bar, kami telah mempersiapkan artikel ini dengan baik untuk sobat baca dan ambil informasi didalamnya. Mudah-mudahan isi postingan [TUTORIAL] Mod SystemUI Menambahkan Battrey Bar yang kami tulis ini dapat sobat Jogja Android Blog pahami. Baiklah, selamat membaca sambil menikmati kopi.
Pertama-tama siapkan dahulu bahan-bahannya :
1. APKTool [Download]
2. 920 Text Editor [Download]
3. Root Explorer [Download]
4. Bahan Batteray Resourch [Download]
5. BatterayBarSettimg.apk [Download]
Sebelumnya agan-agan harus paham dan mengerti soal decompile/recompile APK
Langsung aja,....
Decompile SystemUI.apk
1. SystemUI.apk/res/values/attrs.xml
tambahkan line ini di baris akhir
<attr name="viewLocation" format="integer" />
diatas line
</resources>
maka akan seperti berikut :
<attr name="viewLocation" format="integer" />
</resources>
2. SystemUI.apk/res/layout/
gemini_status_bar.xml atau status_bar.xml atau zzz_status_bar.xml ( tergantung Device dan OS )
tambahkan line ini di baris akhir :
<com.android.systemui.statusbar.policy.BatteryBarController android:layout_width="fill_parent" android:layout_height="1.0dip" systemui:viewLocation="1" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
maka akan sperti berikut :
<com.android.systemui.statusbar.policy.BatteryBarController android:layout_width="fill_parent" android:layout_height="1.0dip" systemui:viewLocation="1" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
3. SystemUI.apk/res/layout/navigation_bar.xml
- tambahkan Relative layout berikut di bawah line yg ada kata -> android:id="@id/rot0"
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
- tambahkan Relative layout berikut di bawah line yg ada kata -> android:id="@id/rot90"
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:rotation="180.0" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:rotation="180.0" systemui:viewLocation="3" />
</RelativeLayout>
Maka Contoh hasilnya akan seperti berikut :
- AOSP / MEDIATEK BASE :
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.NavigationBarView android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:id="@id/rot0" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/nav_buttons" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animateLayoutChanges="true">
<View android:visibility="invisible" android:layout_width="40.0dip" android:layout_height="fill_parent" android:layout_weight="0.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_back" android:scaleType="center" android:layout_weight="0.0" android:contentDescription="@string/accessibility_back" systemui:keyCode="4" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/home" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_home" android:layout_weight="0.0" android:contentDescription="@string/accessibility_home" systemui:keyCode="3" systemui:keyRepeat="false" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/recent_apps" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_recent" android:layout_weight="0.0" android:contentDescription="@string/accessibility_recent" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/menu" android:visibility="invisible" android:layout_width="@dimen/navigation_menu_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_menu" android:layout_weight="0.0" android:contentDescription="@string/accessibility_menu" systemui:keyCode="82" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/lights_out" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:layout_width="80.0dip" android:layout_height="fill_parent" android:layout_marginLeft="40.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0.0" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<ImageView android:layout_width="80.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" android:layout_weight="0.0" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<ImageView android:layout_width="80.0dip" android:layout_height="fill_parent" android:layout_marginRight="40.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0.0" />
</LinearLayout>
<com.android.systemui.statusbar.policy.DeadZone android:layout_gravity="top" android:id="@id/deadzone" android:layout_width="fill_parent" android:layout_height="@dimen/navigation_bar_deadzone_size" />
</FrameLayout>
<FrameLayout android:id="@id/rot90" android:paddingTop="0.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:rotation="180.0" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:rotation="180.0" systemui:viewLocation="3" />
</RelativeLayout>
<LinearLayout android:orientation="vertical" android:id="@id/nav_buttons" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animateLayoutChanges="true">
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/menu" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="40.0dip" android:src="@drawable/ic_sysbar_menu_land" android:layout_weight="0.0" android:contentDescription="@string/accessibility_menu" systemui:keyCode="82" systemui:glowBackground="@drawable/ic_sysbar_highlight_land" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/recent_apps" android:layout_width="fill_parent" android:layout_height="80.0dip" android:src="@drawable/ic_sysbar_recent_land" android:layout_weight="0.0" android:contentDescription="@string/accessibility_recent" systemui:glowBackground="@drawable/ic_sysbar_highlight_land" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/home" android:layout_width="fill_parent" android:layout_height="80.0dip" android:src="@drawable/ic_sysbar_home_land" android:layout_weight="0.0" android:contentDescription="@string/accessibility_home" systemui:keyCode="3" systemui:keyRepeat="false" systemui:glowBackground="@drawable/ic_sysbar_highlight_land" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:layout_width="fill_parent" android:layout_height="80.0dip" android:src="@drawable/ic_sysbar_back_land" android:scaleType="center" android:layout_weight="0.0" android:contentDescription="@string/accessibility_back" systemui:keyCode="4" systemui:glowBackground="@drawable/ic_sysbar_highlight_land" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="40.0dip" android:layout_weight="0.0" />
</LinearLayout>
<LinearLayout android:orientation="vertical" android:id="@id/lights_out" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:layout_width="fill_parent" android:layout_height="80.0dip" android:layout_marginTop="40.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0.0" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<ImageView android:layout_width="fill_parent" android:layout_height="80.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" android:layout_weight="0.0" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<ImageView android:layout_width="fill_parent" android:layout_height="80.0dip" android:layout_marginBottom="40.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0.0" />
</LinearLayout>
<com.android.systemui.statusbar.policy.DeadZone android:layout_gravity="left" android:id="@id/deadzone" android:layout_width="@dimen/navigation_bar_deadzone_size" android:layout_height="fill_parent" />
</FrameLayout>
<View android:id="@id/rot270" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</com.android.systemui.statusbar.phone.NavigationBarView>
- CyanogenMod BASE :
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.NavigationBarView android:background="@drawable/nav_bar_bg" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:id="@id/rot0" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/container" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<include layout="@layout/mid_navigation_bar_port" />
</LinearLayout>
<LinearLayout android:gravity="center_horizontal" android:layout_gravity="center_horizontal" android:orientation="horizontal" android:id="@id/lights_out" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="40.0dip" android:layout_marginRight="40.0dip">
<ImageView android:layout_width="80.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<View android:visibility="invisible" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
<ImageView android:layout_width="80.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<View android:visibility="invisible" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
<ImageView android:layout_width="80.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<View android:visibility="invisible" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
<ImageView android:layout_width="80.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
</LinearLayout>
<com.android.systemui.statusbar.policy.KeyButtonView android:layout_gravity="center_horizontal" android:id="@id/search_light" android:visibility="gone" android:layout_width="80.0dip" android:layout_height="fill_parent" android:src="@drawable/search_light" android:scaleType="center" />
<com.android.systemui.statusbar.policy.DeadZone android:layout_gravity="top" android:id="@id/deadzone" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:minSize="@dimen/navigation_bar_deadzone_size" systemui:maxSize="@dimen/navigation_bar_deadzone_size_max" systemui:holdTime="@integer/navigation_bar_deadzone_hold" systemui:decayTime="@integer/navigation_bar_deadzone_decay" systemui:orientation="horizontal" />
</FrameLayout>
<FrameLayout android:id="@id/rot90" android:paddingTop="0.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:rotation="180.0" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:rotation="180.0" systemui:viewLocation="3" />
</RelativeLayout>
<LinearLayout android:gravity="center_vertical" android:layout_gravity="center_vertical" android:orientation="vertical" android:id="@id/container" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<include layout="@layout/mid_navigation_bar_land" />
</LinearLayout>
<LinearLayout android:gravity="center_vertical" android:layout_gravity="center_vertical" android:orientation="vertical" android:id="@id/lights_out" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="40.0dip" android:layout_marginBottom="40.0dip">
<ImageView android:layout_width="fill_parent" android:layout_height="80.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_weight="1.0" />
<ImageView android:layout_width="fill_parent" android:layout_height="80.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_weight="1.0" />
<ImageView android:layout_width="fill_parent" android:layout_height="80.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<View android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_weight="1.0" />
<ImageView android:layout_width="fill_parent" android:layout_height="80.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
</LinearLayout>
<com.android.systemui.statusbar.policy.KeyButtonView android:layout_gravity="center_vertical" android:id="@id/search_light" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="80.0dip" android:src="@drawable/search_light" android:scaleType="center" />
<com.android.systemui.statusbar.policy.DeadZone android:layout_gravity="top" android:id="@id/deadzone" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:minSize="@dimen/navigation_bar_deadzone_size" systemui:maxSize="@dimen/navigation_bar_deadzone_size_max" systemui:holdTime="@integer/navigation_bar_deadzone_hold" systemui:decayTime="@integer/navigation_bar_deadzone_decay" systemui:orientation="vertical" />
</FrameLayout>
<View android:id="@id/rot270" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</com.android.systemui.statusbar.phone.NavigationBarView>
4. SystemUI.apk/res/layout-sw600dp/navigation_bar.xml
- tambahkan Relative layout berikut di bawah line yg ada kata -> android:id="@id/rot0"
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
- tambahkan Relative layout berikut di bawah line yg ada kata -> android:id="@id/rot90"
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
Maka Contoh hasilnya akan seperti berikut :
AOSP / MEDIATEK Base
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.NavigationBarView android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:id="@id/rot0" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/nav_buttons" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animateLayoutChanges="true">
<View android:visibility="invisible" android:layout_width="48.0dip" android:layout_height="fill_parent" android:layout_marginLeft="2.0dip" android:layout_weight="0.0" />
<Space android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:paddingLeft="25.0dip" android:paddingRight="25.0dip" android:layout_width="128.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_back" android:layout_weight="0.0" android:contentDescription="@string/accessibility_back" systemui:keyCode="4" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/home" android:paddingLeft="25.0dip" android:paddingRight="25.0dip" android:layout_width="128.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_home" android:layout_weight="0.0" android:contentDescription="@string/accessibility_home" systemui:keyCode="3" systemui:keyRepeat="false" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/recent_apps" android:paddingLeft="25.0dip" android:paddingRight="25.0dip" android:layout_width="128.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_recent" android:layout_weight="0.0" android:contentDescription="@string/accessibility_recent" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<Space android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/menu" android:visibility="invisible" android:layout_width="48.0dip" android:layout_height="fill_parent" android:layout_marginRight="2.0dip" android:src="@drawable/ic_sysbar_menu" android:layout_weight="0.0" android:contentDescription="@string/accessibility_menu" systemui:keyCode="82" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/lights_out" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<Space android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<ImageView android:paddingLeft="25.0dip" android:paddingRight="25.0dip" android:layout_width="128.0dip" android:layout_height="fill_parent" android:layout_marginLeft="40.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0.0" />
<ImageView android:paddingLeft="25.0dip" android:paddingRight="25.0dip" android:layout_width="128.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" android:layout_weight="0.0" />
<ImageView android:paddingLeft="25.0dip" android:paddingRight="25.0dip" android:layout_width="128.0dip" android:layout_height="fill_parent" android:layout_marginRight="40.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0.0" />
<Space android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
</LinearLayout>
<com.android.systemui.statusbar.policy.DeadZone android:layout_gravity="top" android:id="@id/deadzone" android:layout_width="fill_parent" android:layout_height="@dimen/navigation_bar_deadzone_size" />
</FrameLayout>
<FrameLayout android:id="@id/rot90" android:paddingTop="0.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/nav_buttons" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animateLayoutChanges="true">
<View android:visibility="invisible" android:layout_width="48.0dip" android:layout_height="fill_parent" android:layout_marginLeft="2.0dip" android:layout_weight="0.0" />
<Space android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:paddingLeft="42.0dip" android:paddingRight="42.0dip" android:layout_width="162.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_back" android:layout_weight="0.0" android:contentDescription="@string/accessibility_back" systemui:keyCode="4" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/home" android:paddingLeft="42.0dip" android:paddingRight="42.0dip" android:layout_width="162.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_home" android:layout_weight="0.0" android:contentDescription="@string/accessibility_home" systemui:keyCode="3" systemui:keyRepeat="true" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/recent_apps" android:paddingLeft="42.0dip" android:paddingRight="42.0dip" android:layout_width="162.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_recent" android:layout_weight="0.0" android:contentDescription="@string/accessibility_recent" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<Space android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/menu" android:visibility="invisible" android:layout_width="48.0dip" android:layout_height="fill_parent" android:layout_marginRight="2.0dip" android:src="@drawable/ic_sysbar_menu" android:layout_weight="0.0" android:contentDescription="@string/accessibility_menu" systemui:keyCode="82" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/lights_out" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<Space android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
<ImageView android:paddingLeft="42.0dip" android:paddingRight="42.0dip" android:layout_width="162.0dip" android:layout_height="fill_parent" android:layout_marginLeft="40.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0.0" />
<ImageView android:paddingLeft="42.0dip" android:paddingRight="42.0dip" android:layout_width="162.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" android:layout_weight="0.0" />
<ImageView android:paddingLeft="42.0dip" android:paddingRight="42.0dip" android:layout_width="162.0dip" android:layout_height="fill_parent" android:layout_marginRight="40.0dip" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:layout_weight="0.0" />
<Space android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" />
</LinearLayout>
<com.android.systemui.statusbar.policy.DeadZone android:layout_gravity="top" android:id="@id/deadzone" android:layout_width="fill_parent" android:layout_height="@dimen/navigation_bar_deadzone_size" />
</FrameLayout>
<View android:id="@id/rot270" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</com.android.systemui.statusbar.phone.NavigationBarView>
CyanogenMod Base :
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.NavigationBarView android:background="@drawable/nav_bar_bg" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:id="@id/rot0" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/container" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<include layout="@layout/mid_navigation_bar_port" />
</LinearLayout>
<LinearLayout android:gravity="center_horizontal" android:layout_gravity="center_horizontal" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
<View android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
<LinearLayout android:gravity="center_horizontal" android:layout_gravity="center_horizontal" android:orientation="horizontal" android:id="@id/lights_out" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginLeft="40.0dip" android:layout_marginRight="40.0dip" android:layout_weight="1.0">
<ImageView android:paddingLeft="25.0dip" android:paddingRight="25.0dip" android:layout_width="128.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<ImageView android:paddingLeft="25.0dip" android:paddingRight="25.0dip" android:layout_width="128.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<ImageView android:paddingLeft="25.0dip" android:paddingRight="25.0dip" android:layout_width="128.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<ImageView android:paddingLeft="25.0dip" android:paddingRight="25.0dip" android:layout_width="128.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
</LinearLayout>
<View android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
</LinearLayout>
<com.android.systemui.statusbar.policy.KeyButtonView android:layout_gravity="center_horizontal" android:id="@id/search_light" android:visibility="gone" android:layout_width="128.0dip" android:layout_height="fill_parent" android:src="@drawable/search_light" android:scaleType="center" />
<com.android.systemui.statusbar.policy.DeadZone android:layout_gravity="top" android:id="@id/deadzone" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:minSize="@dimen/navigation_bar_deadzone_size" systemui:maxSize="@dimen/navigation_bar_deadzone_size_max" systemui:holdTime="@integer/navigation_bar_deadzone_hold" systemui:decayTime="@integer/navigation_bar_deadzone_decay" systemui:orientation="horizontal" />
</FrameLayout>
<FrameLayout android:id="@id/rot90" android:paddingTop="0.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
<LinearLayout android:gravity="center_horizontal" android:layout_gravity="center_horizontal" android:orientation="horizontal" android:id="@id/container" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<include layout="@layout/mid_navigation_bar_land" />
</LinearLayout>
<LinearLayout android:gravity="center_horizontal" android:layout_gravity="center_horizontal" android:orientation="horizontal" android:visibility="visible" android:layout_width="fill_parent" android:layout_height="fill_parent">
<View android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
<LinearLayout android:gravity="center_horizontal" android:layout_gravity="center_horizontal" android:orientation="horizontal" android:id="@id/lights_out" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginLeft="40.0dip" android:layout_marginRight="40.0dip" android:layout_weight="1.0">
<ImageView android:paddingLeft="42.0dip" android:paddingRight="42.0dip" android:layout_width="162.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<ImageView android:paddingLeft="42.0dip" android:paddingRight="42.0dip" android:layout_width="162.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<ImageView android:paddingLeft="42.0dip" android:paddingRight="42.0dip" android:layout_width="162.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<ImageView android:paddingLeft="42.0dip" android:paddingRight="42.0dip" android:layout_width="162.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
</LinearLayout>
<View android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" />
</LinearLayout>
<com.android.systemui.statusbar.policy.KeyButtonView android:layout_gravity="center_horizontal" android:id="@id/search_light" android:visibility="gone" android:layout_width="162.0dip" android:layout_height="fill_parent" android:src="@drawable/search_light" android:scaleType="center" />
<com.android.systemui.statusbar.policy.DeadZone android:layout_gravity="top" android:id="@id/deadzone" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:minSize="@dimen/navigation_bar_deadzone_size" systemui:maxSize="@dimen/navigation_bar_deadzone_size_max" systemui:holdTime="@integer/navigation_bar_deadzone_hold" systemui:decayTime="@integer/navigation_bar_deadzone_decay" systemui:orientation="vertical" />
</FrameLayout>
<View android:id="@id/rot270" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</com.android.systemui.statusbar.phone.NavigationBarView>
5. COMPILE SystemUI.apk dan kemudian di Decompile lagi , lalu ke hasil decompile tersebut :
System_SystemUI.apk/res/values/public.xml
cari Line berikut :
<public type="attr" name="viewLocation" id="0x7f??????" />
perhatikan -> 0x7f??????
6.SystemUI.apk/smali/com/android/systemui/R$styleable.smali
- tambahkan line
.field public static final BatteryBarController:[I = null
dibawah line :
# static fields
maka akan seperti :
# static fields
.field public static final BatteryBarController:[I = null
.field public static xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - jangan di copy !
- tambahkan line :
new-array v0, v3, [I
const v1, 0x7f??????
aput v1, v0, v2
sput-object v0, Lcom/android/systemui/R$styleable;->BatteryBarController:[I
Dibawah barisan line :
# direct methods
.method static constructor <clinit>()V
.locals 4
.prologue
const/4 v3, 0x1
const/4 v2, 0x0
maka akan seperti ini :
# direct methods
.method static constructor <clinit>()V
.locals 4
.prologue
const/4 v3, 0x1
const/4 v2, 0x0
.line 1910
new-array v0, v3, [I
const v1, 0x7f??????
aput v1, v0, v2
sput-object v0, Lcom/android/systemui/R$styleable;->BatteryBarController:[I
- perhatikan angka 0x7f?????? tersebut diganti dengan yang tadi ada di public.xml dri hasil decompile yg kedua kalinya
7. SystemUI.apk/smali/com/android/systemui/statusbar/policy/Prefs.smali
tambahkan line berikut di bawah .method public static edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;
.method public static getLastBatteryLevel(Landroid/content/Context;)I
.locals 3
.parameter "context"
.prologue
.line 46
invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v0
const-string v1, "last_battery_level"
const/16 v2, 0x32
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
move-result v0
return v0
.end method
dan line berikut di bawah .method public static read(Landroid/content/Context;)Landroid/content/SharedPreferences;
.method public static setLastBatteryLevel(Landroid/content/Context;I)V
.locals 2
.parameter "context"
.parameter "level"
.prologue
.line 42
invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "last_battery_level"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 43
return-void
.end method
maka hasilnya akan sperti berikut :
.method public static edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;
.locals 2
.parameter "context"
.prologue
.line 36
const-string v0, "status_bar"
const/4 v1, 0x0
invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
return-object v0
.end method
.method public static getLastBatteryLevel(Landroid/content/Context;)I
.locals 3
.parameter "context"
.prologue
.line 46
invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v0
const-string v1, "last_battery_level"
const/16 v2, 0x32
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
move-result v0
return v0
.end method
.method public static read(Landroid/content/Context;)Landroid/content/SharedPreferences;
.locals 2
.parameter "context"
.prologue
.line 32
const-string v0, "status_bar"
const/4 v1, 0x0
invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object v0
return-object v0
.end method
.method public static setLastBatteryLevel(Landroid/content/Context;I)V
.locals 2
.parameter "context"
.parameter "level"
.prologue
.line 42
invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "last_battery_level"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 43
return-void
.end method
SystemUI.apk/smali/com/android/systemui/statusbar/policy/
9. Selesai lalu Compile SystemUI.apk , lalu push ke system/app
9. Download BatteryBarSettings.apk , push ke system/app
Stock ROM edit bagian :
-status_bar.xml
-zzz_status_bar_gemini.xml
-zzz_status_bar_gemini_cu.xml
Lidroid edit bagain :
-zzz_status_bar_gemini_cc.xml
-zzz_status_bar_gemini_cu.xml
Catatan :
-Ikuti langkahnya dengan teliti.
-Selalu backup (buat cadangan) APK yang akan agan-agan modif.
-DWYOR
Source from : Adi AishitEru , salam hormat
Demikian Artikel dengan judul [TUTORIAL] Mod SystemUI Menambahkan Battrey Bar
Mudah-mudahan bisa memberi manfaat untuk sobat Jogja Android Blog semua. Baiklah, sampai jumpa di postingan artikel lainnya.
Sobat Jogja Android Blog sekarang membaca artikel [TUTORIAL] Mod SystemUI Menambahkan Battrey Bar dengan alamat link https://jogjandroidz.blogspot.com/2014/10/tutorial-mod-systemui-menambahkan.html
0 Response to "[TUTORIAL] Mod SystemUI Menambahkan Battrey Bar"
Post a Comment