I am using volley - CardView and RecyclerView to create a project this project give information from the json url and show in my application
But the RecyclerView.setOnScrollChangeListener just need api 23 and that will not run in other versions
What should I do?
My dependencies:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile files('libs/volley.jar') }
You can use addOnScrollListener
it works perfectly fine
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
//onScrollStateChanged will be fire every time you scroll
//Perform your operation here
}
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With