FORUMS

[GUIDE] [TUT] Toast Animation

100 posts
Thanks Meter: 164
 
Post Reply Email Thread
GUIDE Toast Animation (Suppport Show-Hide Toast Icon)
Work and Tested - CM 12.1 & LP Based

1. Decompile framework-res
copy and paste ingredients into place
framework-res.apk\res\values
styles.xml
add the following lines

Quote:

<style name="Animation.Toast.Fade" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/fade_in</item>
<item name="windowExitAnimation">@anim/fade_out</item>
</style>
<style name="Animation.Toast.SlideRight" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/slide_in_right</item>
<item name="windowExitAnimation">@anim/slide_out_right</item>
</style>
<style name="Animation.Toast.SlideLeft" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/slide_in_left</item>
<item name="windowExitAnimation">@anim/slide_out_left</item>
</style>
<style name="Animation.Toast.Xylon" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/xylon_toast_enter</item>
<item name="windowExitAnimation">@anim/xylon_toast_exit</item>
</style>
<style name="Animation.Toast.Toko" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/toko_toast_enter</item>
<item name="windowExitAnimation">@anim/toko_toast_exit</item>
</style>
<style name="Animation.Toast.Tn" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/tn_toast_enter</item>
<item name="windowExitAnimation">@anim/tn_toast_exit</item>
</style>
<style name="Animation.Toast.Honami" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/honami_toast_enter</item>
<item name="windowExitAnimation">@anim/honami_toast_exit</item>
</style>
<style name="Animation.Toast.FastFade" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/fast_fade_in</item>
<item name="windowExitAnimation">@anim/fast_fade_out</item>
</style>
<style name="Animation.Toast.GrowFade" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/grow_fade_in</item>
<item name="windowExitAnimation">@anim/fast_fade_out</item>
</style>
<style name="Animation.Toast.GrowFadeCenter" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/grow_fade_in_center</item>
<item name="windowExitAnimation">@anim/fast_fade_out</item>
</style>
<style name="Animation.Toast.Translucent" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/translucent_enter</item>
<item name="windowExitAnimation">@anim/translucent_exit</item>
</style>
<style name="Animation.Toast.GrowFadeBottom" parent="@style/Animation.Toast">
<item name="windowEnterAnimation">@anim/grow_fade_in_from_bottom</item>
<item name="windowExitAnimation">@anim/fast_fade_out</item>
</style>

Recompile-Decompile again..
open public.xml, and leave it opened

2.Decompile framework.jar
Copy and paste Ingredients Into His place
Replace id below conform with public.xml framework-res.apk

Quote:

framework.jar\smali_classes2\android\widget\Toast$ TN.smali (15 hits)
Line 97 : const v1, 0x1030004 # type="style" name="Animation.Toast"
Line 301: const v8, 0x1020006 # type="id" name="icon"
Line 525: const v8, 0x1030004 # type="style" name="Animation.Toast"
Line 535: const v8, 0x10304c3 # type="style" name="Animation.Toast.Fade"
Line 545: const v8, 0x10304c4 # type="style" name="Animation.Toast.SlideRight"
Line 555: const v8, 0x10304c5 # type="style" name="Animation.Toast.SlideLeft"
Line 565: const v8, 0x10304c6 # type="style" name="Animation.Toast.Xylon"
Line 575: const v8, 0x10304c7 # type="style" name="Animation.Toast.Toko"
Line 585: const v8, 0x10304c8 # type="style" name="Animation.Toast.Tn"
Line 595: const v8, 0x10304c9 # type="style" name="Animation.Toast.Honami"
Line 605: const v8, 0x10304ca # type="style" name="Animation.Toast.FastFade"
Line 615: const v8, 0x10304cb # type="style" name="Animation.Toast.GrowFade"
Line 625: const v8, 0x10304cc # type="style" name="Animation.Toast.GrowFadeCenter"
Line 635: const v8, 0x10304ce # type="style" name="Animation.Toast.GrowFadeBottom"
Line 645: const v8, 0x10304cd # type="style" name="Animation.Toast.Translucent"

3.Decompile Settings.apk
Settings.apk\res\xml
copy and paste ingredients into place
Settings.apk\res\xml
display.xml
-Add Line

Quote:

<PreferenceScreen android:id="@+id/animation_settings" android:title="@string/animation_settings" android:fragment="com.android.settings.rr.Animatio nSettings" />

Settings.apk\res\values
strings.xml
add the following lines

Quote:

<string name="misc_settings_title"><b>Miscellaneous</b></string>
<string name="animation_settings"><b>Animations</b></string>
<string name="toast_title"><b>Toast</b></string>
<string name="toast_icon_title">Toast icon</string>
<string name="toast_animation_title">Toast animations</string>
<string name="toast_animation_summary">Select and preview system toast animation</string>
<string name="toast_none_animation">None</string>
<string name="toast_default_animation">Default</string>
<string name="toast_fade_animation">Fade animation</string>
<string name="toast_SlideRight_animation">Slide right</string>
<string name="toast_SlideLeft_animation">Slide left</string>
<string name="toast_Xylon_animation">Xylon animation</string>
<string name="toast_Toko_animation">Toko animation</string>
<string name="toast_Tn_animation">Tn animation</string>
<string name="toast_Honami_animation">Honami animation</string>
<string name="toast_FastFade_animation">Fast fade</string>
<string name="toast_GrowFade_animation">Grow fade</string>
<string name="toast_GrowFadeCenter_animation">Grow fade center</string>
<string name="toast_GrowFadeBottom_animation">Grow fade bottom</string>
<string name="toast_Translucent_animation">Translucent animation</string>
<string name="animation_settings_title">Animations</string>

Settings.apk\res\values
arrays.xml
add the following lines

Quote:

<string-array name="toast_animation_entries">
<item>@string/toast_none_animation</item>
<item>@string/toast_default_animation</item>
<item>@string/toast_fade_animation</item>
<item>@string/toast_SlideRight_animation</item>
<item>@string/toast_SlideLeft_animation</item>
<item>@string/toast_Xylon_animation</item>
<item>@string/toast_Toko_animation</item>
<item>@string/toast_Tn_animation</item>
<item>@string/toast_Honami_animation</item>
<item>@string/toast_FastFade_animation</item>
<item>@string/toast_GrowFade_animation</item>
<item>@string/toast_GrowFadeCenter_animation</item>
<item>@string/toast_GrowFadeBottom_animation</item>
<item>@string/toast_Translucent_animation</item>
</string-array>
<string-array name="toast_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>
<item>12</item>
<item>13</item>
</string-array>

Settings.apk\smali\com\android\settings
SettingsPreferenceFragment.smali

PHP Code:
-copy and paste the line below
.field protected mContext:Landroid/content/Context;

-
right below
.field private mContentResolver:Landroid/content/ContentResolver

--------------------------------------------------------------------------
-
copy and paste this line
    
.line 93
    invoke
-virtual {p0}, Lcom/android/settings/SettingsPreferenceFragment;->getActivity()Landroid/app/Activity;

    
move-result-object v1

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

    
move-result-object v1

    iput
-object v1p0Lcom/android/settings/SettingsPreferenceFragment;->mContext:Landroid/content/Context;
    
    .
line 94
    invoke
-virtual {p0}, Lcom/android/settings/SettingsPreferenceFragment;->getActivity()Landroid/app/Activity;

    
move-result-object v2

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

    
move-result-object v2

    iput
-object v2p0Lcom/android/settings/SettingsPreferenceFragment;->mContext:Landroid/content/Context;

-
right below
    invoke
-super {p0p1}, Landroid/preference/PreferenceFragment;->onCreate(Landroid/os/Bundle;)
Recompile
Decompile
Settings.apk\smali\com\android\settings\rr
AnimationSettings.smali

Quote:

Replace id below conform with public.xml
const v1, 0x7f06006c public type="xml" name="rr_animation_settings" id="

Recompile.

Files and Compare Press Me
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2016-11-07-05-46-05.png
Views:	288
Size:	30.1 KB
ID:	4018713   Click image for larger version

Name:	Screenshot_2016-11-07-05-46-14.png
Views:	294
Size:	81.5 KB
ID:	4018714  
The Following User Says Thank You to ahmed.nasser.hk For This Useful Post: [ View ] Gift ahmed.nasser.hk Ad-Free
27th January 2017, 07:35 AM |#2  
Junior Member
Thanks Meter: 1
 
More
Thanks bro, and good job !!

Enviado desde mi Lenovo K50-t5 mediante Tapatalk
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes