Disable fade-in effect on images in Android 2.3

This should fix the flickering problem during updates, though it
won't look quite as nice when scrolling the contribs list.
This commit is contained in:
Brion Vibber 2013-04-29 07:56:24 -07:00
parent 06ba377eb0
commit e5f38ab6d2

View file

@ -92,8 +92,15 @@ public class Utils {
public static DisplayImageOptions.Builder getGenericDisplayOptions() {
if(defaultImageOptionsBuilder == null) {
defaultImageOptionsBuilder = new DisplayImageOptions.Builder().cacheInMemory()
.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
.displayer(new FadeInBitmapDisplayer(300))
.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// List views flicker badly during data updates on Android 2.3; we
// haven't quite figured out why but cells seem to be rearranged oddly.
// Disable the fade-in on 2.3 to reduce the effect.
defaultImageOptionsBuilder = defaultImageOptionsBuilder
.displayer(new FadeInBitmapDisplayer(300));
}
defaultImageOptionsBuilder = defaultImageOptionsBuilder
.cacheInMemory()
.resetViewBeforeLoading();
}