[Guide][Smali][CM11] How to add toast animations

Search This thread

qoejohn

Senior Member
Feb 2, 2015
327
472
Yogyakarta Special Region
Hallo All :D
I want to share how to add animation toast .. with settings..

What can be done with this MOD ?
  • This mod will allow you to have Toast with various types of animations , and can change it without need reboot
  • Here is a video of what I mean.. :cool:



okey lets go to Guide:
first of all need some requirement for this MOD-GUIDE

REQUIREMENT:
- BRAIN
- Patient
- experience
- Know how to decompile/recompiling Apk and JAR file
- Tool for decompiling, : apktool/apkmultitools/ or else (I am currently using apktool 1.5.2)
- notepad++


Settings.apk
Decompile your settings.apk
- Download attached file and merge it to your decompiled Settings.apk
- Settings.apk\res\values\arrays.xml
add this lines to end of it before </resources>

Code:
<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_SlideLeftRight_animation</item>
        <item>@string/toast_SlideRightLeft_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>
        <item>14</item>
        <item>15</item>
    </string-array>


- Settings.apk\res\values\strings.xml
add this lines to end of it before </resources>

Code:
<string name="toast_animation_title">Toast animations</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">SlideRight Animation</string>
    <string name="toast_SlideLeft_animation">SlideLeft Animation</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">FastFade Animation</string>
    <string name="toast_GrowFade_animation">GrowFade Animation</string>
    <string name="toast_GrowFadeCenter_animation">GrowFadeCenter Animation</string>
    <string name="toast_GrowFadeBottom_animation">GrowFadeBottom Animation</string>
    <string name="toast_Translucent_animation">Translucent Animation</string>
    <string name="toast_SlideLeftRight_animation">Slide Left To Right Animation</string>
    <string name="toast_SlideRightLeft_animation">Slide Right To Left Animation</string>


- Settings.apk\res\xml\display_settings.xml
put this line

Code:
[COLOR="Red"]<PreferenceScreen android:title="@string/toast_animation_title" android:key="toast_animation" android:fragment="com.android.settings.cyanogenmod.ToastSettings" />[/COLOR]
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/display_settings"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
    <com.android.settings.BrightnessPreference android:persistent="false" android:title="@string/brightness" />
    [COLOR="Red"]<PreferenceScreen android:title="@string/toast_animation_title" android:key="toast_animation" android:fragment="com.android.settings.cyanogenmod.ToastSettings" />[/COLOR]
    <PreferenceCategory android:title="@string/display_settings_title" android:key="display_prefs">
        <PreferenceScreen android:title="@string/display_rotation_title" android:key="display_rotation" android:fragment="com.android.settings.cyanogenmod.DisplayRotation" />
        <ListPreference android:persistent="false" android:entries="@array/screen_timeout_entries" android:title="@string/screen_timeout" android:key="screen_timeout" android:summary="@string/screen_timeout_summary" android:entryValues="@array/screen_timeout_values" />
        <com.android.settings.FontDialogPreference android:title="@string/title_font_size" android:key="font_size" android:summary="@string/summary_font_size" android:dialogTitle="@string/dialog_title_font_size" />
        <PreferenceScreen android:title="@string/screensaver_settings_title" android:key="screensaver" android:fragment="com.android.settings.DreamSettings" />
        <PreferenceScreen android:title="@string/wifi_display_settings_title" android:key="wifi_display" android:fragment="com.android.settings.wfd.WifiDisplaySettings" />
    </PreferenceCategory>
but you can put the line whereever you like,.. Can be placed in other xml ;)

- Recompile your Settings.apk

- Decompile the newly recompiled APK again
go to your secondly decompiled Settings.apk\res\values\public.xml
and let it stay open .

Pay attention to this 0x7f?????? !!!
- Now go to Settings.apk\smali\com\android\settings\cyanogenmod\ToastSettings.smali
search this -> const v21, 0x7f05007a

change this -> 0x7f05007a , according to the value you got in your own public.xml
Code:
<public type="xml" name="toast_settings" id="0x7f?????? />

- Done and save
- Recompile it
- Next, go to framework-res.apk...


framework-res.apk
Decompile your framework-res.apk
- Download attached file and merge it to your decompiled framework-res.apk
- framework-res.apk\res\values\styles.xml
add this lines to end of it before </resources>
Code:
<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.SlideRightLeft" parent="@style/Animation.Toast">
        <item name="windowEnterAnimation">@anim/slide_in_right</item>
        <item name="windowExitAnimation">@anim/slide_out_left</item>
    </style>
    <style name="Animation.Toast.SlideLeftRight" parent="@style/Animation.Toast">
        <item name="windowEnterAnimation">@anim/slide_in_left</item>
        <item name="windowExitAnimation">@anim/slide_out_right</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.GrowFadeBottom" parent="@style/Animation.Toast">
        <item name="windowEnterAnimation">@anim/grow_fade_in_from_bottom</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>

- save and Recompile it

- Decompile the newly recompiled APK again
go to your secondly decompiled framework-res.apk\res\values\public.xml
and let it stay open ...
- Now go to framework.jar...


framework.jar
- Decompile/baksmali your framework.jar
- Navigate to framework.jar.out/smali/android/widget/Toast$TN.smali
- search .method public handleShow()V
Code:
.method public handleShow()V
    .locals 6

    .prologue
    const/high16 v5, 0x3f80

    .line 376
    iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    iget-object v4, p0, Landroid/widget/Toast$TN;->mNextView:Landroid/view/View;

    if-eq v3, v4, :cond_4

    .line 378
    invoke-virtual {p0}, Landroid/widget/Toast$TN;->handleHide()V

    .line 379
    iget-object v3, p0, Landroid/widget/Toast$TN;->mNextView:Landroid/view/View;

    iput-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    .line 380
    iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    .line 381
    .local v1, context:Landroid/content/Context;
    if-nez v1, :cond_0

    .line 382
    iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v1

    .line 384
    :cond_0
    const-string/jumbo v3, "window"

    invoke-virtual {v1, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/view/WindowManager;

    iput-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;

    .line 387
    iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;

    move-result-object v0

    .line 388
    .local v0, config:Landroid/content/res/Configuration;
    iget v3, p0, Landroid/widget/Toast$TN;->mGravity:I

    invoke-virtual {v0}, Landroid/content/res/Configuration;->getLayoutDirection()I

    move-result v4

    invoke-static {v3, v4}, Landroid/view/Gravity;->getAbsoluteGravity(II)I

    move-result v2

    .line 389
    .local v2, gravity:I
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iput v2, v3, Landroid/view/WindowManager$LayoutParams;->gravity:I

    .line 390
    and-int/lit8 v3, v2, 0x7

    const/4 v4, 0x7

    if-ne v3, v4, :cond_1

    .line 391
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iput v5, v3, Landroid/view/WindowManager$LayoutParams;->horizontalWeight:F

    .line 393
    :cond_1
    and-int/lit8 v3, v2, 0x70

    const/16 v4, 0x70

    if-ne v3, v4, :cond_2

    .line 394
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iput v5, v3, Landroid/view/WindowManager$LayoutParams;->verticalWeight:F

    .line 396
    :cond_2
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iget v4, p0, Landroid/widget/Toast$TN;->mX:I

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->x:I

    .line 397
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iget v4, p0, Landroid/widget/Toast$TN;->mY:I

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->y:I

    .line 398
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iget v4, p0, Landroid/widget/Toast$TN;->mVerticalMargin:F

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->verticalMargin:F

    .line 399
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iget v4, p0, Landroid/widget/Toast$TN;->mHorizontalMargin:F

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->horizontalMargin:F

    .line 400
    iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    invoke-virtual {v3}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v3

    if-eqz v3, :cond_3

    .line 402
    iget-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;

    iget-object v4, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    invoke-interface {v3, v4}, Landroid/view/WindowManager;->removeView(Landroid/view/View;)V

    .line 405
    :cond_3
    iget-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;

    iget-object v4, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    iget-object v5, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    invoke-interface {v3, v4, v5}, Landroid/view/WindowManager;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 406
    invoke-direct {p0}, Landroid/widget/Toast$TN;->trySendAccessibilityEvent()V

    .line 408
    .end local v0           #config:Landroid/content/res/Configuration;
    .end local v1           #context:Landroid/content/Context;
    .end local v2           #gravity:I
    :cond_4
    return-void
.end method
- Replace all with this :
Code:
[COLOR="Red"].method public handleShow()V
    .locals 7

    .prologue
    const/high16 v6, 0x3f80

    .line 377
    iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    iget-object v4, p0, Landroid/widget/Toast$TN;->mNextView:Landroid/view/View;

    if-eq v3, v4, :cond_4

    .line 379
    invoke-virtual {p0}, Landroid/widget/Toast$TN;->handleHide()V

    .line 380
    iget-object v3, p0, Landroid/widget/Toast$TN;->mNextView:Landroid/view/View;

    iput-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    .line 381
    iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    .line 382
    .local v1, context:Landroid/content/Context;
    if-nez v1, :cond_0

    .line 383
    iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v1

    .line 385
    :cond_0
    const-string/jumbo v3, "window"

    invoke-virtual {v1, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/view/WindowManager;

    iput-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;

    .line 388
    iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;

    move-result-object v0

    .line 389
    .local v0, config:Landroid/content/res/Configuration;
    iget v3, p0, Landroid/widget/Toast$TN;->mGravity:I

    invoke-virtual {v0}, Landroid/content/res/Configuration;->getLayoutDirection()I

    move-result v4

    invoke-static {v3, v4}, Landroid/view/Gravity;->getAbsoluteGravity(II)I

    move-result v2

    .line 390
    .local v2, gravity:I
    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string/jumbo v4, "toast_animation"

    const/4 v5, 0x1

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

    move-result v3

    packed-switch v3, :pswitch_data_0

    .line 440
    :goto_0
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iput v2, v3, Landroid/view/WindowManager$LayoutParams;->gravity:I

    .line 441
    and-int/lit8 v3, v2, 0x7

    const/4 v4, 0x7

    if-ne v3, v4, :cond_1

    .line 442
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iput v6, v3, Landroid/view/WindowManager$LayoutParams;->horizontalWeight:F

    .line 444
    :cond_1
    and-int/lit8 v3, v2, 0x70

    const/16 v4, 0x70

    if-ne v3, v4, :cond_2

    .line 445
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iput v6, v3, Landroid/view/WindowManager$LayoutParams;->verticalWeight:F

    .line 447
    :cond_2
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iget v4, p0, Landroid/widget/Toast$TN;->mX:I

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->x:I

    .line 448
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iget v4, p0, Landroid/widget/Toast$TN;->mY:I

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->y:I

    .line 449
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iget v4, p0, Landroid/widget/Toast$TN;->mVerticalMargin:F

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->verticalMargin:F

    .line 450
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    iget v4, p0, Landroid/widget/Toast$TN;->mHorizontalMargin:F

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->horizontalMargin:F

    .line 451
    iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    invoke-virtual {v3}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v3

    if-eqz v3, :cond_3

    .line 453
    iget-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;

    iget-object v4, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    invoke-interface {v3, v4}, Landroid/view/WindowManager;->removeView(Landroid/view/View;)V

    .line 456
    :cond_3
    iget-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;

    iget-object v4, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;

    iget-object v5, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    invoke-interface {v3, v4, v5}, Landroid/view/WindowManager;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 457
    invoke-direct {p0}, Landroid/widget/Toast$TN;->trySendAccessibilityEvent()V

    .line 459
    .end local v0           #config:Landroid/content/res/Configuration;
    .end local v1           #context:Landroid/content/Context;
    .end local v2           #gravity:I
    :cond_4
    return-void

    .line 392
    .restart local v0       #config:Landroid/content/res/Configuration;
    .restart local v1       #context:Landroid/content/Context;
    .restart local v2       #gravity:I
    :pswitch_0
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const/4 v4, -0x1

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto :goto_0

    .line 395
    :pswitch_1
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x1030004

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto :goto_0

    .line 398
    :pswitch_2
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x1030324

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto :goto_0

    .line 401
    :pswitch_3
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x1030328

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto :goto_0

    .line 404
    :pswitch_4
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x1030327

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto :goto_0

    .line 407
    :pswitch_5
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x1030325

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto :goto_0

    .line 410
    :pswitch_6
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x1030326

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto :goto_0

    .line 413
    :pswitch_7
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x1030329

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto/16 :goto_0

    .line 416
    :pswitch_8
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x103032a

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto/16 :goto_0

    .line 419
    :pswitch_9
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x103032b

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto/16 :goto_0

    .line 422
    :pswitch_a
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x103032c

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto/16 :goto_0

    .line 425
    :pswitch_b
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x103032d

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto/16 :goto_0

    .line 428
    :pswitch_c
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x103032e

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto/16 :goto_0

    .line 431
    :pswitch_d
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x103032f

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto/16 :goto_0

    .line 434
    :pswitch_e
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x1030330

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto/16 :goto_0

    .line 437
    :pswitch_f
    iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;

    const v4, 0x1030331

    iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I

    goto/16 :goto_0

    .line 390
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
        :pswitch_4
        :pswitch_5
        :pswitch_6
        :pswitch_7
        :pswitch_8
        :pswitch_9
        :pswitch_a
        :pswitch_b
        :pswitch_c
        :pswitch_d
        :pswitch_e
        :pswitch_f
    .end packed-switch
.end method[/COLOR]

- Then search const v4, 0x1030004

ATTENTION! id public for framework.jar
just TAKE the BLUE CODE
and SKIP the RED CODE

1. change this -> 0x1030004 , according to the value you got in your own public.xml of framework-res.apk
Code:
<public type="style" name="Animation.Toast" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
do it too to all lines below, in the smali

2. const v4, 0x1030324
Code:
<public type="style" name="Animation.Toast.Fade" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
3. const v4, 0x1030328
Code:
<public type="style" name="Animation.Toast.SlideLeftRight" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
4. const v4, 0x1030327
Code:
<public type="style" name="Animation.Toast.SlideRightLeft" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
5. const v4, 0x1030325
Code:
<public type="style" name="Animation.Toast.SlideRight" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
6. const v4, 0x1030326
Code:
<public type="style" name="Animation.Toast.SlideLeft" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
7. const v4, 0x1030329
Code:
<public type="style" name="Animation.Toast.Xylon" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
8. const v4, 0x103032a
Code:
<public type="style" name="Animation.Toast.Toko" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
9. const v4, 0x103032b
Code:
<public type="style" name="Animation.Toast.Tn" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
10. const v4, 0x103032c
Code:
<public type="style" name="Animation.Toast.Honami" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
11. const v4, 0x103032d
Code:
<public type="style" name="Animation.Toast.FastFade" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
12. const v4, 0x103032e
Code:
<public type="style" name="Animation.Toast.GrowFade" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
13. const v4, 0x103032f
Code:
<public type="style" name="Animation.Toast.GrowFadeCenter" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
14. const v4, 0x1030330
Code:
<public type="style" name="Animation.Toast.GrowFadeBottom" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
15. const v4, 0x1030331
Code:
<public type="style" name="Animation.Toast.Translucent" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
- save and Recompile it

if all thats finished .. then input all to system .. , can be manual , and can also use flashable.zip ,,
make sure you BACKUP first ,
make sure you BACKUP first ,
make sure you BACKUP first ,


Have Nice Moding..
Good Luck :D
 

Attachments

  • Screenshot_2015-04-20-23-42-52.png
    Screenshot_2015-04-20-23-42-52.png
    71.9 KB · Views: 563
  • Screenshot_2015-04-20-23-43-02.png
    Screenshot_2015-04-20-23-43-02.png
    81 KB · Views: 556
  • Settings.apk.zip
    3.9 KB · Views: 329
  • framework-res.apk.zip
    14.1 KB · Views: 309

Atrankas

Senior Member
Nov 1, 2012
107
113
Toledo
I love this tutorials! Thank you very much!

It's working on Note3 N9005MIUIv6 (4.4.2 TouchWiz based), with some lines slighty retouched. All it's working fine (menu, animations), but produces FC when I select one of the anims, before "preview toast" show up. Logcat indicates the app stops at tag .line 659, (ToastSettings.smali)

move-result-object v8

aget-object v8, v8, v2

invoke-virtual {v5, v8}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

.line 659
iget-object v5, p0, Lcom/android/settings/cyanogenmod/ToastSettings;->mContext:Landroid/content/Context;

const-string v8, "Test toast animation"

invoke-static {v5, v8, v7}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

move-result-object v5

invoke-virtual {v5}, Landroid/widget/Toast;->show()V

goto :goto_1

I don't know how fix this small part. Thanks in advance.

PD: I´m using framework2.jar instead of framework.jar
 
Last edited:

qoejohn

Senior Member
Feb 2, 2015
327
472
Yogyakarta Special Region
I love this tutorials! Thank you very much!

It's working on Note3 N9005MIUIv6 (4.4.2 TouchWiz based), with some lines slighty retouched. All it's working fine (menu, animations), but produces FC when I select one of the anims, before "preview toast" show up. Logcat indicates the app stops at tag .line 659, (ToastSettings.smali)

move-result-object v8

aget-object v8, v8, v2

invoke-virtual {v5, v8}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

.line 659
iget-object v5, p0, Lcom/android/settings/cyanogenmod/ToastSettings;->mContext:Landroid/content/Context;

const-string v8, "Test toast animation"

invoke-static {v5, v8, v7}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

move-result-object v5

invoke-virtual {v5}, Landroid/widget/Toast;->show()V

goto :goto_1

I don't know how fix this small part. Thanks in advance.

PD: I´m using framework2.jar instead of framework.jar

use smali on attachments
- add on strings.xml
Code:
<string name="toast_test_animation">Test toast animation</string>
- decompile-recompile
- change ids
Code:
const v1, 0x7f050077 ---------- <public type="xml" name="toast_settings" id=
const v5, 0x7f080ca1 ---------- <public type="string" name="toast_test_animation" id=
- recompile
 

Attachments

  • ToastAnimationInterfaceSettings.zip
    1.5 KB · Views: 146
  • Like
Reactions: Atrankas

Atrankas

Senior Member
Nov 1, 2012
107
113
Toledo
Thanks for your reply, @qoejohn. I have the same error with this new code (FC when I touch one of the element from the list, but the animation is applied correctly).
Logcat
java.lang.NoSuchFieldError:
com.android.settings.cyanogenmod.ToastSettings.mContext

at
com.android.settings.cyanogenmod.ToastSettings.onPreferenceChange(ToastSettings.java:659)

at
android.preference.Preference.callChangeListener(Preference.java)

at
android.preference.ListPreference.onDialogClosed(ListPreference.java)

at
android.preference.DialogPreference.onDismiss(DialogPreference.java)

at
android.app.Dialog$ListenersHandler.handleMessage(Dialog.java)


at android.os.Handler.dispatchMessage(Handler.java)

at android.os.Looper.loop(Looper.java)
at android.app.ActivityThread.main(ActivityThread.java)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:515)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)

