From 636ddc362369c7658ea40bb3f9e488db902f6408 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 16 Oct 2014 12:32:14 +0400 Subject: [PATCH] fadein animation for flavor images --- src/org/fox/ttrss/HeadlinesFragment.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index f8b67125..f58e0a0b 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -18,6 +18,7 @@ import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; +import android.animation.ObjectAnimator; import android.app.Activity; import android.content.Context; import android.content.Intent; @@ -855,8 +856,18 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, View arg1, Bitmap arg2) { // TODO Auto-generated method stub - if (arg2.getWidth() > 128 && arg2.getHeight() > 128) + if (!isAdded()) return; + + if (arg2.getWidth() > 128 && arg2.getHeight() > 128) { + + if (!m_activity.isCompatMode()) { + ObjectAnimator anim = ObjectAnimator.ofFloat(flavorImage, "alpha", 0f, 1f); + anim.setDuration(500); + anim.start(); + } + flavorImage.setVisibility(View.VISIBLE); + } } @Override