本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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("保存失败");
}
});
}
});
}
}
示例5: initPhotoView
import com.bm.library.PhotoView; //导入依赖的package包/类
public void initPhotoView(){
photoView = (PhotoView) findViewById(R.id.img);
// 启用图片缩放功能
photoView.enable();
// 禁用图片缩放功能 (默认为禁用,会跟普通的ImageView一样,缩放功能需手动调用enable()启用)
// photoView.disenable();
}
示例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;
}
示例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);
}
示例8: saveImage
import com.bm.library.PhotoView; //导入依赖的package包/类
/**
* 保存图片
* @param photoViewTemp 展示图片的控件
*/
void saveImage(PhotoView photoViewTemp);