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

windowIsTranslucent设置为"true"之后 #41

Open
ybADMIN opened this issue Oct 14, 2016 · 9 comments
Open

windowIsTranslucent设置为"true"之后 #41

ybADMIN opened this issue Oct 14, 2016 · 9 comments

Comments

@ybADMIN
Copy link

ybADMIN commented Oct 14, 2016

windowIsTranslucent设置为"true"之后 从该activity中启动的所有activity都不可以应用其他动画了,比如我想要在发布按钮点击后向上弹出activity并且关闭发布界面的时候也要向下关闭

@Jude95
Copy link
Owner

Jude95 commented Oct 14, 2016

我暂时也没有很好的解决办法。希望你能帮忙找找...

@ybADMIN
Copy link
Author

ybADMIN commented Oct 17, 2016

谢谢你的回答,如果我找到解决办法会即时通知你的

@9h0st
Copy link

9h0st commented Oct 20, 2016

windowIsTranslucent设置为true之后 还会破坏生命周期。当Activity A启动Activity B, A不透明,B透明,那么 A的onStop不会被调用,只会调用onPause。相当于启动了一个dialog。目前没有找到比较好的解决方式。

@9h0st
Copy link

9h0st commented Oct 21, 2016

@Jude95 为何项目里加入了Utils类,却没有使用?convertFromTranslucent这个反射方法可以在代码中更将windowIsTranslucent true改为false,不过和convertToTranslucent一样,有兼容性问题。

@Paul-KK
Copy link

Paul-KK commented Dec 31, 2016

只要windowIsTranslucent设置为true之后,就会影响activity生命周期,并且导致android:activityOpenExitAnimation和android:activityCloseEnterAnimation失效,这个和该开源库没有关系,因为google并不建议设置windowIsTranslucent为true,这样会导致activity无法回收。

@softrice
Copy link

@9h0st windowIsTranslucent设置为true 在activity启动的时候使用convertFromTranslucent置成false,
在滑动的时候使用convertToTranslucent置成true.
与正常的生命周期相比,只有细微差别 具体你可以打印看看

@AndSync
Copy link

AndSync commented Jun 11, 2017

@softrice 这个具体怎么设置啊 我设置了之后生命周期方法出来了 但是滑动的时候下面黑屏

 Utils.convertActivityFromTranslucent(this);
        SwipeBackHelper.onCreate(this);
        SwipeBackHelper.getCurrentPage(this)//get current instance
            .setSwipeBackEnable(true)//on-off
            .setSwipeRelateEnable(true)//if should move together with the following Activity
            .addListener(new SwipeListener() {
                @Override
                public void onScroll(float percent, int px) {
                    Utils.convertActivityToTranslucent((Activity) context);
                }

                @Override
                public void onEdgeTouch() {
                    Utils.convertActivityToTranslucent((Activity) context);
                }

                @Override
                public void onScrollToClose() {

                }
            })
            .setSwipeRelateOffset(500);

@AndSync
Copy link

AndSync commented Jun 12, 2017

@Jude95
看到这篇文章讲的 希望对这个有帮助
http://www.jianshu.com/p/b6d682e301c2#

@caowen
Copy link

caowen commented Jul 17, 2017

关于动画的问题 可以在BaseActivity 里面 startActivity 和 finish 方法 调用 overridePendingTransition 添加动画即可

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

7 participants