Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlexibleAdapter.onLoadMoreComplete(list,-1) not work #597

Closed
steventxc opened this issue Apr 18, 2018 · 4 comments
Closed

FlexibleAdapter.onLoadMoreComplete(list,-1) not work #597

steventxc opened this issue Apr 18, 2018 · 4 comments

Comments

@steventxc
Copy link

steventxc commented Apr 18, 2018

public void onLoadMoreComplete(@Nullable List<T> newItems, @IntRange(from = -1) long delay) {
    // ......
    // Remove the progressItem if needed
    if (delay > 0 && (newItemsSize == 0 || !isEndlessScrollEnabled())) {
        log.v("onLoadMore     enqueued removing progressItem (%sms)", delay);
        mHandler.sendEmptyMessageDelayed(LOAD_MORE_COMPLETE, delay);
    } else {
        hideProgressItem();
    }
   // ......
}

above codes from FlexibleAdapter.onLoadMoreComplete, and the doc says :

@param delay    the delay used to remove the progress item or 
                -1 to disable the loading forever and to keep the progress item visible.

when I passed -1, it is not work, actually the above method not handle this situation.
I want to know, how can i keep the progress item when nothing returned to show some tips, any suggestion? thanks.

@davideas davideas added the bug label Apr 18, 2018
@davideas
Copy link
Owner

@steventxc, the idea was that, then some modifications led to miss that part.
However, I need to verify few things. For example, what to do if the user refreshes with the progressItem already visible?

@davideas davideas changed the title 'FlexibleAdapter.onLoadMoreComplete(list,-1)' not work FlexibleAdapter.onLoadMoreComplete(list,-1) not work Apr 18, 2018
@davideas davideas changed the title FlexibleAdapter.onLoadMoreComplete(list,-1) not work FlexibleAdapter.onLoadMoreComplete(list,-1) not work Apr 18, 2018
@steventxc
Copy link
Author

@davideas I wonder how can i pause the endless scroll mechanism, I found when add footer in the noMoreLoad method would trigger noMoreLoad method again, so I wanna pause the mechanism and then restart it. Looking forward to your suggestion, thanks

@davideas
Copy link
Owner

Please try with 5.0.4-SNAPSHOT and let me know if it works now.
You need an if to pass delay of -1 when empty and 0 or more seconds to remove the progressItem.
A simple refresh will trigger the loading more automatically.

allprojects {
    repositories {
        // For SNAPSHOT
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    }
}
dependencies {
    implementation ('eu.davidea:flexible-adapter:5.0.4-SNAPSHOT') {
        changing = true;
    }
}

@steventxc
Copy link
Author

@davideas that's fine, i test it in my code, and work fine. thanks for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants