Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

进入时会旋转 #206

Open
wammy-h opened this issue Feb 13, 2025 · 9 comments
Open

进入时会旋转 #206

wammy-h opened this issue Feb 13, 2025 · 9 comments

Comments

@wammy-h
Copy link

wammy-h commented Feb 13, 2025

ImagePreview
.getInstance()
.with(activity)
.setIndex(position)
.setMediaInfoList(urlList)
// 加载策略,默认为手动模式:默认普清,点击按钮再加载原图;会根据原图、缩略图url是否一样来判断是否显示查看原图按钮
.setLoadStrategy(ImagePreview.LoadStrategy.AlwaysThumb)
// 长图的展示模式,默认是缩小到内部居中,可选撑满屏幕:
.setLongPicDisplayMode(ImagePreview.LongPicDisplayMode.Default)
// 保存的文件夹名称,会在(Pictures/Movies)目录进行文件夹的新建。
.setFolderName("livechat")
// 缩放动画时长,单位ms
.setZoomTransitionDuration(300)
// 是否显示加载失败的Toast
.setShowErrorToast(false)
// 是否启用点击图片关闭。默认启用
.setEnableClickClose(true)
// 是否启用下拉关闭。默认启用
.setEnableDragClose(true)
// 是否启用上拉关闭。默认启用
.setEnableUpDragClose(true)
// 是否忽略缩放启用拉动关闭。默认忽略
.setEnableDragCloseIgnoreScale(true)
// 是否显示关闭页面按钮,在页面左下角。默认不显示
.setShowCloseButton(false)
// 设置关闭按钮图片资源,可不填,默认为库中自带:R.drawable.ic_action_close
.setCloseIconResId(R.drawable.ic_action_close)
// 设置关闭按钮背景shape
.setCloseIconBackgroundResId(R.drawable.shape_indicator_bg)
// 是否显示下载按钮,在页面右下角。默认显示
.setShowDownButton(false)
// 设置下载按钮图片资源,可不填,默认为库中自带:R.drawable.icon_download_new
.setDownIconResId(R.drawable.icon_download_new)
// 设置下载按钮背景shape
.setDownIconBackgroundResId(R.drawable.shape_indicator_bg)
// 设置是否显示顶部的指示器(1/9)默认显示
.setShowIndicator(true)
// 设置顶部指示器背景shape,默认自带灰色圆角shape
.setIndicatorShapeResId(R.drawable.shape_indicator_bg)
// 设置失败时的占位图,默认为库中自带R.drawable.load_failed,设置为 0 时不显示
.setErrorPlaceHolder(R.mipmap.error_picture)
// 内置下载过程回调,可自定义toast。如果不设置此回调会使用默认的toast内容,反之,设置了此回调时不会展示默认toast
.setDownloadListener(new OnDownloadListener() {
@OverRide
public void onDownloadStart(@nonnull Activity activity, int position) {
// 此处可以设置自己的开始下载的toast,仅仅在使用内置下载时失效
}

                @Override
                public void onDownloadSuccess(@NonNull Activity activity, int position) {
                    // 此处可以设置自己的下载成功的toast,仅仅在使用内置下载时失效
                }

                @Override
                public void onDownloadFailed(@NonNull Activity activity, int position) {
                    // 此处可以设置自己的下载失败的toast,仅仅在使用内置下载时失效
                }
            })
            // 长按图片回调
            .setBigImageLongClickListener(new OnBigImageLongClickListener() {
                @Override
                public boolean onLongClick(@NonNull Activity activity, @NonNull View view, int position) {
                    // ...请使用该方法提供的activity,否则弹窗会被覆盖

                    return true;
                }
            })
            // 开启预览
            .start();

配置如下

@SherlockGougou
Copy link
Owner

问题是什么呢?

@wammy-h
Copy link
Author

wammy-h commented Feb 13, 2025

问题是什么呢?
按照上面的配置点击图片打开预览时 预览页面会逆时针旋转大概45度 这个时哪里来的动画吗

@SherlockGougou
Copy link
Owner

可否录个屏看看呢?

@wammy-h
Copy link
Author

wammy-h commented Feb 13, 2025

可否录个屏看看呢?

ddf03c463cba43f9aad1c9e7640f0599.mp4

@SherlockGougou
Copy link
Owner

你在这个手机上面直接运行demo看看呢?

@wammy-h
Copy link
Author

wammy-h commented Feb 13, 2025

你在这个手机上面直接运行demo看看呢?

扫码的demo没有这个问题

@SherlockGougou
Copy link
Owner

手机设置自动旋转了吗?

@wammy-h
Copy link
Author

wammy-h commented Feb 13, 2025

手机设置自动旋转了吗?

没有 方向锁定了

@wammy-h
Copy link
Author

wammy-h commented Feb 13, 2025

Image是不是它的原因

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants