Coder Social home page Coder Social logo

实现方式好奇葩,我提一句,微信的滑动返回使用的时api 19的hidden api,convertAcitivtyToTransluctent,你可以试试 about and_swipeback HOT 5 CLOSED

xbeats avatar xbeats commented on July 22, 2024
实现方式好奇葩,我提一句,微信的滑动返回使用的时api 19的hidden api,convertAcitivtyToTransluctent,你可以试试

from and_swipeback.

Comments (5)

XBeats avatar XBeats commented on July 22, 2024 3

微信的实现方式,没有去考虑,只是参考了他的实现效果;这个思路也是由于目前接触到的需求来确定的,最低要求Api14及其以上,基本兼容各个手机;如果要用hidden api,当时可能需要用反射的方式,这样就需要去判断Api和不断地去维护,觉得有点得不偿失了。

from and_swipeback.

29995270 avatar 29995270 commented on July 22, 2024

@hackware1993 能详细说明一下么,我试着对 activityA 在 start 新的activityB 后 调用 activityA 的 convertFromTranslucent ,确实没有了透明背景造成的性能问题,但是返回的时候 activityA 似乎被 stop 了,有一些动画效果无法被执行,我试了在返回之前 调用 activityA 的 convertToTranslucent,依旧没有效果。

from and_swipeback.

29995270 avatar 29995270 commented on July 22, 2024

@hackware1993 我又尝试了一下 在 activityA 的生命周期里调用 上述方法,貌似一切正常了

@OverRide
protected void onResume() {
super.onResume();
Utils.convertActivityToTranslucent(this);
}

@Override
protected void onPause() {
    super.onPause();
    Utils.convertActivityFromTranslucent(BaseActivity.this);
}

from and_swipeback.

29995270 avatar 29995270 commented on July 22, 2024

@hackware1993 @XBeats
很多启发,非常感谢,我换了思路把自己的实现重构了,现在基本不用担心性能和界面被销毁了

from and_swipeback.

hackware1993 avatar hackware1993 commented on July 22, 2024

@29995270 convert方案是有兼容性问题的,不能做到通用,你要小心

from and_swipeback.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.