Performance improvements new artist detail
This commit is contained in:
parent
1bf584e638
commit
0de409a459
16 changed files with 224 additions and 188 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue