From c364d9f2de28f79c636fcb145c355da52f52b7ad Mon Sep 17 00:00:00 2001 From: John Hoford Date: Tue, 12 Feb 2013 09:05:39 -0800 Subject: [PATCH] remove animations if before Jelly Bean Change-Id: Ifb60390f513f60af2875cbc2218fdc185752e9b2 --- res/layout/filtershow_activity.xml | 1 - .../gallery3d/filtershow/FilterShowActivity.java | 8 ++++++ .../gallery3d/filtershow/PanelController.java | 29 +++++++++++++++------- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/res/layout/filtershow_activity.xml b/res/layout/filtershow_activity.xml index e42839b03..20b0ece7e 100644 --- a/res/layout/filtershow_activity.xml +++ b/res/layout/filtershow_activity.xml @@ -52,7 +52,6 @@ android:id="@+id/mainPanel" android:layout_width="match_parent" android:layout_height="match_parent" - android:layerType="hardware" android:orientation="vertical" > = android.os.Build.VERSION_CODES.JELLY_BEAN) { + return true; + } + return false; } public void setFixedAspect(boolean t) { @@ -205,12 +209,16 @@ public class PanelController implements OnClickListener { mView.setY(0); int h = mRowPanel.getHeight(); anim.y(-h); - anim.setDuration(ANIM_DURATION).withLayer().withEndAction(new Runnable() { - @Override - public void run() { - mView.setVisibility(View.GONE); - } - }); + if (PanelController.useAnimations()) { + anim.setDuration(ANIM_DURATION).withLayer().withEndAction(new Runnable() { + @Override + public void run() { + mView.setVisibility(View.GONE); + } + }); + } else { + mView.setVisibility(View.GONE); + } mSelected = false; return anim; } @@ -221,10 +229,13 @@ public class PanelController implements OnClickListener { mView.setX(0); mView.setY(-h); updateText(); + mSelected = true; ViewPropertyAnimator anim = mView.animate(); anim.y(0); - anim.setDuration(ANIM_DURATION).withLayer(); - mSelected = true; + anim.setDuration(ANIM_DURATION); + if (PanelController.useAnimations()) { + anim.withLayer(); + } return anim; } -- 2.11.0