public final class PreviewBuilder
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PreviewBuilder.IndicatorType
指示器类型
|
| Modifier and Type | Method and Description |
|---|---|
static PreviewBuilder |
from(android.app.Activity activity)
设置开始启动预览
|
static PreviewBuilder |
from(Fragment fragment)
设置开始启动预览
|
PreviewBuilder |
setCurrentIndex(int currentIndex)
设置默认索引
|
PreviewBuilder |
setDrag(boolean isDrag)
设置图片禁用拖拽返回
|
PreviewBuilder |
setDrag(boolean isDrag,
float sensitivity)
设置图片禁用拖拽返回
|
PreviewBuilder |
setDuration(int setDuration)
设置动画的时长
|
PreviewBuilder |
setFullscreen(boolean isFullscreen)
设置是否全屏
|
<E extends IPreviewInfo> |
setImg(E imgUrl)
设置单个图片数据源
|
<T extends IPreviewInfo> |
setImgs(java.util.List<T> imgUrls)
设置图片数据源
|
PreviewBuilder |
setOnVideoPlayerListener(OnVideoClickListener listener)
设置是怕你点击播放回调
|
PreviewBuilder |
setPhotoFragment(java.lang.Class<? extends BasePhotoFragment> className)
设置图片预览fragment
|
PreviewBuilder |
setProgressColor(int progressColorId)
设置图片预加载的进度条颜色
|
PreviewBuilder |
setSingleFling(boolean isSingleFling)
设置超出内容点击退出(黑色区域)
|
PreviewBuilder |
setSingleShowType(boolean isShow)
是否设置为一张图片时 显示指示器 默认显示
|
PreviewBuilder |
setType(PreviewBuilder.IndicatorType indicatorType)
设置指示器类型
|
void |
start()
启动
|
PreviewBuilder |
to(java.lang.Class<? extends PreviewActivity> className)
自定义预览activity 类名
|
public static PreviewBuilder from(android.app.Activity activity)
activity - 启动界面public static PreviewBuilder from(Fragment fragment)
fragment - 启动界面public PreviewBuilder to(java.lang.Class<? extends PreviewActivity> className)
className - 继承PreviewActivitypublic <T extends IPreviewInfo> PreviewBuilder setImgs(java.util.List<T> imgUrls)
T - imgUrls - 数据public <E extends IPreviewInfo> PreviewBuilder setImg(E imgUrl)
E - 你的实体类类型imgUrl - 数据public PreviewBuilder setPhotoFragment(java.lang.Class<? extends BasePhotoFragment> className)
className - 你的Fragment类public PreviewBuilder setCurrentIndex(int currentIndex)
currentIndex - 数据public PreviewBuilder setType(PreviewBuilder.IndicatorType indicatorType)
indicatorType - 枚举public PreviewBuilder setProgressColor(int progressColorId)
progressColorId - 进度条的颜色资源IDpublic PreviewBuilder setDrag(boolean isDrag)
isDrag - true 可以 false 默认 truepublic PreviewBuilder setDrag(boolean isDrag, float sensitivity)
isDrag - true 可以 false 默认 truesensitivity - sensitivity mMaxTransScale 的值来控制灵敏度。public PreviewBuilder setSingleShowType(boolean isShow)
isShow - true 显示 false 不显示public PreviewBuilder setSingleFling(boolean isSingleFling)
isSingleFling - true 可以 falsepublic PreviewBuilder setDuration(int setDuration)
setDuration - 单位毫秒public PreviewBuilder setFullscreen(boolean isFullscreen)
isFullscreen - 单位毫秒public PreviewBuilder setOnVideoPlayerListener(OnVideoClickListener listener)
public void start()