blob: 95d5a96d96e0f405f79aebbf2794bb81641b4e75 [file] [log] [blame]
<html devsite="true">
<head>
<title>ListenableFuturePagingSource</title>
{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>ListenableFuturePagingSource</h1>
{% setvar page_path %}androidx/paging/ListenableFuturePagingSource.html{% endsetvar %}
{% setvar can_switch %}1{% endsetvar %}
{% include "reference/_java_switcher2.md" %}
<p>
<pre>public abstract class ListenableFuturePagingSource&lt;Key&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>,&nbsp;Value&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>&gt; 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="/reference/java/lang/Object.html">Object</a></td>
</tr>
<tr>
<td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
<td colspan="2"><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
<td colspan="1"><a href="/reference/androidx/paging/ListenableFuturePagingSource.html">ListenableFuturePagingSource</a></td>
</tr>
</tbody>
</table>
</div>
<hr>
<p><a href="[ListenableFuture]">ListenableFuture</a>-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/ListenableFuturePagingSource.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/ListenableFuturePagingSource.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/ListenableFuturePagingSource.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>&lt;Key&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>,&nbsp;Value&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/paging/ListenableFuturePagingSource.html#ListenableFuturePagingSource()">ListenableFuturePagingSource</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><a href="/reference/androidx/paging/PagingSource.LoadResult.html">PagingSource.LoadResult</a>&lt;Key,&nbsp;Value&gt;</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/paging/ListenableFuturePagingSource.html#load(androidx.paging.PagingSource.LoadParams)">load</a>(<a href="/reference/androidx/paging/PagingSource.LoadParams.html">PagingSource.LoadParams</a>&lt;Key&gt;&nbsp;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]/&lt;ERROR CLASS&gt;.html">&lt;ERROR CLASS&gt;</a>&lt;<a href="/reference/androidx/paging/PagingSource.LoadResult.html">PagingSource.LoadResult</a>&lt;Key,&nbsp;Value&gt;&gt;</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/paging/ListenableFuturePagingSource.html#loadFuture(androidx.paging.PagingSource.LoadParams)">loadFuture</a>(<a href="/reference/androidx/paging/PagingSource.LoadParams.html">PagingSource.LoadParams</a>&lt;Key&gt;&nbsp;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>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>&lt;Key,&nbsp;Value&gt;&nbsp;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>(<a href="/reference/kotlin/jvm/functions/Function0.html">Function0</a>&lt;<a href="/reference/kotlin/Unit.html">Unit</a>&gt;&nbsp;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>(<a href="/reference/kotlin/jvm/functions/Function0.html">Function0</a>&lt;<a href="/reference/kotlin/Unit.html">Unit</a>&gt;&nbsp;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&nbsp;final&nbsp;boolean&nbsp;<a href="/reference/androidx/paging/ListenableFuturePagingSource.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&nbsp;boolean&nbsp;<a href="/reference/androidx/paging/ListenableFuturePagingSource.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&nbsp;boolean&nbsp;<a href="/reference/androidx/paging/ListenableFuturePagingSource.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="ListenableFuturePagingSource--"></a>
<h3 class="api-name" id="ListenableFuturePagingSource()">ListenableFuturePagingSource</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;&lt;Key&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>,&nbsp;Value&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/paging/ListenableFuturePagingSource.html#ListenableFuturePagingSource()">ListenableFuturePagingSource</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&nbsp;<a href="/reference/androidx/paging/PagingSource.LoadResult.html">PagingSource.LoadResult</a>&lt;Key,&nbsp;Value&gt;&nbsp;<a href="/reference/androidx/paging/ListenableFuturePagingSource.html#load(androidx.paging.PagingSource.LoadParams)">load</a>(<a href="/reference/androidx/paging/PagingSource.LoadParams.html">PagingSource.LoadParams</a>&lt;Key&gt;&nbsp;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="loadFuture-androidx.paging.PagingSource.LoadParams-"></a>
<h3 class="api-name" id="loadFuture(androidx.paging.PagingSource.LoadParams)">loadFuture</h3>
<pre class="api-signature no-pretty-print">public&nbsp;abstract&nbsp;<a href="/reference/[JVM root]/&lt;ERROR CLASS&gt;.html">&lt;ERROR CLASS&gt;</a>&lt;<a href="/reference/androidx/paging/PagingSource.LoadResult.html">PagingSource.LoadResult</a>&lt;Key,&nbsp;Value&gt;&gt;&nbsp;<a href="/reference/androidx/paging/ListenableFuturePagingSource.html#loadFuture(androidx.paging.PagingSource.LoadParams)">loadFuture</a>(<a href="/reference/androidx/paging/PagingSource.LoadParams.html">PagingSource.LoadParams</a>&lt;Key&gt;&nbsp;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>