-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
滑动返回触发后,又取消滑动返回,退出动画会失效 #192
Comments
R.anim.tran_enter_out代码: ![image](https://user-images.githubusercontent.com/23522084/72498228-b0f83700-3869-11ea-8420-ce4918959404.png) R.anim.tran_exit_out代码: ![image](https://user-images.githubusercontent.com/23522084/72498262-c8372480-3869-11ea-982f-2c1853e7c483.png)第一个楼层的代码被吞掉了,我又补发了一下代码,顺带截图了,如果还被吞掉,就只能参考代码截图了 |
这个解决没 |
取消滑动返回时,将activity 设置回不透明即可解决 注意只有当Activity使用了非窗口透明的主题时才这么做,通过以下代码判断: /**
* Determines whether the current Window is translucent or floating by default, according to
* the {@link android.R.attr#windowIsFloating} and {@link android.R.attr#windowIsTranslucent}
* attributes set in its theme.
*/
public static boolean isWindowTranslucentOrFloatingTheme(Window window) {
try {
@SuppressLint("PrivateApi")
Class<?> styleableClass =
window.getContext().getClassLoader()
.loadClass("com.android.internal.R$styleable");
return getWindowStyleBoolean(window, styleableClass, "Window_windowIsTranslucent", false)
|| getWindowStyleBoolean(window, styleableClass, "Window_windowIsFloating", false);
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
private static boolean getWindowStyleBoolean(
Window window,
Class<?> styleableClass,
String attrIndexName,
@SuppressWarnings("SameParameterValue") boolean defValue) throws Exception {
return window
.getWindowStyle()
.getBoolean(styleableClass.getField(attrIndexName).getInt(styleableClass), defValue);
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
版本是:
R.anim.tran_exit_out代码: 如果触发侧滑返回(从左边向右轻微拖动,然后再取消)只有R.anim.tran_exit_out的代码块会被执行到,R.anim.tran_enter_out不会执行,如果不触发侧滑返回,则两个都会执行到 测试环境: oppoR15真机,模拟器都会必现me.imid.swipebacklayout.lib:library:1.3.0
退出的动画:
@OverRide
public void finish() {
super.finish();
overridePendingTransition(R.anim.tran_enter_out, R.anim.tran_exit_out);
}
R.anim.tran_enter_out代码:
The text was updated successfully, but these errors were encountered: