Performance improvements new artist detail

This commit is contained in:
Karim Abou Zeid 2015-03-15 18:12:21 +01:00
commit 0de409a459
16 changed files with 224 additions and 188 deletions

View file

@ -6,9 +6,11 @@ import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.PathInterpolator;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
/**
* Created by karim on 06.12.14.
@ -95,4 +97,16 @@ public class ViewUtil {
}
});
}
public static void animateTextViewMaxLines(TextView text, int maxLines) {
try {
ObjectAnimator animation = ObjectAnimator.ofInt(text, "maxLines", maxLines);
animation.setInterpolator(new AccelerateInterpolator());
animation.setDuration(200);
animation.start();
} catch (Exception e) {
// Some devices crash at runtime when using the ObjectAnimator
text.setMaxLines(maxLines);
}
}
}