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

【BUG反馈】CustomDialog dismiss()在Android 13上闪一下 #280

Closed
Dormxb opened this issue Mar 1, 2023 · 5 comments
Closed

【BUG反馈】CustomDialog dismiss()在Android 13上闪一下 #280

Dormxb opened this issue Mar 1, 2023 · 5 comments
Labels
bug Something isn't working 等待反馈 存疑或问题需要进一步确认

Comments

@Dormxb
Copy link

Dormxb commented Mar 1, 2023

BUG 反馈

请先确认您已阅读《常见问题》

问题描述:

CustomDialog 在使用自定义动画时dismiss(),画面会闪一下
Ps: 使用Android 10设备执行相同的动画代码,是正常dismiss,不会闪
自定义代码如下

anim_right_in.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
        android:duration="200"
        android:fromXDelta="100%p"
        android:toXDelta="0"/>
    <alpha
        android:duration="200"
        android:fromAlpha="0.0"
        android:toAlpha="1.0"/>
</set>

anim_right_out.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
        android:duration="200"
        android:fromXDelta="0"
        android:toXDelta="100%p"/>
    <alpha
        android:duration="200"
        android:fromAlpha="1.0"
        android:toAlpha="0.0"/>
</set>

调用

setAnimResId(R.anim.anim_right_in, R.anim.anim_right_out)

设备信息:

Samsung S23 Ultra (Android 13)

是否在 Demo 中能复现此问题?

问题截图/视频

3.1.mp4
@Dormxb Dormxb added the bug Something isn't working label Mar 1, 2023
@kongzue kongzue added the 待处理 已收到,待处理 label Mar 1, 2023
@kongzue
Copy link
Owner

kongzue commented Mar 4, 2023

已测试,未能在最新版本中复现此问题,请更新至0.0.48.beta12版本后再试

device-2023-03-04-112915.mp4

测试设备:Google Pixel5 with Android 13

@kongzue kongzue added 等待反馈 存疑或问题需要进一步确认 and removed 待处理 已收到,待处理 labels Mar 4, 2023
@Dormxb
Copy link
Author

Dormxb commented Mar 7, 2023

使用 0.0.48.beta13版本 问题依旧
怀疑点

  1. 与系统自适应刷新率有关,更改为标准 60Hz刷新率模式,问题依旧
  2. 与OneUI 5.1 本身兼容性相关
  3. 使用 Google Pixel4a with Android 13 未出现以上问题

总结
与OneUI 5.1 本身兼容性有关的概率极高(但是由于我这边只有一台OneUI 5.1 Android 13的设备,无法进行其他版本OneUI的测试),可以等待OneUI后续更新,我这边再做测试

辛苦

@Dormxb Dormxb closed this as completed Mar 7, 2023
@kongzue
Copy link
Owner

kongzue commented Mar 7, 2023

你可以尝试在自定义动画的根标签 <set/> 下加入设置 android:fillAfter="true" 看看能否解决问题。
CustomDialog 关于关闭动画的控制代码在 CustomDialog.java:505 你也可以通过自定义 DialogXAnimInterface 来控制全部的入场和出场动画流程,具体 请参考文档《高阶扩展用法 - 完全自定义开启、关闭动画》

@Dormxb
Copy link
Author

Dormxb commented Mar 7, 2023

好的

@Dormxb
Copy link
Author

Dormxb commented Mar 7, 2023

通过添加 android:fillAfter="true" 解决了 (^o^)/
感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 等待反馈 存疑或问题需要进一步确认
Projects
None yet
Development

No branches or pull requests

2 participants