[Guide][tut] [LP/MM] Cyanogenmod Battery Styles (stock/circle dotted/percentage/cm) - Sony Cross-Device Development Themes and Apps

Hello guys
today i would like to post a small tut battery styles
as per users request
first i would like to thank
aliv Rom, Basar and Vanya Melnechenko from MAAADR group
from their source i had ported for LP/MM with small changes
This is specially for sony ( if for any other roms Please compare system_icon.xml )
Features:
Hide/Show Stock battery
Battery Styles
Icon
Percentage
Icon with Percentage
Icon with percentage (JB style)
Circle
Circle with percentage
Dotted Circle
Dotted circle with percentage
No battery
Battery color
Circle animation speed
Percent text color
precent text charging color
apply mods
For this all you required :-
Deodexed SystemUI.apk and patience
look for post #2

Systemui ( First part )
1. Decompile SystemUI.apk
2. Download this Attchment View attachment SystemUI.zip and merge
open systemui.apk/res/arrays.xml
before </resources> add this
Code:
<integer-array name="batterymeter_color_levels_1">
<item>4</item>
<item>15</item>
<item>100</item>
</integer-array>
<array name="batterymeter_color_values_1">
<item>#ffff3300</item>
<item>#ffff3300</item>
<item>#ffffffff</item>
</array>
<integer-array name="batterymeter_inverted_bolt_points">
<item>743</item>
<item>73</item>
<item>743</item>
<item>292</item>
<item>442</item>
<item>201</item>
<item>442</item>
<item>400</item>
<item>0</item>
<item>20</item>
<item>369</item>
<item>157</item>
<item>369</item>
<item>0</item>
</integer-array>
open systemui.apk/res/attrs.xml
before </resources> add this
Code:
<attr name="batteryView" format="string" />
open systemui.apk/res/colors.xml
before </resources> add this
Code:
<color name="batterymeter_critical">#ffff3300</color>
<color name="batterymeter_low">#ffff3300</color>
<color name="batterymeter_full">#ffffffff</color>
<color name="battery_text_color">#ffffffff</color>
<color name="statusbar_clock_color">#ffffffff</color>
open systemui.apk/res/styles.xmlbefore </resources> add this
Code:
<style name="TextAppearance.StatusBar.Battery" parent="@android:style/TextAppearance.StatusBar.Icon">
<item name="android:textSize">13.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">@color/status_bar_clock_color</item>
</style>
now compile and decompile for public ids
Now open com/android/systemui/statusbar/phone/phonestatusbar.smali
find this
Code:
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;
before that add this line
Code:
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatterySettingsObserver;,
now look for this
Code:
.field private mBackdropInterpolator:Landroid/view/animation/Interpolator;
below that add these lines
Code:
.field private mBattery:Lcom/android/systemui/BatteryMeterViewMod;
.field private mCircleBattery:Lcom/android/systemui/BatteryCircleMeterView;
find this access code
Code:
.method static synthetic access$7800(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/widget/ImageView;
access$7800 may differ so dont worry
above that add this
Code:
.method static synthetic access$77000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.locals 0
.param p0, "x0" # Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
.prologue
.line 155
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateBatteryIcons()V
return-void
.end method
now look for this method
Code:
.method private updateClearAll()V
above that add this method
Code:
.method private updateBatteryIcons()V
.locals 2
.prologue
const/4 v1, 0x0
.line 723
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBattery:Lcom/android/systemui/BatteryMeterViewMod;
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCircleBattery:Lcom/android/systemui/BatteryCircleMeterView;
if-eqz v0, :cond_0
.line 724
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBattery:Lcom/android/systemui/BatteryMeterViewMod;
invoke-virtual {v0, v1}, Lcom/android/systemui/BatteryMeterViewMod;->updateSettings(Z)V
.line 725
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCircleBattery:Lcom/android/systemui/BatteryCircleMeterView;
invoke-virtual {v0, v1}, Lcom/android/systemui/BatteryCircleMeterView;->updateSettings(Z)V
.line 727
:cond_0
return-void
.end method
now look for this method
Code:
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
in that method
look for this line
Code:
invoke-virtual {v0, v3, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
below that line add this code
Code:
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f10021d
invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Lcom/android/systemui/BatteryMeterViewMod;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBattery:Lcom/android/systemui/BatteryMeterViewMod;
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f10021c
invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Lcom/android/systemui/BatteryCircleMeterView;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCircleBattery:Lcom/android/systemui/BatteryCircleMeterView;
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateBatteryIcons()V
change the ids compare with mine and replace with yours
now look for this method
Code:
.method public start()V
in that find this line
Code:
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
above that line add this
Code:
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatterySettingsObserver;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;
invoke-direct {v0, p0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatterySettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatterySettingsObserver;->observe()V
save it and close
3. Now open com/android/systemui/R$styleable.smali
look for this
Code:
.field public static final AnalogClock:[I
below that add this
Code:
.field public static final BatteryIcon:[I
now look for this
Code:
sput-object v0, Lcom/android/systemui/R$styleable;->AnalogClock:[I
below add this
Code:
new-array v0, v3, [I
const v1, 0x7f01003c
aput v1, v0, v2
sput-object v0, Lcom/android/systemui/R$styleable;->BatteryIcon:[I
compare id from mine and replace
save it and close
compare my public ids and replace with your ids
from these files
com/android/systemui/BatteryCircleMeterView
com/android/systemui/BatteryMeterView
com/android/systemui/BatteryMeterView$BatteryTracker
and you are finally done
save it all and compile and replace

settings.apk final part editing
1. Download this app View attachment app-release.apk
2. Install the app
3. Have fun with this mod
no time to make settings
but one fine day i will add tut to add in settings app
Have fun
Dont forget to mention me if you used my work

Mod edit:
OP quote removed
wait for add to settings sir :fingers-crossed:

Work for systemui xperia X mod?

InitialL_Dee said:
wait for add to settings sir :fingers-crossed:
Click to expand...
Click to collapse
yhu dnt need to quote tha whole post just to post please.... edit please!

InitialL_Dee said:
wait for add to settings sir :fingers-crossed:
Click to expand...
Click to collapse
Hmm sure I will add but when I am free haha
Delete the quote bro
Make thread clean
vandiaz_sairavinz said:
Work for systemui xperia X mod?
Click to expand...
Click to collapse
Yes will work bro tested

@venkat kamesh thanks for the guide. I am going to have a busy weekend. ?
Sent from my SM-G935F using Tapatalk

Nice guide sir..
And By the way, did you ever try to port battery style from bliss pop 5.1..?

Screenshot please. thanks

venkat kamesh said:
vandiaz_sairavinz said:
Work for systemui xperia X mod?
Click to expand...
Click to collapse
Yes will work bro tested
Click to expand...
Click to collapse
I'm using Xperia X SystemUI, but my .smali doesn't have these lines:
Code:
invoke-virtual {v0, v3, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
Code:
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
Is there something else I should be looking for?

@venkat kamesh
Hi bro
I can't find this line
Code:
invoke-virtual {v0, v3, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
I am using Xperia X SystemUI. U told its working with X SystemUI too.
@Bloodlvst bro same here.

Awsm mod bro ?
Any guide(mod or theming) of xperia x systemui for cm12.1 ☺
Thx bro

Bloodlvst said:
I'm using Xperia X SystemUI, but my .smali doesn't have these lines:
Code:
invoke-virtual {v0, v3, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
Code:
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
Is there something else I should be looking for?
Click to expand...
Click to collapse
Rajeev said:
@venkat kamesh
Hi bro
I can't find this line
Code:
invoke-virtual {v0, v3, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
I am using Xperia X SystemUI. U told its working with X SystemUI too.
@Bloodlvst bro same here.
Click to expand...
Click to collapse
Instead of this
Code:
invoke-virtual {v0, v3, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
Search for this
Code:
invoke-virtual/range {v4 .. v9}, Landroid/content/Context;->registerReceiverAsUser(Landroid/content/BroadcastReceiver;Landroid/os/UserHandle;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;)Landroid/content/Intent;
Instead of this
Code:
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
Search for this
Code:
:cond_0
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->addNavigationBar()V
Just search these lines instead of those two and do all stuff as said by op.

jitz975 said:
Just search these lines instead of those two and do all stuff as said by op.
Click to expand...
Click to collapse
Gave this a shot, but I'm getting force close in SystemUI.
Couple of notes - the 2 files at the end:
BatteryMeterView
BatteryMeterView$BatteryTracker
Am I editing those or am I editing:
BatteryMeterViewMod
BatteryMeterViewMod$BatteryTracker
I ask because the puiblic ID's in BatteryMeterView don't match at all with the public(compare).xml, but the "mod" ones do. Is there a step missing?
Hopefully it's just a small issue! :fingers-crossed:

Bloodlvst said:
Gave this a shot, but I'm getting force close in SystemUI.
Couple of notes - the 2 files at the end:
BatteryMeterView
BatteryMeterView$BatteryTracker
Am I editing those or am I editing:
BatteryMeterViewMod
BatteryMeterViewMod$BatteryTracker
I ask because the puiblic ID's in BatteryMeterView don't match at all with the public(compare).xml, but the "mod" ones do. Is there a step missing?
Hopefully it's just a small issue! :fingers-crossed:
Click to expand...
Click to collapse
Bro i did this mod, only using this guide and it worked at first go.

jitz975 said:
Bro i did this mod, only using this guide and it worked at first go.
Click to expand...
Click to collapse
Did you change the ID's in:
BatteryMeterView
BatteryMeterView$BatteryTracker
Or the ones in:
BatteryMeterViewMod
BatteryMeterViewMod$BatteryTracker
I'll give it another go!

Bloodlvst said:
Did you change the ID's in:
BatteryMeterView
BatteryMeterView$BatteryTracker
Or the ones in:
BatteryMeterViewMod
BatteryMeterViewMod$BatteryTracker
I'll give it another go!
Click to expand...
Click to collapse
Yes, id's are in these two
BatteryMeterViewMod
BatteryMeterViewMod$BatteryTracker, op missed that mod part

If using Xperia X UI, you will need to replace your system_icons.xml with the following code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:id="@id/system_icons" android:layout_width="wrap_content" 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">
<com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="0.0dip" layout="@layout/signal_cluster_view" />
<com.android.systemui.BatteryMeterViewMod android:id="@+id/battery_stock" android:visibility="gone" android:layout_width="10.5dip" android:layout_height="16.0dip" android:layout_marginBottom="1.0px" android:layout_marginStart="0.0dip" systemui:batteryView="statusbar" />
<com.android.systemui.BatteryCircleMeterView android:textAppearance="@style/TextAppearance.StatusBar.Battery" android:gravity="bottom" android:id="@+id/circle_battery" android:paddingLeft="0.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" systemui:batteryView="statusbar" />
<com.android.systemui.rz.LeftLayout android:layout_width="wrap_content" android:layout_height="wrap_content" key="battery_hide">
<LinearLayout android:gravity="center_vertical" android:id="@id/battery_group" android:layout_width="wrap_content" android:layout_height="wrap_content">
<com.sonymobile.systemui.BatteryLevelView android:textSize="@dimen/battery_level_text_size" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:id="@id/battery_level" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:importantForAccessibility="noHideDescendants" />
<com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="9.5dip" android:layout_height="14.5dip" android:layout_marginBottom="@dimen/battery_margin_bottom" android:layout_marginStart="@dimen/battery_margin_start" />
</LinearLayout>
</com.android.systemui.rz.LeftLayout>
</LinearLayout>

@venkat kamesh - Bro, is there any plans to make it so you don't need to restart systemUI to make changes? Or is this a limitation of Marshmallow?

Related

[Q] [HOW TO]Add EDT-based statusbar tweaks

Hello...Want to share my experience of moding stock rom...
This manual helps You to add EDT-based tweaks to our phone.
Apologize for my bad English
!!!This was tested only on 2.3.6 stock Rom!!!
All changes you do at your own risk. I'm not responsible for any damage to your device
All credit goes to: Romanbb
Original thread
Key features:
- removing standard battery icon from the panel, replacing (or adding to the standard) the standard icon percentage indicator in increments of 1%, change percentage indicator color
- removing clock from the panel, change clock colour.
And more....
Bugs:
- not working changing of signal indicator
- any modifications to the icons will take some time to update
As I said, it's only my experience, and maybe it's little wrong. Please, try and tell me, how it works
And one more thing...I hope people, who read this manual know how to decompile/recompile system apk's :fingers-crossed:
Ok..let's start
You need to decompile your SystemUI.apk
Than take the BatteryText*.smali and Clock*.smali files from archive(see "attachments") and put them
into your SystemUI/smali/com/android/systemui/statusbar/ directory.
Then open SystemUI/smali/com/android/systemui/statusbar/policy/StatusBarPolicy.smali
and search this strings:
const-string v7, "battery"
invoke-virtual {v6, v7, v2, v3}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;II)V
Click to expand...
Click to collapse
Add below this:
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "show_battery_icon"
invoke-static {v2, v3, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-nez v2, :cond_0
const v2, 0x0
invoke-virtual {v6, v7, v2}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
return-void
Click to expand...
Click to collapse
So, your code should look like this (or something like that) :
const-string v7, "battery"
invoke-virtual {v6, v7, v2, v3}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;II)V
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "show_battery_icon"
invoke-static {v2, v3, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-nez v2, :cond_0
const v2, 0x0
invoke-virtual {v6, v7, v2}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
return-void
.line 652
const-string v6, "plugged"
Click to expand...
Click to collapse
We finish with *.smali.
Next step. Open SystemUI/res/layout/status_bar.xml and search for this:
Code:
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" />
Add below:
Code:
<com.android.systemui.statusbar.BatteryText android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center_vertical" android:orientation="horizontal" android:paddingRight="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" />
Thats all. Now compile your SystemUI.apk.
Copy SystemUI.apk and ETD.apk (see "attachments") to your system/app/ directory
Reboot. Enjoy.
Hope I helped someone
VavanL said:
Hello...Want to share my experience of moding stock rom...
This manual helps You to add EDT-based tweaks to our phone.
Apologize for my bad English
!!!This was tested only on 2.3.6 stock Rom!!!
All changes you do at your own risk. I'm not responsible for any damage to your device
All credit goes to: Romanbb
Original thread
Key features:
- removing standard battery icon from the panel, replacing (or adding to the standard) the standard icon percentage indicator in increments of 1%, change percentage indicator color
- removing clock from the panel, change clock colour.
And more....
Bugs:
- not working changing of signal indicator
- any modifications to the icons will take some time to update
As I said, it's only my experience, and maybe it's little wrong. Please, try and tell me, how it works
And one more thing...I hope people, who read this manual know how to decompile/recompile system apk's :fingers-crossed:
Ok..let's start
You need to decompile your SystemUI.apk
Than take the BatteryText*.smali and Clock*.smali files from archive(see "attachments") and put them
into your SystemUI/smali/com/android/systemui/statusbar/ directory.
Then open SystemUI/smali/com/android/systemui/statusbar/policy/StatusBarPolicy.smali
and search this strings:
Add below this:
So, your code should look like this (or something like that) :
We finish with *.smali.
Next step. Open SystemUI/res/layout/status_bar.xml and search for this:
Code:
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" />
Add below:
Code:
<com.android.systemui.statusbar.BatteryText android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center_vertical" android:orientation="horizontal" android:paddingRight="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" />
Thats all. Now compile your SystemUI.apk.
Copy SystemUI.apk and ETD.apk (see "attachments") to your system/app/ directory
Reboot. Enjoy.
Hope I helped someone
Click to expand...
Click to collapse
Great guide
Hope u will add more options
CoolCatGetHome said:
Great guide
Hope u will add more options
Click to expand...
Click to collapse
Thank's a lot...Yeah, I know how to add also percentage signal strength indicator, but don't know how to make removable stock signal indicator.
Maybe I'll update this guide soon
Hi,
how I can put the batterytext before battery Icon instead after?
thnaks in advance
hiej said:
Hi,
how I can put the batterytext before battery Icon instead after?
thnaks in advance
Click to expand...
Click to collapse
Put the added line before iconmanager
Sent from my ST25i using xda app-developers app
SpaceCaker said:
Put the added line before iconmanager
Sent from my ST25i using xda app-developers app
Click to expand...
Click to collapse
did you mean IconMerger ?
cause cant fin iconmanager :silly:
great!
Nice how to... thanks bro!

[MOD][HOW-TO] Real-time notification panel background color/transparency

This will allow you to change the background color/transparency of the notification panel in real time without rebooting.
We're going to be working with the following two files:
SecSettings.apk
SystemUI.apk
KEY
REMOVE what's in BLUE
ADD what's in RED
Note:
If you've already implemented my Clock mod and added the color picker files, you'll have to replace it with what I've attached as I've changed how the color picker works. It now saves your setting instead of reverting it to default everytime you leave and come back to the menu. I'll be updating the clock mod right now.
Issues:
There is a tiny line that goes across just under the brightness slider/notification toggles that I cannot figure out how to remove. It's only noticeable when you use colors. If you're just using transparency then it's hard to tell.
SecSettings.apk
Navigate to /res/values/strings.xml
Add the following to the end of the file
Code:
<string name="notification_panel_color_title">Notification panel color</string>
<string name="notification_panel_color_summary">Change the background color of the notification panel</string>
<string name="dialog_color_picker">Color Picker</string>
<string name="press_color_to_apply">Press on Color to apply</string>
Navigate to /res/values/ids.xml
add the following to the end of the file
Code:
<item type="id" name="color_picker_view">false</item>
<item type="id" name="old_color_panel">false</item>
<item type="id" name="new_color_panel">false</item>
Navigate to /xml/display_settings.xml
Add the following line wherever you would like it to show in the menu
Code:
<com.loser.colorpicker.ColorPickerPreference android:persistent="false" android:title="@string/notification_panel_color_title" android:key="notification_panel_color" android:summary="@string/notification_panel_color_summary" android:defaultValue="0xff000000" alphaSlider="true" />
Navigate to /smali/com/android/settings/DisplaySettings.smali
Code:
.field private mMultiWindowModeObserver:Landroid/database/ContentObserver;
.field private mMultiWindowPref:Landroid/preference/CheckBoxPreference;
[COLOR="Red"].field private mNotificationPanelColor:Lcom/loser/colorpicker/ColorPickerPreference;[/COLOR]
.field private mNotificationPulse:Landroid/preference/CheckBoxPreference;
.field private mPowerSavingMode:Landroid/preference/CheckBoxPreference;
.method private updateState()V
Code:
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "display_battery_percentage"
invoke-static {v0, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_4
move v0, v1
:goto_1
invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[COLOR="red"]iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mNotificationPanelColor:Lcom/loser/colorpicker/ColorPickerPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "notification_panel_color"
const v5, -0xffffff
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
const/16 v5, 0x0
invoke-virtual {v0, v5, v3}, Lcom/loser/colorpicker/ColorPickerPreference;->onSetInitialValue(ZLjava/lang/Object;)V[/COLOR]
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mTouchKeyLight:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "button_key_light"
.method public onCreate(Landroid/os/BundleV
Code:
const-string v11, "display_battery_level"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
[COLOR="red"]const-string v11, "notification_panel_color"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Lcom/loser/colorpicker/ColorPickerPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mNotificationPanelColor:Lcom/loser/colorpicker/ColorPickerPreference;
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mNotificationPanelColor:Lcom/loser/colorpicker/ColorPickerPreference;
invoke-virtual {v11, p0}, Lcom/loser/colorpicker/ColorPickerPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getActivity()Landroid/app/Activity;
move-result-object v11
invoke-static {v11}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
move-result v11
if-eqz v11, :cond_6
.method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/ObjectZ
Code:
:catch_2
move-exception v0
.line 1038
const-string v1, "DisplaySettings"
const-string v2, "could not persist Touch key light setting"
invoke-static {v1, v2, v0}, Landroid/util/Log;->secE(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto/16 :goto_4
.line 1040
:cond_9
[COLOR="red"]const-string v2, "notification_panel_color"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_next
invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v2
const-string v1, "^#"
const-string v3, ""
invoke-virtual {v2, v1, v3}, Ljava/lang/String;->replaceFirst(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v1
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "notification_panel_color"
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_4
:cond_next[/COLOR]
const-string v2, "quick_launch"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
Now download the attached zip and extract to the root of your SecSettings folder.
Compile and then decompile and open up /res/values/public.xml
Open /smali/com/loser/colorpicker/ColorPickerDialog.smali
There should be a total of 6 id's you need to get. Make sure you're looking at the type as there's a layout and string with the same name.
That's it for SecSettings. Compile.
Now for SystemUI.apk
Navigate to /smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
.method protected updateExpandedViewPos(I)V
Code:
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
[COLOR="Red"]const/4 v6, 0x0
invoke-virtual {v9, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->setBackground(Landroid/graphics/drawable/Drawable;)V
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v6, "notification_panel_color"
const v9, -0xffffff
invoke-static {v3, v6, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Landroid/view/View;[/COLOR]
invoke-virtual {v9, v3}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->setBackgroundColor(I)V
Simple enough? Compile and test!
loserskater said:
Issues:
There is a tiny line that goes across just under the brightness slider/notification toggles that I cannot figure out how to remove. It's only noticeable when you use colors. If you're just using transparency then it's hard to tell.
Click to expand...
Click to collapse
Great work as always.
Regarding the above issue, did you look to see if it's a PNG or a color you can make transparent? Sounds like it's a separator.
I am guessing you did, but I just thought I'd ask.
upndwn4par said:
Great work as always.
Regarding the above issue, did you look to see if it's a PNG or a color you can make transparent? Sounds like it's a separator.
I am guessing you did, but I just thought I'd ask.
Click to expand...
Click to collapse
I think something is taking up like one extra pixel than it's background so the color background shows through.
Sent from my SAMSUNG-SGH-I747
You could also include this:
Code:
\res\layout\tw_status_bar_expanded.xml
Find in red, change to blue
TWO Edits here:
Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/notification_panel" android:background="@drawable/notification_panel_bg" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
<include android:layout_width="fill_parent" android:layout_height="@dimen/tw_notification_panel_header_height" layout="@layout/tw_status_bar_expanded_header" />
<TextView android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />
<HorizontalScrollView android:id="@id/quicksetting_scroller" android:scrollbars="none" android:layout_width="wrap_content" android:layout_height="@dimen/quick_setting_button_height" android:layout_marginTop="@dimen/tw_notification_panel_header_height">
<com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel android:orientation="horizontal" android:id="@id/quicksetting_container" android:layout_width="wrap_content" android:layout_height="wrap_content" android:divider="@drawable/tw_black_bg" android:showDividers="middle" />
</HorizontalScrollView>
<ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="@dimen/notification_panel_quicksettingbtn_height" android:overScrollMode="ifContentScrolls">
<LinearLayout android:orientation="vertical" android:id="@id/scrollCart" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:orientation="vertical" android:id="@id/brightness_controller" [COLOR="Red"]android:background="#[COLOR="Blue"]00[/COLOR]000000"[/COLOR] android:visibility="visible" android:layout_width="fill_parent" android:layout_height="56.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="55.0dip">
<ImageView android:id="@id/brightness_icon" android:clickable="true" android:layout_width="25.0dip" android:layout_height="fill_parent" android:layout_marginLeft="13.0dip" android:src="@drawable/ic_sysbar_brightness" android:contentDescription="@string/accessibility_brightness_icon" />
<FrameLayout android:id="@id/brightness_group" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />
<com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/auto_brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />
</FrameLayout>
</LinearLayout>
<View [COLOR="Red"]android:background="#[COLOR="blue"]00[/COLOR]091a24"[/COLOR] android:layout_width="fill_parent" android:layout_height="1.0dip" />
</LinearLayout>
<LinearLayout android:orientation="vertical" android:id="@id/noNotificationsTitle" android:focusable="true" android:layout_width="fill_parent" android:layout_height="wrap_content">
<TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textStyle="bold" android:textColor="@color/notification_category_color" android:gravity="left|center" android:id="@id/noNotificationsText" android:paddingLeft="11.0dip" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height" android:text="@string/status_bar_no_notifications_title" />
</LinearLayout>
<LinearLayout android:orientation="vertical" android:id="@id/onGoingCart" android:background="#ff293945" android:focusable="true" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height">
<TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textStyle="bold" android:textColor="@color/notification_category_color" android:gravity="left|center" android:id="@id/onGoingNotificationText" android:paddingLeft="11.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:text="@string/status_bar_ongoing_events_title" />
</LinearLayout>
<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/onGoingItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />
<LinearLayout android:orientation="vertical" android:id="@id/notificationCart" android:background="#ff293945" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height">
<RelativeLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
<TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textStyle="bold" android:textColor="@color/notification_category_color" android:gravity="left|center" android:id="@id/latestNotificationText" android:paddingLeft="11.0dip" android:layout_width="180.0dip" android:layout_height="fill_parent" android:text="@string/status_bar_latest_events_title" android:layout_alignParentLeft="true" />
<TextView android:textSize="@dimen/status_bar_expanded_notification_clear_button_text_size" android:textColor="@color/tw_status_bar_clear_btn_text" android:gravity="center" android:id="@id/clear_all_button" android:background="@drawable/tw_btn_default_small" android:padding="0.100000024dip" android:focusable="true" android:clickable="true" android:layout_width="@dimen/status_bar_expanded_clear_button_width" android:layout_height="fill_parent" android:layout_marginRight="4.0dip" android:text="@string/status_bar_clear_all_button" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_clear_all" />
</RelativeLayout>
</LinearLayout>
<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/notificationItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />
<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />
</LinearLayout>
</ScrollView>
</FrameLayout>
<com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="vertical" android:id="@id/close" android:layout_width="fill_parent" android:layout_height="@dimen/tw_close_handle_height">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/tw_close_handle_height" android:src="@drawable/tw_status_bar_close" android:scaleType="fitXY" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network" android:gravity="center" android:layout_gravity="bottom" android:id="@id/carrier_label" android:layout_width="fill_parent" android:layout_height="@dimen/tw_close_handle_height" android:layout_marginBottom="10.0dip" />
</RelativeLayout>
</com.android.systemui.statusbar.phone.CloseDragHandle>
</FrameLayout>
Also, in the zipa re some transparent files that go in drawable-xhdpi.
Put them into that folder, then build/compile
EDIT:
Just noticed the above post... there's that tiny line sorted for you That's the second edit.
Thank you as always Loser ! Going to try this one tomorrow... I promise I'll try to do this one without my noon questions.
I know you can't say for sure but do you think this would translate closely to 4.1.2.
Most of yours have for me but just figured I'd ask
Sent from my SAMSUNG-SGH-I747 using xda premium
hednik said:
Thank you as always Loser ! Going to try this one tomorrow... I promise I'll try to do this one without my noon questions.
I know you can't say for sure but do you think this would translate closely to 4.1.2.
Most of yours have for me but just figured I'd ask
Sent from my SAMSUNG-SGH-I747 using xda premium
Click to expand...
Click to collapse
All the code is from the tmo 4.1.2 build so you shouldn't have any issues.
loserskater said:
All the code is from the tmo 4.1.2 build so you shouldn't have any issues.
Click to expand...
Click to collapse
Almost have it working correctly. Compiled and decompiled and the public "id"s all looked correct. Flashed went to display settings. Got a force close on the option so.... I've got the Id's incorrect but I looked then over and all I saw was :
Code:
<public type="id" name="color_picker_view" id="0x7f0b03f7" />
<public type="id" name="old_color_panel" id="0x7f0b03f8" />
<public type="id" name="new_color_panel" id="0x7f0b03f9" />
These were the only "id"s i saw. I ignored the ones with "layout" or "string"
Now in the colorpickerdialog.smali I saw this:
Code:
.line 65
.local v0, inflater:Landroid/view/LayoutInflater;
const v2, 0x7f040129
const/4 v3, 0x0
invoke-virtual {v0, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v1
.line 67
.local v1, layout:Landroid/view/View;
invoke-virtual {p0, v1}, Lcom/loser/colorpicker/ColorPickerDialog;->setContentView(Landroid/view/View;)V
.line 69
const v2, 0x7f090e96
invoke-virtual {p0, v2}, Lcom/loser/colorpicker/ColorPickerDialog;->setTitle(I)V
.line 71
const v2, 0x7f0b03f7
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v2
check-cast v2, Lcom/loser/colorpicker/ColorPickerView;
iput-object v2, p0, Lcom/loser/colorpicker/ColorPickerDialog;->mColorPicker:Lcom/loser/colorpicker/ColorPickerView;
.line 72
const v2, 0x7f0b03f8
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v2
check-cast v2, Lcom/loser/colorpicker/ColorPickerPanelView;
iput-object v2, p0, Lcom/loser/colorpicker/ColorPickerDialog;->mOldColor:Lcom/loser/colorpicker/ColorPickerPanelView;
.line 73
const v2, 0x7f0b03f9
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v2
check-cast v2, Lcom/loser/colorpicker/ColorPickerPanelView;
iput-object v2, p0, Lcom/loser/colorpicker/ColorPickerDialog;->mNewColor:Lcom/loser/colorpicker/ColorPickerPanelView;
and this one further down, which is repeated from up top
Code:
method public onClick(Landroid/view/View;)V
.locals 2
.parameter "v"
.prologue
.line 122
invoke-virtual {p1}, Landroid/view/View;->getId()I
move-result v0
const v1, 0x7f0b03f9
if-ne v0, v1, :cond_0
.line 123
iget-object v0, p0, Lcom/loser/colorpicker/ColorPickerDialog;->mListener:Lcom/loser/colorpicker/ColorPickerDialog$OnColorChangedListener;
if-eqz v0, :cond_0
Here were all the id's from the colorpickerdialog.smali:
Code:
Line 88: const v2, 0x7f040129 - [COLOR="red"][B]This one was under "layout"[/B][/COLOR]
Line 101: const v2, 0x7f090e96 [COLOR="red"][B]This one wasn't in the public xml[/B][/COLOR]
Line 106: const v2, 0x7f0b03f7
Line 117: const v2, 0x7f0b03f8
Line 128: const v2, 0x7f0b03f9
Line 229: const v1, 0x7f0b03f9
As a side note the check boc was about twice the size the others ones I have as well. Thanks !
here are the files just in case I didn't make much sense in my rambling:
ColorPickerDialog.smali - 10.67 KB
public.xml - 485.77 KB
hednik said:
Almost have it working correctly. Compiled and decompiled and the public "id"s all looked correct. Flashed went to display settings. Got a force close on the option so.... I've got the Id's incorrect but I looked then over and all I saw was :
...
As a side note the check boc was about twice the size the others ones I have as well. Thanks !
here are the files just in case I didn't make much sense in my rambling:
ColorPickerDialog.smali - 10.67 KB
public.xml - 485.77 KB
Click to expand...
Click to collapse
I accidentally uploaded the colorpickerdialog that doesn't have the comments, I'll fix the upload soon
Sent from my SAMSUNG-SGH-I747
EDIT: Fixed. Download the new zip and look at ColorPickerDialog.smali
Also, yes the box is bigger. It's not a checkbox but a color box that shows the color.
loserskater said:
I accidentally uploaded the colorpickerdialog that doesn't have the comments, I'll fix the upload soon
Sent from my SAMSUNG-SGH-I747
EDIT: Fixed. Download the new zip and look at ColorPickerDialog.smali
Also, yes the box is bigger. It's not a checkbox but a color box that shows the color.
Click to expand...
Click to collapse
Thank you. You are a good man @loserskater. Thanks for supporting my habit ha
61M26173M3471522L
EDIT: works perfectly. Thank you !
Great Guide!
Did it for Galaxy Grand Duos Credits are given
Code:
http://forum.xda-developers.com/showthread.php?t=2320158
this solves the small line issue (if it lies below the brightness slider)
in values/dimens.xml
Code:
<dimen name="notification_panel_notification_top_margin">[COLOR="Red"]184.0dip[/COLOR]</dimen>
set it to 180.dip or so .
Thanks Loser :good:
You can just edit the actual xml and change it's height or visibility as I posted. Much simpler.
Kryten2k35 said:
You can just edit the actual xml and change it's height or visibility as I posted. Much simpler.
Click to expand...
Click to collapse
i just like everything on its place ^_^
first of all thanks for the mod.
ive decompiled and recompiled secsettings which is showing the options..
Before this mod my dropdown was transparent,
so...
I edited my systemUI.apk and recompiled it. my dropdown is now full BLACK (0% trans) which means i think ive recompiled systemUI.apk good??
but i cant select a color??
EDIT:
Navigated to /smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
@.method protected updateExpandedViewPos(I)V
the command at OP:
Code:
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
[COLOR="Red"]const/4 v6, 0x0
invoke-virtual {v9, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->setBackground(Landroid/graphics/drawable/Drawable;)V
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v6, "notification_panel_color"
const v9, -0xffffff
invoke-static {v3, v6, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Landroid/view/View;[/COLOR]
invoke-virtual {v9, v3}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->setBackgroundColor(I)V
My Code (N7100):
Code:
.local v3, color:I
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
[COLOR="red"]const/4 v6, 0x0
invoke-virtual {v9, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->setBackground(Landroid/graphics/drawable/Drawable;)V
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v6, "notification_panel_color"
const v9, -0xffffff
invoke-static {v3, v6, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Landroid/view/View;[/COLOR]
invoke-virtual {v9, v3}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->setBackgroundColor(I)V
.line 3479
.end local v3 #color:I
.end local v6 #k:F
:cond_5
const/4 v9, 0x0
move-object/from16 v0, p0
ON phone, when i hit the selected color it doesnt change, it stays on black :/???
AskinSavascisi said:
first of all thanks for the mod.
ive decompiled and recompiled secsettings which is showing the options..
Before this mod my dropdown was transparent,
so...
I edited my systemUI.apk and recompiled it. my dropdown is now full BLACK (0% trans) which means i think ive recompiled systemUI.apk good??
but i cant select a color??
EDIT:
Navigated to /smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
@.method protected updateExpandedViewPos(I)V
the command at OP:
Code:
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
[COLOR="Red"]const/4 v6, 0x0
invoke-virtual {v9, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->setBackground(Landroid/graphics/drawable/Drawable;)V
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v6, "notification_panel_color"
const v9, -0xffffff
invoke-static {v3, v6, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Landroid/view/View;[/COLOR]
invoke-virtual {v9, v3}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->setBackgroundColor(I)V
My Code (N7100):
Code:
.local v3, color:I
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
[COLOR="red"]const/4 v6, 0x0
invoke-virtual {v9, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->setBackground(Landroid/graphics/drawable/Drawable;)V
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v6, "notification_panel_color"
const v9, -0xffffff
invoke-static {v3, v6, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Landroid/view/View;[/COLOR]
invoke-virtual {v9, v3}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->setBackgroundColor(I)V
.line 3479
.end local v3 #color:I
.end local v6 #k:F
:cond_5
const/4 v9, 0x0
move-object/from16 v0, p0
ON phone, when i hit the selected color it doesnt change, it stays on black :/???
Click to expand...
Click to collapse
BUMP???
I'm trying to implement this mod but not in Display Settings, in my ROM settings.smali. But I've an error in OnpreferenceChange. Here's the log:
Code:
W/dalvikvm(4676): VFY: register1 v0 type 0, wanted ref
W/dalvikvm(4676): VFY: bad arg 1 (into Ljava/lang/Object;)
W/dalvikvm(4676): VFY: rejecting call to Ljava/lang/String;.equals (Ljava/lang/Object;)Z
W/dalvikvm(4676): VFY: rejecting opcode 0x6e at 0x0036
W/dalvikvm(4676): VFY: rejected Lcom/android/settings/phdsettings;.onPreferenceChange (Landroid/preference/Preference;Ljava/lang/Object;)Z
W/dalvikvm(4676): Verifier rejected class Lcom/android/settings/phdsettings;
W/dalvikvm(4676): Class init failed in newInstance call (Lcom/android/settings/phdsettings;)
D/AndroidRuntime(4676): Shutting down VM
W/dalvikvm(4676): threadid=1: thread exiting with uncaught exception (group=0x41a232a0)
What I'm doing wrong? Thanks in advance!
Anyone figure out how to get rid of the black background for notifications on MG2?
This is driving me nuts.
upndwn4par said:
Anyone figure out how to get rid of the black background for notifications on MG2?
This is driving me nuts.
Click to expand...
Click to collapse
Do you mean the background on notifcations themselves, not the actual panel? That is all in framework-res.apk I was scanning systemui.apk for hours to find out how to change those until I remembered framework-res controlled certain backgrounds in the system such as the background in secsettings.apk. If I remember correctly the files are in res/layout of framework-res.apk and they are called notification_template_xx.xml,
hope this helps bro
Danvdh said:
Do you mean the background on notifcations themselves, not the actual panel? That is all in framework-res.apk I was scanning systemui.apk for hours to find out how to change those until I remembered framework-res controlled certain backgrounds in the system such as the background in secsettings.apk. If I remember correctly the files are in res/layout of framework-res.apk and they are called notification_template_xx.xml,
hope this helps bro
Click to expand...
Click to collapse
Yes, the background of the notifications themselves. To make the notification drawer completely transparent a combination of PNGs and xmls must be changed (not the ones you mentioned). I have done this more than once. So either something has changed in the latest firmware, or I'm losing it. :cyclops:

Enable QuickLaunch and use (Hidden Settings)

In DisplaySettings.smali I have found some feature but this feature (QuickLaunch) work with a small edit in statusbar file
For this guide is necessary:
-SecSettings;
-SystemUI;
-Notepad++;
-apktool for decompile and compile this file.
For SecSettings:
1.Decompile SecSettings and go to smali/com/android/settings and open DisplaySettings.smali
2.Search this line: quick_launch
3.And now remove this line in .method public onCreate(Landroid/os/BundleV:
Code:
:cond_a
const-string v11, "quick_launch"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/ListPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mQuickLaunchPreference:Landroid/preference/ListPreference;
const-string v11, "quick_launch_app"
const/4 v12, 0x0
invoke-static {v8, v11, v12}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mQuickLaunchPreference:Landroid/preference/ListPreference;
invoke-static {v2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-virtual {v11, v12}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mQuickLaunchPreference:Landroid/preference/ListPreference;
invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
const/4 v1, 0x1
:try_start_0
const-string v11, "window"
invoke-static {v11}, Landroid/os/ServiceManager;->getService(Ljava/lang/String;)Landroid/os/IBinder;
move-result-object v11
invoke-static {v11}, Landroid/view/IWindowManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/view/IWindowManager;
move-result-object v10
invoke-interface {v10}, Landroid/view/IWindowManager;->hasSystemNavBar()Z
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_1
move-result v11
if-nez v11, :cond_11
const/4 v1, 0x1
:goto_2
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getActivity()Landroid/app/Activity;
move-result-object v11
invoke-static {v11}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
move-result v11
if-eqz v11, :cond_b (REMOVE THIS LINE)
if-eqz v1, :cond_c
:cond_b (REMOVE THIS LINE)
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen; (REMOVE)
move-result-object v11 (REMOVE THIS LINE)
iget-object v12, p0, Lcom/android/settings/DisplaySettings;->mQuickLaunchPreference:Landroid/preference/ListPreference; (REMOVE)
invoke-virtual {v11, v12}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z (REMOVE THIS LINE)
When you have remove this lines, you can compile this file.
For SystemUI:
Decompile SystemUI and go to res/layout/ and open this file:
tw_status_bar_expanded if you want insert this button under brightness slider in notification panel
tw_status_bar_expanded_header if you want insert this button next to date view in notification panel
For tw_status_bar_expanded add this line:
Code:
<LinearLayout android:orientation="vertical" android:id="@id/brightness_controller" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="56.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="55.0dip">
<ImageView android:id="@id/brightness_icon" android:clickable="true" android:layout_width="25.0dip" android:layout_height="fill_parent" android:layout_marginLeft="13.0dip" android:src="@drawable/ic_sysbar_brightness" android:contentDescription="@string/accessibility_brightness_icon" />
<FrameLayout android:id="@id/brightness_group" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />
<com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/auto_brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />
</FrameLayout>
</LinearLayout>
<View android:background="#ff091a24" android:layout_width="fill_parent" android:layout_height="1.0dip" />
</LinearLayout> UNDER THIS LINE INSERT THIS:
<com.android.systemui.statusbar.policy.QuickLaunchKeyButtonView android:id="@id/quick_launch" android:visibility="visible" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_ic_sysbar_capture" android:contentDescription="@string/accessibility_capture" />
For tw_status_bar_expanded_header:
Code:
<Space android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_weight="1.0" /> UNDER THIS LINE INSERT:
<com.android.systemui.statusbar.policy.QuickLaunchKeyButtonView android:id="@id/quick_launch" android:visibility="visible" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_ic_sysbar_capture" android:contentDescription="@string/accessibility_capture" />
And what exactly does this do?
Your rom isnt looking like a stock rom maybe a modded stock rom
krazy1101 said:
And what exactly does this do?
Your rom isnt looking like a stock rom maybe a modded stock rom
Click to expand...
Click to collapse
Is a stock rom feature, you can capture screen , shortcut to camera and search from notification panel
Try and express your preference
confirmed working flawlessly on MS1.:good: code change from v11->v12 as well as condition name change but simple enuff to find.
any systemui code line to make notification curtain collapse on the soft-key press?
Hey mate, I managed to get it to work on my i9070 but Camera and Applications doesn't work.. and Screenshot only takes the screenshot of the notification panel (which basically doesn't have much use)... But still, thanks for sharing this info
Sami Kabir said:
Hey mate, I managed to get it to work on my i9070 but Camera and Applications doesn't work.. and Screenshot only takes the screenshot of the notification panel (which basically doesn't have much use)... But still, thanks for sharing this info
Click to expand...
Click to collapse
You can add this line in tw_status_bar.xml in layout folder.
Find this line:
<com.android.systemui.statusbar.policy.Clock
and add this below:
Code:
<com.android.systemui.statusbar.policy.QuickLaunchKeyButtonView android:id="@id/quick_launch" android:visibility="visible" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_ic_sysbar_capture" android:contentDescription="@string/accessibility_capture" />
In this way, this function will be displayed to the right of the clock in the status bar
Applications is a link with the application of the launcher and camera is link of samsung camera but I do not know why you will not work.
@Vivek_Neel @_Sale_ Can you make this mod flashable for neatrom ?
Pishtaz said:
@Vivek_Neel @_Sale_ Can you make this mod flashable for neatrom ?
Click to expand...
Click to collapse
Oh am seeing now only.
Y not if I have time.
Sure.
Typed using Iphone kb and sent from my GT-I9100 using Tapatalk 2

[GUIDE] How to create two big button in notification panel like S5

In this guide, I will explain how to create a button in notification panel and giving it a function
See attachments to see the result of the guide, and any files that are needed for this change.
Requires:
- knowledge on how to compile / decompile with apktool;
- SystemUI.apk;
- Notepad++;
- brain and patience.
First decompile SystemUI, go to res/layout, open tw_status_bar_expanded.xml and add the red line:
Code:
<HorizontalScrollView android:id="@id/quicksetting_scroller" android:scrollbars="none" android:layout_width="wrap_content" android:layout_height="wrap_content">
<com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel android:orientation="horizontal" android:id="@id/quicksetting_container" android:layout_width="wrap_content" android:layout_height="wrap_content" android:divider="@drawable/tw_black_bg" android:showDividers="middle" />
</HorizontalScrollView>
[COLOR="Red"]<LinearLayout android:orientation="vertical" android:id="@id/sfinder_qconnect_layout" android:visibility="visible" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:paddingLeft="@dimen/finder_connect_button_padding_right" android:paddingTop="@dimen/finder_connect_button_padding_top" android:paddingRight="@dimen/finder_connect_button_padding_left" android:paddingBottom="@dimen/finder_connect_button_padding_bottom" android:layout_width="fill_parent" android:layout_height="wrap_content">
<Button android:textSize="@dimen/tw_quick_panel_sfinder_qconnect_button_text_size" android:textColor="@drawable/tw_quick_panel_sfinder_qconnect_button_text_color" android:id="@id/sfinder_button_big" android:background="@drawable/tw_quick_panel_sfinder_qconnect_button" android:layout_width="0.0dip" android:layout_height="@dimen/finder_connect_button_height" android:layout_marginRight="10.0dip" android:text="@string/big_button_barra" android:layout_weight="0.5" />
<Button android:textSize="@dimen/tw_quick_panel_sfinder_qconnect_button_text_size" android:textColor="@drawable/tw_quick_panel_sfinder_qconnect_button_text_color" android:id="@id/qconnect_button_big" android:background="@drawable/tw_quick_panel_sfinder_qconnect_button" android:layout_width="0.0dip" android:layout_height="@dimen/finder_connect_button_height" android:layout_marginLeft="10.0dip" android:text="@string/big_button_panel" android:layout_weight="0.5" />
</LinearLayout>
<View android:id="@id/sfinder_qconnect_divider" android:background="@drawable/notification_bottom_line" android:layout_width="fill_parent" android:layout_height="1.0dip" />
</LinearLayout>[/COLOR]
<LinearLayout android:orientation="vertical" android:id="@id/brightness_controller" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="56.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="55.0dip">
<ImageView android:id="@id/brightness_icon" android:clickable="true" android:layout_width="25.0dip" android:layout_height="fill_parent" android:layout_marginLeft="13.0dip" android:src="@drawable/ic_sysbar_brightness" android:contentDescription="@string/accessibility_brightness_icon" />
<FrameLayout android:id="@id/brightness_group" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />
<com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/auto_brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />
</FrameLayout>
</LinearLayout>
<View android:background="#ff091a24" android:layout_width="fill_parent" android:layout_height="1.0dip" />
</LinearLayout>
Now go to values folder and add this line in this files.
In ids.xml:
Code:
<item type="id" name="sfinder_qconnect_layout">false</item>
<item type="id" name="sfinder_button_big">false</item>
<item type="id" name="qconnect_button_big">false</item>
<item type="id" name="sfinder_qconnect_divider">false</item>
In dimens.xml
Code:
<dimen name="finder_connect_button_padding_top">11.0dip</dimen>
<dimen name="finder_connect_button_padding_bottom">10.0dip</dimen>
<dimen name="finder_connect_button_padding_right">20.0dip</dimen>
<dimen name="finder_connect_button_padding_left">20.0dip</dimen>
<dimen name="finder_connect_button_height">37.0dip</dimen>
<dimen name="tw_quick_panel_sfinder_qconnect_button_text_size">16.0dip</dimen>
In strings.xml
Code:
<string name="big_button_barra">Display</string>
<string name="big_button_panel">Sound</string>
Add the res files in drawable and drawable-hdpi.
Recompile SystemUI and decompile for insert the value of ids in public.xml
Now there is the smali part. Go to smali/com/android/systemui/statusbar/phone and open PhoneStatusbar.smali
Add this field in instance fields:
Code:
.field private mBigButtonListener:Landroid/view/View$OnClickListener;
.field private mBigButtonListener2:Landroid/view/View$OnClickListener;
Add the red line at the end of the .method public constructor <init>()V
Code:
[COLOR="Red"]new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$X1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$X1;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBigButtonListener:Landroid/view/View$OnClickListener;
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$X2;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$X2;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBigButtonListener2:Landroid/view/View$OnClickListener;
[/COLOR]
return-void
.end method
Add the red line in .method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
Code:
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v10, 0x7f0d0051
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v9
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsButton:Landroid/view/View;
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsButton:Landroid/view/View;
iget-object v10, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsButtonListener:Landroid/view/View$OnClickListener;
invoke-virtual {v9, v10}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
[COLOR="Red"]iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v10, 0x7f0d01ea
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v9
check-cast v9, Landroid/widget/Button;
iget-object v10, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBigButtonListener:Landroid/view/View$OnClickListener;
invoke-virtual {v9, v10}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v10, 0x7f0d01eb
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v9
check-cast v9, Landroid/widget/Button;
iget-object v10, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBigButtonListener2:Landroid/view/View$OnClickListener;
invoke-virtual {v9, v10}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V[/COLOR]
0x7f0d01ea is the public id of "sfinder_button_big"
0x7f0d01eb is the public id of "qconnect_button_big"
Now add the file of smali folder.
If you want to change the intent of the button, you must open the two smali files(PhoneStatusbar$X1 and PhoneStatusbar$X2) and change the parts highlighted in red, adding the names of the resulting applications and tasks that you want to open.
Code:
new-instance v2, Landroid/content/Intent;
invoke-direct {v2}, Landroid/content/Intent;-><init>()V
const-string v3, "android.intent.action.MAIN"
invoke-virtual {v2, v3}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
const/high16 v4, 0x1000
invoke-virtual {v2, v4}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
const-string v5, "[COLOR="red"]com.android.settings[/COLOR]"
const-string v6, "[COLOR="red"]com.android.settings.Settings$DisplaySettingsActivity[/COLOR]"
invoke-virtual {v2, v5, v6}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
move-result-object v2
invoke-virtual {v1, v2}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$X1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->animateCollapse()V
After insert the smali file, recompile SystemUI, then add the meta-inf folder and the AndroidManifest.xml from the original SystemUI or sign the file, then recompile again.
That's it all, if you have trouble commented on this thread and give you a hand to solve
@rrgrrg
Sent from my GT-I9100 using XDA Premium 4 mobile app
request bro...for custom rom cm10.1
D2Y aka E said:
request bro...for custom rom cm10.1
Click to expand...
Click to collapse
I do not use the cm so I have to give the framework and the systemui
Can you mod this for s3 mini???
Sent from my GT-I8190N using XDA Premium 4 mobile app
error in compile apk.....(an error occured plz check the log (option 21)
??!!
Nice thanks
Add the red line in .method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
i not found this line and my system ui force stoped
fargh123 said:
Add the red line in .method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
i not found this line and my system ui force stoped
Click to expand...
Click to collapse
Search the below text alone
Code:
makeStatusBarView
You can find the method.
@ gerrys2 thanks for the guide.
But I would like to suggest one thing regarding adding ids.
You can mention in your thread that after adding smali , recompile SystemUI.apk
Then again decompile the modded SystemUI.apk so that the ids for those two button they can see in public.xml
For adding them in smali
@gerryS2 good job gerry:good:
Thanks for sharing
Thanks for sharing
Caproid said:
@rrgrrg
Sent from my GT-I9100 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
i prefer this guide
as its advantages are u set the function by yourself and u can remove them when u want :angel:
"After insert the smali file, recompile SystemUI, then add the meta-inf folder and the AndroidManifest.xml from the original SystemUI or sign the file, then recompile again" i didnt understand this step
bhavstech said:
"After insert the smali file, recompile SystemUI, then add the meta-inf folder and the AndroidManifest.xml from the original SystemUI or sign the file, then recompile again" i didnt understand this step
Click to expand...
Click to collapse
After insert the smali, Recompile systemUI and sign it
Thanks
gerryS2 said:
After insert the smali, Recompile systemUI and sign it
Click to expand...
Click to collapse
it didnt work i did that
after I insert smali and sign the apk my system ui give fc
Sent from my GT-I9100 using Tapatalk
fargh123 said:
after I insert smali and sign the apk my system ui give fc
Sent from my GT-I9100 using Tapatalk
Click to expand...
Click to collapse
Me too why?

[Guide]Serajr Swiping Power Toggles for Lollipop

Hi Community!
Here is a Guide For Porting Swiping Power toggles Created by Master @serajr
Works on 5.1,5.0.2 & 5.0
REQUIREMENTS
1.)DEODEXED SystemUI & Settings
2.)Knowledge About Replacing IDs
3.)Latest Apktool
Lets Start
Download the attached files and merge them into your SystemUI
Then Open Android-mainfest.xml
Add this code before </manifest>
Code:
<meta-data android:name="com.sonymobile.runtimeskinning.LAF_VERSION" android:value="1"/>
<receiver android:name="com.serajr.powertoggles.receivers.NetworkModeReceiver" android:process="com.android.phone"/>
<activity android:configChanges="orientation|screenSize" android:exported="true" android:icon="@drawable/ic_settings" android:label="@string/power_toggles_preferences_category_power_toggles" android:name="com.serajr.powertoggles.preferences.PowerTogglesPreferencesActivity" android:theme="@style/DeviceDefaultLight">
<intent-filter>
<action android:name="com.serajr.powertoggles.preferences.intent.PREFERENCES"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<meta-data android:name="com.sonymobile.settings.preference.TITLE" android:resource="@string/power_toggles_preferences_category_power_toggles"/>
<meta-data android:name="com.sonymobile.settings.preference.SUMMARY" android:resource="@string/status_bar_settings"/>
<meta-data android:name="android.support.PARENT_ACTIVITY" android:value="com.android.settings.display"/>
</activity>
<activity android:configChanges="orientation|screenSize" android:exported="false" android:icon="@drawable/ic_settings" android:label="@string/power_toggles_preferences_category_order" android:name="com.serajr.powertoggles.preferences.PowerTogglesPreferencesOrderActivity" android:theme="@style/DeviceDefaultLight">
<intent-filter>
<action android:name="com.serajr.powertoggles.preferences.intent.ORDER"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
Now Open Res/Values/Arrays.xmal
Add this Codes before </resources>
Code:
<string-array name="power_toggles_available_buttons">
<item>MeProfile</item>
<item>SystemSettings</item>
<item>RecentApps</item>
<item>BatteryInfo</item>
<item>Camera</item>
<item>Wifi</item>
<item>WifiAp</item>
<item>Bluetooth</item>
<item>GPS</item>
<item>StaminaMode</item>
<item>NFC</item>
<item>Roaming</item>
<item>Throw</item>
<item>Sound</item>
<item>Flashlight</item>
<item>Brightness</item>
<item>ScreenTimeout</item>
<item>StayAwakePlugged</item>
<item>Sync</item>
<item>Lockscreen</item>
<item>AutoRotate</item>
<item>Airplane</item>
<item>MobileData</item>
<item>NetworkMode</item>
<item>USBConnectionMode</item>
<item>USBDebugging</item>
<item>USBTether</item>
<item>Reboot</item>
<item>Shutdown</item>
</string-array>
<string-array name="power_toggles_reboot_options">
<item>@string/power_toggles_reboot</item>
<item>@string/power_toggles_reboot_recovery</item>
<item>@string/power_toggles_reboot_bootloader</item>
</string-array>
<string-array name="power_toggles_reboot_actions">
<item>now</item>
<item>recovery</item>
<item>bootloader</item>
</string-array>
<string-array name="power_toggles_usb_connection_mode_options">
<item>@string/power_toggles_usb_mtp_mode</item>
<item>@string/power_toggles_usb_msc_mode</item>
</string-array>
<string-array name="power_toggles_usb_connection_mode_actions">
<item>mtp</item>
<item>mass_storage</item>
</string-array>
<string-array name="power_toggles_battery_info_options">
<item>@string/power_toggles_battery_info_info</item>
<item>@string/power_toggles_battery_info_usage</item>
</string-array>
<string-array name="power_toggles_battery_info_actions">
<item>battery_info</item>
<item>battery_usage</item>
</string-array>
Open Bools.xml
ADD these codes
Code:
<bool name="power_toggles_colored_battery_info">true</bool>
<bool name="power_toggles_colored_usb_connection_mode">true</bool>
<bool name="power_toggles_colored_system_settings">true</bool>
<bool name="power_toggles_colored_recent_apps">true</bool>
<bool name="power_toggles_colored_reboot">true</bool>
<bool name="power_toggles_colored_shutdown">true</bool>
<bool name="power_toggles_active_camera_double_cells">true</bool>
Open colors.xml
Add these code
Code:
<color name="custom_drawer_layout_bg">#e60e0e0e</color>
<color name="custom_drawer_layout_scrin">#55ffffff</color>
<color name="power_toggles_button_icon_color">#ff33b5e5</color>
<color name="power_toggles_button_label_color">#ffffffff</color>
Open Dimens.xml
Add these codes
Code:
<dimen name="custom_drawer_layout_width">300.0dip</dimen>
<dimen name="power_toggles_button_height">80.0dip</dimen>
<dimen name="power_toggles_grid_width">300.0dip</dimen>
Open Ids.xml
Code:
<item type="id" name="custom_drawer_layout">false</item>
<item type="id" name="power_toggles">false</item>
<item type="id" name="power_toggles_button">false</item>
<item type="id" name="power_toggles_button_icon">false</item>
<item type="id" name="power_toggles_button_text">false</item>
<item type="id" name="power_toggles_button_status">false</item>
<item type="id" name="power_toggles_me_profile_button">false</item>
<item type="id" name="power_toggles_preference_icon">false</item>
<item type="id" name="power_toggles_preferences_order_grid">false</item>
<item type="id" name="power_toggles_button_camera_surface_holder">false</item>
<item type="id" name="power_toggles_button_camera_surface_flash_overlay">false</item>
Open integers.xml
ADD these codes
Code:
<integer name="power_toggles_row_layout_portrait_buttons_count">4</integer>
<integer name="power_toggles_row_layout_landscape_buttons_count">8</integer>
<integer name="power_toggles_grid_layout_columns_count">4</integer>
Open String.xml
Code:
<string name="custom_drawer_layout_header_text">POWER TOGGLES</string>
<string name="power_toggles_wifi_text">Wi-Fi</string>
<string name="power_toggles_mobile_data_text">Data</string>
<string name="power_toggles_network_text">Network Mode</string>
<string name="power_toggles_sound_sound_text">Sound</string>
<string name="power_toggles_sound_sound_vibration_text">Sound Vibration</string>
<string name="power_toggles_sound_silent_text">Silent</string>
<string name="power_toggles_sound_vibration_text">Vibration</string>
<string name="power_toggles_auto_rotate_text">Auto Rotation</string>
<string name="power_toggles_bluetooth_text">Bluetooth</string>
<string name="power_toggles_gps_text">GPS</string>
<string name="power_toggles_sync_text">Auto Sync</string>
<string name="power_toggles_brightness_text">Brightness</string>
<string name="power_toggles_screen_timeout_text">Screen Timeout</string>
<string name="power_toggles_lockscreen_text">Lockscreen</string>
<string name="power_toggles_airplane_text">Airplane Mode</string>
<string name="power_toggles_flashlight_text">Flashlight</string>
<string name="power_toggles_reboot_text">Reboot</string>
<string name="power_toggles_shutdown_text">Shutdown</string>
<string name="power_toggles_airplane_mode">In Flight Mode</string>
<string name="power_toggles_shutdown_confirm">Your phone will shut down.</string>
<string name="power_toggles_reboot">Reboot</string>
<string name="power_toggles_reboot_recovery">Recovery</string>
<string name="power_toggles_reboot_bootloader">Bootloader</string>
<string name="power_toggles_usb_debugging_text">USB Debugging</string>
<string name="power_toggles_usb_connection_mode_text">USB Conn. Mode</string>
<string name="power_toggles_usb_mtp_title">Current mode: MTP</string>
<string name="power_toggles_usb_msc_title">Current mode: MSC</string>
<string name="power_toggles_usb_mtp_mode">MTP - Media Transfer</string>
<string name="power_toggles_usb_msc_mode">MSC - Mass Storage</string>
<string name="power_toggles_wifi_ap_text">Wi-Fi Hotspot</string>
<string name="power_toggles_stay_awake_plugged_text">Stay Awake</string>
<string name="power_toggles_battery_info_text">Battery Info</string>
<string name="power_toggles_battery_info_info">Battery Information</string>
<string name="power_toggles_battery_info_usage">Battery Power Usage</string>
<string name="power_toggles_system_settings_text">System Settings</string>
<string name="power_toggles_recent_apps_text">Recent Apps</string>
<string name="power_toggles_me_profile_contact_text">Me</string>
<string name="power_toggles_stamina_mode_text">STAMINA Mode</string>
<string name="power_toggles_nfc_text">NFC</string>
<string name="power_toggles_roaming_text">Roaming</string>
<string name="power_toggles_throw_text">Throw</string>
<string name="power_toggles_usb_tether_text">USB Tethering</string>
<string name="power_toggles_preferences_category_power_toggles">Power Toggles</string>
<string name="power_toggles_preferences_close_on_toggle_title">Close on Toggle</string>
<string name="power_toggles_preferences_close_on_toggle_summary">Close the notification pulldown after toggling a button</string>
<string name="power_toggles_preferences_category_order">Buttons Order</string>
<string name="power_toggles_preferences_buttons_order_title">Change Order</string>
<string name="power_toggles_preferences_buttons_order_summary">Change the buttons order (two or more selected selected buttons are needed)</string>
<string name="power_toggles_preferences_category_buttons">Buttons (Alphabetically Sorted)</string>
<string name="power_toggles_preferences_category_reset">Reset</string>
<string name="power_toggles_preferences_reset_title">Reset Buttons</string>
<string name="power_toggles_preferences_reset_summary">All buttons and default order</string>
<string name="power_toggles_preferences_reset_message">All buttons will be included with the default order. Continue?</string>
<string name="power_toggles_preferences_reset_success_message">All buttons and order successfully reseted!</string>
<string name="power_toggles_preferences_about">About</string>
<string name="power_toggles_preferences_buttons_titles_title">Buttons Titles</string>
<string name="power_toggles_preferences_buttons_titles_summary">Show buttons titles</string>
<string name="power_toggles_camera_text">Camera</string>
<string name="power_toggles_battery_meter_format">@string/status_bar_settings_battery_meter_format</string>
Open Styles.xml
Add these Codes
Code:
<style name="TextAppearance.StatusBar.CustomDrawerLayout" parent="@android:style/Widget.DeviceDefault.Light.TimePicker">
<item name="android:textSize">12.0dip</item>
<item name="android:textAllCaps">true</item>
</style>
<style name="DeviceDefaultLight" parent="@android:style/Theme.DeviceDefault.Light" />
<style name="power_toggles_text_appearance" parent="@android:style/TextAppearance">
<item name="android:textSize">9.0sp</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">@color/power_toggles_button_label_color</item>
<item name="android:ellipsize">marquee</item>
<item name="android:paddingLeft">2.0dip</item>
<item name="android:paddingRight">2.0dip</item>
<item name="android:fadingEdge">horizontal</item>
<item name="android:maxLines">2</item>
<item name="android:singleLine">false</item>
<item name="android:textAllCaps">true</item>
</style>
Recompile
Post 2 contains Smali part
Smali Part
Decompile the newly recompiled SystemUI again
Open SystemUI\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali
Find
Code:
.field private mQSPanel:Lcom/android/systemui/qs/QSPanel;
Add the Line above that
Code:
.field private mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
Find
Code:
.field mDataTrafficController:Lcom/sonymobile/systemui/statusbar/policy/DataTrafficControllerImpl;
Add this Line above that
Code:
.field private mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;
Find
Code:
.method private setNavigationIconHints(I)V
Add these Methods below that
Code:
.method private setupCustomDrawerLayout()V
.locals 3
.prologue
.line 57
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v1, 0x7f1001e7 #type="id" name="custom_drawer_layout"
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;
.line 61
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;
iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v1
const v2, 0x7f09006b #type="color" name="custom_drawer_layout_scrin"
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getColor(I)I
move-result v1
invoke-virtual {v0, v1}, Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;->setScrimColor(I)V
.line 65
return-void
.end method
.method private setupPowerToggles()V
.locals 3
.prologue
.line 55
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v1, 0x7f1001e8 #type="id" name="power_toggles"
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/serajr/powertoggles/PowerToggles;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
.line 56
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v1
const v2, 0x7f0e01ad #type="dimen" name="power_toggles_grid_width"
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v1
invoke-virtual {v0, v1}, Lcom/serajr/powertoggles/PowerToggles;->gridWidth(I)V
.line 57
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
const/4 v1, 0x0
invoke-virtual {v0, v1}, Lcom/serajr/powertoggles/PowerToggles;->buttonShowTitle(Z)V
.line 58
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
invoke-virtual {v0}, Lcom/serajr/powertoggles/PowerToggles;->setupPowerToggles()V
.line 59
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
invoke-virtual {v0}, Lcom/serajr/powertoggles/PowerToggles;->updatePowerToggles()V
.line 60
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
new-instance v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$48;
invoke-direct {v1, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$48;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
invoke-virtual {v0, v1}, Lcom/serajr/powertoggles/PowerToggles;->setChangeContentObserverListener(Lcom/serajr/powertoggles/PowerToggles$ChangeObserverCallbackInterface;)V
.line 61
return-void
.end method
Replace Public ID of these
Code:
0x7f1001e7 #type="id" name="custom_drawer_layout"
0x7f09006b #type="color" name="custom_drawer_layout_scrin"
0x7f1001e8 #type="id" name="power_toggles"
0x7f0e01ad #type="dimen" name="power_toggles_grid_width"
Find
Code:
.method public postAnimateCollapsePanels()V
Add these lines
Code:
.line 2048
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;
invoke-virtual {v0}, Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;->closeDrawers()V
.line 4475
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
invoke-virtual {v0}, Lcom/serajr/powertoggles/PowerToggles;->fullScroll()V
Like this
Code:
.method public postAnimateCollapsePanels()V
.locals 2
.prologue
[COLOR="Red"].line 2048
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;
invoke-virtual {v0}, Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;->closeDrawers()V
.line 4475
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
invoke-virtual {v0}, Lcom/serajr/powertoggles/PowerToggles;->fullScroll()V[/COLOR]
Find
Code:
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->resetUserSetupObserver()V
Add these code Above that
Code:
.line 1243
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupCustomDrawerLayout()V
.line 1244
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerToggles()V
.line 1245
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->powerTogglesEnabledCallback()V
.line 1246
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->powerTogglesPreferencesButtonsTitlesCallback()V
Find
Code:
.method public refreshAllStatusBarIcons()V
Add these Methods above that
Code:
.method public powerTogglesEnabledCallback()V
.locals 3
.prologue
const/4 v2, 0x1
.line 109
iget-object v0, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "power_toggles_enabled"
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-ne v0, v2, :cond_0
.line 112
const-string v0, "powerTogglesEnabledCallback"
const-string v1, "habilita"
invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 113
const/4 v0, 0x1
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->customDrawerLayoutEnabled(Z)V
.line 120
:goto_0
return-void
.line 117
:cond_0
const-string v0, "powerTogglesEnabledCallback"
const-string v1, "desabilita"
invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 118
const/4 v0, 0x0
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->customDrawerLayoutEnabled(Z)V
goto :goto_0
.end method
.method public powerTogglesPreferencesButtonsTitlesCallback()V
.locals 4
.prologue
.line 134
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
if-eqz v1, :cond_1
.line 136
const/4 v0, 0x0
.line 138
.local v0, "showTitles":Z
iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "power_toggles_preferences_buttons_titles"
const/4 v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const/4 v2, 0x1
if-ne v1, v2, :cond_0
.line 140
const/4 v0, 0x1
.line 144
:cond_0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
invoke-virtual {v1, v0}, Lcom/serajr/powertoggles/PowerToggles;->buttonShowTitle(Z)V
.line 145
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
invoke-virtual {v1}, Lcom/serajr/powertoggles/PowerToggles;->setupPowerToggles()V
.line 146
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
invoke-virtual {v1}, Lcom/serajr/powertoggles/PowerToggles;->updatePowerToggles()V
.line 149
.end local v0 # "showTitles":Z
:cond_1
return-void
.end method
Find
Code:
.method public destroy()V
Add this method above that
Code:
.method public customDrawerLayoutEnabled(Z)V
.locals 2
.param p1, "enabled" # Z
.prologue
.line 77
const/4 v0, 0x0
.line 79
.local v0, "lockMode":I
if-nez p1, :cond_0
.line 81
const/4 v0, 0x1
.line 85
:cond_0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;
invoke-virtual {v1, v0}, Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;->setDrawerLockMode(I)V
.line 87
return-void
.end method
Save it
Open /res/layout/status_bar_expanded.xml or msim_status_bar_expanded(dual sim)
Add these Red Lines
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.NotificationPanelView android:id="@id/notification_panel" android:background="@android:color/transparent" 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">
<include android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/carrier_label_height" layout="@layout/subs_label" />
<include android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/carrier_label_height" android:layout_marginBottom="@dimen/close_handle_height" layout="@layout/carrier_label" />
<include android:visibility="gone" android:layout_height="wrap_content" layout="@layout/keyguard_status_view" />
[COLOR="red"]<com.serajr.systemui.navigationdrawer.CustomDrawerLayout android:id="@id/custom_drawer_layout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="48.0dip">[/COLOR]
<include layout="@layout/somc_keyguard_voice_unlock_microphone_frame" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network.EmergencyOnly" android:gravity="center" android:id="@id/emergency_calls_only" android:padding="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />
<FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<include layout="@layout/msim_status_bar_expanded_header" />
<com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer android:layout_gravity="center|top|clip_horizontal" android:id="@id/notification_container_parent" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.phone.ObservableScrollView android:layout_gravity="center|top|clip_horizontal" android:id="@id/scroll_view" android:scrollbars="none" android:layout_width="@dimen/notification_panel_width" android:layout_height="fill_parent" android:fillViewport="true" android:overScrollMode="never">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<include android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/status_bar_header_height_expanded" android:layout_marginStart="@dimen/notification_side_padding" android:layout_marginEnd="@dimen/notification_side_padding" layout="@layout/qs_panel" />
<View android:id="@id/reserve_notification_space" android:layout_width="fill_parent" android:layout_height="@dimen/min_stack_height" android:layout_marginTop="@dimen/notifications_top_padding" />
<View android:layout_width="fill_parent" android:layout_height="@dimen/notification_side_padding" />
</LinearLayout>
</com.android.systemui.statusbar.phone.ObservableScrollView>
<com.android.systemui.statusbar.stack.NotificationStackScrollLayout android:layout_gravity="center|top|clip_horizontal" android:id="@id/notification_stack_scroller" android:layout_width="@dimen/notification_panel_width" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap" />
<ViewStub android:layout_gravity="end" android:id="@id/keyguard_user_switcher" android:layout="@layout/keyguard_user_switcher" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/status_bar_header_height_keyguard" />
<include android:visibility="invisible" layout="@layout/keyguard_status_bar" />
</com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer>
</FrameLayout>
[COLOR="red"]<LinearLayout android:layout_gravity="end" android:orientation="vertical" android:background="@color/custom_drawer_layout_bg" android:layout_width="@dimen/custom_drawer_layout_width" android:layout_height="fill_parent">
<TextView android:gravity="center" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/custom_drawer_layout_header_text" style="@style/power_toggles_text_appearance" />
<FrameLayout android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_weight="1.0">
<com.serajr.powertoggles.PowerToggles android:id="@id/power_toggles" android:layout_width="fill_parent" android:layout_height="wrap_content" />
</FrameLayout>
</LinearLayout>
</com.serajr.systemui.navigationdrawer.CustomDrawerLayout>[/COLOR]
<include android:visibility="gone" layout="@layout/keyguard_bottom_area" />
<com.android.systemui.statusbar.AlphaOptimizedView android:layout_gravity="bottom" android:id="@id/qs_navbar_scrim" android:background="@drawable/qs_navbar_scrim" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="96.0dip" />
</com.android.systemui.statusbar.phone.NotificationPanelView>
-Save
-Recompile
-Sign
Final Part
Decompile Settings.apk
Open res/xml/display_settings.xml or (on your own xml)
Add
Code:
<com.sonymobile.settings.preference.IntentPreference android:key="power_toggles" settings:dependOnResource="true" settings:dependOnIsValidIntent="true" settings:hasMetaData="true">
<intent android:targetPackage="com.android.systemui" android:targetClass="com.serajr.powertoggles.preferences.PowerTogglesPreferencesActivity" />
</com.sonymobile.settings.preference.IntentPreference>
Done
-Recompile
-Sign
If you have are having problems then checkTHIS Post
Here is my SystemUI.apk(Z2) if you are too lazy to do these stuff
Screenshot
Credits
Master @serajr
@Nathan Ali Ashari
Reserved
Good bro
Nice guide will try it ?
Awesome masters lml
Thank you buddy!
It is always a pleasure to me seeing my work still being ported, and better yet seeing it been made with so such great mastery.
Hats off!
serajr said:
Thank you buddy!
It is always a pleasure to me seeing my work still being ported, and better yet seeing it been made with so such great mastery.
Hats off!
Click to expand...
Click to collapse
Thanks Master
Its work in my device cm 12.1 xperia L but toggle mobile data not work (fc) .. How to fix ? ?
Sent from my C2105 using XDA Free mobile app
Arga_Abidullah said:
Its work in my device cm 12.1 xperia L but toggle mobile data not work (fc) .. How to fix ? ?
Sent from my C2105 using XDA Free mobile app
Click to expand...
Click to collapse
Post logcat buddy
Or
Open /data/system/Dropbox/and post the latest system app crash txt
java.lang.NoSuchMethodError: No virtual method getMobileDataEnabled(Z)V in class Landroid/net/ConnectivityManager; or its super classes (declaration of 'android.net.ConnectivityManager' appears in /system/framework/framework.jar)
at com.serajr.powertoggles.buttons.MobileData.toggleState(MobileData.java:98)
at com.serajr.powertoggles.PowerTogglesButton$1.onClick(PowerTogglesButton.java:175)
at android.view.View.performClick(View.java:4789)
at android.view.View$PerformClick.run(View.java:19881)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5291)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Sent from my C2105 using XDA Free mobile app
Hi
I have tried this in my Z2. Followed tut as per OP. No errors. Done all things correctly.. But after replace SystemUI and reboot i got blank screen. Then tried ur SystemUI apk. Same result.. I have fully super deodexed stock Z2 rom.. Any help.. ?
Rajeev said:
Hi
I have tried this in my Z2. Followed tut as per OP. No errors. Done all things correctly.. But after replace SystemUI and reboot i got blank screen. Then tried ur SystemUI apk. Same result.. I have fully super deodexed stock Z2 rom.. Any help.. ?
Click to expand...
Click to collapse
me too, i´m glad that this issue happens to a experienced dev too
thought it was my fault ...
@Rajeev
it seems that spuris Z2 arrived ... great
Rajeev said:
Hi
I have tried this in my Z2. Followed tut as per OP. No errors. Done all things correctly.. But after replace SystemUI and reboot i got blank screen. Then tried ur SystemUI apk. Same result.. I have fully super deodexed stock Z2 rom.. Any help.. ?
Click to expand...
Click to collapse
Yes same result here bro @Rajeev on my Z3
Tried it today.... No luck, black screen ><"
Pandemic said:
Yes same result here bro @Rajeev on my Z3
Tried it today.... No luck, black screen ><"
Click to expand...
Click to collapse
moonryder said:
me too, i´m glad that this issue happens to a experienced dev too
thought it was my fault ...
@Rajeev
it seems that spuris Z2 arrived ... great
Click to expand...
Click to collapse
Yes. Hope that OP will find the issue and update his tutorial. Its a very good one for us..
Rajeev said:
Yes. Hope that OP will find the issue and update his tutorial. Its a very good one for us..
Click to expand...
Click to collapse
Pandemic said:
Yes same result here bro @Rajeev on my Z3
Tried it today.... No luck, black screen ><"
Click to expand...
Click to collapse
Logs please?
Gaurav007 said:
Logs please?
Click to expand...
Click to collapse
I have tired ur shared SystemUI apk too.. Same results.. In my Z2..
Rajeev said:
I have tired ur shared SystemUI apk too.. Same results.. In my Z2..
Click to expand...
Click to collapse
Bro 2-3 people told me it works
If you can send me logcat then I can check what is the problem
Or
You can open /data/system/Dropbox/
Here you'll find all crash reports
Post the latest system_app_crash.txt
Xperia Z2

Categories

Resources