[Sprint Galaxy S 5 Themes and Apps] tdunham:
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.

.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:

[COLOR="Red"].method endFling()V
[/COLOR]
[COLOR="Blue"].method endFling(Z)V[/COLOR]

Add new method right above the newly renamed method:

.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.

.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.

.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

.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.

# 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.

.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

.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

.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.

.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.

.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.

.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.

.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.

.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)

.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

.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

.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 [MENTION=5204709]Adi Aisiteru Reborn[/MENTION] for the original thread HERE

also credit to [MENTION=5056266]lacoursiere18[/MENTION] for the updated KitKat guide HERE