当前位置: 首页>>代码示例>>Java>>正文


Java PhotoView类代码示例

本文整理汇总了Java中com.bm.library.PhotoView的典型用法代码示例。如果您正苦于以下问题:Java PhotoView类的具体用法?Java PhotoView怎么用?Java PhotoView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PhotoView类属于com.bm.library包,在下文中一共展示了PhotoView类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initData

import com.bm.library.PhotoView; //导入依赖的package包/类
private void initData(){
    image = (PhotoView) findViewById(R.id.source_img);
    image.enable();
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setTitle(R.string.text_image);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    layoutParams = new LayoutParams(ScreenUtil.getScreenWidth(), ScreenUtil.getScreenHeight()-toolbar.getHeight());

    Intent intent = getIntent();
    image.setImageBitmap(getBitmapFromUri(Uri.parse(intent.getStringExtra(getString(R.string.id_image_uri)))));
    image.setLayoutParams(layoutParams);
}
 
开发者ID:Brioal,项目名称:MultiImageChooser-master,代码行数:20,代码来源:ImageDetailsActivity.java

示例2: instantiateItem

import com.bm.library.PhotoView; //导入依赖的package包/类
@Override
public Object instantiateItem(ViewGroup container, int position) {
    View view = LayoutInflater.from(container.getContext()).inflate(R.layout.layout_image_browser, null);
    mPhotoView = (PhotoView) view.findViewById(R.id.mPhotoView);
    tv_progress = (TextView) view.findViewById(R.id.tv_progress);
    mPhotoView.enable();
    String url = list.get(position);
    if (SharePrefUtil.getBoolean(context, "load_hd_pic", false)) {
        url = url.replace("thumbnail", "large");
        LogUtils.i("原图尺寸图片地址 :" + url);
    } else {
        url = url.replace("thumbnail", "bmiddle");
        LogUtils.i("中等尺寸图片地址 :" + url);
    }
    imageLoader.displayImage(url, mPhotoView, options, listener, onProgressListener);
    container.addView(view);
    return view;
}
 
开发者ID:yuqirong,项目名称:Koku,代码行数:19,代码来源:ImagePagerAdapter.java

示例3: onCreateView

import com.bm.library.PhotoView; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    //Log.d("onCeatedView",currentPage+"-onCeatedView");

    View view = inflater.inflate(R.layout.comic_photo_view,container,false);
    comicPhotoView = (PhotoView) view.findViewById(R.id.pv_comic_read);
    llLoadingProgress = (LinearLayout) view.findViewById(R.id.ll_loading_progress);
    llLoadingFailed = (LinearLayout) view.findViewById(R.id.ll_loading_failed);
    btLoadingFailed = (Button) view.findViewById(R.id.bt_loading_fail);
    tvLoadingCurrentPage = (TextView) view.findViewById(R.id.tv_loading_currentpage);
    pbLoadingProgress = (RoundProgressBarWithNumber) view.findViewById(R.id.pb_loading_progress);
    return view;
}
 
开发者ID:NicoLiutong,项目名称:miaosou,代码行数:15,代码来源:ComicReadFragment.java

示例4: saveImage

import com.bm.library.PhotoView; //导入依赖的package包/类
@Override
public void saveImage(final PhotoView photoViewTemp) {
    if (photoViewTemp != null) {
        GlideBitmapDrawable glideBitmapDrawable = (GlideBitmapDrawable) photoViewTemp.getDrawable();
        if (glideBitmapDrawable == null) {
            return;
        }
        Bitmap bitmap = glideBitmapDrawable.getBitmap();
        if (bitmap == null) {
            return;
        }
        mView.startLoading();
        FileUtils.saveImage(photoViewTemp.getContext(), bitmap, new FileUtils.SaveResultCallback() {
            @Override
            public void onSavedSuccess() {
                photoViewTemp.post(new Runnable() {
                    @Override
                    public void run() {
                        mView.stopLoading();
                        mView.onSaveImageSucceed();
                    }
                });
            }

            @Override
            public void onSavedFailed() {
                photoViewTemp.post(new Runnable() {
                    @Override
                    public void run() {
                        mView.stopLoading();
                        mView.onSaveImageFailed("保存失败");
                    }
                });
            }
        });
    }
}
 
开发者ID:mzlogin,项目名称:guanggoo-android,代码行数:38,代码来源:ViewImagePresenter.java

示例5: initPhotoView

import com.bm.library.PhotoView; //导入依赖的package包/类
public void initPhotoView(){
		photoView = (PhotoView) findViewById(R.id.img);
// 启用图片缩放功能
		photoView.enable();
// 禁用图片缩放功能 (默认为禁用,会跟普通的ImageView一样,缩放功能需手动调用enable()启用)
//		photoView.disenable();
	}
 
开发者ID:gtf35,项目名称:easyShopping,代码行数:8,代码来源:PhotoView.java

示例6: instantiateItem

import com.bm.library.PhotoView; //导入依赖的package包/类
@Override
public Object instantiateItem(ViewGroup container, int position) {
    PhotoView view = new PhotoView(ImageBrowserActivity.this);
    view.enable();
    view.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
    Glide.with(ImageBrowserActivity.this)
            .load(mList.get(position).getPath())
            .crossFade()
            .into(view);
    container.addView(view);
    return view;
}
 
开发者ID:fishwjy,项目名称:MultiType-FilePicker,代码行数:13,代码来源:ImageBrowserActivity.java

示例7: loadImage

import com.bm.library.PhotoView; //导入依赖的package包/类
public void loadImage(String url, PhotoView photoView) {
    Glide.with(this).load(url).diskCacheStrategy(DiskCacheStrategy.SOURCE).into(photoView);
}
 
开发者ID:GcsSloop,项目名称:diycode,代码行数:4,代码来源:ImageActivity.java

示例8: saveImage

import com.bm.library.PhotoView; //导入依赖的package包/类
/**
 * 保存图片
 * @param photoViewTemp 展示图片的控件
 */
void saveImage(PhotoView photoViewTemp);
 
开发者ID:mzlogin,项目名称:guanggoo-android,代码行数:6,代码来源:ViewImageContract.java


注:本文中的com.bm.library.PhotoView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。