openaphid / android-flip

A component for flip animation on Android, which is similar to the effect in Flipboard iPhone/Android
http://openaphid.github.com/
2.84k stars 1.25k forks source link

Problem when using flipView with Imageloader #27

Closed hoangpn412 closed 11 years ago

hoangpn412 commented 11 years ago

I'm using ImageLoader 1.5.7 When I'm a first page: I try to flip it to top, the problem is:

If I add ImageLoader setting: .withCacheManager(new LruBitmapCache(this)) then: The ImageView set to default image before set true image.

You can add .withCacheManager(new LruBitmapCache(this)) to settings in FlipAsyncContentActivity to test !

I want to use cache memory but the problem is fix. Can you help me !

Thanks !

openaphid commented 11 years ago

This issue is a bit related to #29, but it's actually not a bug of FlipView.

When bouncing ends, FlipView invokes setSelection(), which finally makes the adapter to get a view.

The line inside getView() is the root cause of the visual glitch:

FlipAsyncContentActivity.getImageManager().getLoader().load(photoView);

In order to prove my point, I made a minimal app, in which the ImageView always displays the default image first and then switches to the actual image.

https://www.dropbox.com/s/y4mudczmjz9smrr/Issue27_ImageLoaderTest.zip

ImageLoader is only used in FlipView demo app for demonstration purpose. I'm not familiar with its APIs. I will replace it with other lightweight solutions.

hoangpn412 commented 11 years ago

Thank you,

When you have solution, send it to me pls.