Git Product home page Git Product logo

Comments (2)

peng8350 avatar peng8350 commented on September 15, 2024

不太明白,拖拽动画一般是跟随着手指触摸的位置,是否可给几个截图加上调试设备?

from jptabbar.

JinJieGu avatar JinJieGu commented on September 15, 2024

Bug效果如下:

snip20170503_2

我简单地研究了下作者的源码和demo,发现产生这种情况的原因是因为我的showBadge方法是放在了onCreate中调用的,作者的源码中有两段代码是对画布去除状态栏的偏移处理,例如DragBadgeView 中#199 的代码:
canvas.translate(0, -BadgeViewUtil.getStatusBarHeight(mBadgeViewHelper.getRootView()));
而作者BadgeViewUtil.getStatusBarHeight的方法是通过应用区域的top属性推算的出状态栏的高度
view.getRootView().getWindowVisibleDisplayFrame(rectangle);
而这种方式的弊端也很明显,就是必须依赖窗口回调机制,也就是需要等onWindowFocusChanged执行后才能调用,所以我放到onCreate中调用showBadge时拿到的StatusBarHeight是0,就出现了标题中我所描述的bug。

等会我会PR一个解决方案,作者可以参考一下。

from jptabbar.

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.