Search in sources :

Example 1 with PhotoView

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();
}
Also used : ImageConfig(org.aisen.android.component.bitmaploader.core.ImageConfig) DefaultDisplayer(org.aisen.android.component.bitmaploader.display.DefaultDisplayer) AttacherInterface(org.aisen.weibo.sina.ui.widget.photoview.AttacherInterface) WaveView(org.aisen.weibo.sina.ui.widget.WaveView) PhotoView(org.aisen.weibo.sina.ui.widget.photoview.PhotoView) View(android.view.View) File(java.io.File)

Aggregations

View (android.view.View)1 File (java.io.File)1 ImageConfig (org.aisen.android.component.bitmaploader.core.ImageConfig)1 DefaultDisplayer (org.aisen.android.component.bitmaploader.display.DefaultDisplayer)1 WaveView (org.aisen.weibo.sina.ui.widget.WaveView)1 AttacherInterface (org.aisen.weibo.sina.ui.widget.photoview.AttacherInterface)1 PhotoView (org.aisen.weibo.sina.ui.widget.photoview.PhotoView)1