Last active
April 7, 2019 09:31
-
-
Save amitshekhariitbhu/d48fa6481ddbb9ad6da49028f5e71cd7 to your computer and use it in GitHub Desktop.
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
public class PaginationActivity extends AppCompatActivity { | |
/** | |
* Simulation of network data | |
*/ | |
private Single<List<String>> dataFromNetwork(final int page) { | |
return Single.just(true) | |
.delay(2, TimeUnit.SECONDS) | |
.map(value -> { | |
List<String> items = new ArrayList<>(); | |
for (int i = 1; i <= 10; i++) { | |
items.add("Item " + (page * 10 + i)); | |
} | |
return items; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment