[MOD][HowTo] Samsung KeyBoard Swipe Color Change Found! - Sprint Samsung Galaxy Note II

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

Related

[MOD] [UPDATED]Top battery line indicator with pngs

Hi there, I want to share this tutorial for implementing Top line battery indicator mod.
I have re-made and tweaked (for XWLA4) one of my favourite theme (Dark Theme by Mr. Megi), just to show you how it looks like!
You will find this mod with this theme on the attached zip cwm file - only for deodexed xwla4.
{
"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"
}
Watch it on youtube fullscreen mode
I started by studying the java source code for handling battery info!
source code -> here
Then i looked into a couple of classes inside SystemUI.apk just to see where i could put my hands..
To better understand the smali code of the classes i modified, i used the java source code here, it is a bit different by the Galaxy S2 implementation but a good start point!
Requirement:
1. Decompiled SystemUI.apk with Apk Manager.
2. Some advanced understanding about editing xml file and smali code.
3. Backup SystemUI.apk first!
Before to start, i'd like to point out that i used XWLA4 firmware as base, but it should work for any firmware with some changes.
Files to be edited in SystemUI.apk:
1. res/layout/status_bar.xml
2. res/values/ids.xml
3. smali/com/android/systemui/statusbar/StatusBarService.smali
4. smali/com/android/systemui/statusbar/StatusBarView.smali
1. Editing SystemUI.apk
1.1 Editing res/layout/status_bar.xml
We need to insert a ViewImage item on the xml for displaying our battery line indicator, normal/charging
Add the following line just above <LinearLayout androidrientation="horizontal" android:id="@id/icons" android:layout_width="fill_parent" android:layout_height="fill_parent">
Code:
<ImageView android:id="@id/battery_indicator_charging" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/battery_indicator_charging" />
2 Edit res/values/ids.xml
We need to add IDs for the item we have added on the status_bar.xml
Add this line at the TOP of the file, this should be the first line!
Code:
<item type="id" name="battery_indicator_charging">false</item>
2.1 Add images to res/drawable-hdpi
We need to add the following 3 images, you will find them attached on my source code!
z_battery_indicator_charging.png
z_battery_indicator.9.png
z_battery_indicator_low.9.png
2.2 Recompile SystemUI.apk
We need to recompile the apk because we need to take care about the ID ref assigned to battery_indicator_charging, and the drawable IDs for images we have added on the previus step.
Now decompile again SystemUI.apk and open res/values/public.xml:
You should see these new entries:
Code:
<public type="drawable" name="z_battery_indicator" id="0x7f0200b8" />
<public type="drawable" name="z_battery_indicator_charging" id="0x7f0200b9" />
<public type="drawable" name="z_battery_indicator_low" id="0x7f0200ba" />
...
<public type="id" name="battery_indicator_charging" id="0x7f0a0034" />
Take note of these 3 IDS: 0x7f0200b8, 0x7f0200ba, 0x7f0a0034
Please note that in your system they can have different values.
3 Editing StatusBarService.smali
We need to intercept addIcon function and when the battery icon is passed as parameter we need to call our function updateBatteryIndicator.
Find this method:
Code:
.method public addIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;)V
Add replace it with the code below
Code:
.method public addIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;)V
.locals 6
.parameter "slot"
.parameter "index"
.parameter "viewIndex"
.parameter "icon"
.prologue
const-string v5, "battery"
.line 466
new-instance v0, Lcom/android/systemui/statusbar/StatusBarIconView;
invoke-direct {v0, p0, p1}, Lcom/android/systemui/statusbar/StatusBarIconView;-><init>(Landroid/content/Context;Ljava/lang/String;)V
.line 467
.local v0, view:Lcom/android/systemui/statusbar/StatusBarIconView;
invoke-virtual {v0, p4}, Lcom/android/systemui/statusbar/StatusBarIconView;->set(Lcom/android/internal/statusbar/StatusBarIcon;)Z
.line 468
iget-object v1, p0, Lcom/android/systemui/statusbar/StatusBarService;->mStatusIcons:Landroid/widget/LinearLayout;
new-instance v2, Landroid/widget/LinearLayout$LayoutParams;
iget v3, p0, Lcom/android/systemui/statusbar/StatusBarService;->mIconSize:I
iget v4, p0, Lcom/android/systemui/statusbar/StatusBarService;->mIconSize:I
invoke-direct {v2, v3, v4}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V
invoke-virtual {v1, v0, p3, v2}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V
invoke-virtual {v5, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
.line 410
invoke-direct {p0, p4}, Lcom/android/systemui/statusbar/StatusBarService;->updateBatteryIndicator(Lcom/android/internal/statusbar/StatusBarIcon;)V
.line 469
:cond_0
return-void
.end method
Now we need to do the same for "updateIcon" method. Find this method:
Code:
.method public updateIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;Lcom/android/internal/statusbar/StatusBarIcon;)V
Replace it with the code below:
Code:
.method public updateIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;Lcom/android/internal/statusbar/StatusBarIcon;)V
.locals 2
.parameter "slot"
.parameter "index"
.parameter "viewIndex"
.parameter "old"
.parameter "icon"
.prologue
.line 477
iget-object v1, p0, Lcom/android/systemui/statusbar/StatusBarService;->mStatusIcons:Landroid/widget/LinearLayout;
invoke-virtual {v1, p3}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/android/systemui/statusbar/StatusBarIconView;
.line 478
.local v0, view:Lcom/android/systemui/statusbar/StatusBarIconView;
invoke-virtual {v0, p5}, Lcom/android/systemui/statusbar/StatusBarIconView;->set(Lcom/android/internal/statusbar/StatusBarIcon;)Z
const-string v1, "battery"
invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
.line 424
invoke-direct {p0, p5}, Lcom/android/systemui/statusbar/StatusBarService;->updateBatteryIndicator(Lcom/android/internal/statusbar/StatusBarIcon;)V
.line 479
:cond_0
return-void
.end method
It's time to add our method to handle the Update our Battery Indicator!
Code:
.method private updateBatteryIndicator(Lcom/android/internal/statusbar/StatusBarIcon;)V
.locals 2
.parameter "icon"
.prologue
.line 462
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarService;->mStatusBarView:Lcom/android/systemui/statusbar/StatusBarView;
iget-object v0, v0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicator:Landroid/widget/ImageView;
iget v1, p1, Lcom/android/internal/statusbar/StatusBarIcon;->iconLevel:I
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setTag(Ljava/lang/Object;)V
.line 463
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarService;->mStatusBarView:Lcom/android/systemui/statusbar/StatusBarView;
iget-object v0, v0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorCharging:Landroid/widget/ImageView;
iget v1, p1, Lcom/android/internal/statusbar/StatusBarIcon;->iconId:I
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setTag(Ljava/lang/Object;)V
.line 464
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarService;->mStatusBarView:Lcom/android/systemui/statusbar/StatusBarView;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/StatusBarView;->requestLayout()V
.line 465
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarService;->mStatusBarView:Lcom/android/systemui/statusbar/StatusBarView;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/StatusBarView;->invalidate()V
.line 466
return-void
.end method
Add this code where you prefer!
Note:
We use setTag function to store an useful info: "batteryLevel" inside the two views we created.
4 Editing StatusBarView.smali
Well on this class we need to change a lot of stuff, i advice to see my attached source code and diff it.
To sum up, this is the class responsible to display the status bar view.
We need to instantiate a "BroadcastReceiver" to intercept this intent: "android.intent.action.SCREEN_ON" That's because we don't want to play the charging animation while the screen is off.
I will report, just to let you understand it better, the java pseudo code where the view is created, here we need to do some calculation to get the correct values (width) for our Barline indicator images. In addition we are creating the animation for battery charging state.
Pseudo Java source code:
Code:
protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
super.onLayout(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4);
if ((!this.mShowBatteryIndicator))
{
this.mBatteryIndicator.setVisibility(8);
this.mBatteryIndicatorCharging.setVisibility(8);
this.mBatteryIndicatorCharging.clearAnimation();
}
else
{
this.mBatteryIndicator.setVisibility(0);
this.mBatteryIndicatorCharging.setVisibility(0);
int j = ((Integer)this.mBatteryIndicator.getTag()).intValue();
this.mBatteryIndicatorWidth = (j * (paramInt3 - paramInt1) / 100);
this.mBatteryIndicatorCharging.layout(paramInt3, paramInt2, paramInt3 + this.mBatteryIndicatorCharging.getMeasuredWidth(), paramInt2 + this.mBatteryIndicatorCharging.getMeasuredHeight());
int i = BATTERY_INDICATOR_ID;
if ((!this.mScreenIsOn) || (chargeIconID != ((Integer)this.mBatteryIndicatorCharging.getTag()).intValue()))
{
this.mBatteryIndicatorCharging.clearAnimation();
if (j < this.mBatteryLowLevel)
i = LOW_BATTERY_INDICATOR_ID;
}
else
{
TranslateAnimation localTranslateAnimation = new TranslateAnimation(0.0F, this.mBatteryIndicatorWidth - (paramInt3 - paramInt1), 0.0F, 0.0F);
localTranslateAnimation.setDuration(1500L);
localTranslateAnimation.setStartOffset(3500L);
localTranslateAnimation.setRepeatCount(-1);
localTranslateAnimation.setRepeatMode(1);
this.mBatteryIndicatorCharging.startAnimation(localTranslateAnimation);
}
this.mBatteryIndicator.setImageResource(i);
this.mBatteryIndicator.layout(paramInt1, paramInt2, paramInt3, paramInt2 + this.mBatteryIndicator.getDrawable().getIntrinsicHeight());
}
}
Smali code
We need to add new field member to this class: StatusBarView. You can add these lines just below: "# instance fields" at the very top!
Code:
.field mBatteryIndicator:Landroid/widget/ImageView;
.field mBatteryIndicatorCharging:Landroid/widget/ImageView;
.field private mBatteryIndicatorWidth:I
.field private mBatteryLowLevel:I
.field private mShowBatteryIndicator:Z
.field mScreenIsOn:Z
.field mIntentReceiver:Landroid/content/BroadcastReceiver;
Now we need to change the constructor of this class to set values for our field members:
Find this method:
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
and replace with the one below.
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 1
.parameter "context"
.parameter "attrs"
.prologue
.line 56
invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.line 54
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mScreenIsOn:Z
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mShowBatteryIndicator:Z
.line 55
new-instance v0, Lcom/android/systemui/statusbar/StatusBarView$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/StatusBarView$1;-><init>(Lcom/android/systemui/statusbar/StatusBarView;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mIntentReceiver:Landroid/content/BroadcastReceiver;
const v0, 0x1e
iput v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryLowLevel:I
.line 49
const/4 v0, 0x1
iput v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mStatusBarMarqueeDirection:I
.line 50
const/4 v0, 0x0
iput v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mStatusBarMarqueeRange:I
.line 57
return-void
.end method
Please note on the code above this line: const v0, 0x1e, 0x1e = 30, i set the lowbattery threshold to 30% which means that from this point, the battery charging indicator png will be used! Change it as you like!
Now we need to register our receiver for "Screen On" and "Screen Off" intents.
Find the following method
Code:
.method protected onAttachedToWindow()V
Replace with the following:
Code:
.method protected onAttachedToWindow()V
.locals 5
.prologue
.line 76
invoke-super {p0}, Landroid/widget/FrameLayout;->onAttachedToWindow()V
.line 77
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mService:Lcom/android/systemui/statusbar/StatusBarService;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/StatusBarService;->onBarViewAttached()V
.line 110
new-instance v0, Landroid/content/IntentFilter;
invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V
.line 111
.local v0, filter:Landroid/content/IntentFilter;
const-string v1, "android.intent.action.SCREEN_OFF"
invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 112
const-string v1, "android.intent.action.SCREEN_ON"
invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 113
iget-object v1, p0, Lcom/android/systemui/statusbar/StatusBarView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/systemui/statusbar/StatusBarView;->mIntentReceiver:Landroid/content/BroadcastReceiver;
const/4 v3, 0x0
new-instance v4, Landroid/os/Handler;
invoke-direct {v4}, Landroid/os/Handler;-><init>()V
invoke-virtual {v1, v2, v0, v3, v4}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;)Landroid/content/Intent;
return-void
.end method
At this point we need to add a method that take care of unregister our broadcast receiver. Add the following method where you prefer.
Code:
.method protected onDetachedFromWindow()V
.locals 2
.prologue
.line 127
invoke-super {p0}, Landroid/widget/FrameLayout;->onDetachedFromWindow()V
.line 128
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mContext:Landroid/content/Context;
iget-object v1, p0, Lcom/android/systemui/statusbar/StatusBarView;->mIntentReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v0, v1}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V
.line 130
return-void
.end method
Let's add a new method responsible for clipping our battery indicator png image based on the current value of mBatteryIndicatorWidth field (i.e the current level)
Code:
.method public onDraw(Landroid/graphics/Canvas;)V
.locals 4
.parameter "canvas"
.prologue
.line 224
iget-boolean v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mShowBatteryIndicator:Z
if-eqz v0, :cond_0
.line 225
invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I
.line 226
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicator:Landroid/widget/ImageView;
invoke-virtual {v0}, Landroid/widget/ImageView;->getLeft()I
move-result v0
iget-object v1, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicator:Landroid/widget/ImageView;
invoke-virtual {v1}, Landroid/widget/ImageView;->getTop()I
move-result v1
iget v2, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorWidth:I
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicator:Landroid/widget/ImageView;
invoke-virtual {v3}, Landroid/widget/ImageView;->getBottom()I
move-result v3
invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Canvas;->clipRect(IIII)Z
.line 231
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicator:Landroid/widget/ImageView;
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->draw(Landroid/graphics/Canvas;)V
.line 232
invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V
.line 234
:cond_0
invoke-super {p0, p1}, Landroid/widget/FrameLayout;->onDraw(Landroid/graphics/Canvas;)V
.line 235
return-void
.end method
4.1 Create a new smali file: StatusBarView$1.smali
Copy the following code in your file, and save it in smali/com/android/systemui/statusbar/
Code:
.method constructor <init>(Lcom/android/systemui/statusbar/StatusBarView;)V
.locals 0
.parameter
.prologue
.line 60
iput-object p1, p0, Lcom/android/systemui/statusbar/StatusBarView$1;->this$0:Lcom/android/systemui/statusbar/StatusBarView;
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
return-void
.end method
# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 3
.parameter "context"
.parameter "intent"
.prologue
.line 63
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarView$1;->this$0:Lcom/android/systemui/statusbar/StatusBarView;
const-string v1, "android.intent.action.SCREEN_ON"
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v2
invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
iput-boolean v1, v0, Lcom/android/systemui/statusbar/StatusBarView;->mScreenIsOn:Z
.line 64
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarView$1;->this$0:Lcom/android/systemui/statusbar/StatusBarView;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/StatusBarView;->requestLayout()V
.line 65
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarView$1;->this$0:Lcom/android/systemui/statusbar/StatusBarView;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/StatusBarView;->invalidate()V
.line 66
return-void
.end method
Now replace the methods: "onAttachedToWindow" with the code below:
Code:
.method protected onAttachedToWindow()V
.locals 5
.prologue
.line 76
invoke-super {p0}, Landroid/widget/FrameLayout;->onAttachedToWindow()V
.line 77
iget-object v0, p0, Lcom/android/systemui/statusbar/StatusBarView;->mService:Lcom/android/systemui/statusbar/StatusBarService;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/StatusBarService;->onBarViewAttached()V
.line 110
new-instance v0, Landroid/content/IntentFilter;
invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V
.line 111
.local v0, filter:Landroid/content/IntentFilter;
const-string v1, "android.intent.action.SCREEN_OFF"
invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 112
const-string v1, "android.intent.action.SCREEN_ON"
invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 113
iget-object v1, p0, Lcom/android/systemui/statusbar/StatusBarView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/systemui/statusbar/StatusBarView;->mIntentReceiver:Landroid/content/BroadcastReceiver;
const/4 v3, 0x0
new-instance v4, Landroid/os/Handler;
invoke-direct {v4}, Landroid/os/Handler;-><init>()V
invoke-virtual {v1, v2, v0, v3, v4}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;)Landroid/content/Intent;
return-void
.end method
Almost finished , now we need to modify the method "onLayout":
search for this line: return-void and replace with goto :goto_3 then add the following code just belowe this line: goto :goto_0
Code:
:goto_3
const/4 v4, 0x0
iget-boolean v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mShowBatteryIndicator:Z
if-eqz v3, :cond_3
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicator:Landroid/widget/ImageView;
invoke-virtual {v3, v4}, Landroid/widget/ImageView;->setVisibility(I)V
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorCharging:Landroid/widget/ImageView;
invoke-virtual {v3, v4}, Landroid/widget/ImageView;->setVisibility(I)V
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicator:Landroid/widget/ImageView;
invoke-virtual {v3}, Landroid/widget/ImageView;->getTag()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/lang/Integer;
invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
move-result v2
.local v2, batteryLevel:I
sub-int v3, p4, p2
mul-int/2addr v3, v2
div-int/lit8 v3, v3, 0x64
iput v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorWidth:I
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorCharging:Landroid/widget/ImageView;
iget-object v4, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorCharging:Landroid/widget/ImageView;
invoke-virtual {v4}, Landroid/widget/ImageView;->getMeasuredWidth()I
move-result v4
add-int/2addr v4, p4
iget-object v5, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorCharging:Landroid/widget/ImageView;
invoke-virtual {v5}, Landroid/widget/ImageView;->getMeasuredHeight()I
move-result v5
add-int/2addr v5, p3
invoke-virtual {v3, p4, p3, v4, v5}, Landroid/widget/ImageView;->layout(IIII)V
const v1, 0x7f0200b8
.local v1, batteryIndicatorDrawableId:I
iget-boolean v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mScreenIsOn:Z
if-eqz v3, :cond_4
const v4, 0x10802c3
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorCharging:Landroid/widget/ImageView;
invoke-virtual {v3}, Landroid/widget/ImageView;->getTag()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/lang/Integer;
invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
move-result v3
if-eq v4, v3, :cond_4
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorWidth:I
sub-int v4, p4, p2
sub-int/2addr v3, v4
int-to-float v3, v3
invoke-direct {v0, v6, v3, v6, v6}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
.local v0, animation:Landroid/view/animation/TranslateAnimation;
const-wide/16 v3, 0x5dc
invoke-virtual {v0, v3, v4}, Landroid/view/animation/TranslateAnimation;->setDuration(J)V
const-wide/16 v3, 0xdac
invoke-virtual {v0, v3, v4}, Landroid/view/animation/TranslateAnimation;->setStartOffset(J)V
const/4 v3, -0x1
invoke-virtual {v0, v3}, Landroid/view/animation/TranslateAnimation;->setRepeatCount(I)V
const/4 v3, 0x1
invoke-virtual {v0, v3}, Landroid/view/animation/TranslateAnimation;->setRepeatMode(I)V
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorCharging:Landroid/widget/ImageView;
invoke-virtual {v3, v0}, Landroid/widget/ImageView;->startAnimation(Landroid/view/animation/Animation;)V
.end local v0 #animation:Landroid/view/animation/TranslateAnimation;
:cond_5
:goto_2
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicator:Landroid/widget/ImageView;
invoke-virtual {v3, v1}, Landroid/widget/ImageView;->setImageResource(I)V
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicator:Landroid/widget/ImageView;
iget-object v4, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicator:Landroid/widget/ImageView;
invoke-virtual {v4}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object v4
invoke-virtual {v4}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result v4
add-int/2addr v4, p3
invoke-virtual {v3, p2, p3, p4, v4}, Landroid/widget/ImageView;->layout(IIII)V
.end local v1 #batteryIndicatorDrawableId:I
.end local v2 #batteryLevel:I
:goto_1
return-void
.restart local v1 #batteryIndicatorDrawableId:I
.restart local v2 #batteryLevel:I
:cond_4
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorCharging:Landroid/widget/ImageView;
invoke-virtual {v3}, Landroid/widget/ImageView;->clearAnimation()V
iget v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryLowLevel:I
if-ge v2, v3, :cond_5
const v1, 0x7f0200ba
goto :goto_2
.end local v1 #batteryIndicatorDrawableId:I
.end local v2 #batteryLevel:I
:cond_3
const/16 v5, 0x8
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicator:Landroid/widget/ImageView;
invoke-virtual {v3, v5}, Landroid/widget/ImageView;->setVisibility(I)V
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorCharging:Landroid/widget/ImageView;
invoke-virtual {v3, v5}, Landroid/widget/ImageView;->setVisibility(I)V
iget-object v3, p0, Lcom/android/systemui/statusbar/StatusBarView;->mBatteryIndicatorCharging:Landroid/widget/ImageView;
invoke-virtual {v3}, Landroid/widget/ImageView;->clearAnimation()V
goto :goto_1
.end method
Finally, we need to adjust values to match our Ref ID (drawable images and battery_indicator ID)
chargeIconID in my pseudo code is used to verify if the phone is charging, in my attached source code you will see the line below
The following value (inside onLayout method) is used to verify if the phone is charging.
const v6, 0x10802c3
Decompile framework-res.apk and open /res/values/public.xml, search for this string: name="stat_sys_battery_charge"
Code:
<public type="drawable" name="stat_sys_battery_charge" id="0x10802c3" />
Make sure that the id you are using match with that value!
Now we need to take care about one ID used by onFinishInflate method:
const v1, 0x7f0a0034
need to match with our ID in res/values/public.xml
<public type="id" name="battery_indicator_charging" id="0x7f0a0034" />
The same for the method onLayout but this time we need to take care about 2 IDs:
const v1, 0x7f0200b8
<public type="drawable" name="z_battery_indicator" id="0x7f0200b8" />
const v1, 0x7f0200ba
<public type="drawable" name="z_battery_indicator_low" id="0x7f0200ba" />
Hope this helps you guys!
nice! thank you
Good work Leo.
I will try to port it to ICS .
nice work, but who is SanX and what has he cracked? lol
Congratulations for this very detailed howto! Just a thought: MIUI has this by default, you'll most probably take less time flashing MIUI than applying these mods!
thunderteaser said:
Congratulations for this very detailed howto! Just a thought: MIUI has this by default, you'll most probably take less time flashing MIUI than applying these mods!
Click to expand...
Click to collapse
It's for the devs, not regular users
I've been using the application onibar which does this really well as its an overlay.
Sent from my GT-I9100 using xda premium
Are there any advantages compared to this?
xethor said:
Are there any advantages compared to this?
Click to expand...
Click to collapse
Well if you go with the OP approach then you don't need the app. From an end user the app you linked to is fine. For devs however this can be integrated and forgo the need for the app altogether.
Tomorrow i will update this tutorial as i have made another mod that uses png for battery line indicator, it's much better since themer can change color, trasparency,..
xethor said:
Are there any advantages compared to this?
Click to expand...
Click to collapse
Yes, that applications start a background service that poll battery info, it will drain your battery..
Also this application doesn't animate the battery indicator while charging.
The mod i post instead is built in on the systemUI statusbar service!
In addition, with this mod (it will be updated tomorrow) it is also possible to change png for battery line indicator, not just the color as the app you mentioned!
Hey Leo, will this be implemented in CheckROM RevoHD™ V4 and future versions?Or at least given as a MOD in the kitchen?
Hollow.Droid said:
It's for the devs, not regular users
Click to expand...
Click to collapse
But it's so well written and clear! I guess a user could do this, that's why I'm talking just about time.
Hi Leo !
Will you make it as a script and we just need to flash it ?
Pleaseeeee...
joezy07 said:
Hi Leo !
Will you make it as a script and we just need to flash it ?
Pleaseeeee...
Click to expand...
Click to collapse
Yes please in ICS blue too!!!!!!!!!!!!!!!!!!!!!!
sorry. i just flashd Intratech's Frankenstein LA4. it has the top battery line indicator. did he already implement this.?
what is the diff from this ?
what is different from this Leo? thanks
mariosraptor said:
what is different from this Leo? thanks
Click to expand...
Click to collapse
see the post a few ones back... it drains the battery more... and also the charging is not animated in the market app
Yes, that applications start a background service that poll battery info, it will drain your battery..
Also this application doesn't animate the battery indicator while charging.
The mod i post instead is built in on the systemUI statusbar service!
In addition, with this mod (it will be updated tomorrow) it is also possible to change png for battery line indicator, not just the color as the app you mentioned!
Click to expand...
Click to collapse
seriously awesome....
I have updated the OP, now this mod uses png images, it's much better since themers can change the aspect of these bars without any effort.

[GUIDE][How-to] New Power Menu JB - With Screenshot

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.

[MOD][THEME][APP][TUTORIAL] Samsung KeyBoard Swipe Color Change Found!

Thanks to @Gunthermic for finding this.. confirmed working on Note2 as well...
Gunthermic said:
Okay, alot of dev's/themers been looking for this one...
If you use, please give credit, I spent many hours finding this Mod... Dont take credit for someone else's work...
This Mod will allow you to change the Samsung KeyBoard Swipe Color..(SamsungIME.apk)
Look for:
smalicomdiotekimeframeworkviewAbstractKeyBoardView.smali
Search for -> .method private setTracePaintOptionsWithSettings()V
Click to see Org Code
Code:
.method private setTracePaintOptionsWithSettings()V
.registers 6
.prologue
const/4 v1, 0x1
const/4 v4, 0x0
.line 7006
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_d
.line 7007
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 7009
:cond_d
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_16
.line 7010
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 7012
:cond_16
iput-short v4, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 7013
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 7014
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 7015
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xff
const/16 v2, 0xa5
const/16 v3, 0xf3
invoke-static {v1, v4, v2, v3}, Landroid/graphics/Color;->argb(IIII)I
move-result v1
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setColor(I)V
.line 7016
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V
.line 7017
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Join;->ROUND:Landroid/graphics/Paint$Join;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeJoin(Landroid/graphics/Paint$Join;)V
.line 7018
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Cap;->ROUND:Landroid/graphics/Paint$Cap;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V
.line 7019
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0x96
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAlpha(I)V
.line 7020
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
iget v1, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePenThickness:I
int-to-float v1, v1
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeWidth(F)V
.line 7021
return-void
.end method
Click to see what to change:
Code:
.method private setTracePaintOptionsWithSettings()V
.registers 6
.prologue
const/4 v1, 0x1
[COLOR="Red"]const/4 v4, 0x0[/COLOR] [B]# This is your Red Value[/B]
.line 7006
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_d
.line 7007
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 7009
:cond_d
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_16
.line 7010
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 7012
:cond_16
iput-short v4, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 7013
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 7014
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 7015
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xff
[COLOR="Lime"]const/16 v2, 0xa5[/COLOR] [B]# This is your Green Value[/B]
[COLOR="DeepSkyBlue"]const/16 v3, 0xf3[/COLOR] [B]# this is your Blue Value[/B]
invoke-static {v1, v4, v2, v3}, Landroid/graphics/Color;->argb(IIII)I
move-result v1
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setColor(I)V
.line 7016
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V
.line 7017
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Join;->ROUND:Landroid/graphics/Paint$Join;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeJoin(Landroid/graphics/Paint$Join;)V
.line 7018
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Cap;->ROUND:Landroid/graphics/Paint$Cap;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V
.line 7019
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0x96
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAlpha(I)V
.line 7020
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
iget v1, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePenThickness:I
int-to-float v1, v1
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeWidth(F)V
.line 7021
return-void
.end method
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!!!!
Verified to work on N2 KeyBoards
Click to expand...
Click to collapse
XDA:DevDB Information
Samsung KeyBoard Swipe Color Change Found! , a ROM for the Sprint Samsung Galaxy Note II
Contributors
JoshBeach, Gunthermic
Version Information
Status: Testing
Created 2013-12-14
Last Updated 2014-04-15
IT WORKS!
Thanks to both of you guys ! :highfive::laugh:
Hey all, @JoshBeach is graciously going to defer to the original discoverer of the mod, @Gunthermic, to continue the discussion here http://forum.xda-developers.com/showthread.php?t=2569480.

