Last active
April 7, 2019 09:31
Star
You must be signed in to star a gist
This file contains 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