| <html devsite="true"> |
| <head> |
| <title>RxPagingSource</title> |
| {% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} |
| {% include "_shared/_reference-head-tags.html" %} |
| </head> |
| <body> |
| <h1>RxPagingSource</h1> |
| {% setvar page_path %}androidx/paging/rxjava2/RxPagingSource.html{% endsetvar %} |
| {% setvar can_switch %}1{% endsetvar %} |
| {% include "reference/_java_switcher2.md" %} |
| <p> |
| <pre>public abstract class RxPagingSource<Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>, Value extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> extends <a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></pre> |
| </p> |
| <div class="devsite-table-wrapper"> |
| <table class="jd-inheritance-table"> |
| <tbody> |
| <tr> |
| <td colspan="3"><a href="https://developer.android.com/reference/java/lang/Object.html">Object</a></td> |
| </tr> |
| <tr> |
| <td class="jd-inheritance-space"> ↳</td> |
| <td colspan="2"><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></td> |
| </tr> |
| <tr> |
| <td> </td> |
| <td class="jd-inheritance-space"> ↳</td> |
| <td colspan="1"><a href="/reference/androidx/paging/rxjava2/RxPagingSource.html">RxPagingSource</a></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <hr> |
| <p>Rx-based compatibility wrapper around <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code>'s suspending APIs.</p> |
| <h2>Summary</h2> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <thead> |
| <tr> |
| <th colspan="2"><h3>Public fields</h3></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td><code>final boolean</code></td> |
| <td width="100%"> |
| <div><code><a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#invalid()">invalid</a></code></div> |
| <p>Whether this <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> has been invalidated, which should happen when the data this <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> represents changes since it was first instantiated.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>boolean</code></td> |
| <td width="100%"> |
| <div><code><a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#jumpingSupported()">jumpingSupported</a></code></div> |
| <p><code>true</code> if this <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> supports jumping, <code>false</code> otherwise.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>boolean</code></td> |
| <td width="100%"> |
| <div><code><a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#keyReuseSupported()">keyReuseSupported</a></code></div> |
| <p><code>true</code> if this <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> expects to re-use keys to load distinct pages without a call to <code><a href="/reference/androidx/paging/PagingSource.html#invalidate()">invalidate</a></code>, <code>false</code> otherwise.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <thead> |
| <tr> |
| <th colspan="2"><h3>Public constructors</h3></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td> |
| <div><code><Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>, Value extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#RxPagingSource()">RxPagingSource</a>()</code></div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <thead> |
| <tr> |
| <th colspan="2"><h3>Public methods</h3></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td><code>final <a href="/reference/androidx/paging/PagingSource.LoadResult.html">PagingSource.LoadResult</a><Key, Value></code></td> |
| <td width="100%"> |
| <div><code><a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#load(androidx.paging.PagingSource.LoadParams)">load</a>(<a href="/reference/androidx/paging/PagingSource.LoadParams.html">PagingSource.LoadParams</a><Key> params)</code></div> |
| <p>Loading API for <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>abstract <a href="/reference/[JVM root]/<ERROR CLASS>.html"><ERROR CLASS></a><<a href="/reference/androidx/paging/PagingSource.LoadResult.html">PagingSource.LoadResult</a><Key, Value>></code></td> |
| <td width="100%"> |
| <div><code><a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#loadSingle(androidx.paging.PagingSource.LoadParams)">loadSingle</a>(<a href="/reference/androidx/paging/PagingSource.LoadParams.html">PagingSource.LoadParams</a><Key> params)</code></div> |
| <p>Loading API for <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code>.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive" id="inhmethods"> |
| <thead> |
| <tr> |
| <th colspan="2"><h3>Inherited methods</h3></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td><devsite-expandable><span class="expand-control">From class <a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></span> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <tbody> |
| <tr> |
| <td><code>@<a href="/reference/androidx/paging/ExperimentalPagingApi.html">ExperimentalPagingApi</a> @<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> Key</code></td> |
| <td width="100%"> |
| <div><code><a href="/reference/androidx/paging/PagingSource.html#getRefreshKey(androidx.paging.PagingState)">getRefreshKey</a>(<a href="/reference/androidx/paging/PagingState.html">PagingState</a><Key, Value> state)</code></div> |
| <p>Request a refresh key given the current <code><a href="/reference/androidx/paging/PagingState.html">PagingState</a></code> of the associated <code><a href="/reference/androidx/paging/PagingData.html">PagingData</a></code> used to present loaded data from this <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>void</code></td> |
| <td width="100%"> |
| <div><code><a href="/reference/androidx/paging/PagingSource.html#invalidate()">invalidate</a>()</code></div> |
| <p>Signal the <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> to stop loading.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final void</code></td> |
| <td width="100%"> |
| <div><code><a href="/reference/androidx/paging/PagingSource.html#registerInvalidatedCallback(kotlin.Function0)">registerInvalidatedCallback</a>(Function0<<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>> onInvalidatedCallback)</code></div> |
| <p>Add a callback to invoke when the <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> is first invalidated.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final void</code></td> |
| <td width="100%"> |
| <div><code><a href="/reference/androidx/paging/PagingSource.html#unregisterInvalidatedCallback(kotlin.Function0)">unregisterInvalidatedCallback</a>(Function0<<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>> onInvalidatedCallback)</code></div> |
| <p>Remove a previously added invalidate callback.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </devsite-expandable> </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <h2>Public fields</h2> |
| <div><a name="getInvalid()"></a><a name="setInvalid()"></a><a name="getInvalid--"></a><a name="setInvalid--"></a> |
| <h3 class="api-name" id="invalid()">invalid</h3> |
| <pre class="api-signature no-pretty-print">public final boolean <a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#invalid()">invalid</a></pre> |
| <p>Whether this <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> has been invalidated, which should happen when the data this <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> represents changes since it was first instantiated.</p> |
| </div> |
| <div><a name="getJumpingSupported()"></a><a name="setJumpingSupported()"></a><a name="getJumpingSupported--"></a><a name="setJumpingSupported--"></a> |
| <h3 class="api-name" id="jumpingSupported()">jumpingSupported</h3> |
| <pre class="api-signature no-pretty-print">public boolean <a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#jumpingSupported()">jumpingSupported</a></pre> |
| <p><code>true</code> if this <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> supports jumping, <code>false</code> otherwise.</p> |
| <p>Override this to <code>true</code> if pseudo-fast scrolling via jumps is supported.</p> |
| <p>A jump occurs when a <code>RecyclerView</code> scrolls through a number of placeholders defined by <code><a href="/reference/androidx/paging/PagingConfig.html#jumpThreshold()">PagingConfig.jumpThreshold</a></code> and triggers a load with <code><a href="/reference/androidx/paging/LoadType.REFRESH.html">LoadType</a></code>.</p> |
| <p><code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code>s that support jumps should override <code><a href="/reference/androidx/paging/PagingSource.html#getRefreshKey(androidx.paging.PagingState)">getRefreshKey</a></code> to return a <code><a href="/reference/androidx/paging/PagingSource.html">Key</a></code> that would load data fulfilling the viewport given a user's current <code><a href="/reference/androidx/paging/PagingState.html#anchorPosition()">PagingState.anchorPosition</a></code>.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <thead> |
| <tr> |
| <th colspan="2">See also</th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td><code><a href="/reference/androidx/paging/PagingConfig.html#jumpThreshold()">jumpThreshold</a></code></td> |
| <td width="100%"></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div><a name="getKeyReuseSupported()"></a><a name="setKeyReuseSupported()"></a><a name="getKeyReuseSupported--"></a><a name="setKeyReuseSupported--"></a> |
| <h3 class="api-name" id="keyReuseSupported()">keyReuseSupported</h3> |
| <pre class="api-signature no-pretty-print">public boolean <a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#keyReuseSupported()">keyReuseSupported</a></pre> |
| <p><code>true</code> if this <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> expects to re-use keys to load distinct pages without a call to <code><a href="/reference/androidx/paging/PagingSource.html#invalidate()">invalidate</a></code>, <code>false</code> otherwise.</p> |
| </div> |
| <h2>Public constructors</h2> |
| <div><a name="RxPagingSource--"></a> |
| <h3 class="api-name" id="RxPagingSource()">RxPagingSource</h3> |
| <pre class="api-signature no-pretty-print">public final <Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>, Value extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#RxPagingSource()">RxPagingSource</a>()</pre> |
| </div> |
| <h2>Public methods</h2> |
| <div><a name="load-androidx.paging.PagingSource.LoadParams-"></a> |
| <h3 class="api-name" id="load(androidx.paging.PagingSource.LoadParams)">load</h3> |
| <pre class="api-signature no-pretty-print">public final <a href="/reference/androidx/paging/PagingSource.LoadResult.html">PagingSource.LoadResult</a><Key, Value> <a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#load(androidx.paging.PagingSource.LoadParams)">load</a>(<a href="/reference/androidx/paging/PagingSource.LoadParams.html">PagingSource.LoadParams</a><Key> params)</pre> |
| <p>Loading API for <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code>.</p> |
| <p>Implement this method to trigger your async load (e.g. from database or network).</p> |
| </div> |
| <div><a name="loadSingle-androidx.paging.PagingSource.LoadParams-"></a> |
| <h3 class="api-name" id="loadSingle(androidx.paging.PagingSource.LoadParams)">loadSingle</h3> |
| <pre class="api-signature no-pretty-print">public abstract <a href="/reference/[JVM root]/<ERROR CLASS>.html"><ERROR CLASS></a><<a href="/reference/androidx/paging/PagingSource.LoadResult.html">PagingSource.LoadResult</a><Key, Value>> <a href="/reference/androidx/paging/rxjava2/RxPagingSource.html#loadSingle(androidx.paging.PagingSource.LoadParams)">loadSingle</a>(<a href="/reference/androidx/paging/PagingSource.LoadParams.html">PagingSource.LoadParams</a><Key> params)</pre> |
| <p>Loading API for <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code>.</p> |
| <p>Implement this method to trigger your async load (e.g. from database or network).</p> |
| </div> |
| </body> |
| </html> |