Code Monkey home page Code Monkey logo

Comments (3)

sskucinski avatar sskucinski commented on September 13, 2024 2

How to fix it:
Class: AdaptiveTableLayout

public void scrollBy(int x, int y) {
    // block scroll one axle
    int tempX = mState.isRowDragging() ? 0 : x;
    int tempY = mState.isColumnDragging() ? 0 : y;

    int diffX = tempX;
    int diffY = tempY;

    int shadowShiftX = mManager.getColumnCount() * mSettings.getCellMargin();
    int shadowShiftY = mManager.getRowCount() * mSettings.getCellMargin();

    long maxX = mManager.getFullWidth() + shadowShiftX;
    long maxY = mManager.getFullHeight() + shadowShiftY;

    if (mState.getScrollX() + tempX < 0) {
        // scroll over view to the left
        diffX = mState.getScrollX();
        mState.setScrollX(0);
    } else if (mSettings.getLayoutWidth() > maxX) {
        // few items and we have free space.
        diffX = 0;
        mState.setScrollX(0);
    } else if (mState.getScrollX() + mSettings.getLayoutWidth() + tempX > maxX) {
        // scroll over view to the right
        diffX = (int) (maxX - mState.getScrollX() - mSettings.getLayoutWidth());

        mState.setScrollX(mState.getScrollX() + diffX);
    } else {
        mState.setScrollX(mState.getScrollX() + tempX);
    }

    if (mState.getScrollY() + tempY < 0) {
        // scroll over view to the top
        diffY = mState.getScrollY();
        mState.setScrollY(0);
    } else if (mSettings.getLayoutHeight() > maxY) {
        // few items and we have free space.
        diffY = 0;
        mState.setScrollY(0);
    } else if (mState.getScrollY() + mSettings.getLayoutHeight() + tempY > maxY) {
        // scroll over view to the bottom
        diffY = (int) (maxY - mState.getScrollY() - mSettings.getLayoutHeight());
        mState.setScrollY(mState.getScrollY() + diffY);
    } else {
        mState.setScrollY(mState.getScrollY() + tempY);
    }

    if (diffX == 0 && diffY == 0) {
        return;
    }

    if (mAdapter != null) {
        // refresh views
        recycleViewHolders();
        mVisibleArea.set(mState.getScrollX(),
                mState.getScrollY(),
                mState.getScrollX() + mSettings.getLayoutWidth(),
                mState.getScrollY() + mSettings.getLayoutHeight());
        addViewHolders(mVisibleArea);
        refreshViewHolders();
    }
}

from adaptivetablelayout.

yarovoiag avatar yarovoiag commented on September 13, 2024

Will be fixed in near future.

from adaptivetablelayout.

yarovoiag avatar yarovoiag commented on September 13, 2024

Fixed in 1.1.1 version

from adaptivetablelayout.

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.