Giter Site home page Giter Site logo

rulerview's People

Contributors

yjwfn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rulerview's Issues

你好,有关RulerView请教两个问题!

第一个演示图上是不是有一个当前滑到的位置的指示标?这个在代码里好像没体现,请问在哪里呀

第二个如何获得松开手之后滑动的数据呢?rulerview的OnScaleListener onScaleChanged 好像在手滑动过程中一直会调用

非常感谢!

发现两个问题

1,绘制文字没居中对齐,原因是y计算的问题
改为如下会好一点

    int y ;
        if (!isGravityTop()) {
            y = (int) (mIndicateLoc.top / 2 - (mTextPaint.ascent() + mTextPaint.descent()) / 2);
        } else {
            y = (int) (mIndicateLoc.bottom + textHeight / 2 - (mTextPaint.ascent() + mTextPaint.descent()) / 2);
        }

2.是阻尼系数(应该是这样叫...)的问题

if (getScrollX() <= 0 || getScrollX() >= getMaximumScroll())

小于零就开始减少滑动的距离了,但是demo中分界线是中间,这样判断有不妥

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.