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

楼主,发现问题:侧滑关闭后,toolbar位置会有灰色方块 闪烁一下 #39

Open
ximencx opened this issue Sep 10, 2016 · 9 comments

Comments

@ximencx
Copy link

ximencx commented Sep 10, 2016

如题

@Jude95
Copy link
Owner

Jude95 commented Sep 10, 2016

那是你的你的Activity关闭动画加上statusbar的背景吧。改一下动画或将statusbar改为可绘

@ximencx
Copy link
Author

ximencx commented Sep 11, 2016

楼主下面这段是框架activity的主题,关闭activity并没有设置动画,是找错地方了么?谢谢
`<style name="AppTheme.swipebacklayout" parent="Base.Theme.normal">
false
true
true
@style/SlideRightAnimation

</style>`

<style name="Base.Theme.normal" parent="Theme.AppCompat.Light.NoActionBar"> <!-- for library use when is in night theme--> <item name="themeColorSecondary">@color/theme_color_secondary</item> <item name="android:windowBackground">@color/window_background</item> <item name="android:textColorPrimary">@color/text_primary_color</item> </style>

@ximencx
Copy link
Author

ximencx commented Sep 11, 2016

重新贴下代码 ,上面有点乱,swipebackactivity的主题

<style name="Base.Theme.normal" parent="Theme.AppCompat.Light.NoActionBar"> <!-- for library use when is in night theme--> <item name="themeColorSecondary">@color/theme_color_secondary</item> <item name="android:windowBackground">@color/window_background</item> <item name="android:textColorPrimary">@color/text_primary_color</item> </style>

<style name="AppTheme.swipebacklayout" parent="Base.Theme.normal"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowAnimationStyle">@style/SlideRightAnimation</item> </style>

@Jude95
Copy link
Owner

Jude95 commented Sep 19, 2016

我也遇到过style定义的动画无效的情况。你的情况应该就是关闭动画的问题。你能自己分析下吗,顺便求结果。

@ximencx
Copy link
Author

ximencx commented Sep 25, 2016

楼主,这个问题原因没找到。
经过在日活5k的app测试,侧拉框架有时会报这个异常,每天后台会有10个,定位不到问题。
java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true

@Paul-KK
Copy link

Paul-KK commented Dec 31, 2016

你这个问题应该和作者说的问题一样,这个是因为这个库插入的layout不包含StatusBar那一块区域,所以当你滑动结束后由于activity切换动画的原因导致StatusBar区域因为动画而位移,所以产生了闪烁的现象,为了解决这个问题,你需要自己去除系统的StatusBar自己重画一个,可以利用StatusBarUtil解决。

@5ZSQ
Copy link

5ZSQ commented Jan 21, 2017

建议:使用StatusBarUtil后可能还是会出现statusBar显示异常,可以尝试在**onPostCreate()**方法追加:

SwipeBackHelper.onPostCreate(this); StatusBarUtil.setColor(this, getResources().getColor(R.color.blue),0);

@papa320
Copy link

papa320 commented Dec 21, 2017

SwipeBackHelper.getCurrentPage(this).setSwipeBackEnable(isSwipeBackEnable()).setSwipeRelateEnable(true).setSwipeEdge(DeviceUtils.dp2px(80))
.addListener(new SwipeListener() {
@OverRide
public void onScroll(float percent, int px) {

                }

                @Override
                public void onEdgeTouch() {

                }

                @Override
                public void onScrollToClose() {
                    onBackPressed();

                    //核心这句话,完成滑动后执行下自己的一段动画即可
                    overridePendingTransition(R.anim.in, R.anim.out);
                }
            });

@GHpeter
Copy link

GHpeter commented Aug 10, 2022

great ,this method is solved my question

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

6 participants