[MOD][GUIDE] Stand Alone Battery Bar w/Options and color picker

Didact74

Senior Member
Sep 2, 2010
609
1,877
0
Lake Shore, MD
What does this MOD do?
-Allows you to add the battery bar to your ROM with out any Add-On APKs

This is for DEVs to use to bake into their ROMs, its not a flashable ZIP. If you want this MOD and do not know how to do the work, look up my Multi-Mod with Rom Control and flash it or wait until a DEV bakes this into your favorite ROM.

This MOD is based on Verizon VRBMB1 JB 4.1.2. Any other carrier or ROM and you will probably have to do some tweaking.

Please hit the thanks button and give credit if you plan to use this. A donation of $100 is not required but its greatly appreciated :)

Lets get on with the TUT!


Disclaimer*** Always perform a Nandroid before making changes to your phone.
Disclaimer #2**** I can not promise this TUT is dead on balls but I will do my best. If you notice something I forgot or something that doesn't look right, let me know, I am only human after all.

We will be working with two files:
SystemUI.apk
SecSettings.apk

I will assume you are using my ROM control. If not you will have to extrapolate my smali settings in Rom control to blend into the file of your choice. Sorry, but I built Rom Control to keep things easy on me.

We will begin with SecSettings.

Navigate to res/xml/rom_settings.xml (if you're not using RomControl navigate to the file of your choice)
Place the following code where you like
Code:
<ListPreference android:entries="@array/battery_bar_entries" android:title="@string/battery_bar" android:key="battery_bar" android:entryValues="@array/battery_bar_values" />
    <com.didact.colorpicker.ColorPickerPreference android:title="@string/battery_bar_color" android:key="battery_bar_color" android:defaultValue="@*android:color/holo_blue_light" alphaSlider="true" />
    <ListPreference android:entries="@array/battery_bar_style_entries" android:title="@string/battery_bar_style_title" android:key="battery_bar_style" android:entryValues="@array/battery_bar_style_values" />
    <ListPreference android:entries="@array/battery_bar_thickness_entries" android:title="@string/battery_bar_thickness_title" android:key="battery_bar_thickness" android:entryValues="@array/battery_bar_thickness_values" />
    <CheckBoxPreference android:title="@string/battery_bar_animate_title" android:key="battery_bar_animate" android:summary="@string/battery_bar_animate_summary" />
Navigate to res/values/arrays
Place the following code there:
Code:
<string-array name="battery_bar_entries">
        <item>Hide</item>
        <item>Show</item>
        </string-array>
    <string-array name="battery_bar_values">
        <item>0</item>
        <item>1</item>
        </string-array>
    <string-array name="battery_bar_style_entries">
        <item>Regular</item>
        <item>Center-mirrored</item>
    </string-array>
    <string-array name="battery_bar_style_values">
        <item>0</item>
        <item>1</item>
    </string-array>
    <string-array name="battery_bar_thickness_entries">
        <item>1 dp</item>
        <item>2 dp</item>
        <item>3 dp</item>
        <item>4 dp</item>
    </string-array>
    <string-array name="battery_bar_thickness_values">
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
    </string-array>
Navigate to res/values/strings
Place the following code there:
Code:
<string name="battery_bar">Enable battery bar</string>
    <string name="battery_bar_color">Choose battery bar color</string>
    <string name="battery_bar_style_title">Battery bar style</string>
    <string name="battery_bar_thickness_title">Battery Bar Thickness</string>
    <string name="battery_bar_animate_title">Battery Bar Animation</string>
    <string name="battery_bar_animate_summary">Animate bar when charging</string>
    <string name="battery_bar_summary">%s</string>
    <string name="battery_bar_color_summary">Bar color</string>
    <string name="battery_bar_style_title_summary">%s</string>
    <string name="battery_bar_thickness_title_summary">%s</string>
Navigate to smali/com/android/settings/didact/RomSettings.smali
Add the following in RED:
Code:
# instance fields
.field mAospLockVibration:Landroid/preference/CheckBoxPreference;

[COLOR="red"].field mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

.field mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

.field mBatteryBarList:Landroid/preference/ListPreference;

.field mBatteryBarStyle:Landroid/preference/ListPreference;

.field mBatteryBarThickness:Landroid/preference/ListPreference;
[/COLOR]
.field mBatteryIcon:Landroid/preference/ListPreference;

.field mBatteryStyle:Landroid/preference/ListPreference;

.field mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;
in method .method public onCreate(Landroid/os/Bundle;)V, add the following in RED:
Code:
const-string v5, "long_press_kill"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
	
	[COLOR="red"]const-string v1, "battery_bar_style"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/ListPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v4

    invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "battery_bar_style"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    const-string v1, "battery_bar"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/ListPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v4

    invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "battery_bar"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    const-string v1, "battery_bar_thickness"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/ListPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v4

    invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "battery_bar_thickness"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
	
	const-string v1, "battery_bar_color"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Lcom/didact/colorpicker/ColorPickerPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    invoke-virtual {v1, p0}, Lcom/didact/colorpicker/ColorPickerPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[/COLOR]	
	const-string v1, "statusbar_color"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Lcom/didact/colorpicker/ColorPickerPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    invoke-virtual {v1, p0}, Lcom/didact/colorpicker/ColorPickerPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
Same method, add the following in RED
Code:
const-string v1, "display_brightness_slider"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/CheckBoxPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;

    iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v1

    invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v5, "display_brightness_slider"

    invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    if-ne v1, v2, :cond_5

    move v1, v2

    :goto_5
    invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    [COLOR="red"]const-string v1, "battery_bar_animate"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/CheckBoxPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v1

    invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v5, "battery_bar_animate"

    invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    if-ne v1, v2, :cond_6

    move v1, v2

    :goto_6
    invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[/COLOR]
    return-void

    :cond_0
    move v1, v3

    goto/16 :goto_0

    :cond_1
    move v1, v3

    goto/16 :goto_1

    :cond_2
    move v1, v3

    goto/16 :goto_2

    :cond_3
    move v1, v3

    goto :goto_3

    :cond_4
    move v1, v3

    goto :goto_4

    :cond_5
    move v1, v3

    goto :goto_5

   [COLOR="red"] :cond_6
    move v1, v3

    goto :goto_6
[/COLOR].end method
In method .method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z, add the following in RED:
Code:
const-string v6, "long_press_kill"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0

    :cond_9
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    if-ne p1, v5, :cond_a

    invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v5

    invoke-static {v5}, Lcom/didact/colorpicker/ColorPickerPreference;->convertToARGB(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V

    invoke-static {v0}, Lcom/didact/colorpicker/ColorPickerPreference;->convertToColorInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    [COLOR="red"]const-string v6, "battery_bar_color"

    invoke-static {v5, v6, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0

    :cond_a
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    if-ne p1, v5, :cond_b

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const-string v6, "battery_bar"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0

    :cond_b
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    if-ne p1, v5, :cond_c

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const-string v6, "battery_bar_style"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0

    :cond_c
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    if-ne p1, v5, :cond_0

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const-string v6, "battery_bar_thickness"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0
[/COLOR].end method
In method .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z, add the following in RED:
Code:
:cond_a
    iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;

    if-ne p2, v2, [COLOR="red"]:cond_c[/COLOR]

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v2

    invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "display_brightness_slider"

    check-cast p2, Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v4

    if-eqz v4, :cond_b

    move v0, v1

    :cond_b
    invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0

    [COLOR="red"]:cond_c
    iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    if-ne p2, v2, :cond_1

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v2

    invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "battery_bar_animate"

    check-cast p2, Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v4

    if-eqz v4, :cond_d

    move v0, v1

    :cond_d
    invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0
[/COLOR].end method
That's it for SecSettings, recompile and check the new options and toggles are there. Then move on to part two for SystemUI.



Part II SystemUI.apk


Find the attached zip file and place all files in smali/com/android/systemui/statusbar/policy

Navigate to res/layout/tw_statusbar

Add the following code in RED:
Code:
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_old" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_new" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.phone.TickerView>
    </LinearLayout>
    [COLOR="red"]<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="1" />
[/COLOR]</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Navigate to res/values/attrs

Add the following code there:
Code:
<attr name="viewLocation" format="integer" />


That's it, recompile and enjoy. Thanks button!
 

Attachments

Last edited:

MattBooth

Senior Member
Jan 4, 2011
8,403
13,710
0
33
Bradford
mattbooth.dev
Anyone using this guide needs ot add:

Code:
.method public static getLastBatteryLevel(Landroid/content/Context;)I
    .locals 3

    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 getLastFastChargeState(Landroid/content/Context;)Z
    .locals 3

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    const-string v1, "last_fcharge_state"

    const/4 v2, 0x0

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    return v0
.end method
and

Code:
.method public static setLastBatteryLevel(Landroid/content/Context;I)V
    .locals 2

    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

    return-void
.end method

.method public static setLastFastChargeState(Landroid/content/Context;Z)V
    .locals 2

    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_fcharge_state"

    invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    return-void
.end method
To

Code:
SystemUI.apk\smali\com\android\systemui\statusbar\policy\Prefs.smali

EDIT:

There's something else too because it's not working for me right now. I'll have another look tomorrow, unless @Didact74 gets to it before me :D
 
Last edited:

upndwn4par

Inactive Recognized Developer
Jan 22, 2012
3,640
10,375
0
New Jersey
Sorry guys....been a little preoccupied with my S4 :)

I will take a look at this shortly. It definitely works, if you want to diff it out with the Multi-Mod it may help too.
I just edited my previous post....Kryten2k35's edit got the mod working perfect for me.

I want to get the S4, but I am waiting to see if the bootloader gets unlocked. Since djrbliss published his exploit, I guarantee Samsung patched it already. If that's the case then anyone buying an S4 from now on will not be able to use his loki patch once the production devices get updated. It is such a shame that Sumsung locked that device down so tight. They are going to alienate the development community.
 
  • Like
Reactions: loserskater

maskerwsk

Senior Member
Dec 13, 2011
1,479
1,588
0
Sheffield
hi guys. can someone help me please?

ive done this mod and added the options to my own rom control smali.
everything works except the colour picker.

it seems the code for the colour picker doesn't work in my smali.

here is what ive added

iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

if-ne p1, v5, :cond_a

invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

move-result-object v5

invoke-static {v5}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

move-result-object v5

invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

move-result v5

invoke-static {v5}, Lcom/didact/colorpicker/ColorPickerPreference;->convertToARGB(I)Ljava/lang/String;

move-result-object v0

invoke-virtual {p1, v0}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V

invoke-static {v0}, Lcom/didact/colorpicker/ColorPickerPreference;->convertToColorInt(Ljava/lang/String;)I

move-result v1

invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

move-result-object v5

invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v5

const-string v6, "battery_bar_color"

invoke-static {v5, v6, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

goto/16 :goto_0

:cond_a
however all my other items have different v5, v6 etc -example of working code
iget-object v0, p0, Lcom/android/settings/RomSettings;->mStatusbarTransparency:Landroid/preference/ListPreference;

if-ne p1, v0, :cond_6

check-cast p2, Ljava/lang/String;

invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

move-result-object v0

invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

move-result v1

invoke-virtual {p0}, Lcom/android/settings/RomSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v0

const-string v2, "status_bar_transparency"

invoke-static {v0, v2, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

:cond_6
ca anyone suggest what the vNo. and pNo.s need to be changed too?
I did change the cond values to match mine and removed all reference to "settings/didact/RomSettings" as my rom_control smali is "settings/RomSettings"

thanks.
 
Last edited:

Rogers Alavrez RoGod

Senior Member
Nov 27, 2012
53
69
0
VENEZUELA
www.facebook.com
What does this MOD do?
-Allows you to add the battery bar to your ROM with out any Add-On APKs

This is for DEVs to use to bake into their ROMs, its not a flashable ZIP. If you want this MOD and do not know how to do the work, look up my Multi-Mod with Rom Control and flash it or wait until a DEV bakes this into your favorite ROM.

This MOD is based on Verizon VRBMB1 JB 4.1.2. Any other carrier or ROM and you will probably have to do some tweaking.

Please hit the thanks button and give credit if you plan to use this. A donation of $100 is not required but its greatly appreciated :)

Lets get on with the TUT!


Disclaimer*** Always perform a Nandroid before making changes to your phone.
Disclaimer #2**** I can not promise this TUT is dead on balls but I will do my best. If you notice something I forgot or something that doesn't look right, let me know, I am only human after all.

We will be working with two files:
SystemUI.apk
SecSettings.apk

I will assume you are using my ROM control. If not you will have to extrapolate my smali settings in Rom control to blend into the file of your choice. Sorry, but I built Rom Control to keep things easy on me.

We will begin with SecSettings.

Navigate to res/xml/rom_settings.xml (if you're not using RomControl navigate to the file of your choice)
Place the following code where you like
Code:
<ListPreference android:entries="@array/battery_bar_entries" android:title="@string/battery_bar" android:key="battery_bar" android:entryValues="@array/battery_bar_values" />
    <com.didact.colorpicker.ColorPickerPreference android:title="@string/battery_bar_color" android:key="battery_bar_color" android:defaultValue="@*android:color/holo_blue_light" alphaSlider="true" />
    <ListPreference android:entries="@array/battery_bar_style_entries" android:title="@string/battery_bar_style_title" android:key="battery_bar_style" android:entryValues="@array/battery_bar_style_values" />
    <ListPreference android:entries="@array/battery_bar_thickness_entries" android:title="@string/battery_bar_thickness_title" android:key="battery_bar_thickness" android:entryValues="@array/battery_bar_thickness_values" />
    <CheckBoxPreference android:title="@string/battery_bar_animate_title" android:key="battery_bar_animate" android:summary="@string/battery_bar_animate_summary" />
Navigate to res/values/arrays
Place the following code there:
Code:
<string-array name="battery_bar_entries">
        <item>Hide</item>
        <item>Show</item>
        </string-array>
    <string-array name="battery_bar_values">
        <item>0</item>
        <item>1</item>
        </string-array>
    <string-array name="battery_bar_style_entries">
        <item>Regular</item>
        <item>Center-mirrored</item>
    </string-array>
    <string-array name="battery_bar_style_values">
        <item>0</item>
        <item>1</item>
    </string-array>
    <string-array name="battery_bar_thickness_entries">
        <item>1 dp</item>
        <item>2 dp</item>
        <item>3 dp</item>
        <item>4 dp</item>
    </string-array>
    <string-array name="battery_bar_thickness_values">
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
    </string-array>
Navigate to res/values/strings
Place the following code there:
Code:
<string name="battery_bar">Enable battery bar</string>
    <string name="battery_bar_color">Choose battery bar color</string>
    <string name="battery_bar_style_title">Battery bar style</string>
    <string name="battery_bar_thickness_title">Battery Bar Thickness</string>
    <string name="battery_bar_animate_title">Battery Bar Animation</string>
    <string name="battery_bar_animate_summary">Animate bar when charging</string>
    <string name="battery_bar_summary">%s</string>
    <string name="battery_bar_color_summary">Bar color</string>
    <string name="battery_bar_style_title_summary">%s</string>
    <string name="battery_bar_thickness_title_summary">%s</string>
Navigate to smali/com/android/settings/didact/RomSettings.smali
Add the following in RED:
Code:
# instance fields
.field mAospLockVibration:Landroid/preference/CheckBoxPreference;

[COLOR="red"].field mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

.field mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

.field mBatteryBarList:Landroid/preference/ListPreference;

.field mBatteryBarStyle:Landroid/preference/ListPreference;

.field mBatteryBarThickness:Landroid/preference/ListPreference;
[/COLOR]
.field mBatteryIcon:Landroid/preference/ListPreference;

.field mBatteryStyle:Landroid/preference/ListPreference;

.field mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;
in method .method public onCreate(Landroid/os/Bundle;)V, add the following in RED:
Code:
const-string v5, "long_press_kill"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
	
	[COLOR="red"]const-string v1, "battery_bar_style"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/ListPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v4

    invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "battery_bar_style"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    const-string v1, "battery_bar"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/ListPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v4

    invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "battery_bar"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    const-string v1, "battery_bar_thickness"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/ListPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v4

    invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "battery_bar_thickness"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
	
	const-string v1, "battery_bar_color"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Lcom/didact/colorpicker/ColorPickerPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    invoke-virtual {v1, p0}, Lcom/didact/colorpicker/ColorPickerPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[/COLOR]	
	const-string v1, "statusbar_color"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Lcom/didact/colorpicker/ColorPickerPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    invoke-virtual {v1, p0}, Lcom/didact/colorpicker/ColorPickerPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
Same method, add the following in RED
Code:
const-string v1, "display_brightness_slider"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/CheckBoxPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;

    iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v1

    invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v5, "display_brightness_slider"

    invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    if-ne v1, v2, :cond_5

    move v1, v2

    :goto_5
    invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    [COLOR="red"]const-string v1, "battery_bar_animate"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/CheckBoxPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v1

    invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v5, "battery_bar_animate"

    invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    if-ne v1, v2, :cond_6

    move v1, v2

    :goto_6
    invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[/COLOR]
    return-void

    :cond_0
    move v1, v3

    goto/16 :goto_0

    :cond_1
    move v1, v3

    goto/16 :goto_1

    :cond_2
    move v1, v3

    goto/16 :goto_2

    :cond_3
    move v1, v3

    goto :goto_3

    :cond_4
    move v1, v3

    goto :goto_4

    :cond_5
    move v1, v3

    goto :goto_5

   [COLOR="red"] :cond_6
    move v1, v3

    goto :goto_6
[/COLOR].end method
In method .method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z, add the following in RED:
Code:
const-string v6, "long_press_kill"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0

    :cond_9
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    if-ne p1, v5, :cond_a

    invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v5

    invoke-static {v5}, Lcom/didact/colorpicker/ColorPickerPreference;->convertToARGB(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V

    invoke-static {v0}, Lcom/didact/colorpicker/ColorPickerPreference;->convertToColorInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    [COLOR="red"]const-string v6, "battery_bar_color"

    invoke-static {v5, v6, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0

    :cond_a
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    if-ne p1, v5, :cond_b

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const-string v6, "battery_bar"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0

    :cond_b
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    if-ne p1, v5, :cond_c

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const-string v6, "battery_bar_style"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0

    :cond_c
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    if-ne p1, v5, :cond_0

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const-string v6, "battery_bar_thickness"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0
[/COLOR].end method
In method .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z, add the following in RED:
Code:
:cond_a
    iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;

    if-ne p2, v2, [COLOR="red"]:cond_c[/COLOR]

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v2

    invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "display_brightness_slider"

    check-cast p2, Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v4

    if-eqz v4, :cond_b

    move v0, v1

    :cond_b
    invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0

    [COLOR="red"]:cond_c
    iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    if-ne p2, v2, :cond_1

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v2

    invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "battery_bar_animate"

    check-cast p2, Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v4

    if-eqz v4, :cond_d

    move v0, v1

    :cond_d
    invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0
[/COLOR].end method
That's it for SecSettings, recompile and check the new options and toggles are there. Then move on to part two for SystemUI.



Part II SystemUI.apk


Find the attached zip file and place all files in smali/com/android/systemui/statusbar/policy

Navigate to res/layout/tw_statusbar

Add the following code in RED:
Code:
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_old" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_new" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.phone.TickerView>
    </LinearLayout>
    [COLOR="red"]<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="1" />
[/COLOR]</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Navigate to res/values/attrs

Add the following code there:
Code:
<attr name="viewLocation" format="integer" />


That's it, recompile and enjoy. Thanks button!
My settigs.apk folder does not have the DIDAC someone cannot give me the route please PLIS PLIS
 

f120ltn

Member
Jan 23, 2015
33
2
0
What does this MOD do?
-Allows you to add the battery bar to your ROM with out any Add-On APKs

This is for DEVs to use to bake into their ROMs, its not a flashable ZIP. If you want this MOD and do not know how to do the work, look up my Multi-Mod with Rom Control and flash it or wait until a DEV bakes this into your favorite ROM.

This MOD is based on Verizon VRBMB1 JB 4.1.2. Any other carrier or ROM and you will probably have to do some tweaking.

Please hit the thanks button and give credit if you plan to use this. A donation of $100 is not required but its greatly appreciated :)

Lets get on with the TUT!


Disclaimer*** Always perform a Nandroid before making changes to your phone.
Disclaimer #2**** I can not promise this TUT is dead on balls but I will do my best. If you notice something I forgot or something that doesn't look right, let me know, I am only human after all.

We will be working with two files:
SystemUI.apk
SecSettings.apk

I will assume you are using my ROM control. If not you will have to extrapolate my smali settings in Rom control to blend into the file of your choice. Sorry, but I built Rom Control to keep things easy on me.

We will begin with SecSettings.

Navigate to res/xml/rom_settings.xml (if you're not using RomControl navigate to the file of your choice)
Place the following code where you like
Code:
<ListPreference android:entries="@array/battery_bar_entries" android:title="@string/battery_bar" android:key="battery_bar" android:entryValues="@array/battery_bar_values" />
    <com.didact.colorpicker.ColorPickerPreference android:title="@string/battery_bar_color" android:key="battery_bar_color" android:defaultValue="@*android:color/holo_blue_light" alphaSlider="true" />
    <ListPreference android:entries="@array/battery_bar_style_entries" android:title="@string/battery_bar_style_title" android:key="battery_bar_style" android:entryValues="@array/battery_bar_style_values" />
    <ListPreference android:entries="@array/battery_bar_thickness_entries" android:title="@string/battery_bar_thickness_title" android:key="battery_bar_thickness" android:entryValues="@array/battery_bar_thickness_values" />
    <CheckBoxPreference android:title="@string/battery_bar_animate_title" android:key="battery_bar_animate" android:summary="@string/battery_bar_animate_summary" />
Navigate to res/values/arrays
Place the following code there:
Code:
<string-array name="battery_bar_entries">
        <item>Hide</item>
        <item>Show</item>
        </string-array>
    <string-array name="battery_bar_values">
        <item>0</item>
        <item>1</item>
        </string-array>
    <string-array name="battery_bar_style_entries">
        <item>Regular</item>
        <item>Center-mirrored</item>
    </string-array>
    <string-array name="battery_bar_style_values">
        <item>0</item>
        <item>1</item>
    </string-array>
    <string-array name="battery_bar_thickness_entries">
        <item>1 dp</item>
        <item>2 dp</item>
        <item>3 dp</item>
        <item>4 dp</item>
    </string-array>
    <string-array name="battery_bar_thickness_values">
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
    </string-array>
Navigate to res/values/strings
Place the following code there:
Code:
<string name="battery_bar">Enable battery bar</string>
    <string name="battery_bar_color">Choose battery bar color</string>
    <string name="battery_bar_style_title">Battery bar style</string>
    <string name="battery_bar_thickness_title">Battery Bar Thickness</string>
    <string name="battery_bar_animate_title">Battery Bar Animation</string>
    <string name="battery_bar_animate_summary">Animate bar when charging</string>
    <string name="battery_bar_summary">%s</string>
    <string name="battery_bar_color_summary">Bar color</string>
    <string name="battery_bar_style_title_summary">%s</string>
    <string name="battery_bar_thickness_title_summary">%s</string>
Navigate to smali/com/android/settings/didact/RomSettings.smali
Add the following in RED:
Code:
# instance fields
.field mAospLockVibration:Landroid/preference/CheckBoxPreference;

[COLOR="red"].field mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

.field mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

.field mBatteryBarList:Landroid/preference/ListPreference;

.field mBatteryBarStyle:Landroid/preference/ListPreference;

.field mBatteryBarThickness:Landroid/preference/ListPreference;
[/COLOR]
.field mBatteryIcon:Landroid/preference/ListPreference;

.field mBatteryStyle:Landroid/preference/ListPreference;

.field mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;
in method .method public onCreate(Landroid/os/Bundle;)V, add the following in RED:
Code:
const-string v5, "long_press_kill"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
	
	[COLOR="red"]const-string v1, "battery_bar_style"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/ListPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v4

    invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "battery_bar_style"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    const-string v1, "battery_bar"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/ListPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v4

    invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "battery_bar"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    const-string v1, "battery_bar_thickness"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/ListPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v4

    invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "battery_bar_thickness"

    invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
	
	const-string v1, "battery_bar_color"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Lcom/didact/colorpicker/ColorPickerPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    invoke-virtual {v1, p0}, Lcom/didact/colorpicker/ColorPickerPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[/COLOR]	
	const-string v1, "statusbar_color"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Lcom/didact/colorpicker/ColorPickerPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    invoke-virtual {v1, p0}, Lcom/didact/colorpicker/ColorPickerPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
Same method, add the following in RED
Code:
const-string v1, "display_brightness_slider"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/CheckBoxPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;

    iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v1

    invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v5, "display_brightness_slider"

    invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    if-ne v1, v2, :cond_5

    move v1, v2

    :goto_5
    invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    [COLOR="red"]const-string v1, "battery_bar_animate"

    invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/CheckBoxPreference;

    iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v1

    invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v5, "battery_bar_animate"

    invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    if-ne v1, v2, :cond_6

    move v1, v2

    :goto_6
    invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[/COLOR]
    return-void

    :cond_0
    move v1, v3

    goto/16 :goto_0

    :cond_1
    move v1, v3

    goto/16 :goto_1

    :cond_2
    move v1, v3

    goto/16 :goto_2

    :cond_3
    move v1, v3

    goto :goto_3

    :cond_4
    move v1, v3

    goto :goto_4

    :cond_5
    move v1, v3

    goto :goto_5

   [COLOR="red"] :cond_6
    move v1, v3

    goto :goto_6
[/COLOR].end method
In method .method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z, add the following in RED:
Code:
const-string v6, "long_press_kill"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0

    :cond_9
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarColor:Lcom/didact/colorpicker/ColorPickerPreference;

    if-ne p1, v5, :cond_a

    invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v5

    invoke-static {v5}, Lcom/didact/colorpicker/ColorPickerPreference;->convertToARGB(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V

    invoke-static {v0}, Lcom/didact/colorpicker/ColorPickerPreference;->convertToColorInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    [COLOR="red"]const-string v6, "battery_bar_color"

    invoke-static {v5, v6, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0

    :cond_a
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarList:Landroid/preference/ListPreference;

    if-ne p1, v5, :cond_b

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const-string v6, "battery_bar"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0

    :cond_b
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    if-ne p1, v5, :cond_c

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const-string v6, "battery_bar_style"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0

    :cond_c
    iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    if-ne p1, v5, :cond_0

    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v5

    invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const-string v6, "battery_bar_thickness"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    move-result v2

    goto/16 :goto_0
[/COLOR].end method
In method .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z, add the following in RED:
Code:
:cond_a
    iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;

    if-ne p2, v2, [COLOR="red"]:cond_c[/COLOR]

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v2

    invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "display_brightness_slider"

    check-cast p2, Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v4

    if-eqz v4, :cond_b

    move v0, v1

    :cond_b
    invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0

    [COLOR="red"]:cond_c
    iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    if-ne p2, v2, :cond_1

    invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;

    move-result-object v2

    invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "battery_bar_animate"

    check-cast p2, Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v4

    if-eqz v4, :cond_d

    move v0, v1

    :cond_d
    invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0
[/COLOR].end method
That's it for SecSettings, recompile and check the new options and toggles are there. Then move on to part two for SystemUI.



Part II SystemUI.apk


Find the attached zip file and place all files in smali/com/android/systemui/statusbar/policy

Navigate to res/layout/tw_statusbar

Add the following code in RED:
Code:
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_old" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_new" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.phone.TickerView>
    </LinearLayout>
    [COLOR="red"]<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="1" />
[/COLOR]</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Navigate to res/values/attrs

Add the following code there:
Code:
<attr name="viewLocation" format="integer" />


That's it, recompile and enjoy. Thanks button!
i use rom 4.1.2 (LG) but see RomSettings.jar
PL: the same it and code
 

syaeful

Senior Member
Jul 31, 2013
130
87
0
Purbalingga
i use rom 4.1.2 (LG) but see RomSettings.jar
PL: the same it and code
My settigs.apk folder does not have the DIDAC someone cannot give me the route please PLIS PLIS
for part Settings, you can port it to DisplaySettings.smali and put part ListPreference and CheckboxPreference to res/xml/DisplaySettings.xml sir.. ;)

and please don't quote op. thanks
 
  • Like
Reactions: f120ltn

Dragonnoi

New member
May 3, 2014
3
0
0
I use android lollipop and I want to ask that how can I apply this mod for my Rom, because I can't find SecSettings.xml file? Thanks you very much! :)