GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: back pressure protection · linuxgg/RxJava-Android-Samples@dd8e117

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • app/src/main/java/com/morihacky/android/rxjava/pagination
    • PaginationFragment.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/src/main/java/com/morihacky/android/rxjava/pagination/PaginationFragment.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/pagination/PaginationFragment.java
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ public void onStart() {
5959

6060
Subscription s2 =//
6161
_paginator//
62+
.onBackpressureDrop()//
6263
.concatMap(nextPage -> _itemsFromNetworkCall(nextPage + 1, 10))//
63-
.observeOn(AndroidSchedulers.mainThread())
64-
.map(items -> {
65-
int start = _adapter.getItemCount() - 1;
64+
.observeOn(AndroidSchedulers.mainThread()).map(items -> {
65+
int start = _adapter.getItemCount() - 1;
6666

67-
_adapter.addItems(items);
68-
_adapter.notifyItemRangeInserted(start, 10);
67+
_adapter.addItems(items);
68+
_adapter.notifyItemRangeInserted(start, 10);
6969

70-
_progressBar.setVisibility(View.INVISIBLE);
71-
return null;
72-
})//
70+
_progressBar.setVisibility(View.INVISIBLE);
71+
return null;
72+
})//
7373
.subscribe();
7474

7575
// I'm using an Rxbus purely to hear from a nested button click

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.