JB Notification Panel Menu
While I really like the lidroid extended toggles, I have been interested in getting the stock extended toggles working now that there is capability to have the same features to rearrange & remove toggles (plus 4g is there in stock). However, this feature is not fully enabled on our JB build.
I need to know if this is enabled stock on any Samsung build so we can take a closer look at what might need to be done to get ours working.
The image is of a working Panel Menu that was ported over to the i9100.
BTW, the brightness slider toggle already works on our E4GT as shown.
\
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Looks like I need this, I know a few including me that would like to have 4g toggle. I was reading earlier today about this somewhere. Ill see if I can find it, and Ill post
This video shows that the international s3 has this feature on the stock rom. I'll be downloading and looking for differences.
EDIT:
Just noticed 4.2.1 dropped for international sgs3 !
Sent from my SPH-L900 using Xparent Skyblue Tapatalk 2
elijahbrown said:
Click to expand...
Click to collapse
Yup, that's what I'm hoping for.
tdunham said:
Yup, that's what I'm hoping for.
Click to expand...
Click to collapse
I'm hoping I get some time to dig into this. Need to see if I can modify this stock version. Notice the lack of a 4g AND 3g toggle.
The Note 2 currently had no way to toggle any data. It is all done by the connection manager. Not that this phone is in need of it, I can get 24 hours with days constantly on and 3 hours screen time, but I don't like not having the control.
Sent from my SPH-L900 using Xparent Skyblue Tapatalk 2
anything going on with this mod?
comptonhubbard said:
anything going on with this mod?
Click to expand...
Click to collapse
Not yet, they have it working elsewhere but no luck for our phone yet.
Sent from my SPH-D710 using xda premium
tdunham said:
Not yet, they have it working elsewhere but no luck for our phone yet.
Sent from my SPH-D710 using xda premium
Click to expand...
Click to collapse
was looking forward to this mod...hopefully we get some action on this soon.
Didn't couple of early jb leaks for our phone have more toggles in pulldown than gb27?
===================
BluesRulez said:
Didn't couple of early jb leaks for our phone have more toggles in pulldown than gb27?
Click to expand...
Click to collapse
There were. We removed the options that were either unavailable or didn't work for our phone. The base code is the same across many different Samsung phones but not all the features work. Mainly because of hardware differences.
tdunham said:
There were. We removed the options that were either unavailable or didn't work for our phone. The base code is the same across many different Samsung phones but not all the features work. Mainly because of hardware differences.
Click to expand...
Click to collapse
looks like we're at a standstill with this....did jb source help any?
I noticed some on GT-I9100 forum successfully added extra toggles in Settings -> Display -> Notification panel section (airplane, torch and notifications).
Credits to:
- shoman94
- jeboo
- Mirko_ddd
Click to expand...
Click to collapse
I tried to study xml and smali and resources changes in order to port it to other JellyBean 4.1.2 ROMs..
I consulted Mirko_ddd that had succeed adding new toggles in his custom ROM
Here are the changes that I noticed:
1) For SystemUI.apk:
- I added extra resources images to "drawable-xhdpi" folder [tw_quick_panel_icon_flashlight_off.png] and [tw_quick_panel_icon_flashlight_on.png] other for airplane and notifications are already there.
- I added the following strings to strings.xml in values folder:
Code:
<string name="quickpanel_flashlight_text">Torch</string>
other strings for airplane and notifications are already there.
- Then I recompiled SystemUI.apk again to generate new ids in public.xml files then decompile the new SystemUI.apk
- Then I added [FlashlightQuickSettingButton.smali] file to SystemUI.apk\smali\com\android\systemui\statusbar\policy\quicksetting folder
- Then I opened this smali and changes the 3 ids that starts with 0x7f?????? with new ids generated in public.xml in the following orders:
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
const/4 v6, 0x0
.line 35
const/4 v2, 0x0
const v3, [B][COLOR="Red"]0x7f0a014c[/COLOR] [COLOR="Green"]<!-- id of quickpanel_flashlight_text[/COLOR][/B]
const v4, [B][COLOR="Red"]0x7f020280[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_on[/COLOR][/B]
const v5, [B][COLOR="Red"]0x7f02027f[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_off[/COLOR][/B]
move-object v0, p0
- Then I recompiled the finished SystemUI project.
2) For SecSettings.apk:
- I added extra resources images to "drawable-xhdpi" folder [notification_panel_airplane.png] and [notification_panel_flashlight.png] and [notification_panel_notification.png]
- Then I added these strings to strings.xml in values folder:
Code:
<string name="notification_panel_flashlight">Torch</string>
<string name="notification_panel_airplane">Airplane Mode</string>
<string name="notification_panel_notification">Notifications</string>
- Then I navigated to SecSettings.apk\smali\com\android\settings folder and open NotificationPanel.smali file.
- I searched for ".method public MakeConvertPanelName()V" and I added these lines (the blue ones):
Code:
.method public MakeConvertPanelName()V
.locals 3
.prologue
.line 119
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Wifi"
const-string v2, "notification_panel_wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
const-string v1, "Sync"
const-string v2, "notification_panel_sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 154
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Flashlight"
const-string v2, "notification_panel_flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "AirplaneMode"
const-string v2, "notification_panel_airplane"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "DoNotDisturb"
const-string v2, "notification_panel_notification"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;[/COLOR][/B]
.line 135
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 136
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_wifi"
const-string v2, "Wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 137
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_gps"
const-string v2, "Location"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
.line 151
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_sync"
const-string v2, "Sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_flashlight"
const-string v2, "Flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_airplane"
const-string v2, "AirplaneMode"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 157
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_notification"
const-string v2, "DoNotDisturb"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[/COLOR][/B]
.line 152
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_empty"
const-string v2, "Empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 153
return-void
.end method
- Then I recompiled the finished project...
Then I pushed SystemUI.apk and SecSettings.apk and Torch.apk to my phone and I fixed permissions, but still I have no extra toggles in Settings -> Display -> Notification panel section..
I consulted Mirko_ddd again and he said:
Now only thing left is to update the database (db).
U need to add nu quick panels name to database helper in secsettingsprovider.apk
In res string.xml
Database will load only once so need a wipe to take effect.
Click to expand...
Click to collapse
I added the new toggles name to strings in SecSettingsProvider.apk like what he did:
Code:
<string name="def_active_notification_list">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync</string>
<string name="def_candidate_notification_list">AirplaneMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet">DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_vzw">Bluetooth;Location;SilentMode;AirplaneMode;AutoRotate;PowerSaving;SmartStay;DrivingMode;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet_vzw">Wifi;MobileData;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_spr">Wifi;Bluetooth;Location;SilentMode;AutoRotate;AirplaneMode;PowerSaving;AllShareCast;Empty;Empty;</string>
<string name="def_candidate_notification_list_tablet_spr">MobileData;DormantMode;Sync;DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;</string>
<string name="def_country_code">011</string>
<string name="def_active_notification_list_q1">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync;</string>
<string name="def_candidate_notification_list_q1">DrivingMode;SmartStay;Flashlight;AirplaneMode;DoNotDisturb;Empty;Empty;Empty;Empty;Empty;</string>
But doing these changes and doing full wipe to phone in order to load new database give me bootloop!!! So wild thinking, I think I missed something in DatabaseHelper.smali itself in SecSettingsProvider.apk..
This is what I have reached to.. and I hope someone can get benifit from it and continue from where I stuck on (SecSettingsProvider.apk),,,
Resources are in the attachment
Cheers
majdinj said:
I noticed some on GT-I9100 forum successfully added extra toggles in Settings -> Display -> Notification panel section (airplane, torch and notifications).
I tried to study xml and smali and resources changes in order to port it to other JellyBean 4.1.2 ROMs..
I consulted Mirko_ddd that had succeed adding new toggles in his custom ROM
Here are the changes that I noticed:
1) For SystemUI.apk:
- I added extra resources images to "drawable-xhdpi" folder [tw_quick_panel_icon_flashlight_off.png] and [tw_quick_panel_icon_flashlight_on.png] other for airplane and notifications are already there.
- I added the following strings to strings.xml in values folder:
Code:
<string name="quickpanel_flashlight_text">Torch</string>
other strings for airplane and notifications are already there.
- Then I recompiled SystemUI.apk again to generate new ids in public.xml files then decompile the new SystemUI.apk
- Then I added [FlashlightQuickSettingButton.smali] file to SystemUI.apk\smali\com\android\systemui\statusbar\policy\quicksetting folder
- Then I opened this smali and changes the 3 ids that starts with 0x7f?????? with new ids generated in public.xml in the following orders:
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
const/4 v6, 0x0
.line 35
const/4 v2, 0x0
const v3, [B][COLOR="Red"]0x7f0a014c[/COLOR] [COLOR="Green"]<!-- id of quickpanel_flashlight_text[/COLOR][/B]
const v4, [B][COLOR="Red"]0x7f020280[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_on[/COLOR][/B]
const v5, [B][COLOR="Red"]0x7f02027f[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_off[/COLOR][/B]
move-object v0, p0
- Then I recompiled the finished SystemUI project.
2) For SecSettings.apk:
- I added extra resources images to "drawable-xhdpi" folder [notification_panel_airplane.png] and [notification_panel_flashlight.png] and [notification_panel_notification.png]
- Then I added these strings to strings.xml in values folder:
Code:
<string name="notification_panel_flashlight">Torch</string>
<string name="notification_panel_airplane">Airplane Mode</string>
<string name="notification_panel_notification">Notifications</string>
- Then I navigated to SecSettings.apk\smali\com\android\settings folder and open NotificationPanel.smali file.
- I searched for ".method public MakeConvertPanelName()V" and I added these lines (the blue ones):
Code:
.method public MakeConvertPanelName()V
.locals 3
.prologue
.line 119
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Wifi"
const-string v2, "notification_panel_wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
const-string v1, "Sync"
const-string v2, "notification_panel_sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 154
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Flashlight"
const-string v2, "notification_panel_flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "AirplaneMode"
const-string v2, "notification_panel_airplane"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "DoNotDisturb"
const-string v2, "notification_panel_notification"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;[/COLOR][/B]
.line 135
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 136
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_wifi"
const-string v2, "Wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 137
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_gps"
const-string v2, "Location"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
.line 151
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_sync"
const-string v2, "Sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_flashlight"
const-string v2, "Flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_airplane"
const-string v2, "AirplaneMode"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 157
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_notification"
const-string v2, "DoNotDisturb"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[/COLOR][/B]
.line 152
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_empty"
const-string v2, "Empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 153
return-void
.end method
- Then I recompiled the finished project...
Then I pushed SystemUI.apk and SecSettings.apk and Torch.apk to my phone and I fixed permissions, but still I have no extra toggles in Settings -> Display -> Notification panel section..
I consulted Mirko_ddd again and he said:
I added the new toggles name to strings in SecSettingsProvider.apk like what he did:
Code:
<string name="def_active_notification_list">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync</string>
<string name="def_candidate_notification_list">AirplaneMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet">DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_vzw">Bluetooth;Location;SilentMode;AirplaneMode;AutoRotate;PowerSaving;SmartStay;DrivingMode;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet_vzw">Wifi;MobileData;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_spr">Wifi;Bluetooth;Location;SilentMode;AutoRotate;AirplaneMode;PowerSaving;AllShareCast;Empty;Empty;</string>
<string name="def_candidate_notification_list_tablet_spr">MobileData;DormantMode;Sync;DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;</string>
<string name="def_country_code">011</string>
<string name="def_active_notification_list_q1">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync;</string>
<string name="def_candidate_notification_list_q1">DrivingMode;SmartStay;Flashlight;AirplaneMode;DoNotDisturb;Empty;Empty;Empty;Empty;Empty;</string>
But doing these changes and doing full wipe to phone in order to load new database give me bootloop!!! So wild thinking, I think I missed something in DatabaseHelper.smali itself in SecSettingsProvider.apk..
This is what I have reached to.. and I hope someone can get benifit from it and continue from where I stuck on (SecSettingsProvider.apk),,,
Resources are in the attachment
Cheers
Click to expand...
Click to collapse
please say how to add notification panel setting in settings menu for i9100 ? i open secsettings.apk and notification menu found other roms. but can not put my apk. i get an error. please help me. which files I need to put where. Can you tell us more
citymen34 said:
please say how to add notification panel setting in settings menu for i9100 ? i open secsettings.apk and notification menu found other roms. but can not put my apk. i get an error. please help me. which files I need to put where. Can you tell us more
Click to expand...
Click to collapse
I didn't manage to have extra toggles by the original way :crying:
You can check Mirko_ddd custom ROM (DisaterROM) that has extra toggles enabled by him
majdinj said:
I didn't manage to have extra toggles by the original way :crying:
You can check Mirko_ddd custom ROM (DisaterROM) that has extra toggles enabled by him
Click to expand...
Click to collapse
When you diff the original SecSettingsProvider.apk of the S2 and the modified ones, there are changes in Database*. smali and in two or three files in res/values folder. But applying the changes myself will always lead to bootloop after factory reset.
majdinj said:
I noticed some on GT-I9100 forum successfully added extra toggles in Settings -> Display -> Notification panel section (airplane, torch and notifications).
I tried to study xml and smali and resources changes in order to port it to other JellyBean 4.1.2 ROMs..
I consulted Mirko_ddd that had succeed adding new toggles in his custom ROM
Here are the changes that I noticed:
1) For SystemUI.apk:
- I added extra resources images to "drawable-xhdpi" folder [tw_quick_panel_icon_flashlight_off.png] and [tw_quick_panel_icon_flashlight_on.png] other for airplane and notifications are already there.
- I added the following strings to strings.xml in values folder:
Code:
<string name="quickpanel_flashlight_text">Torch</string>
other strings for airplane and notifications are already there.
- Then I recompiled SystemUI.apk again to generate new ids in public.xml files then decompile the new SystemUI.apk
- Then I added [FlashlightQuickSettingButton.smali] file to SystemUI.apk\smali\com\android\systemui\statusbar\policy\quicksetting folder
- Then I opened this smali and changes the 3 ids that starts with 0x7f?????? with new ids generated in public.xml in the following orders:
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
const/4 v6, 0x0
.line 35
const/4 v2, 0x0
const v3, [B][COLOR="Red"]0x7f0a014c[/COLOR] [COLOR="Green"]<!-- id of quickpanel_flashlight_text[/COLOR][/B]
const v4, [B][COLOR="Red"]0x7f020280[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_on[/COLOR][/B]
const v5, [B][COLOR="Red"]0x7f02027f[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_off[/COLOR][/B]
move-object v0, p0
- Then I recompiled the finished SystemUI project.
2) For SecSettings.apk:
- I added extra resources images to "drawable-xhdpi" folder [notification_panel_airplane.png] and [notification_panel_flashlight.png] and [notification_panel_notification.png]
- Then I added these strings to strings.xml in values folder:
Code:
<string name="notification_panel_flashlight">Torch</string>
<string name="notification_panel_airplane">Airplane Mode</string>
<string name="notification_panel_notification">Notifications</string>
- Then I navigated to SecSettings.apk\smali\com\android\settings folder and open NotificationPanel.smali file.
- I searched for ".method public MakeConvertPanelName()V" and I added these lines (the blue ones):
Code:
.method public MakeConvertPanelName()V
.locals 3
.prologue
.line 119
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Wifi"
const-string v2, "notification_panel_wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
const-string v1, "Sync"
const-string v2, "notification_panel_sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 154
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Flashlight"
const-string v2, "notification_panel_flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "AirplaneMode"
const-string v2, "notification_panel_airplane"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "DoNotDisturb"
const-string v2, "notification_panel_notification"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;[/COLOR][/B]
.line 135
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 136
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_wifi"
const-string v2, "Wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 137
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_gps"
const-string v2, "Location"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
.line 151
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_sync"
const-string v2, "Sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_flashlight"
const-string v2, "Flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_airplane"
const-string v2, "AirplaneMode"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 157
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_notification"
const-string v2, "DoNotDisturb"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[/COLOR][/B]
.line 152
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_empty"
const-string v2, "Empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 153
return-void
.end method
- Then I recompiled the finished project...
Then I pushed SystemUI.apk and SecSettings.apk and Torch.apk to my phone and I fixed permissions, but still I have no extra toggles in Settings -> Display -> Notification panel section..
I consulted Mirko_ddd again and he said:
I added the new toggles name to strings in SecSettingsProvider.apk like what he did:
Code:
<string name="def_active_notification_list">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync</string>
<string name="def_candidate_notification_list">AirplaneMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet">DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_vzw">Bluetooth;Location;SilentMode;AirplaneMode;AutoRotate;PowerSaving;SmartStay;DrivingMode;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet_vzw">Wifi;MobileData;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_spr">Wifi;Bluetooth;Location;SilentMode;AutoRotate;AirplaneMode;PowerSaving;AllShareCast;Empty;Empty;</string>
<string name="def_candidate_notification_list_tablet_spr">MobileData;DormantMode;Sync;DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;</string>
<string name="def_country_code">011</string>
<string name="def_active_notification_list_q1">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync;</string>
<string name="def_candidate_notification_list_q1">DrivingMode;SmartStay;Flashlight;AirplaneMode;DoNotDisturb;Empty;Empty;Empty;Empty;Empty;</string>
But doing these changes and doing full wipe to phone in order to load new database give me bootloop!!! So wild thinking, I think I missed something in DatabaseHelper.smali itself in SecSettingsProvider.apk..
This is what I have reached to.. and I hope someone can get benifit from it and continue from where I stuck on (SecSettingsProvider.apk),,,
Resources are in the attachment
Cheers
Click to expand...
Click to collapse
This is the work of jeboo and I for our rom. I gave it to mirko some we share some mods. Make sure credit is given correctly. ... Thanks
Sent from my SAMSUNG-SGH-I337 using Tapatalk 4 Beta
shoman94 said:
This is the work of jeboo and I for our rom. I gave it to mirko some we share some mods. Make sure credit is given correctly. ... Thanks
Sent from my SAMSUNG-SGH-I337 using Tapatalk 4 Beta
Click to expand...
Click to collapse
Oh.. sorry I didn't mean to be rude man, but I saw it in DisasterROM of Mirko_ddd, so I started to investigate it,,,
I didn't know that was you shoman94 :laugh:
Also I post it here because I couldn't have it to work by doing these changes (of course I compare smali myself so I though there was a mistake, so I asked Mirko; I didn't intend to steal anyone work so that's why I said credits to Mirko which turned to be you man and jeboo, anyhow I will correct that post)
So do you know what is wrong with smali code here??
majdinj said:
Oh.. sorry I didn't mean to be rude man, but I saw it in DisasterROM of Mirko_ddd, so I started to investigate it,,,
I didn't know that was you shoman94 :laugh:
Also I post it here because I couldn't have it to work by doing these changes (of course I compare smali myself so I though there was a mistake, so I asked Mirko; I didn't intend to steal anyone work so that's why I said credits to Mirko which turned to be you man and jeboo, anyhow I will correct that post)
So do you know what is wrong with smali code here??
Click to expand...
Click to collapse
No problem! I'm actually glad you made the notes. I'm working on 4.2.2 now, and will hopefully have a version that doesn't require SecSettingsProvider patch (thus no more wipe!).
would be pretty cool since i dont use the 4g toggle and would like to have a 3g one
Related
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
****** For ICS 4.0.4, the code has changed a bit. Instead of changing the original tutorial, I'm providing a known working patch I did for an i9100 XWLPT build ******
(there's also a 2nd patch below to ignore regular swipe actions while using AOSP lockscreen)
https://github.com/shoman94/SHOstock2-XWLPT/commit/523075aac1730883a14e365e29c58eb8cce03248
https://github.com/shoman94/SHOstock2-XWLPT/commit/a55fb9b42a5f3f0c0c840c72e68372ab6a199cc2
This tutorial will be a bit involved, you've been warned! It was more of a learning experience, so here are the things you will see:
1. Add toggle settings via xml
2. Add global settings that are retained
3. Add code support for your toggles
4. Have your toggles be smart, and enable/disable other related toggles
5. Add a debug message using Slog, this is invaluable for any project!
Based on 4.0.3 LP3 base..Adjust resource IDs (bolded) for your base!!
--------------------------------------------------------------------------
Step 1. Adding the toggles to Settings/Date & Time (the easy part)
Decompile Settings.apk, modify the following:
public.xml, add:
Code:
<public type="string" name="disable_ampm" id="[b]0x7f0b0923[/b]" />
<public type="string" name="disable_ampm_text" id="[b]0x7f0b0924[/b]" />
<public type="string" name="disable_time" id="[b]0x7f0b0925[/b]" />
<public type="string" name="disable_time_text" id="[b]0x7f0b0926[/b]" />
strings.xml, add:
Code:
<string name="disable_time">Hide Time</string>
<string name="disable_time_text">Remove time from status bar</string>
<string name="disable_ampm">Hide AM/PM</string>
<string name="disable_ampm_text">Remove AM/PM from time in status bar</string>
xml/date_time_prefs.xml, add:
Code:
<CheckBoxPreference android:title="@string/disable_time" android:key="hide_time" android:summary="@string/disable_time_text" />
<CheckBoxPreference android:title="@string/disable_ampm" android:key="hide_ampm" android:summary="@string/disable_ampm_text" />
Compile settings.apk, u/l and reboot. Make sure the toggles are added!
Step 2. Adding code for the settings (the not so easy part). This code gets a bit involved since we have to handle the new settings, and also add 'toggle logic' for different combinations to enable/disable them.
Still in settings.apk, DateTimeSettings.smali:
At top, add:
Code:
.field private mHideTime:Landroid/preference/Preference;
.field private mHideAmPm:Landroid/preference/Preference;
Then in the '.method private initUI()V', find 'return-void' and add this code above it:
Code:
const-string v6, "hide_time"
invoke-virtual {p0, v6}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v6
check-cast v6, Landroid/preference/Preference;
iput-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
const-string v6, "hide_ampm"
invoke-virtual {p0, v6}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v6
check-cast v6, Landroid/preference/Preference;
iput-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :no_disablebtns
const/4 v0, 0x0
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:no_disablebtns
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :no_disableampm
const/4 v0, 0x0
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:no_disableampm
Now search for '.method public onPreferenceTreeClick' and on the line below, change .locals 2 to:
Code:
.locals 6
Now search for:
:cond_2
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
if-ne p2, v0, :cond_0
change the last line to:
Code:
if-ne p2, v0, :cond_new
About 10 lines below that, you will see 'invoke-direct {p0, v0}, Lcom/android/settings/DateTimeSettings;->set24Hour(Z)V', add this below that line:
Code:
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-nez v0, :cond_hideampm
const/4 v0, 0x1
goto :set_ampm
:cond_hideampm
const/4 v0, 0x0
:set_ampm
invoke-virtual {v1, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:cond_updatetime
Then search for 'goto :goto_0' about 10 lines below and add this before '.end method':
Code:
:cond_new
const-string v3, "hide_ampm"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-ne p2, v0, :cond_new2
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
:save_ampm
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_ampm"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :cond_updatetime
:cond_new2
const-string v3, "hide_time"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
if-ne p2, v0, :goto_0
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
:save_time
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_time"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
if-nez v2, :cond_hidebtns
const/4 v2, 0x1
goto :cond_setbtns
:cond_hidebtns
const/4 v2, 0x0
:cond_setbtns
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
goto :cond_updatetime
And that's it for Settings! Recompile and upload and check everything looks right in Settings/Date and Time and the toggles work.
Step 3. Modifying the clock code to handle new changes (kinda easy =)
Decompile SystemUI and open Clock.smali.
Search for the following in func getSmallTime:
.local v3, context:Landroid/content/Context;
invoke-static {v3}, Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/ContextZ
Then add this code BEFORE the invoke-static .. line above (NOTE: there's a constant below that refers to the clock resource in public.xml [<public type="id" name="clock" id="0x7f0e0027" />], be sure it matches!):
Code:
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v7, "hide_time"
const/4 v0, 0x0
invoke-static {v2, v7, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
const/4 v0, 0x0
if-eqz v7, :cond_nohide
const/16 v0, 0x8
:cond_nohide
const v1, [b]0x7f0e0027[/b]
invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v1
invoke-virtual {v1, v0}, Landroid/view/View;->setVisibility(I)V
About 20 lines below that, you will see:
.local v1, MAGIC2:C
invoke-virtual {v3, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v4
Add this directly after:
Code:
if-nez v2, :cond_continue
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_ampm"
const/4 v0, 0x0
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
########### Start of debug msg, can be removed #######
const-string v0, "ampm"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "getint returned="
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
########### End of debug msg ###########
move v2, v7
if-eqz v2, :cond_continue
const-string v4, "h:mm"
:cond_continue
That's it for Clock.smali.
Step 4. Almost there, now we just have to make one more change to SystemUI in PhoneStatusBar.smali.
Find '.method public showClock' and change .locals 2 to:
Code:
.locals 3
Find:
if-eqz p1, :cond_1
const/4 v0, 0x0
and insert this code after it:
Code:
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_time"
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :goto_0
const/16 v0, 0x8
Recompile SystemUI and reboot. Now try out the new feature =)
Excellent.... built into my rom. Thanks !
...or just use 24h format which is shorter and more natural
sorg said:
...or just use 24h format which is shorter and more natural
Click to expand...
Click to collapse
Ummm You can use this to remove the clock completely....
I just updated to OP to include Step 4. I didn't realize the lock screen was interfering with the feature since I don't use one..Fixed now.
Building into mine as well, tonight if I don't fall asleep.
And a few moments of disagreeing with smali, got it going...thanks a bunch Jeboo!
nice, welldone!
but it s better to leave public.xml, add only the others xml and recompile once.
then decompile again to get the public xml
it s safer, and then match the smali changes with the new public values.
Anyway great guide
if your decompiling with smali/baksmali directly make sure to use the -l flag (thats a L) so you have local varibles instead of registers, learned this the hard way lol
This mod is amazing, thank you very much my friend works fabulously
Add a toggle for CRT Animation
Building upon the same theme from the OP, we can now add another toggle under display settings for CRT animation. This feature is controlled by the boolean animateScreenLights in framework-res.apk (thanks to whomever the original author was!).
Since adding the setting is pretty much identical to the procedure in the OP, I will just discuss the relevant code needed to access the new setting (I leave adding the setting up to you!). The only requirement is you name your setting 'crt_animation'.
Our patch point will be inside services.jar, specifically PowerManagerService$BrightnessState.smali (this is based on LP7):
Code:
iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
iget-boolean v6, v6, Lcom/android/server/PowerManagerService;->mAnimateScreenLights:Z
if-nez v6, :cond_19
NOTE: cond_19 may differ depending on your decompiler.
So we need to delete the 3 lines above. In its place, add our new code:
Code:
iget-object v0, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v0}, Lcom/android/server/PowerManagerService;->access$4300(Lcom/android/server/PowerManagerService;)Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "crt_animation"
const/4 v4, 0x0
invoke-static {v0, v1, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v6
if-eqz v6, :cond_19
NOTE: Again, if cond_19 is different, fix the last line above!
Recompile settings.apk & services.jar, u/l and reboot!
Porting this mod to the skyrocket
Hey jeboo, as i told you I am trying to port this over to my rom but need some guidance in clock.smali and PhoneStatusBar.smali Thanks I appreciate the help I am attaching the smali files...
adding toggle CRT animation settings
jeboo said:
Building upon the same theme from the OP, we can now add another toggle under display settings for CRT animation. This feature is controlled by the boolean animateScreenLights in framework-res.apk (thanks to whomever the original author was!).
Since adding the setting is pretty much identical to the procedure in the OP, I will just discuss the relevant code needed to access the new setting (I leave adding the setting up to you!). The only requirement is you name your setting 'crt_animation'.
Our patch point will be inside services.jar, specifically PowerManagerService$BrightnessState.smali (this is based on LP7):
Code:
iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
iget-boolean v6, v6, Lcom/android/server/PowerManagerService;->mAnimateScreenLights:Z
if-nez v6, :cond_19
NOTE: cond_19 may differ depending on your decompiler.
So we need to delete the 3 lines above. In its place, add our new code:
Code:
iget-object v0, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v0}, Lcom/android/server/PowerManagerService;->access$4300(Lcom/android/server/PowerManagerService;)Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "crt_animation"
const/4 v4, 0x0
invoke-static {v0, v1, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v6
if-eqz v6, :cond_19
NOTE: Again, if cond_19 is different, fix the last line above!
Recompile settings.apk & services.jar, u/l and reboot!
Click to expand...
Click to collapse
hi Mr Jeboo.. could u specify the settings in the strings.xml and public.xml in settings.apk? i assume u have got this mod to work.. I couldn't get what to add in this files.. thanks..
Apparently when I was redoing the whole thing to do AOSP/CRT toggle I placed the step 4 in the wrong spot.
How would we disable Weather in Lockscreen when AOSP is checked?
Clock.smali
Ok so I found out that the the statusbarservices is where I look instead of phonestatusbar.smali
however I'm having trouble with the Clock.smali inserts.
Could someone take a look, who knows, and make any suggestions or point me where i need to edit?
jeboo said:
...
Find:
if-eqz p1, :cond_1
const/4 v0, 0x0
and insert this code after it:
Code:
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_time"
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, [B][COLOR="DarkOrange"]:goto_0[/COLOR][/B]
const/16 v0, 0x8
Recompile SystemUI and reboot. Now try out the new feature =)
Click to expand...
Click to collapse
On LPD, instead of :goto_0, use :goto_e
Robobob1221 said:
Ok so I found out that the the statusbarservices is where I look instead of phonestatusbar.smali
however I'm having trouble with the Clock.smali inserts.
Could someone take a look, who knows, and make any suggestions or point me where i need to edit?
Click to expand...
Click to collapse
I took a quick look at your clock.smali, GB sure made things complicated (24 registers vs 9 in ICS). When the registers change that much, unfortunately you're going to have to track them, it sucks.
One major problem I see is the return value from is24hourfmt in your ver uses v9, so you need to update the line 'if-nez v2, :cond_continue' to use v9 as well. Try that and let me know.
Thanks to the others for helping with the other changes lately..I must admit I use a much shorter patch for personal use, so I can fall behind with the latest code changes =)
jeboo
jeboo said:
I took a quick look at your clock.smali, GB sure made things complicated (24 registers vs 9 in ICS). When the registers change that much, unfortunately you're going to have to track them, it sucks.
One major problem I see is the return value from is24hourfmt in your ver uses v9, so you need to update the line 'if-nez v2, :cond_continue' to use v9 as well. Try that and let me know.
Thanks to the others for helping with the other changes lately..I must admit I use a much shorter patch for personal use, so I can fall behind with the latest code changes =)
jeboo
Click to expand...
Click to collapse
Thanks for checking out my file.
So you mean that the line should be 'if-nez v2, v9 :cond_continue' or just replace v2 with v9?
Thanks for the help
私はローボーボブ。 Haro!!
Robobob1221 said:
Thanks for checking out my file.
So you mean that the line should be 'if-nez v2, v9 :cond_continue' or just replace v2 with v9?
Thanks for the help
私はローボーボブ。 Haro!!
Click to expand...
Click to collapse
if-nez v9, :cond_continue
Basically if you're using military time, there's no need to worry about am/pm.
Still no compiling
jeboo said:
if-nez v9, :cond_continue
Basically if you're using military time, there's no need to worry about am/pm.
Click to expand...
Click to collapse
In plain English it seems so simple! Lol!
Thanks again. I'll check it out and see if it works. I hope it does Thanks again for the help.
Ok I tried the change you suggested and it still won't compile
I tried a few other changes but it results in the same error '
Could not smali file: [email protected]'. Sometimes the numbers ate end vary but its the same result.
another set is this
[email protected]
私はローボーボブ。 Haro!!
jeboo said:
if-nez v9, :cond_continue
Basically if you're using military time, there's no need to worry about am/pm.
Click to expand...
Click to collapse
Hello Jeboo!
Weird to say but.. with ur tutorial I ve been able to make a toggle to choose Samsung lockscreen or the AOSP one credits for u in my next Simplistic Disaster III Rom
whoa!
This is based off of FL16/GB08 JB 4.1.2.
A touchwiz 4.3 guide has been posted here:
[Guide How-to/MOD] New Power Menu with Screenshot TW 4.3
This will allow you to have Recovery and Bootloader (download mode) right in the Power Menu selections. I grew tired of the extended restart menu so I wrote this.
This is not a flashable mod, it is a guide only.
The attached zip file are support files only that are necessary to create this modification.
Power Menu Guide
Code:
[U][B]Framework-res.apk changes[/B]:[/U]
Add these lines to res/values/strings.xml
[CODE] <string name="download">Bootloader</string>
<string name="recovery">Recovery</string>
Add the two png files in the attachment to:
res/drawable-hdpi
Recompile framework-res.apk.
Decompile the new framework-res.apk and open res/values/public.xml.
We need to write down these values because we need them later. Yours will probably be different. Leave off the leading zero:
Code:
<public type="drawable" name="tw_ic_download" id="0x0[COLOR="Red"]1080ad6[/COLOR]" />
<public type="drawable" name="tw_ic_recovery" id="0x0[COLOR="Red"]1080ad7[/COLOR]" />
<public type="string" name="download" id="0x0[COLOR="Red"]1040843[/COLOR]" />
<public type="string" name="recovery" id="0x0[COLOR="Red"]1040844[/COLOR]" />
Android.policy.jar changes:
Add the two smali files in the attachment to com\android\internal\policy\impl
Smali edit:
com\android\internal\policy\impl\GlobalActions.smali
New line before:
Code:
.field private mDialog:Landroid/app/AlertDialog;
.field private mHandler:Landroid/os/Handler;
After:
Code:
.field private mDialog:Landroid/app/AlertDialog;
[COLOR="Red"].field private mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR].field private mHandler:Landroid/os/Handler;
New line before:
Code:
.field private mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
After:
Code:
.field private mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[COLOR="Red"].field private mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR].field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
Find around line 1075:
Code:
.line 372
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
const v2, 0x10808ee
const v3, 0x1040192
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 399
Add new lines after this section:
***NOTE THE LINES IN BLUE, THESE MUST MATCH THE VALUES WE GOT FROM FRAMEWORK (without the leading zero)***
Code:
.line 372
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
const v2, 0x10808ee
const v3, 0x1040192
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 399
[COLOR="Red"] new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;
const v2, 0x[COLOR="Blue"]1080ad6[/COLOR]
const v3, 0x[COLOR="Blue"]1040843[/COLOR]
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 400
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Recovery;
const v2, 0x[COLOR="Blue"]1080ad7[/COLOR]
const v3, 0x[COLOR="Blue"]1040844[/COLOR]
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Recovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 401
[/COLOR] new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$5;
Now we are going to expand the existing array to include 2 more entries.
Around line 1138:
Before:
Code:
.line 428
const/4 v1, 0x5
After:
Code:
.line 428
[COLOR="Red"]const/4 v1, 0x7[/COLOR]
Find around line 1137:
Code:
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x4
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
Replace with:
Code:
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x4
move-object/from16 v0, p0
[COLOR="Red"] iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x5
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x6
move-object/from16 v0, p0[/COLOR]
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
How to remove menu items:
Smali edit:
com\android\internal\policy\impl\GlobalActions.smali
We need to reconfigure the array that displays the options.
Before:
Code:
.line 428
const/4 v1, 0x7
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
const/4 v2, 0x0
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x1
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x2
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x3
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x4
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x5
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x6
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
move-result-object v1
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
We need to split up the array so that we can easily see the different sections.
It will make it easier to modify the line you want to remove.
Code:
.line 428
const/4 v1, 0x7
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
#
const/4 v2, 0x0
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
const/4 v2, 0x1
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
const/4 v2, 0x2
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
#
const/4 v2, 0x3
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
#
const/4 v2, 0x4
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
const/4 v2, 0x5
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
const/4 v2, 0x6
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
move-result-object v1
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
Now we will remove the Data Network Mode and Airplane Mode choices from the menu. We need to shrink the array by 2 and also renumber the remaining options. Please note the changes in red.
Code:
.line 428
[COLOR="Red"] const/4 v1, 0x5[/COLOR]
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
#
const/4 v2, 0x0
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
const/4 v2, 0x1
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
[COLOR="Red"] # const/4 v2, 0x2
# move-object/from16 v0, p0
# iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
# aput-object v3, v1, v2
[/COLOR]
#
[COLOR="Red"] # const/4 v2, 0x3
# move-object/from16 v0, p0
# iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
# aput-object v3, v1, v2[/COLOR]
#
[COLOR="Red"] const/4 v2, 0x2[/COLOR]
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
[COLOR="Red"] const/4 v2, 0x3
[/COLOR]
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
[COLOR="Red"] const/4 v2, 0x4
[/COLOR]
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
move-result-object v1
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
Note: Use of the # symbol is not necessary. I use it simply for clarification and to separate out the sections for easier viewing while editing. Additionally, any lines edited with the # symbol will be ignored when recompiling.
Addendum - Adding Screenshot to Power Menu
(This is an addon to the original Power Menu Guide posted above).
Framework-res.apk changes:
Add these lines to res/values/strings.xml
Code:
<string name="global_action_screenshot_txt">Screenshot</string>
Add png file in the screenshot attachment to:
res/drawable-hdpi
Recompile framework-res.apk.
Decompile the new framework-res.apk and open res/values/public.xml.
We need to write down these values because we need them later. Yours will probably be different. Leave off the leading zero:
Code:
<public type="string" name="global_action_screenshot_txt" id="0x01040845" />
<public type="drawable" name="tw_ic_screenshot" id="0x01080ad8" />
Android.policy.jar changes:
Add the two smali files in the attachment to com\android\internal\policy\impl
Smali edit:
com\android\internal\policy\impl\GlobalActions.smali
New line before:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
.field private mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$SilentModeAction;
After:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
[COLOR="Red"].field private mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
.field private mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$SilentModeAction;
New Section Before:
Code:
.line 372
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
const v2, 0x10808ee
const v3, 0x1040192
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 399
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;
const v2, 0x1080ad6
const v3, 0x1040843
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
After:
***NOTE THE LINES IN BLUE, THESE MUST MATCH THE VALUES WE GOT FROM FRAMEWORK (without the leading zero)***
Code:
.line 372
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
const v2, 0x10808ee
const v3, 0x1040192
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[COLOR="Red"] .line 388
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$16;
const v2, 0x[COLOR="Blue"]1080ad8[/COLOR]
const v3, 0x[COLOR="Blue"]1040845[/COLOR]
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$16;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR]
.line 399
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;
const v2, 0x1080ad6
const v3, 0x1040843
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
Now to edit the array and add ScreenShot
NOTE: FYI, here we are removing replacing DataToggle with Airplane Mode to keep menu from overlapping the screen.
Find around line 1180:
Code:
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x3
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x4
move-object/from16 v0, p0
Replace with:
Code:
[COLOR="Red"] iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;[/COLOR]
aput-object v3, v1, v2
const/4 v2, 0x3
move-object/from16 v0, p0
[COLOR="Red"]iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
aput-object v3, v1, v2
const/4 v2, 0x4
move-object/from16 v0, p0
If porting this to another phone
Important update info for Screenshot mod:
You may have to possibly change this value in GlobalActions$16$1.smali which is one of the addon files to match your code.
Code:
invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->[COLOR="Red"]access$200[/COLOR](Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
Here is my access$200 in GlobalActions.smali, just search for the line in red. If it is different access$xxx in your smali, also change access$xxx to match in GlobalActions$16$1.smali:
Code:
.method static synthetic access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
.registers 2
.parameter "x0"
.prologue
.line 88
[COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;[/COLOR]
return-object v0
.end method
Credits to Mirko DDD for the ScreenShot method!!!
OP updated with new section.
How to remove options from Power Menu. Screenshot attached with modification.
thx buddy, i will look into asap.
Looks Nice
Re: [GUIDE][How-to] New Power Menu JB
So those the zip replace all the script changes in the op?
Not sure, changes to script+zip - or just zip to get new power menu?
Pp.:beer:
sent from a jellybean filled epic touch.
Re: [GUIDE][How-to] New Power Menu JB
PanchoPlanet said:
So those the zip replace all the script changes in the op?
Not sure, changes to script+zip - or just zip to get new power menu?
Pp.:beer:
sent from a jellybean filled epic touch.
Click to expand...
Click to collapse
The zip contains extra support files that need to be added to the classes.dex file before it gets recompiled. So yes, the last part of what you said.
And also a couple files for the framework edit are in the zip too.
Sent from my SPH-D710 using xda premium
Re: [GUIDE][How-to] New Power Menu JB
This thread got mentioned on Google+, keep up the good work!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my SPH-D710 using Xparent Skyblue Tapatalk 2
Great Job!! :good:
Gonna try this awesomenesssss..
Samsung Fanboy said:
This thread got mentioned on Google+, keep up the good work!
Click to expand...
Click to collapse
Thanks for keeping an eye out for me.
Yes, another very well written writeup by Egzthunder1.
http://www.xda-developers.com/andro...ems-to-your-jelly-bean-powered-epic-4g-touch/
Very nice, I did that on my Galaxy S3 Mini and works great.
I would love to see a Xposed module made out of this. Would be awesome!
Re: [GUIDE][How-to] New Power Menu JB
Congrats Td on the write-up and recognition. :thumbup::beer::beer::beer:
Keep up the great work and contributions to the community.
Pp.:beer::beer::beer:
sent from a jellybean filled epic touch.
Hi @tdunham
I have been trying to add recovery option using or guide.
It goes well with framework-res.apk but stuck at android. policy.jar
While editing global action.smali I can't find any thing u specified.
Have appached the file
.salil. said:
Hi @tdunham
I have been trying to add recovery option using or guide.
It goes well with framework-res.apk but stuck at android. policy.jar
While editing global action.smali I can't find any thing u specified.
Have appached the file
Click to expand...
Click to collapse
This doesn't look like it came from a touchwiz rom. What rom did you pull it from?
Re: [GUIDE][How-to] New Power Menu JB
tdunham said:
This doesn't look like it came from a touchwiz rom. What rom did you pull it from?
Click to expand...
Click to collapse
Uh its not touchwiz
Is there a way to get through
.salil. said:
Uh its not touchwiz
Is there a way to get through
Click to expand...
Click to collapse
The method is very different and I do not see too many similarities on how they created power menu in this one. I am only familiar with Touchwiz, maybe someone more familiar with the platform you are using could help using same principle but it would require a much different approach.
Re: [GUIDE][How-to] New Power Menu JB
tdunham said:
The method is very different and I do not see too many similarities on how they created power menu in this one. I am only familiar with Touchwiz, maybe someone more familiar with the platform you are using could help using same principle but it would require a much different approach.
Click to expand...
Click to collapse
Kk
Thanks anyway.
Sent from
my bullet proof revolver™ //"="" ````°.
I didn't see a post for this anywhere and didn't want to make a separate one since this is all TD's work. Here is the Power Mod for stock GB27. TD you can post this in the OP or do whatever you want with it. Your guide was excellent and I thank you for putting that together for us.
Download: GB27 Power Mod Deodexed http://tinyw.in/yMcu
MD5: 2df0540be214e3d85bac3eedea0c794d
GB27 Power Mod Odexed http://tinyw.in/9DXd
MD5: 4eddf84ad1cc6b50d36e281ae5be05bf
crawrj said:
I didn't see a post for this anywhere and didn't want to make a separate one since this is all TD's work. Here is the Power Mod for stock GB27. TD you can post this in the OP or do whatever you want with it. Your guide was excellent and I thank you for putting that together for us.
Download: GB27 Power Mod Deodexed http://tinyw.in/yMcu
MD5: 2df0540be214e3d85bac3eedea0c794d
GB27 Power Mod Odexed http://tinyw.in/9DXd
MD5: 4eddf84ad1cc6b50d36e281ae5be05bf
Click to expand...
Click to collapse
Just curious is there a screen shot of this? Wondering what options are in the power menu?
Sent from my SPH-D710 using Tapatalk 2
JonSCSL said:
Just curious is there a screen shot of this? Wondering what options are in the power menu?
Sent from my SPH-D710 using Tapatalk 2
Click to expand...
Click to collapse
It is the full power menu that is in the OP.
Okay, alot of dev's/themers been looking for this one...
If you use, please give credit, I spent many hours finding this Mod... Don't take credit for someone else's work...
This Mod will allow you to change the Samsung KeyBoard Swipe Color..(SamsungIME.apk)
Look for:
smali\com\diotek\ime\framework\view\AbstractKeyBoardView.smali
Search for -> .method private setTracePaintOptionsWithSettings()V
Click to see Org Code
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xa5
const/16 v2, 0xf3
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
Click to see what to change:
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, [B][U][COLOR="Blue"]0xff[/COLOR][/U][/B] [B][COLOR="seagreen"]Change for Alpha Value - "0xff" [/COLOR][/B]
const/4 v1, 0x1
const/4 v3, [B][U][COLOR="Blue"]0x0[/COLOR][/U][/B] [B][COLOR="seaGreen"] - Change for Red Value - "0x0"[/COLOR][/B]
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, [B][U][COLOR="Blue"]0xa5[/COLOR][/U][/B] [COLOR="seagreen"]- Change for Green Value - "0xa5"[/COLOR]
const/16 v2, [B][U][COLOR="Blue"]0xf3[/COLOR][/U][/B] [COLOR="seagreen"] - Change for Blue Value - "0xf3"[/COLOR]
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
So what it boils down to is that the Swipe Color is what we call RGB color coding. I suggest a site like this to see values you can use:
Hex to RGB Color converter
Thats it folks.. swipe color squashed!!!!
A Little clarification on Instructions.
I was swamped with questions on how to edit and such.. So with @strongsteve help we dug more and here is an easier way to get your colors instead of trying to use RGB values..
Note III - Edits
change code:
Code:
const/16 v1, 0xa5
const/16 v2, 0xf3
to
Code:
const v3, 0x33
const v1, 0x66
const v2, 0xcc
Note II - Edits
change code:
Code:
const/16 v1, 0xff
const/16 v2, 0xa5
const/16 v3, 0xf3
change to:
Code:
const/16 v1, 0xff
const v2, 0x66
const v3, 0xcc
const v4, 0x33
Then just use any normal Hex Color code you would normally use!!!
In the above example I used 3366cc which is DarkHorse Blue..
I hope that helps
Text Color in Text Editor(Second Screen Shot)
Note III
Search for
Code:
constructor <init>(Lcom/visionobjects/textwidget/e/a;Landroid/util/DisplayMetrics;)V
and then look for:
Code:
const/high16 v1, -0x100 <--- Black Text Color Previous Typed Word
const v2, -0xcc4a1b <--- Last Typed Word
Change Black Text to a Smali Color Code
Change Last Typed Word to Smali Color code (-0xcc4a1b)
For example:
3366cc converts to -0xCC9934 for smali color codes
Thx to @EMSpilot for pointing out the Black Text Line... Thank you!!!
Black Text Color
If you want to take it a step further the line just below const v2, -0xcc4a1b is
const/high16 v1, -0x100 this is the black text color that shows up when you move on to the next word.
Change it to const v1, "put your color code here" I used -0x4cf0 which is ffb310 in hex. The finished line looks like this const v1, -0x4cf0
Great Job Michael. Your work is greatly appreciated!!!
BTW for me the smali was located here.
SamsungIME\smali\com\visionobjects\textwidget\f\b\a.smali
New Power Menu with Screenshot TW 4.3 MK3/MK5
Create a Backup First
For Stock TW 4.3 SPH-L710 MK3/MK5 Builds Only!Do not flash this on a custom ROM, it replaces important framework files
Notes:
I know the extended restart menu has been around for quite a while but I really prefer the simplicity and ease of access to the standard Power Menu without that extra keypress.
Features:
- Reboot to Recovery (instant - no prompt)
- Reboot to Download Mode (instant - no prompt)
- Screenshot
Update:
Added a second New Power Menu with Airplane Mode toggle removed.
Just flash over the other one if you want to try it.
[Guide How-to] Power Menu
Download the support files located at the bottom of the post.
framework-res.apk edits:
Add the 3 icons (from the support file) to framework-res/res/drawable-xhdpi
Add 3 new lines to framework-res/res/values/strings:
Code:
<string name="download">Bootloader</string>
<string name="recovery">Recovery</string>
<string name="global_action_screenshot_txt">Screenshot</string>
</resources>
Compile then De-compile the new framework-res.apk. We will need to view the public.xml file later to get a few values for the next section.
android.policy.jar edits:
Add the 6 new smali files (from the support file) to android.policy/com/android/internal/policy/impl.
(In the same path) edit GlobalActions.smali (or diff the stock and modified GlobalActions.smali included in the support file):
Before:
Code:
.field private final mDreamManager:Landroid/service/dreams/IDreamManager;
.field private mHandler:Landroid/os/Handler;
After:
Code:
.field private final mDreamManager:Landroid/service/dreams/IDreamManager;
[COLOR="Blue"].field private mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.field private mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR].field private mHandler:Landroid/os/Handler;
Before:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
.field private final mShowSilentToggle:Z
After:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
[COLOR="Blue"].field mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.field mScreenshotConnection:Landroid/content/ServiceConnection;
.field final mScreenshotLock:Ljava/lang/Object;
.field final mScreenshotTimeout:Ljava/lang/Runnable;
[/COLOR].field private final mShowSilentToggle:Z
Before:
Code:
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;->Off:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDataNetworkState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
iput-boolean v6, p0, Lcom/android/internal/policy/impl/GlobalActions;->mIsWaitingForEcmExit:Z
iput-boolean v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDisplayConfirm:Z
const/4 v4, 0x0
After:
Code:
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;->Off:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDataNetworkState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
[COLOR="Blue"] new-instance v4, Ljava/lang/Object;
invoke-direct {v4}, Ljava/lang/Object;-><init>()V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;
const/4 v4, 0x0
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$29;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$29;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;
[/COLOR]
iput-boolean v6, p0, Lcom/android/internal/policy/impl/GlobalActions;->mIsWaitingForEcmExit:Z
iput-boolean v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDisplayConfirm:Z
const/4 v4, 0x0
New method:
Before:
Code:
.method static synthetic access$1700(Lcom/android/internal/policy/impl/GlobalActions;)Z
.locals 1
iget-boolean v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mKeyguardShowing:Z
return v0
.end method
.method static synthetic access$1800(Lcom/android/internal/policy/impl/GlobalActions;)Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mConfirmDialogReceiver:Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
return-object v0
.end method
After:
Code:
.method static synthetic access$1700(Lcom/android/internal/policy/impl/GlobalActions;)Z
.locals 1
iget-boolean v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mKeyguardShowing:Z
return v0
.end method
[COLOR="Blue"].method static synthetic access$1701(Lcom/android/internal/policy/impl/GlobalActions;)V
.locals 0
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->takeScreenshot()V
return-void
.end method
[/COLOR]
.method static synthetic access$1800(Lcom/android/internal/policy/impl/GlobalActions;)Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mConfirmDialogReceiver:Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
return-object v0
.end method
Before:
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;
const v1, 0x1080a60
const v2, 0x10401c8
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$7;
const v1, 0x1080a61
const v2, 0x10401c9
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
After:
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;
const v1, 0x1080a60
const v2, 0x10401c8
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[COLOR="Blue"] new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$Download;
const v1, 0x1081088
const v2, 0x1040a0b
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$Recovery;
const v1, 0x1081089
const v2, 0x1040a0c
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$Recovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$28;
const v1, 0x108108a
const v2, 0x1040a0d
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$28;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR]
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$7;
const v1, 0x1080a61
const v2, 0x10401c9
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
Edit above section
Before continuing, go back to the new DECOMPILED framework-res.apk and open res/values/public.xml with notepad++.
Search for <public type="drawable" name="tw_ic_download"
- All 3 of our new public drawable values for the png images will be listed together.
Search for <public type="string" name="download"
- All 3 of our new public string values will be listed together.
Now, using these we will edit the 3 new sections above for the these new public values. Instead of jumping back and forth in the public.xml, I do the drawables (V1 values) all at once and then go to the strings section and do the strings (V2 values) next.
Code:
<public type="drawable" name="tw_ic_download" id="0x01081088" />
<public type="drawable" name="tw_ic_recovery" id="0x01081089" />
<public type="drawable" name="tw_ic_screenshot" id="0x0108108a" />
Code:
<public type="string" name="download" id="0x01040a0b" />
<public type="string" name="recovery" id="0x01040a0c" />
<public type="string" name="global_action_screenshot_txt" id="0x01040a0d" />
For instance, we are editing these values:
Download:
const v1, 0x1081088 (V1 = DRAWABLE)
const v2, 0x1040a0b (V2 = STRING)
Important Note:
Please note that the leading zero is not used from the public value.
Next, search for const/16 v0, 0x8
Replace this entire section:
Before:
Code:
[COLOR="Red"] const/16 v0, 0x8
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x1
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mTalkBack:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x2
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x3
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x4
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x5
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x6
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mBugReport:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x7
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mLonglife:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
[/COLOR]
After:
Code:
[COLOR="Blue"] const/16 v0, 0x8
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x1
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x2
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mTalkBack:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x3
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x4
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x5
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x6
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x7
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
[/COLOR]
New method. Search for # virtual methods and insert this method BEFORE that line:
Code:
[COLOR="Blue"].method private takeScreenshot()V
.locals 8
iget-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;
monitor-enter v4
:try_start_0
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
if-eqz v3, :cond_0
monitor-exit v4
:goto_0
return-void
:cond_0
new-instance v0, Landroid/content/ComponentName;
const-string v3, "com.android.systemui"
const-string v5, "com.android.systemui.screenshot.TakeScreenshotService"
invoke-direct {v0, v3, v5}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
new-instance v2, Landroid/content/Intent;
invoke-direct {v2}, Landroid/content/Intent;-><init>()V
invoke-virtual {v2, v0}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$30;
invoke-direct {v1, p0}, Lcom/android/internal/policy/impl/GlobalActions$30;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
const/4 v5, 0x1
sget-object v6, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;
invoke-virtual {v3, v2, v1, v5, v6}, Landroid/content/Context;->bindServiceAsUser(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/UserHandle;)Z
move-result v3
if-eqz v3, :cond_1
iput-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mHandler:Landroid/os/Handler;
iget-object v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;
const-wide/16 v6, 0x2710
invoke-virtual {v3, v5, v6, v7}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
:cond_1
monitor-exit v4
goto :goto_0
:catchall_0
move-exception v3
monitor-exit v4
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v3
.end method
[/COLOR]
[Guide How-to] Remove a Menu Item
Search for const/16 v0, 0x8
Each menu item of this array is only 3 lines. We will remove the Airplane Mode toggle. Delete or comment out these 3 lines.
Code:
const/4 v1, 0x3
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
Since we have removed a menu item, the array constructor const/16 v0, 0x8
needs to be changed to const/16 v0, 0x7 (one less item 8-1=7 ).
Also, all the construct lines after the item you have just deleted need to be renumbered so they remain sequential. Here is the code changed after the item has been removed.
Code:
const/4 v1, 0x[COLOR="Red"]3[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x[COLOR="Red"]4[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x[COLOR="Red"]5[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x[COLOR="Red"]6[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
Credits: Huge credits to @rompnit for the use of the Screenshot method for this mod.
Do you have to be on a deodexed rom? Just flashed this twice on stock MK3 and I'm getting nothin'.
Sent from my SPH-L710 using XDA Premium 4 mobile app
marcran75 said:
Do you have to be on a deodexed rom? Just flashed this twice on stock MK3 and I'm getting nothin'.
Click to expand...
Click to collapse
Yes, 99% of any mods are going to be for deodexed. That is partly why it is extremely difficult to find an odexed custom rom.
tdunham said:
Yes, 99% of any mods are going to be for deodexed. That is partly why it is extremely difficult to find an odexed custom rom.
Click to expand...
Click to collapse
That's what I figured but thought I would ask anyways.
Sent from my SPH-L710 using XDA Premium 4 mobile app
another awesome mod !!! love it - so happy you have started making these - keep em' coming !!!!
VM SIII - jdsingle76's MK5 4.3
decimalman's TW dkp kernel
Between you and @CNexus, I will be killing someone soon with all the extra theming you have me doing. Nice job...
[email protected]'$ [email protected]@XY
marcran75 said:
Do you have to be on a deodexed rom? Just flashed this twice on stock MK3 and I'm getting nothin'.
Sent from my SPH-L710 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Move android.policy.jar and android.policy.jar.odex to your sdcard (to make a "backup" of them and delete at the same time) then flash this and it will work.
Deodexed mods can be used on odex, but not the other way around. Only catch is you gotta delete the affected odex files or else the system will preload those cache files and ignore the new file
CNexus said:
Move android.policy.jar and android.policy.jar.odex to your sdcard (to make a "backup" of them and delete at the same time) then flash this and it will work.
Deodexed mods can be used on odex, but not the other way around. Only catch is you gotta delete the affected odex files or else the system will preload those cache files and ignore the new file
Click to expand...
Click to collapse
Tried this and got stock at boot screen. Pulled battery and still the same.
marcran75 said:
Tried this and got stock at boot screen. Pulled battery and still the same.
Click to expand...
Click to collapse
Hmm...I've done this tons of times before on stock odexed and it's worked
Check the zip to see what (if any) other files are affected and move the odex files for those, then try flashing again
Is there anyway you could make a guide. ...I would love this on Wicked sensations.
http://i.imgur.com/qrByUGN.jpg
remotehugger said:
VM SIII - jdsingle76's MK5 4.3
decimalman's TW dkp kernel
Click to expand...
Click to collapse
Notice youre running virgin mobile... Thanks to tdunham, I have put together a zip to get the virgin mobile network running on the wicked sensations ROM... I have stock 4.3 android thru my ota update and with the zip it works perfect in VM.
ROM is here --> http://forum.xda-developers.com/showthread.php?t=2581010
Read the second post for the virgin mobile fix..
Just bored and saw that part of your post lol
Sent from my Virgin Mobile Galaxy S3, running Wicked Sensations Rom powered by DKP kernel, using Tapatalk 4.
bigpappags3 said:
Is there anyway you could make a guide. ...I would love this on Wicked sensations.
http://i.imgur.com/qrByUGN.jpg
Click to expand...
Click to collapse
Shut up clown. Don't give that other clown any ideas... Soon i'll have a 10 in 1 power menu and 60 toggles to theme...
[email protected]'$ [email protected]@XY
Confirm working on wicked and is nice. Nice mod
Sent from my SPH-L710 using xda app-developers app
Thanks for this tdunham. I already clicked thanks but this is just awesome. :thumbup:
Awesome mod. Thank you very much!
Update:
Added to the OP a second New Power Menu with Airplane Mode toggle removed.
Just flash over the other one if you want to try it.
I tried this and it force closes my phone settings (sure it is related to something I did to my personal framework-res.apk). So my question is if you could tell me which if any xmls need modified?
notmyepic said:
I tried this and it force closes my phone settings (sure it is related to something I did to my personal framework-res.apk). So my question is if you could tell me which if any xmls need modified?
Click to expand...
Click to collapse
I won't do full guide until later:
Code:
framework-res.apk edits:
Add the 3 icons (from the support file) to framework-res/res/drawable-xhdpi
Add 3 new lines to framework-res/res/values/strings:
<string name="download">Bootloader</string>
<string name="recovery">Recovery</string>
<string name="global_action_screenshot_txt">Screenshot</string>
</resources>
Still no guarantees if other changes were made that alter public values that get generated when framework-res is compiled.
Hey man, I changed he pngs to match the rest of Dandroid. In the 3rd option down instead of saying "download mode" it says "bootloader". Where would I go to change this?
Chad The Pathfinder said:
Hey man, I changed he pngs to match the rest of Dandroid. In the 3rd option down instead of saying "download mode" it says "bootloader". Where would I go to change this?
Click to expand...
Click to collapse
It's in the post before this one.
Edit: Sorry, meant the post above yours.
Listview Animations for Lollipop - MM files added for compare
This guide is based on the Sprint Galaxy S5 OA6 Lollipop 5.0 firmware.
framework.jar smali edits
\smali_classes2\android\widget\AbsListView$FlingRunnable$1.smali
Delete the line in RED and add the new code in BLUE
Make sure the values in the new code match surrounding code.
Code:
.method public run()V
.
.
.
:cond_2
iget-object v4, p0, Landroid/widget/AbsListView$FlingRunnable$1;->this$1:Landroid/widget/AbsListView$FlingRunnable;
[COLOR="Red"]invoke-virtual {v4}, Landroid/widget/AbsListView$FlingRunnable;->endFling()V
[/COLOR]
[COLOR="Blue"]const/4 v5, 0x0
invoke-virtual {v4, v5}, Landroid/widget/AbsListView$FlingRunnable;->endFling(Z)V
[/COLOR]
iget-object v4, p0, Landroid/widget/AbsListView$FlingRunnable$1;->this$1:Landroid/widget/AbsListView$FlingRunnable;
iget-object v4, v4, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
const/4 v5, 0x3
iput v5, v4, Landroid/widget/AbsListView;->mTouchMode:I
iget-object v4, p0, Landroid/widget/AbsListView$FlingRunnable$1;->this$1:Landroid/widget/AbsListView$FlingRunnable;
iget-object v4, v4, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
const/4 v5, 0x1
invoke-virtual {v4, v5}, Landroid/widget/AbsListView;->reportScrollStateChange(I)V
goto :goto_0
.end method
\smali_classes2\android\widget\AbsListView$FlingRunnable.smali
Rename the following method header in RED to the new name in BLUE:
Code:
[COLOR="Red"].method endFling()V
[/COLOR]
[COLOR="Blue"].method endFling(Z)V[/COLOR]
Add new method right above the newly renamed method:
Code:
.method endFling()V
.locals 1
const/4 v0, 0x1
invoke-virtual {p0, v0}, Landroid/widget/AbsListView$FlingRunnable;->endFling(Z)V
return-void
.end method
Now, make the following edits in BLUE in that newly renamed method also.
Code:
.method endFling(Z)V
.locals 2
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
const/4 v1, -0x1
iput v1, v0, Landroid/widget/AbsListView;->mTouchMode:I
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
invoke-virtual {v0, p0}, Landroid/widget/AbsListView;->removeCallbacks(Ljava/lang/Runnable;)Z
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
iget-object v1, p0, Landroid/widget/AbsListView$FlingRunnable;->mCheckFlywheel:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/widget/AbsListView;->removeCallbacks(Ljava/lang/Runnable;)Z
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/widget/AbsListView;->reportScrollStateChange(I)V
[COLOR="blue"]if-eqz p1, :cond_td[/COLOR]
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
# invokes: Landroid/widget/AbsListView;->clearScrollingCache()V
invoke-static {v0}, Landroid/widget/AbsListView;->access$3100(Landroid/widget/AbsListView;)V
[COLOR="blue"]:cond_td[/COLOR]
Same smali, make the following edits in BLUE
and delete the lines in RED. Note the access$3100 in the following code in GREEN, we may need to change that right after this edit.
Code:
.method start(I)V
.locals 9
const v6, 0x7fffffff
const/4 v1, 0x0
[COLOR="Red"]if-gez p1, :cond_1[/COLOR]
[COLOR="blue"]invoke-static {p1}, Ljava/lang/Math;->abs(I)I
move-result v0
iget-object v3, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
invoke-static {v3}, Landroid/widget/AbsListView;->access$1234(Landroid/widget/AbsListView;)I
move-result v3
if-le v0, v3, :cond_td
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
invoke-static {v0}, Landroid/widget/AbsListView;->[COLOR="Green"]access$3100[/COLOR](Landroid/widget/AbsListView;)V
:cond_td
if-gez p1, :cond_td1[/COLOR]
.
.
.
:cond_0
return-void
[COLOR="Red"]:cond_1
[/COLOR] [COLOR="Blue"]:cond_td1
[/COLOR] move v2, v1
goto :goto_0
.end method
Now lets go confirm that the access$3100 that is called from this smali is the correct one.
Look in and confirm that the following method matches, if it doesn't change the access$3100 in the previous edit so that it does.
\smali_classes2\android\widget\AbsListView.smali
Code:
.method static synthetic access$3100(Landroid/widget/AbsListView;)V
.locals 0
invoke-direct {p0}, Landroid/widget/AbsListView;->clearScrollingCache()V
return-void
.end method
If it matches, perfect. We will continue working in this smali to add changes:
\smali_classes2\android\widget\AbsListView.smali
Add new code in BLUE to #instance fields.
Code:
# instance fields
[COLOR="blue"].field private mDecacheThreshold:I
.field mHeight:I
.field mIsGridView:Z
.field mIsScrolling:Z
.field mIsWidget:Z
.field mWidth:I
.field mvPosition:I
[/COLOR]
.field protected AIR_VIEW_WINSET:Z
.field private HOVERSCROLL_DELAY:I
.field private HOVERSCROLL_SPEED:F
Same smali, add new code in BLUE making sure values match surrounding code.
Code:
.method public constructor <init>(Landroid/content/Context;)V
.
.
.
iput v5, p0, Landroid/widget/AbsListView;->mActivePointerId:I
iput v4, p0, Landroid/widget/AbsListView;->mPointerCount:I
iput-boolean v4, p0, Landroid/widget/AbsListView;->mHapticOverScroll:Z
iput v4, p0, Landroid/widget/AbsListView;->mDirection:I
[COLOR="blue"]iput v4, p0, Landroid/widget/AbsListView;->mHeight:I
iput-boolean v4, p0, Landroid/widget/AbsListView;->mIsGridView:Z
[/COLOR]
iput v4, p0, Landroid/widget/AbsListView;->mHoverTopAreaHeight:I
iput v4, p0, Landroid/widget/AbsListView;->mHoverBottomAreaHeight:I
iput-wide v8, p0, Landroid/widget/AbsListView;->mHoverRecognitionDurationTime:J
Add new method in BLUE
Code:
.method static synthetic access$000(Landroid/widget/AbsListView;Z)V
.locals 0
invoke-direct {p0, p1}, Landroid/widget/AbsListView;->setFastScrollerEnabledUiThread(Z)V
return-void
.end method
[COLOR="Blue"].method static synthetic access$1234(Landroid/widget/AbsListView;)I
.registers 1
iget v0, p0, Landroid/widget/AbsListView;->mDecacheThreshold:I
return v0
.end method[/COLOR]
Same smali, add new code in BLUE making sure new values match surrounding code
Code:
.method private initAbsListView()V
.
.
.
iput v6, p0, Landroid/widget/AbsListView;->mTouchSlop:I
invoke-virtual {v1}, Landroid/view/ViewConfiguration;->getScaledMinimumFlingVelocity()I
move-result v6
iput v6, p0, Landroid/widget/AbsListView;->mMinimumVelocity:I
invoke-virtual {v1}, Landroid/view/ViewConfiguration;->getScaledMaximumFlingVelocity()I
move-result v6
iput v6, p0, Landroid/widget/AbsListView;->mMaximumVelocity:I
[COLOR="blue"] iget v6, p0, Landroid/widget/AbsListView;->mMaximumVelocity:I
div-int/lit8 v6, v6, 0x2
iput v6, p0, Landroid/widget/AbsListView;->mDecacheThreshold:I[/COLOR]
invoke-virtual {v1}, Landroid/view/ViewConfiguration;->getScaledOverscrollDistance()I
move-result v6
iput v6, p0, Landroid/widget/AbsListView;->mOverscrollDistance:I
invoke-virtual {v1}, Landroid/view/ViewConfiguration;->getScaledOverflingDistance()I
move-result v6
iput v6, p0, Landroid/widget/AbsListView;->mOverflingDistance:I
.
.
.
:cond_6
[COLOR="blue"]const/4 v1, 0x3
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setPersistentDrawingCache(I)V
[/COLOR]
return-void
:catch_0
move-exception v4
goto :goto_0
:catch_1
move-exception v4
goto :goto_0
.end method
Add new code in BLUE making sure values match surrounding code.
Code:
.method private scrollIfNeeded(IILandroid/view/MotionEvent;)V
.
.
.
iget v3, v0, Landroid/widget/AbsListView;->mLastY:I
sub-int v3, p2, v3
add-int v21, v3, v34
:goto_1
const/16 v22, 0x0
move-object/from16 v0, p0
iget v3, v0, Landroid/widget/AbsListView;->mTouchMode:I
const/4 v4, 0x3
if-ne v3, v4, :cond_13
[COLOR="blue"]const/4 v3, 0x0
move-object/from16 v0, p0
iput-boolean v3, v0, Landroid/widget/AbsListView;->mIsWidget:Z
[/COLOR] move-object/from16 v0, p0
iget-object v3, v0, Landroid/widget/AbsListView;->mScrollStrictSpan:Landroid/os/StrictMode$Span;
if-nez v3, :cond_2
const-string v3, "AbsListView-scroll"
invoke-static {v3}, Landroid/os/StrictMode;->enterCriticalSpan(Ljava/lang/String;)Landroid/os/StrictMode$Span;
Add new line in BLUE making sure value matches surrounding code.
Code:
.method protected handleDataChanged()V
.locals 15
const/4 v14, 0x5
const/4 v13, -0x1
const/4 v8, 0x3
const/4 v9, 0x1
const/4 v12, 0x0
[COLOR="blue"]iput-boolean v9, p0, Landroid/widget/AbsListView;->mIsWidget:Z
[/COLOR]
iget v1, p0, Landroid/widget/AbsListView;->mItemCount:I
Add new code in BLUE making sure value matches surrounding code.
Code:
.method obtainView(I[Z)Landroid/view/View;
.
.
.
:cond_4
iget-object v7, p0, Landroid/widget/AbsListView;->mRecycler:Landroid/widget/AbsListView$RecycleBin;
invoke-virtual {v7, p1}, Landroid/widget/AbsListView$RecycleBin;->getScrapView(I)Landroid/view/View;
move-result-object v3
iget-object v7, p0, Landroid/widget/AbsListView;->mAdapter:Landroid/widget/ListAdapter;
invoke-interface {v7, p1, v3, p0}, Landroid/widget/ListAdapter;->getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
move-result-object v0
[COLOR="blue"]iget-boolean v7, p0, Landroid/widget/AbsListView;->mIsScrolling:Z
if-eqz v7, :cond_td
iget-boolean v7, p0, Landroid/widget/AbsListView;->mIsWidget:Z
if-nez v7, :cond_td
invoke-virtual {p0, v0}, Landroid/widget/AbsListView;->setAnimation(Landroid/view/View;)Landroid/view/View;
move-result-object v0
:cond_td
[/COLOR]
if-eqz v3, :cond_6
if-eq v0, v3, :cond_7
invoke-virtual {v3}, Landroid/view/View;->isAccessibilityFocused()Z
move-result v7
if-eqz v7, :cond_5
invoke-virtual {v3}, Landroid/view/View;->clearAccessibilityFocus()V
invoke-virtual {v0}, Landroid/view/View;->requestAccessibilityFocus()Z
Add new code in BLUE making sure value matches surrounding code.
Code:
.method protected onLayout(ZIIII)V
.
.
.
:cond_1
invoke-virtual {p0}, Landroid/widget/AbsListView;->layoutChildren()V
const/4 v2, 0x0
iput-boolean v2, p0, Landroid/widget/AbsListView;->mInLayout:Z
sub-int v2, p5, p3
div-int/lit8 v2, v2, 0x3
iput v2, p0, Landroid/widget/AbsListView;->mOverscrollMax:I
[COLOR="Blue"]invoke-virtual {p0}, Landroid/widget/AbsListView;->getHeight()I
move-result v2
iput v2, p0, Landroid/widget/AbsListView;->mHeight:I
invoke-virtual {p0}, Landroid/widget/AbsListView;->getWidth()I
move-result v2
iput v2, p0, Landroid/widget/AbsListView;->mWidth:I
[/COLOR]
iget-object v2, p0, Landroid/widget/AbsListView;->mFastScroll:Landroid/widget/FastScroller;
if-eqz v2, :cond_2
iget-object v2, p0, Landroid/widget/AbsListView;->mFastScroll:Landroid/widget/FastScroller;
invoke-virtual {p0}, Landroid/widget/AbsListView;->getChildCount()I
Add new code in BLUE making sure value matches surrounding code.
Code:
.method reportScrollStateChange(I)V
.
.
.
:goto_3
iput v5, p0, Landroid/widget/AbsListView;->mDVFSCookie:I
:cond_6
invoke-static {v5}, Landroid/os/DVFSHelper;->onScrollEvent(Z)V
iput-boolean v5, p0, Landroid/widget/AbsListView;->mDVFSLockAcquired:Z
:cond_7
iput p1, p0, Landroid/widget/AbsListView;->mLastScrollState:I
[COLOR="blue"]if-eqz p1, :cond_td
const/4 v0, 0x1
:goto_td
iput-boolean v0, p0, Landroid/widget/AbsListView;->mIsScrolling:Z
[/COLOR]
iget-object v0, p0, Landroid/widget/AbsListView;->mOnScrollListener:Landroid/widget/AbsListView$OnScrollListener;
if-eqz v0, :cond_8
iget-boolean v0, p0, Landroid/widget/AbsListView;->mHoverAreaEnter:Z
if-nez v0, :cond_8
iget v0, p0, Landroid/widget/AbsListView;->mQCstate:I
if-eq v0, v7, :cond_8
iget-object v0, p0, Landroid/widget/AbsListView;->mOnScrollListener:Landroid/widget/AbsListView$OnScrollListener;
invoke-interface {v0, p0, p1}, Landroid/widget/AbsListView$OnScrollListener;->onScrollStateChanged(Landroid/widget/AbsListView;I)V
:cond_8
return-void
[COLOR="blue"]:cond_td
const/4 v0, 0x0
goto :goto_td
[/COLOR]
:catch_0
move-exception v0
Add new method above .method public setAirScrollEnable(Z)V (or at the bottom if this method does not exist)
Code:
.method setAnimation(Landroid/view/View;)Landroid/view/View;
.locals 14
const/4 v5, 0x1
const/high16 v2, 0x3f800000
const/high16 v1, 0x3f000000
const/4 v4, 0x0
iget-object v3, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v6, "listview_animation"
invoke-static {v3, v6, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v10
const/4 v13, 0x0
const/4 v11, 0x0
:try_start_0
invoke-virtual {p0}, Landroid/widget/AbsListView;->computeVerticalScrollOffset()I
:try_end_0
.catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_0
move-result v13
:goto_0
if-nez v10, :cond_1
:cond_0
:goto_1
return-object p1
:catch_0
move-exception v9
iget v13, p0, Landroid/widget/AbsListView;->mvPosition:I
goto :goto_0
:cond_1
iget v3, p0, Landroid/widget/AbsListView;->mvPosition:I
if-ge v3, v13, :cond_2
const/4 v11, 0x1
:cond_2
iput v13, p0, Landroid/widget/AbsListView;->mvPosition:I
const/4 v0, 0x0
packed-switch v10, :pswitch_data_0
:goto_2
const-wide/16 v1, 0x1f4
invoke-virtual {v0, v1, v2}, Landroid/view/animation/Animation;->setDuration(J)V
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "listview_interpolator"
const/4 v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
packed-switch v12, :pswitch_data_1
:goto_3
if-eqz p1, :cond_0
invoke-virtual {p1, v0}, Landroid/view/View;->startAnimation(Landroid/view/animation/Animation;)V
goto :goto_1
:pswitch_0
new-instance v0, Landroid/view/animation/ScaleAnimation;
invoke-direct {v0, v1, v2, v1, v2}, Landroid/view/animation/ScaleAnimation;-><init>(FFFF)V
goto :goto_2
:pswitch_1
new-instance v0, Landroid/view/animation/ScaleAnimation;
move v3, v1
move v4, v2
move v6, v2
move v7, v5
move v8, v2
invoke-direct/range {v0 .. v8}, Landroid/view/animation/ScaleAnimation;-><init>(FFFFIFIF)V
goto :goto_2
:pswitch_2
new-instance v0, Landroid/view/animation/ScaleAnimation;
move v3, v1
move v4, v2
move v6, v1
move v7, v5
move v8, v1
invoke-direct/range {v0 .. v8}, Landroid/view/animation/ScaleAnimation;-><init>(FFFFIFIF)V
goto :goto_2
:pswitch_3
new-instance v0, Landroid/view/animation/AlphaAnimation;
invoke-direct {v0, v4, v2}, Landroid/view/animation/AlphaAnimation;-><init>(FF)V
goto :goto_2
:pswitch_4
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
neg-int v1, v1
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:pswitch_5
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:pswitch_6
if-eqz v11, :cond_3
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
neg-int v1, v1
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:cond_3
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:pswitch_7
if-eqz v11, :cond_4
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:cond_4
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
neg-int v1, v1
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:pswitch_8
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mWidth:I
neg-int v1, v1
int-to-float v1, v1
invoke-direct {v0, v1, v4, v4, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto/16 :goto_2
:pswitch_9
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mWidth:I
int-to-float v1, v1
invoke-direct {v0, v1, v4, v4, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto/16 :goto_2
:pswitch_a
new-instance v0, Landroid/view/animation/RotateAnimation;
const/high16 v3, 0x43340000
move-object v2, v0
move v6, v1
move v7, v5
move v8, v1
invoke-direct/range {v2 .. v8}, Landroid/view/animation/RotateAnimation;-><init>(FFIFIF)V
goto/16 :goto_2
:pswitch_b
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0005
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_c
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0006
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_d
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0004
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_e
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0007
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_f
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0008
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_10
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0009
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_11
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a000a
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
:pswitch_5
:pswitch_6
:pswitch_7
:pswitch_8
:pswitch_9
:pswitch_a
.end packed-switch
:pswitch_data_1
.packed-switch 0x1
:pswitch_b
:pswitch_c
:pswitch_d
:pswitch_e
:pswitch_f
:pswitch_10
:pswitch_11
.end packed-switch
.end method
Add new method in BLUE
Code:
.method public setFriction(F)V
.locals 1
iget-object v0, p0, Landroid/widget/AbsListView;->mFlingRunnable:Landroid/widget/AbsListView$FlingRunnable;
if-nez v0, :cond_0
new-instance v0, Landroid/widget/AbsListView$FlingRunnable;
invoke-direct {v0, p0}, Landroid/widget/AbsListView$FlingRunnable;-><init>(Landroid/widget/AbsListView;)V
iput-object v0, p0, Landroid/widget/AbsListView;->mFlingRunnable:Landroid/widget/AbsListView$FlingRunnable;
:cond_0
iget-object v0, p0, Landroid/widget/AbsListView;->mFlingRunnable:Landroid/widget/AbsListView$FlingRunnable;
# getter for: Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;
invoke-static {v0}, Landroid/widget/AbsListView$FlingRunnable;->access$2100(Landroid/widget/AbsListView$FlingRunnable;)Landroid/widget/OverScroller;
move-result-object v0
invoke-virtual {v0, p1}, Landroid/widget/OverScroller;->setFriction(F)V
return-void
.end method
[COLOR="blue"].method public setGridView(Z)V
.locals 0
iput-boolean p1, p0, Landroid/widget/AbsListView;->mIsGridView:Z
return-void
.end method[/COLOR]
Framework files have been added to the bottom of this post for diffing.
If you have a Galaxy S5, you might be able to get away with just replacing the modified framework files for this modification, however there are no guarantees it wont cause other issues with your build.
Continue to Post #2 to add the menu items for the toggles
Addendum:
Listview disabled by default.
Some users were complaining about listview being active on a fresh flash to this how to disable it as default until they go in and make a choice.
Replace the line in RED with the code in BLUE
\smali_classes2\android\widget\AbsListView.smali
Code:
.method setAnimation(Landroid/view/View;)Landroid/view/View;
.locals 14
const/4 v5, 0x1
const/high16 v2, 0x3f800000
const/high16 v1, 0x3f000000
const/4 v4, 0x0
iget-object v3, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v6, "listview_animation"
[COLOR="Red"]invoke-static {v3, v6, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
[/COLOR] [COLOR="Blue"] invoke-static {v3, v6, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
[/COLOR]
Full credits to @Adi Aisiteru Reborn for the original thread HERE
also credit to @lacoursiere18 for the updated KitKat guide HERE
Adding Toggles/Menu Item for Listview
To add Listview Animations menu item to SecSettings, refer to the guide by @lacoursiere18 here:
[GUIDE][SMALI][4.4.2] How to port Mokee ListView Animation for TouchWiz 4.4.2
Note:
For lollipop, I believe the xml edit in res/xml the file to edit is going to be display_settings_2014.xml
_________________________________________________
To add Listview Animations menu item to CustomSettings.apk:
\res\values\arrays.xml
Add new items in BLUE
Code:
[COLOR="blue"]<string-array name="listview_animation_entries">
<item>@string/listview_off</item>
<item>@string/listview_wave_left</item>
<item>@string/listview_wave_right</item>
<item>@string/listview_scale</item>
<item>@string/listview_alpha</item>
<item>@string/listview_stack_top</item>
<item>@string/listview_stack_bottom</item>
<item>@string/listview_unfold</item>
<item>@string/listview_fold</item>
<item>@string/listview_translate_left</item>
<item>@string/listview_translate_right</item>
<item>@string/listview_rotate</item>
</string-array>
<string-array name="listview_animation_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
</string-array>
<string-array name="listview_interpolator_entries">
<item>@string/listview_off</item>
<item>@string/listview_accelerate_interpolator</item>
<item>@string/listview_decelerate_interpolator</item>
<item>@string/listview_accelerate_decelerate_interpolator</item>
<item>@string/listview_anticipate_interpolator</item>
<item>@string/listview_overshoot_interpolator</item>
<item>@string/listview_anticipate_overshoot_interpolator</item>
<item>@string/listview_bounce_interpolator</item>
</string-array>
<string-array name="listview_interpolator_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
</string-array>
[/COLOR]</resources>
\res\values\strings.xml
Add new items in BLUE
Code:
[COLOR="blue"]<string name="listview_off">Off</string>
<string name="listview_wave_left">Wave (left)</string>
<string name="listview_wave_right">Wave (right)</string>
<string name="listview_alpha">Alpha</string>
<string name="listview_scale">Scale</string>
<string name="listview_stack_top">Stack (top)</string>
<string name="listview_stack_bottom">Stack (bottom)</string>
<string name="listview_unfold">Unfold</string>
<string name="listview_fold">Fold</string>
<string name="listview_translate_left">Translate (left)</string>
<string name="listview_translate_right">Translate (right)</string>
<string name="listview_rotate">Rotate</string>
<string name="listview_accelerate_interpolator">Accelerate</string>
<string name="listview_decelerate_interpolator">Decelerate</string>
<string name="listview_accelerate_decelerate_interpolator">Accelerate decelerate</string>
<string name="listview_anticipate_interpolator">Anticipate</string>
<string name="listview_overshoot_interpolator">Overshoot</string>
<string name="listview_anticipate_overshoot_interpolator">Anticipate overshoot</string>
<string name="listview_bounce_interpolator">Bounce</string>
[/COLOR]</resources>
\res\xml\preferences.xml
Code:
<PreferenceScreen android:title="Mokee Listview Animations">
<ListPreference android:persistent="false" android:entries="@array/listview_animation_entries" android:title="Listview animation" android:key="listview_animation" android:summary="%s" android:dependency="listview_animation" android:entryValues="@array/listview_animation_values" />
<ListPreference android:persistent="false" android:entries="@array/listview_interpolator_entries" android:title="Listview interpolator" android:key="listview_interpolator" android:summary="%s" android:dependency="listview_interpolator" android:entryValues="@array/listview_interpolator_values" />
</PreferenceScreen>
Rom Control V2 Entries:
Code:
<string-array name="listview_animation_entries">
<item>Off</item>
<item>Wave Left</item>
<item>Wave Right</item>
<item>Scale</item>
<item>Alpha</item>
<item>Stack Top</item>
<item>Stack Bottom</item>
<item>Unfold</item>
<item>Fold</item>
<item>Translate Left</item>
<item>Translate Right</item>
<item>Rotate</item>
</string-array>
<string-array name="listview_animation_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
</string-array>
<string-array name="listview_interpolator_entries">
<item>Off</item>
<item>Accelerate</item>
<item>Decelerate</item>
<item>Accelerate decelerate</item>
<item>Anticipate</item>
<item>Overshoot</item>
<item>Anticipate overshoot</item>
<item>Bounce</item>
</string-array>
<string-array name="listview_interpolator_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
</string-array>
<PreferenceCategory
android:title="Mokee Listview Animations">
<com.wubydax.romcontrol.v2.prefs.MyListPreference
android:entries="@array/listview_animation_entries"
android:title="Listview animation"
android:key="listview_animation"
android:defaultValue="0"
android:dependency="listview_animation"
android:entryValues="@array/listview_animation_values" />
<com.wubydax.romcontrol.v2.prefs.MyListPreference
android:entries="@array/listview_interpolator_entries"
android:title="Listview interpolator"
android:key="listview_interpolator"
android:defaultValue="0"
android:dependency="listview_interpolator"
android:entryValues="@array/listview_interpolator_values" />
</PreferenceCategory>
Thanks for another great mod and guide. Works great. I wasn't sure what the animations looked like but figured I would try it out. Pretty cool options.
metalfan78 said:
Thanks for another great mod and guide. Works great. I wasn't sure what the animations looked like but figured I would try it out. Pretty cool options.
Click to expand...
Click to collapse
Yes it is pretty cool.
I'm still waiting for some feedback from some of the users that have a different phone to give the framework edits a try.
Its a big task but its worth it.
Yea, it took awhile, pretty neat
metalfan78 said:
Yea, it took awhile, pretty neat
Click to expand...
Click to collapse
Don't you still have the S5?
You could have just replaced the smali files with the ones I posted and been done with it except for adding the menu items.
Good practice though.
Yea, still s5. I did the edits just because I like to, then I diffed.
tdunham said:
Listview Animations for Lollipop
Click to expand...
Click to collapse
It's pretty cool guide.
This is my video from SGS4 i9500: https://youtube.com/watch?feature=youtu.be&v=Jx9_IKhtRKU
Surghikov said:
It's pretty cool guide.
This is my video from SGS4 i9500: https://youtube.com/watch?feature=youtu.be&v=Jx9_IKhtRKU
Click to expand...
Click to collapse
@Surghikov
Very nice. I am curious if you did the full framework modification or just used the files I provided.
I followed your instructions for modifications Framework & SecSettings, were minor discrepancies, but as you can see, it works on my sgs4 i9500.
Thank you and good luck!
@tdunham I am trying this mod on Note 3. it is stuck on boot logo, I attached my stock and modified smalis as well as log, If you could have time looking at my smalis and log and see what's the culprit I would be very thankful. :angel:
kmokhtar79 said:
@tdunham I am trying this mod on Note 3. it is stuck on boot logo, I attached my stock and modified smalis as well as log, If you could have time looking at my smalis and log and see what's the culprit I would be very thankful. :angel:
Click to expand...
Click to collapse
The smali you sent looks fine.
The log wasn't a lot of help so I look at the edit I did for AbsListView$FlingRunnable.smali and see new code for access$3100 where I ask you to check if yours matches the one I posted. I see your AbsListView;->access$3100 is for scrollingcache also. You didn't change that did you?
And just for reference, try plugging in my smali files to see what happens.
Also, send me the other 2 smalis that you edited.
tdunham said:
And just for reference, try plugging in my smali files to see what happens.
Also, send me the other 2 smalis that you edited.
Click to expand...
Click to collapse
OK, let me check.
This is my method which shows the same access
Code:
.method static synthetic access$3100(Landroid/widget/AbsListView;)V
.locals 0
.param p0, "x0" # Landroid/widget/AbsListView;
.prologue
.line 132
invoke-direct {p0}, Landroid/widget/AbsListView;->clearScrollingCache()V
return-void
.end method
I believe those samlis are identical but let's narrow it down the failure.
kmokhtar79 said:
OK, let me check.
This is my method which shows the same access
Code:
.method static synthetic access$3100(Landroid/widget/AbsListView;)V
.locals 0
.param p0, "x0" # Landroid/widget/AbsListView;
.prologue
.line 132
invoke-direct {p0}, Landroid/widget/AbsListView;->clearScrollingCache()V
return-void
.end method
I believe those samlis are identical but let's narrow it down the failure.
Click to expand...
Click to collapse
Right away I see you did not do the edits to AbsListView$FlingRunnable$1.smali or to AbsListView$FlingRunnable.smali because the new method .method endFling(Z)V is missing I think. Read the first part a little more closely, maybe my wording is difficult to understand.
tdunham said:
Right away I see you did not do the edits to AbsListView$FlingRunnable$1.smali or to AbsListView$FlingRunnable.smali because the new method .method endFling(Z)V is missing I think. Read the first part a little more closely, maybe my wording is difficult to understand.
Click to expand...
Click to collapse
Yes I did, I thought you remembering me in mixing up stuff. I uploaded the stock ones. Here I attached the modded smalis. BTW, is this mod going to control or use those animation resources in framework. Because I compiled it successfully and booted fine but there is no animation changes, all I have is stock animation.
kmokhtar79 said:
Yes I did, I thought you remembering me in mixing up stuff. I uploaded the stock ones. Here I attached the modded smalis. BTW, is this mod going to control or use those animation resources in framework. Because I compiled it successfully and booted fine but there is no animation changes, all I have is stock animation.
Click to expand...
Click to collapse
Yes, I got the new set and it looks good too.
Animations only take effect wherever you are scrolling through a list.
Did you add the toggles? Not sure, maybe check for the keys with a sql editor to see if they change on toggle.
tdunham said:
Yes, I got the new set and it looks good too.
Animations only take effect wherever you are scrolling through a list.
Did you add the toggles? Not sure, maybe check for the keys with a sql editor to see if they change on toggle.
Click to expand...
Click to collapse
Yes mate I am aware of that and confirming toggle works but no effect I guess there is something different on Note 3 smalis or resources, anyway thanks for help I think I should move on.
kmokhtar79 said:
Yes mate I am aware of that and confirming toggle works but no effect I guess there is something different on Note 3 smalis or resources, anyway thanks for help I think I should move on.
Click to expand...
Click to collapse
Not sure. I think @lacoursiere18 has a note 4 but not sure if he's tried this yet for his build. Maybe he can share his smali.
Have you tried mine yet? Straight up replacing yours.
tdunham said:
Not sure. I think @lacoursiere18 has a note 4 but not sure if he's tried this yet for his build. Maybe he can share his smali.
Have you tried mine yet? Straight up replacing yours.
Click to expand...
Click to collapse
You mean without comparing? Let me try if it works that way.