Commit 4972db66 by 郭倩芳

相册 预览

parent a550d96c
...@@ -31,5 +31,13 @@ public class SobotMediaLoader implements AlbumLoader { ...@@ -31,5 +31,13 @@ public class SobotMediaLoader implements AlbumLoader {
SobotBitmapUtil.display(imageView.getContext(), uri, imageView); SobotBitmapUtil.display(imageView.getContext(), uri, imageView);
} }
} }
public static void loadImg(ImageView imageView, AlbumFile albumFile) {
if (albumFile != null) {
if (albumFile.getUri() != null) {
SobotBitmapUtil.display(imageView.getContext(), albumFile.getUri() , imageView);
} else {
SobotBitmapUtil.display(imageView.getContext(), albumFile.getPath(), imageView);
}
}
}
} }
\ No newline at end of file
...@@ -17,6 +17,7 @@ package com.sobot.album.app.preview; ...@@ -17,6 +17,7 @@ package com.sobot.album.app.preview;
import android.app.Activity; import android.app.Activity;
import android.net.Uri; import android.net.Uri;
import android.os.Handler;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.Spanned; import android.text.Spanned;
import android.text.style.ForegroundColorSpan; import android.text.style.ForegroundColorSpan;
...@@ -124,7 +125,13 @@ public class PreviewView<Data> extends Contract.GalleryView<Data> implements Vie ...@@ -124,7 +125,13 @@ public class PreviewView<Data> extends Contract.GalleryView<Data> implements Vie
@Override @Override
public void setCurrentItem(int position) { public void setCurrentItem(int position) {
mViewPager.setCurrentItem(position); new Handler().post(new Runnable() {
@Override
public void run() {
mViewPager.setCurrentItem(position);
}
});
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment