blob: 18ddb15202bd13452e82aeb668730a0a62d0c46f [file] [log] [blame]
<html devsite="true">
<head>
<title>PagingSource.LoadParams.Prepend</title>
{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>PagingSource.LoadParams.Prepend</h1>
{% setvar page_path %}androidx/paging/PagingSource.LoadParams.Prepend.html{% endsetvar %}
{% setvar can_switch %}1{% endsetvar %}
{% include "reference/_java_switcher2.md" %}
<p>
<pre>public final class PagingSource.LoadParams.Prepend&lt;Key&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; extends <a href="/reference/androidx/paging/PagingSource.LoadParams.html">PagingSource.LoadParams</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">&nbsp;&nbsp;&nbsp;↳</td>
<td colspan="2"><a href="/reference/androidx/paging/PagingSource.LoadParams.html">PagingSource.LoadParams</a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
<td colspan="1"><a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html">PagingSource.LoadParams.Prepend</a></td>
</tr>
</tbody>
</table>
</div>
<hr>
<p>Params to load a page of data from a <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> via <code><a href="/reference/androidx/paging/PagingSource.html#load(androidx.paging.PagingSource.LoadParams)">PagingSource.load</a></code> to be prepended to the start of the list.</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>Key</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#key()">key</a></code></div>
<p>Key for the page to be loaded.</p>
</td>
</tr>
<tr>
<td><code>final int</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#loadSize()">loadSize</a></code></div>
<p>Requested number of items to load.</p>
</td>
</tr>
<tr>
<td><code>final int</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#pageSize()">pageSize</a></code></div>
<p><strong>This field is deprecated.</strong> PagingConfig.pageSize will be removed in future versions, use PagingConfig.loadSize instead.</p>
</td>
</tr>
<tr>
<td><code>final boolean</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#placeholdersEnabled()">placeholdersEnabled</a></code></div>
<p>From <code><a href="/reference/androidx/paging/PagingConfig.html#enablePlaceholders()">PagingConfig.enablePlaceholders</a></code>, true if placeholders are enabled and the load request for this <code><a href="/reference/androidx/paging/PagingSource.LoadParams.html">LoadParams</a></code> should populate <code><a href="/reference/androidx/paging/PagingSource.LoadResult.Page.html#itemsBefore()">LoadResult.Page.itemsBefore</a></code> and <code><a href="/reference/androidx/paging/PagingSource.LoadResult.Page.html#itemsAfter()">LoadResult.Page.itemsAfter</a></code> if possible.</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="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#Prepend(kotlin.Any,kotlin.Int,kotlin.Boolean,kotlin.Int)">Prepend</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;Key&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;loadSize,<br>&nbsp;&nbsp;&nbsp;&nbsp;boolean&nbsp;placeholdersEnabled,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;pageSize<br>)</code></div>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Public fields</h2>
<div><a name="getKey()"></a><a name="setKey()"></a><a name="getKey--"></a><a name="setKey--"></a>
<h3 class="api-name" id="key()">key</h3>
<pre class="api-signature no-pretty-print">public&nbsp;Key&nbsp;<a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#key()">key</a></pre>
<p>Key for the page to be loaded.</p>
<p><code><a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#key()">key</a></code> can be <code>null</code> only if this <code><a href="/reference/androidx/paging/PagingSource.LoadParams.html">LoadParams</a></code> is <code><a href="/reference/androidx/paging/PagingSource.LoadParams.Refresh.html">Refresh</a></code>, and either no <code>initialKey</code> is provided to the <code><a href="/reference/androidx/paging/Pager.html">Pager</a></code> or <code><a href="/reference/androidx/paging/PagingSource.html#getRefreshKey(androidx.paging.PagingState)">PagingSource.getRefreshKey</a></code> from the previous <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> returns <code>null</code>.</p>
<p>The value of <code><a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#key()">key</a></code> is dependent on the type of <code><a href="/reference/androidx/paging/PagingSource.LoadParams.html">LoadParams</a></code>:</p>
<ul>
<li>
<p><code><a href="/reference/androidx/paging/PagingSource.LoadParams.Refresh.html">Refresh</a></code></p>
</li>
<ul>
<li>
<p>On initial load, the nullable <code>initialKey</code> passed to the <code><a href="/reference/androidx/paging/Pager.html">Pager</a></code>.</p>
</li>
<li>
<p>On subsequent loads due to invalidation or refresh, the result of <code><a href="/reference/androidx/paging/PagingSource.html#getRefreshKey(androidx.paging.PagingState)">PagingSource.getRefreshKey</a></code>.</p>
</li>
</ul>
<li>
<p><code><a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html">Prepend</a></code> - <code><a href="/reference/androidx/paging/PagingSource.LoadResult.Page.html#prevKey()">LoadResult.Page.prevKey</a></code> of the loaded page at the front of the list.</p>
</li>
<li>
<p><code><a href="/reference/androidx/paging/PagingSource.LoadParams.Append.html">Append</a></code> - <code><a href="/reference/androidx/paging/PagingSource.LoadResult.Page.html#nextKey()">LoadResult.Page.nextKey</a></code> of the loaded page at the end of the list.</p>
</li>
</ul>
</div>
<div><a name="getLoadSize()"></a><a name="setLoadSize()"></a><a name="getLoadSize--"></a><a name="setLoadSize--"></a>
<h3 class="api-name" id="loadSize()">loadSize</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;int&nbsp;<a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#loadSize()">loadSize</a></pre>
<p>Requested number of items to load.</p>
<p>Note: It is valid for <code><a href="/reference/androidx/paging/PagingSource.html#load(androidx.paging.PagingSource.LoadParams)">PagingSource.load</a></code> to return a <code><a href="/reference/androidx/paging/PagingSource.LoadResult.html">LoadResult</a></code> that has a different number of items than the requested load size.</p>
</div>
<div><a name="getPageSize()"></a><a name="setPageSize()"></a><a name="getPageSize--"></a><a name="setPageSize--"></a>
<h3 class="api-name" id="pageSize()">pageSize</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;int&nbsp;<a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#pageSize()">pageSize</a></pre>
<aside class="caution"><strong>This field is deprecated.</strong><br>PagingConfig.pageSize will be removed in future versions, use PagingConfig.loadSize instead.</aside>
<p>From <code><a href="/reference/androidx/paging/PagingConfig.html#pageSize()">PagingConfig.pageSize</a></code>, the configured page size.</p>
</div>
<div><a name="getPlaceholdersEnabled()"></a><a name="setPlaceholdersEnabled()"></a><a name="getPlaceholdersEnabled--"></a><a name="setPlaceholdersEnabled--"></a>
<h3 class="api-name" id="placeholdersEnabled()">placeholdersEnabled</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;boolean&nbsp;<a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#placeholdersEnabled()">placeholdersEnabled</a></pre>
<p>From <code><a href="/reference/androidx/paging/PagingConfig.html#enablePlaceholders()">PagingConfig.enablePlaceholders</a></code>, true if placeholders are enabled and the load request for this <code><a href="/reference/androidx/paging/PagingSource.LoadParams.html">LoadParams</a></code> should populate <code><a href="/reference/androidx/paging/PagingSource.LoadResult.Page.html#itemsBefore()">LoadResult.Page.itemsBefore</a></code> and <code><a href="/reference/androidx/paging/PagingSource.LoadResult.Page.html#itemsAfter()">LoadResult.Page.itemsAfter</a></code> if possible.</p>
</div>
<h2>Public constructors</h2>
<div><a name="Prepend(kotlin.Any, kotlin.Int, kotlin.Boolean, kotlin.Int)"></a><a name="Prepend-kotlin.Any-kotlin.Int-kotlin.Boolean-kotlin.Int-"></a>
<h3 class="api-name" id="Prepend(kotlin.Any,kotlin.Int,kotlin.Boolean,kotlin.Int)">Prepend</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;&lt;Key&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/paging/PagingSource.LoadParams.Prepend.html#Prepend(kotlin.Any,kotlin.Int,kotlin.Boolean,kotlin.Int)">Prepend</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;Key&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;loadSize,<br>&nbsp;&nbsp;&nbsp;&nbsp;boolean&nbsp;placeholdersEnabled,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;pageSize<br>)</pre>
</div>
</body>
</html>