[Guide] Listview Animations for Lollipop

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.

[Guide][tut] HeadsUp timeOut settings

Hello guys here go a simple tut
all you need is Deodexed Systemui.apk
1. Decompile SystemUI.apk
2. Open Systemui.apk/smali/com/android/statusbar/phone/PhoneStatusBar.smali
and find this Method
Code:
.method public resetHeadsUpDecayTimer()V
and completely replace with this method
Code:
.method public resetHeadsUpDecayTimer()V
.locals 5
.prologue
const/16 v4, 0x407
.line 1756
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;
invoke-virtual {v0, v4}, Lcom/android/systemui/statusbar/BaseStatusBar$H;->removeMessages(I)V
.line 1757
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mUseHeadsUp:Z
if-eqz v0, :cond_0
iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHeadsUpNotificationDecay:I
if-lez v0, :cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHeadsUpNotificationView:Lcom/android/systemui/statusbar/policy/HeadsUpNotificationView;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/policy/HeadsUpNotificationView;->isClearable()Z
move-result v0
if-eqz v0, :cond_0
.line 1759
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "heads_up_timeout"
const/16 v3, 0xbb8
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
int-to-long v2, v1
invoke-virtual {v0, v4, v2, v3}, Lcom/android/systemui/statusbar/BaseStatusBar$H;->sendEmptyMessageDelayed(IJ)Z
.line 1761
:cond_0
return-void
.end method
Done...!
save it and close
Now compile/sign it and replace the systemui.apk
Control with my app (Click here)
Have fun....
Dont forgot to tag me if you use my work
Thank u very much bro works fine

Categories

Resources