at dalvik.system.NativeStart.main(Native Method)

On the other hand, if I replace the line in xml
<PreferenceScreen android:title="@string/toast_animation_title" android:key="toast_animation" android:fragment="com.android.settings.cyanogenmod.ToastSettings" />

with

<PreferenceScreen android:title="@string/toast_animation_title" android:key="toast_animation" android:fragment="com.android.settings.cyanogenmod.animations.ToastAnimationInterfaceSettings" /> ,the FC is gone, but no effect is applied.
I'll keep on trying, thanks for your time
 
Last edited:

qoejohn

Senior Member
Feb 2, 2015
327
472
Yogyakarta Special Region
Thanks for your reply, @qoejohn. I have the same error with this new code (FC when I touch one of the element from the list, but the animation is applied correctly).
Logcat
java.lang.NoSuchFieldError:
com.android.settings.cyanogenmod.ToastSettings.mContext

at
com.android.settings.cyanogenmod.ToastSettings.onPreferenceChange(ToastSettings.java:659)

at
android.preference.Preference.callChangeListener(Preference.java)

at
android.preference.ListPreference.onDialogClosed(ListPreference.java)

at
android.preference.DialogPreference.onDismiss(DialogPreference.java)

at
android.app.Dialog$ListenersHandler.handleMessage(Dialog.java)


