use of org.aisen.weibo.sina.ui.widget.photoview.PhotoView in project AisenWeiBo by wangdan.
the class WallpaperSettingActivity method setupPhotoView.
private void setupPhotoView(Bundle savedInstanceState) {
photoView.setOnPhotoTapListener(new AttacherInterface.OnPhotoTapListener() {
@Override
public void onPhotoTap(View view, float x, float y) {
finish();
}
});
if (getIntent().getExtras().containsKey(Intent.EXTRA_STREAM)) {
thumbFile = new File(getPath((Uri) getIntent().getParcelableExtra(Intent.EXTRA_STREAM)));
origURL = getIntent().getExtras().getString("origURL");
if (!TextUtils.isEmpty(origURL)) {
Logger.d("Wallpaper", origURL);
origFile = BitmapLoader.getInstance().getCacheFile(origURL);
WallpaperDownloadTask.bindWallpaper(this, origURL, KeyGenerator.generateMD5(origURL), this);
}
if (getFile().exists()) {
ImageConfig config = new ImageConfig();
config.setLoadfaildRes(R.drawable.bg_timeline_loading);
config.setLoadingRes(R.drawable.bg_timeline_loading);
config.setDownloaderClass(SdcardDownloader.class);
config.setDisplayer(new DefaultDisplayer());
BitmapLoader.getInstance().display(null, getFile().getAbsolutePath(), photoView, config);
return;
}
}
finish();
}
Aggregations