Giter VIP home page Giter VIP logo

Comments (7)

BraisGabin avatar BraisGabin commented on July 2, 2024
  1. For the rightmost you can ask to getActualScrollX() (I increase its visibility in 78d689f) For the leftmost istable.getActualScrollX() - table.getWidth() - adapter.getWidth(-1);
  2. That feature isn't implemented.

from tablefixheaders.

liujmok avatar liujmok commented on July 2, 2024

When scrolling a little feeling of vertigo,i think it should scroll should be only in one direction, i am doing some changes.

            private int downX, downY;
            private boolean direction;

    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN: {
            if (!flinger.isFinished()) { // If scrolling, then stop now
                flinger.forceFinished();
            }
            currentX = (int) event.getRawX();
            currentY = (int) event.getRawY();

            downX = currentX;
            downY = currentY;

            break;
        }
        case MotionEvent.ACTION_MOVE: {
            final int x2 = (int) event.getRawX();
            final int y2 = (int) event.getRawY();
            final int diffX = currentX - x2;
            final int diffY = currentY - y2;

            currentX = x2;
            currentY = y2;
            direction = Math.abs(downX - x2) > Math.abs(downY - y2);
            if (direction) {
                scrollBy(diffX, 0);
            } else {
                scrollBy(0, diffY);
            }

            break;
        }
        case MotionEvent.ACTION_UP: {
            final VelocityTracker velocityTracker = this.velocityTracker;
            velocityTracker.computeCurrentVelocity(1000, maximumVelocity);
            int velocityX = (int) velocityTracker.getXVelocity();
            int velocityY = (int) velocityTracker.getYVelocity();

            if (Math.abs(velocityX) > minimumVelocity || Math.abs(velocityY) > minimumVelocity) {
                if (direction) {
                    flinger.start(getActualScrollX(), getActualScrollY(), velocityX, 0, getMaxScrollX(), getMaxScrollY());
                } else {
                    flinger.start(getActualScrollX(), getActualScrollY(), 0, velocityY, getMaxScrollX(), getMaxScrollY());
                }
            } else {
                if (this.velocityTracker != null) { // If the velocity less than threshold
                    this.velocityTracker.recycle(); // recycle the tracker
                    this.velocityTracker = null;
                }
            }
            break;
        }

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 2, 2024

I think that a better option is see the angle of the movement. If it is around 0 or 90 degrees you would activeate only vertical or horizontal scroll for all this tap. Else you would keep the two directions scroll.

I think that with this solution the vertigo is gone and the double scroll feature remains.

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 2, 2024

@liujmok , do you solve the problems with the EditTexts? Is there a bug or only a problem with your implementation?

from tablefixheaders.

liujmok avatar liujmok commented on July 2, 2024

Not a bug, my mistake. because i attempt to modify TableFixedHeaders scroll and use EditText.

The controls is good.

If problems are found, I will feedback to you.

from tablefixheaders.

liujmok avatar liujmok commented on July 2, 2024

Hi BraisGabin,

Whether the control can provide some rolling method, or tell me how to achieve?

1.scrollToBottom
2.scrollToRight

Thanks.

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 2, 2024

scrollToRight: getMaxScrollX() - getActualScrollX()
scrollToBottom: getMaxScrollY() - getActualScrollY()

And, please, if you write about a new topic open a new Issue.

from tablefixheaders.

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.