at android.os.Handler.dispatchMessage(Handler.java)

at android.os.Looper.loop(Looper.java)
at android.app.ActivityThread.main(ActivityThread.java)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:515)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)

at dalvik.system.NativeStart.main(Native Method)

On the other hand, if I replace the line in xml
<PreferenceScreen android:title="@string/toast_animation_title" android:key="toast_animation" android:fragment="com.android.settings.cyanogenmod.ToastSettings" />

with

<PreferenceScreen android:title="@string/toast_animation_title" android:key="toast_animation" android:fragment="com.android.settings.cyanogenmod.animations.ToastAnimationInterfaceSettings" /> ,the FC is gone, but no effect is applied.
I'll keep on trying, thanks for your time


change smali on .jar,, with this
and change id's
 

Attachments

  • jar.zip
    69.7 KB · Views: 100
Last edited:
  • Like
Reactions: Atrankas

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    Hallo All :D
    I want to share how to add animation toast .. with settings..

    What can be done with this MOD ?
    • This mod will allow you to have Toast with various types of animations , and can change it without need reboot
    • Here is a video of what I mean.. :cool:



    okey lets go to Guide:
    first of all need some requirement for this MOD-GUIDE

    REQUIREMENT:
    - BRAIN
    - Patient
    - experience
    - Know how to decompile/recompiling Apk and JAR file
    - Tool for decompiling, : apktool/apkmultitools/ or else (I am currently using apktool 1.5.2)
    - notepad++


    Settings.apk
    Decompile your settings.apk
    - Download attached file and merge it to your decompiled Settings.apk
    - Settings.apk\res\values\arrays.xml
    add this lines to end of it before </resources>

    Code:
    <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_SlideLeftRight_animation</item>
            <item>@string/toast_SlideRightLeft_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>
            <item>14</item>
            <item>15</item>
        </string-array>


    - Settings.apk\res\values\strings.xml
    add this lines to end of it before </resources>

    Code:
    <string name="toast_animation_title">Toast animations</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">SlideRight Animation</string>
        <string name="toast_SlideLeft_animation">SlideLeft Animation</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">FastFade Animation</string>
        <string name="toast_GrowFade_animation">GrowFade Animation</string>
        <string name="toast_GrowFadeCenter_animation">GrowFadeCenter Animation</string>
        <string name="toast_GrowFadeBottom_animation">GrowFadeBottom Animation</string>
        <string name="toast_Translucent_animation">Translucent Animation</string>
        <string name="toast_SlideLeftRight_animation">Slide Left To Right Animation</string>
        <string name="toast_SlideRightLeft_animation">Slide Right To Left Animation</string>


    - Settings.apk\res\xml\display_settings.xml
    put this line

    Code:
    [COLOR="Red"]<PreferenceScreen android:title="@string/toast_animation_title" android:key="toast_animation" android:fragment="com.android.settings.cyanogenmod.ToastSettings" />[/COLOR]
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <PreferenceScreen android:title="@string/display_settings"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
        <com.android.settings.BrightnessPreference android:persistent="false" android:title="@string/brightness" />
        [COLOR="Red"]<PreferenceScreen android:title="@string/toast_animation_title" android:key="toast_animation" android:fragment="com.android.settings.cyanogenmod.ToastSettings" />[/COLOR]
        <PreferenceCategory android:title="@string/display_settings_title" android:key="display_prefs">
            <PreferenceScreen android:title="@string/display_rotation_title" android:key="display_rotation" android:fragment="com.android.settings.cyanogenmod.DisplayRotation" />
            <ListPreference android:persistent="false" android:entries="@array/screen_timeout_entries" android:title="@string/screen_timeout" android:key="screen_timeout" android:summary="@string/screen_timeout_summary" android:entryValues="@array/screen_timeout_values" />
            <com.android.settings.FontDialogPreference android:title="@string/title_font_size" android:key="font_size" android:summary="@string/summary_font_size" android:dialogTitle="@string/dialog_title_font_size" />
            <PreferenceScreen android:title="@string/screensaver_settings_title" android:key="screensaver" android:fragment="com.android.settings.DreamSettings" />
            <PreferenceScreen android:title="@string/wifi_display_settings_title" android:key="wifi_display" android:fragment="com.android.settings.wfd.WifiDisplaySettings" />
        </PreferenceCategory>
    but you can put the line whereever you like,.. Can be placed in other xml ;)

    - Recompile your Settings.apk

    - Decompile the newly recompiled APK again
    go to your secondly decompiled Settings.apk\res\values\public.xml
    and let it stay open .

    Pay attention to this 0x7f?????? !!!
    - Now go to Settings.apk\smali\com\android\settings\cyanogenmod\ToastSettings.smali
    search this -> const v21, 0x7f05007a

    change this -> 0x7f05007a , according to the value you got in your own public.xml
    Code:
    <public type="xml" name="toast_settings" id="0x7f?????? />

    - Done and save
    - Recompile it
    - Next, go to framework-res.apk...


    framework-res.apk
    Decompile your framework-res.apk
    - Download attached file and merge it to your decompiled framework-res.apk
    - framework-res.apk\res\values\styles.xml
    add this lines to end of it before </resources>
    Code:
    <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.SlideRightLeft" parent="@style/Animation.Toast">
            <item name="windowEnterAnimation">@anim/slide_in_right</item>
            <item name="windowExitAnimation">@anim/slide_out_left</item>
        </style>
        <style name="Animation.Toast.SlideLeftRight" parent="@style/Animation.Toast">
            <item name="windowEnterAnimation">@anim/slide_in_left</item>
            <item name="windowExitAnimation">@anim/slide_out_right</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.GrowFadeBottom" parent="@style/Animation.Toast">
            <item name="windowEnterAnimation">@anim/grow_fade_in_from_bottom</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>

    - save and Recompile it

    - Decompile the newly recompiled APK again
    go to your secondly decompiled framework-res.apk\res\values\public.xml
    and let it stay open ...
    - Now go to framework.jar...


    framework.jar
    - Decompile/baksmali your framework.jar
    - Navigate to framework.jar.out/smali/android/widget/Toast$TN.smali
    - search .method public handleShow()V
    Code:
    .method public handleShow()V
        .locals 6
    
        .prologue
        const/high16 v5, 0x3f80
    
        .line 376
        iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        iget-object v4, p0, Landroid/widget/Toast$TN;->mNextView:Landroid/view/View;
    
        if-eq v3, v4, :cond_4
    
        .line 378
        invoke-virtual {p0}, Landroid/widget/Toast$TN;->handleHide()V
    
        .line 379
        iget-object v3, p0, Landroid/widget/Toast$TN;->mNextView:Landroid/view/View;
    
        iput-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        .line 380
        iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;
    
        move-result-object v3
    
        invoke-virtual {v3}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
    
        move-result-object v1
    
        .line 381
        .local v1, context:Landroid/content/Context;
        if-nez v1, :cond_0
    
        .line 382
        iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;
    
        move-result-object v1
    
        .line 384
        :cond_0
        const-string/jumbo v3, "window"
    
        invoke-virtual {v1, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
    
        move-result-object v3
    
        check-cast v3, Landroid/view/WindowManager;
    
        iput-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;
    
        .line 387
        iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;
    
        move-result-object v3
    
        invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
    
        move-result-object v3
    
        invoke-virtual {v3}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;
    
        move-result-object v0
    
        .line 388
        .local v0, config:Landroid/content/res/Configuration;
        iget v3, p0, Landroid/widget/Toast$TN;->mGravity:I
    
        invoke-virtual {v0}, Landroid/content/res/Configuration;->getLayoutDirection()I
    
        move-result v4
    
        invoke-static {v3, v4}, Landroid/view/Gravity;->getAbsoluteGravity(II)I
    
        move-result v2
    
        .line 389
        .local v2, gravity:I
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iput v2, v3, Landroid/view/WindowManager$LayoutParams;->gravity:I
    
        .line 390
        and-int/lit8 v3, v2, 0x7
    
        const/4 v4, 0x7
    
        if-ne v3, v4, :cond_1
    
        .line 391
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iput v5, v3, Landroid/view/WindowManager$LayoutParams;->horizontalWeight:F
    
        .line 393
        :cond_1
        and-int/lit8 v3, v2, 0x70
    
        const/16 v4, 0x70
    
        if-ne v3, v4, :cond_2
    
        .line 394
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iput v5, v3, Landroid/view/WindowManager$LayoutParams;->verticalWeight:F
    
        .line 396
        :cond_2
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iget v4, p0, Landroid/widget/Toast$TN;->mX:I
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->x:I
    
        .line 397
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iget v4, p0, Landroid/widget/Toast$TN;->mY:I
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->y:I
    
        .line 398
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iget v4, p0, Landroid/widget/Toast$TN;->mVerticalMargin:F
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->verticalMargin:F
    
        .line 399
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iget v4, p0, Landroid/widget/Toast$TN;->mHorizontalMargin:F
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->horizontalMargin:F
    
        .line 400
        iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        invoke-virtual {v3}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
    
        move-result-object v3
    
        if-eqz v3, :cond_3
    
        .line 402
        iget-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;
    
        iget-object v4, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        invoke-interface {v3, v4}, Landroid/view/WindowManager;->removeView(Landroid/view/View;)V
    
        .line 405
        :cond_3
        iget-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;
    
        iget-object v4, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        iget-object v5, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        invoke-interface {v3, v4, v5}, Landroid/view/WindowManager;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
    
        .line 406
        invoke-direct {p0}, Landroid/widget/Toast$TN;->trySendAccessibilityEvent()V
    
        .line 408
        .end local v0           #config:Landroid/content/res/Configuration;
        .end local v1           #context:Landroid/content/Context;
        .end local v2           #gravity:I
        :cond_4
        return-void
    .end method
    - Replace all with this :
    Code:
    [COLOR="Red"].method public handleShow()V
        .locals 7
    
        .prologue
        const/high16 v6, 0x3f80
    
        .line 377
        iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        iget-object v4, p0, Landroid/widget/Toast$TN;->mNextView:Landroid/view/View;
    
        if-eq v3, v4, :cond_4
    
        .line 379
        invoke-virtual {p0}, Landroid/widget/Toast$TN;->handleHide()V
    
        .line 380
        iget-object v3, p0, Landroid/widget/Toast$TN;->mNextView:Landroid/view/View;
    
        iput-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        .line 381
        iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;
    
        move-result-object v3
    
        invoke-virtual {v3}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
    
        move-result-object v1
    
        .line 382
        .local v1, context:Landroid/content/Context;
        if-nez v1, :cond_0
    
        .line 383
        iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;
    
        move-result-object v1
    
        .line 385
        :cond_0
        const-string/jumbo v3, "window"
    
        invoke-virtual {v1, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
    
        move-result-object v3
    
        check-cast v3, Landroid/view/WindowManager;
    
        iput-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;
    
        .line 388
        iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;
    
        move-result-object v3
    
        invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
    
        move-result-object v3
    
        invoke-virtual {v3}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;
    
        move-result-object v0
    
        .line 389
        .local v0, config:Landroid/content/res/Configuration;
        iget v3, p0, Landroid/widget/Toast$TN;->mGravity:I
    
        invoke-virtual {v0}, Landroid/content/res/Configuration;->getLayoutDirection()I
    
        move-result v4
    
        invoke-static {v3, v4}, Landroid/view/Gravity;->getAbsoluteGravity(II)I
    
        move-result v2
    
        .line 390
        .local v2, gravity:I
        invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v3
    
        const-string/jumbo v4, "toast_animation"
    
        const/4 v5, 0x1
    
        invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v3
    
        packed-switch v3, :pswitch_data_0
    
        .line 440
        :goto_0
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iput v2, v3, Landroid/view/WindowManager$LayoutParams;->gravity:I
    
        .line 441
        and-int/lit8 v3, v2, 0x7
    
        const/4 v4, 0x7
    
        if-ne v3, v4, :cond_1
    
        .line 442
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iput v6, v3, Landroid/view/WindowManager$LayoutParams;->horizontalWeight:F
    
        .line 444
        :cond_1
        and-int/lit8 v3, v2, 0x70
    
        const/16 v4, 0x70
    
        if-ne v3, v4, :cond_2
    
        .line 445
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iput v6, v3, Landroid/view/WindowManager$LayoutParams;->verticalWeight:F
    
        .line 447
        :cond_2
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iget v4, p0, Landroid/widget/Toast$TN;->mX:I
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->x:I
    
        .line 448
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iget v4, p0, Landroid/widget/Toast$TN;->mY:I
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->y:I
    
        .line 449
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iget v4, p0, Landroid/widget/Toast$TN;->mVerticalMargin:F
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->verticalMargin:F
    
        .line 450
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        iget v4, p0, Landroid/widget/Toast$TN;->mHorizontalMargin:F
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->horizontalMargin:F
    
        .line 451
        iget-object v3, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        invoke-virtual {v3}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
    
        move-result-object v3
    
        if-eqz v3, :cond_3
    
        .line 453
        iget-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;
    
        iget-object v4, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        invoke-interface {v3, v4}, Landroid/view/WindowManager;->removeView(Landroid/view/View;)V
    
        .line 456
        :cond_3
        iget-object v3, p0, Landroid/widget/Toast$TN;->mWM:Landroid/view/WindowManager;
    
        iget-object v4, p0, Landroid/widget/Toast$TN;->mView:Landroid/view/View;
    
        iget-object v5, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        invoke-interface {v3, v4, v5}, Landroid/view/WindowManager;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
    
        .line 457
        invoke-direct {p0}, Landroid/widget/Toast$TN;->trySendAccessibilityEvent()V
    
        .line 459
        .end local v0           #config:Landroid/content/res/Configuration;
        .end local v1           #context:Landroid/content/Context;
        .end local v2           #gravity:I
        :cond_4
        return-void
    
        .line 392
        .restart local v0       #config:Landroid/content/res/Configuration;
        .restart local v1       #context:Landroid/content/Context;
        .restart local v2       #gravity:I
        :pswitch_0
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const/4 v4, -0x1
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto :goto_0
    
        .line 395
        :pswitch_1
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x1030004
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto :goto_0
    
        .line 398
        :pswitch_2
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x1030324
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto :goto_0
    
        .line 401
        :pswitch_3
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x1030328
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto :goto_0
    
        .line 404
        :pswitch_4
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x1030327
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto :goto_0
    
        .line 407
        :pswitch_5
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x1030325
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto :goto_0
    
        .line 410
        :pswitch_6
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x1030326
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto :goto_0
    
        .line 413
        :pswitch_7
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x1030329
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto/16 :goto_0
    
        .line 416
        :pswitch_8
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x103032a
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto/16 :goto_0
    
        .line 419
        :pswitch_9
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x103032b
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto/16 :goto_0
    
        .line 422
        :pswitch_a
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x103032c
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto/16 :goto_0
    
        .line 425
        :pswitch_b
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x103032d
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto/16 :goto_0
    
        .line 428
        :pswitch_c
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x103032e
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto/16 :goto_0
    
        .line 431
        :pswitch_d
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x103032f
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto/16 :goto_0
    
        .line 434
        :pswitch_e
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x1030330
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto/16 :goto_0
    
        .line 437
        :pswitch_f
        iget-object v3, p0, Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
    
        const v4, 0x1030331
    
        iput v4, v3, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
    
        goto/16 :goto_0
    
        .line 390
        nop
    
        :pswitch_data_0
        .packed-switch 0x0
            :pswitch_0
            :pswitch_1
            :pswitch_2
            :pswitch_3
            :pswitch_4
            :pswitch_5
            :pswitch_6
            :pswitch_7
            :pswitch_8
            :pswitch_9
            :pswitch_a
            :pswitch_b
            :pswitch_c
            :pswitch_d
            :pswitch_e
            :pswitch_f
        .end packed-switch
    .end method[/COLOR]

    - Then search const v4, 0x1030004

    ATTENTION! id public for framework.jar
    just TAKE the BLUE CODE
    and SKIP the RED CODE

    1. change this -> 0x1030004 , according to the value you got in your own public.xml of framework-res.apk
    Code:
    <public type="style" name="Animation.Toast" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    do it too to all lines below, in the smali

    2. const v4, 0x1030324
    Code:
    <public type="style" name="Animation.Toast.Fade" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    3. const v4, 0x1030328
    Code:
    <public type="style" name="Animation.Toast.SlideLeftRight" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    4. const v4, 0x1030327
    Code:
    <public type="style" name="Animation.Toast.SlideRightLeft" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    5. const v4, 0x1030325
    Code:
    <public type="style" name="Animation.Toast.SlideRight" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    6. const v4, 0x1030326
    Code:
    <public type="style" name="Animation.Toast.SlideLeft" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    7. const v4, 0x1030329
    Code:
    <public type="style" name="Animation.Toast.Xylon" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    8. const v4, 0x103032a
    Code:
    <public type="style" name="Animation.Toast.Toko" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    9. const v4, 0x103032b
    Code:
    <public type="style" name="Animation.Toast.Tn" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    10. const v4, 0x103032c
    Code:
    <public type="style" name="Animation.Toast.Honami" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    11. const v4, 0x103032d
    Code:
    <public type="style" name="Animation.Toast.FastFade" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    12. const v4, 0x103032e
    Code:
    <public type="style" name="Animation.Toast.GrowFade" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    13. const v4, 0x103032f
    Code:
    <public type="style" name="Animation.Toast.GrowFadeCenter" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    14. const v4, 0x1030330
    Code:
    <public type="style" name="Animation.Toast.GrowFadeBottom" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    15. const v4, 0x1030331
    Code:
    <public type="style" name="Animation.Toast.Translucent" id="[COLOR="Blue"]0x[/COLOR][COLOR="Red"]0[/COLOR][COLOR="Blue"]???????[/COLOR] />
    - save and Recompile it

    if all thats finished .. then input all to system .. , can be manual , and can also use flashable.zip ,,
    make sure you BACKUP first ,
    make sure you BACKUP first ,
    make sure you BACKUP first ,


    Have Nice Moding..
    Good Luck :D
    1
    1
    I love this tutorials! Thank you very much!

    It's working on Note3 N9005MIUIv6 (4.4.2 TouchWiz based), with some lines slighty retouched. All it's working fine (menu, animations), but produces FC when I select one of the anims, before "preview toast" show up. Logcat indicates the app stops at tag .line 659, (ToastSettings.smali)

    move-result-object v8

    aget-object v8, v8, v2

    invoke-virtual {v5, v8}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

    .line 659
    iget-object v5, p0, Lcom/android/settings/cyanogenmod/ToastSettings;->mContext:Landroid/content/Context;

    const-string v8, "Test toast animation"

    invoke-static {v5, v8, v7}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v5

    invoke-virtual {v5}, Landroid/widget/Toast;->show()V

    goto :goto_1

    I don't know how fix this small part. Thanks in advance.

    PD: I´m using framework2.jar instead of framework.jar

    use smali on attachments
    - add on strings.xml
    Code:
    <string name="toast_test_animation">Test toast animation</string>
    - decompile-recompile
    - change ids
    Code:
    const v1, 0x7f050077 ---------- <public type="xml" name="toast_settings" id=
    const v5, 0x7f080ca1 ---------- <public type="string" name="toast_test_animation" id=
    - recompile
    1
    Thanks for your reply, @qoejohn. I have the same error with this new code (FC when I touch one of the element from the list, but the animation is applied correctly).
    Logcat
    java.lang.NoSuchFieldError:
    com.android.settings.cyanogenmod.ToastSettings.mContext

    at
    com.android.settings.cyanogenmod.ToastSettings.onPreferenceChange(ToastSettings.java:659)

    at
    android.preference.Preference.callChangeListener(Preference.java)

    at
    android.preference.ListPreference.onDialogClosed(ListPreference.java)

    at
    android.preference.DialogPreference.onDismiss(DialogPreference.java)

    at
    android.app.Dialog$ListenersHandler.handleMessage(Dialog.java)


    at android.os.Handler.dispatchMessage(Handler.java)

    at android.os.Looper.loop(Looper.java)
    at android.app.ActivityThread.main(ActivityThread.java)

    at java.lang.reflect.Method.invokeNative(Native Method)

    at java.lang.reflect.Method.invoke(Method.java:515)

    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)

    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)

    at dalvik.system.NativeStart.main(Native Method)

    On the other hand, if I replace the line in xml
    <PreferenceScreen android:title="@string/toast_animation_title" android:key="toast_animation" android:fragment="com.android.settings.cyanogenmod.ToastSettings" />

    with

    <PreferenceScreen android:title="@string/toast_animation_title" android:key="toast_animation" android:fragment="com.android.settings.cyanogenmod.animations.ToastAnimationInterfaceSettings" /> ,the FC is gone, but no effect is applied.
    I'll keep on trying, thanks for your time


    change smali on .jar,, with this
    and change id's
    1
    on const-string v8, "Test toast animation" change to const-string v8, "test_toast_animation" save and recompile
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone