mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
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:
parent
06ba377eb0
commit
e5f38ab6d2
1 changed files with 9 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue