INNER CODE UNIT · Java

onDown

jjoe64/GraphView · src/main/java/com/jjoe64/graphview/CursorMode.java:94

    public void onDown(MotionEvent e) {
        mPosX = Math.max(e.getX(), mGraphView.getGraphContentLeft());
        mPosX = Math.min(mPosX, mGraphView.getGraphContentLeft() + mGraphView.getGraphContentWidth());
        mPosY = e.getY();
        mCursorVisible = true;
        findCurrentDataPoint();
        mGraphView.invalidate();
    }

    public void onMove(MotionEvent e) {
        if (mCursorVisible) {
            mPosX = Math.max(e.getX(), mGraphView.getGraphContentLeft());
            mPosX = Math.min(mPosX, mGraphView.getGraphContentLeft() + mGraphView.getGraphContentWidth());
            mPosY = e.getY();
            findCurrentDataPoint();
            mGraphView.invalidate();
        }
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…