Coder Social home page Coder Social logo

Comments (5)

XBeats avatar XBeats commented on July 30, 2024

在处理View和手势之间的关系的时候,习惯性的用runnable和handler来处理了,滑动返回项目在最初阶段也是有其他的思路的,不过现在看来确定是可以不用handler的,这个点确实可以优化。

from and_swipeback.

XBeats avatar XBeats commented on July 30, 2024

你能详细描述一下遇到的 “因为Handler和事件分发有时候会造成时序的混乱” ,这种情况吗?

from and_swipeback.

softrice avatar softrice commented on July 30, 2024

这个是在我优化了滑动触发后发生的。
原本的代码是直接把屏幕左边的事件拦截,有些左上角的按钮例如返回键就无法触发.
我做了点改动,仿造微信(ios)的风格,在手指在左侧滑动一定距离后才触发滑动返回.
但是后来测试发现,如果乱按,由于Handler发送的Message和点击滑动事件不一定会按照时间先后顺序执行.
由于滑动取消还涉及了动画,动画结束后又发送了Message,在我的代码里有几率出现问题.
原来的代码不会这样,只是我修改后这样.

from and_swipeback.

softrice avatar softrice commented on July 30, 2024

因为改得比较苦恼,所以就去除了Handler.

from and_swipeback.

XBeats avatar XBeats commented on July 30, 2024

Handler处理Message肯定是按序处理的,但是想要响应返回按键确定会有一定的问题,这个是我正在优化的点。

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.