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

朋友圈图片显示大图时,如果图片加载不出或者图片链接不存在时,点击返回键无效 #41

Closed
fantasticlw opened this issue Mar 5, 2017 · 2 comments

Comments

@fantasticlw
Copy link

朋友圈图片显示大图时,如果图片加载不出或者图片链接不存在试,点击返回键无效,无法返回,你可以放一个不存在的图片链接试试

@razerdp
Copy link
Owner

razerdp commented Mar 5, 2017

@112721933

谢谢反馈,已经修复了(push到了main-dev分支,迟点合并到主分支)

这次的问题出现在GalleryPhotoViewplayExitAnimaInternal()方法中

在该方法中我有两个判断:

    private void playExitAnimaInternal(final Rect to, @Nullable View alphaView) {
        if (isPlayingEnterAnima || to == null || mAttacher == null) {
            return;
        }

 ...略
        if (drawableBounds == null) {
            return;
        }

 ...略

    }

其中第一行的return基本不会出现,问题在于第二个return

如您所说,当图片无法加载,意味着drawableBounds 为null,此时直接被我return了,这导致了PhotoBrowseActivityfinish()里的currentPhotoView无法回调到onExitAnimaEnd(),也就无法finish当前activity了

解决方法就是在return之前添加上回调,或者finish里最后一行添加super.finish()以保证finish绝对成功执行,我采取的是前者。

谢谢您的反馈-V-

razerdp added a commit that referenced this issue Mar 5, 2017
@razerdp
Copy link
Owner

razerdp commented Mar 5, 2017

如果没什么问题,该issue由你关闭了哦

@razerdp razerdp closed this as completed in d1b9bbb Mar 8, 2017
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