This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. For paddingStart, Severity: Errors. | |
because we also have paddingLeft, so for old platform, the paddingStart is ignored; so api < 17, the lint tool | |
will show error about paddingStart, and we do not currently support RTL, and paddingStart work the same way as | |
paddingLeft, so i think it really about the NewApi. Because the lint tool just check whether paddingStart is | |
compatible with api < 17, and I check that when api == 16, it works fine and does not crash. I have checked all | |
the lint error list, i do not find other lint checks might solve this. So I think just add | |
tools:ignore="NewApi" will be fine. | |
2. the warnings in build.gradle showing that some of the tools are using the old version, do i need change | |
these to newest, or just suppress lint to ignore NewerVersionAvailable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. | |
int firstVisibleItem, visibleItemCount, totalItemCount; |