From 9b637ba1392d21f86f3964adb3889bbf8df32465 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 25 Feb 2012 13:27:57 +0300 Subject: [PATCH] enable transitions for API 15, remove TransitionHelper --- src/org/fox/ttrss/MainActivity.java | 6 ++++-- src/org/fox/ttrss/OfflineActivity.java | 6 ++++-- src/org/fox/ttrss/TransitionHelper.java | 12 ------------ 3 files changed, 8 insertions(+), 16 deletions(-) delete mode 100644 src/org/fox/ttrss/TransitionHelper.java diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index 7ec8ffd2..e1aece8c 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Timer; import java.util.TimerTask; +import android.animation.LayoutTransition; import android.app.AlertDialog; import android.app.Dialog; import android.content.BroadcastReceiver; @@ -482,8 +483,9 @@ public class MainActivity extends FragmentActivity implements OnlineServices { Log.d(TAG, "m_compatMode=" + m_compatMode); if (!m_compatMode) { - if (android.os.Build.VERSION.SDK_INT < 14) { - new TransitionHelper((ViewGroup) findViewById(R.id.main)); + if (android.os.Build.VERSION.SDK_INT < 14 || android.os.Build.VERSION.SDK_INT == 15) { + LayoutTransition transitioner = new LayoutTransition(); + ((ViewGroup) findViewById(R.id.main)).setLayoutTransition(transitioner); } m_headlinesActionModeCallback = new HeadlinesActionModeCallback(); diff --git a/src/org/fox/ttrss/OfflineActivity.java b/src/org/fox/ttrss/OfflineActivity.java index 400ce9e4..087a9758 100644 --- a/src/org/fox/ttrss/OfflineActivity.java +++ b/src/org/fox/ttrss/OfflineActivity.java @@ -2,6 +2,7 @@ package org.fox.ttrss; import org.fox.ttrss.OnlineServices.RelativeArticle; +import android.animation.LayoutTransition; import android.app.AlertDialog; import android.app.Dialog; import android.app.NotificationManager; @@ -131,8 +132,9 @@ public class OfflineActivity extends FragmentActivity implements Log.d(TAG, "m_compatMode=" + m_compatMode); if (!m_compatMode) { - if (android.os.Build.VERSION.SDK_INT < 14) { - new TransitionHelper((ViewGroup) findViewById(R.id.main)); + if (android.os.Build.VERSION.SDK_INT < 14 || android.os.Build.VERSION.SDK_INT == 15) { + LayoutTransition transitioner = new LayoutTransition(); + ((ViewGroup) findViewById(R.id.main)).setLayoutTransition(transitioner); } m_headlinesActionModeCallback = new HeadlinesActionModeCallback(); diff --git a/src/org/fox/ttrss/TransitionHelper.java b/src/org/fox/ttrss/TransitionHelper.java deleted file mode 100644 index 569d15b7..00000000 --- a/src/org/fox/ttrss/TransitionHelper.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.fox.ttrss; - -import android.animation.LayoutTransition; -import android.view.ViewGroup; -import android.widget.LinearLayout; - -public class TransitionHelper { - public TransitionHelper(ViewGroup layout) { - LayoutTransition transitioner = new LayoutTransition(); - layout.setLayoutTransition(transitioner); - } -}