blob: 6b6f0f420f84892211788720865a0837a54f4d14 [file] [log] [blame]
<html devsite="true">
<head>
<title>PagedList.Companion</title>
{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>PagedList.Companion</h1>
{% setvar page_path %}androidx/paging/PagedList.Companion.html{% endsetvar %}
{% setvar can_switch %}1{% endsetvar %}
{% include "reference/_java_switcher2.md" %}
<p>
<pre>object PagedList.Companion</pre>
</p>
<hr>
<h2>Summary</h2>
<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/PagedList.html">PagedList</a>&lt;T&gt;</code></td>
<td width="100%">
<div><code>&lt;K&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>,&nbsp;T&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/paging/PagedList.Companion.html#create(androidx.paging.PagingSource,androidx.paging.PagingSource.LoadResult.Page,kotlinx.coroutines.CoroutineScope,kotlinx.coroutines.CoroutineDispatcher,kotlinx.coroutines.CoroutineDispatcher,androidx.paging.PagedList.BoundaryCallback,androidx.paging.PagedList.Config,kotlin.Any)">create</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/androidx/paging/PagingSource.html">PagingSource</a>&lt;K,&nbsp;T&gt;&nbsp;pagingSource,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;<a href="/reference/androidx/paging/PagingSource.LoadResult.Page.html">PagingSource.LoadResult.Page</a>&lt;K,&nbsp;T&gt;&nbsp;initialPage,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/kotlinx/coroutines/CoroutineScope.html">CoroutineScope</a>&nbsp;coroutineScope,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a>&nbsp;notifyDispatcher,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a>&nbsp;fetchDispatcher,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;<a href="/reference/androidx/paging/PagedList.BoundaryCallback.html">PagedList.BoundaryCallback</a>&lt;T&gt;&nbsp;boundaryCallback,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/androidx/paging/PagedList.Config.html">PagedList.Config</a>&nbsp;config,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;K&nbsp;key<br>)</code></div>
<p>Create a <code><a href="/reference/androidx/paging/PagedList.html">PagedList</a></code> which loads data from the provided data source on a background thread, posting updates to the main thread.</p>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Public methods</h2>
<div><a name="create(androidx.paging.PagingSource, androidx.paging.PagingSource.LoadResult.Page, kotlinx.coroutines.CoroutineScope, kotlinx.coroutines.CoroutineDispatcher, kotlinx.coroutines.CoroutineDispatcher, androidx.paging.PagedList.BoundaryCallback, androidx.paging.PagedList.Config, kotlin.Any)"></a><a name="create-androidx.paging.PagingSource-androidx.paging.PagingSource.LoadResult.Page-kotlinx.coroutines.CoroutineScope-kotlinx.coroutines.CoroutineDispatcher-kotlinx.coroutines.CoroutineDispatcher-androidx.paging.PagedList.BoundaryCallback-androidx.paging.PagedList.Config-kotlin.Any-"></a>
<h3 class="api-name" id="create(androidx.paging.PagingSource,androidx.paging.PagingSource.LoadResult.Page,kotlinx.coroutines.CoroutineScope,kotlinx.coroutines.CoroutineDispatcher,kotlinx.coroutines.CoroutineDispatcher,androidx.paging.PagedList.BoundaryCallback,androidx.paging.PagedList.Config,kotlin.Any)">create</h3>
<pre class="api-signature no-pretty-print">@<a href="/reference/[JVM root]/&lt;ERROR CLASS&gt;.html">&lt;ERROR CLASS&gt;</a><br>public&nbsp;final&nbsp;<a href="/reference/androidx/paging/PagedList.html">PagedList</a>&lt;T&gt;&nbsp;&lt;K&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>,&nbsp;T&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/paging/PagedList.Companion.html#create(androidx.paging.PagingSource,androidx.paging.PagingSource.LoadResult.Page,kotlinx.coroutines.CoroutineScope,kotlinx.coroutines.CoroutineDispatcher,kotlinx.coroutines.CoroutineDispatcher,androidx.paging.PagedList.BoundaryCallback,androidx.paging.PagedList.Config,kotlin.Any)">create</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/androidx/paging/PagingSource.html">PagingSource</a>&lt;K,&nbsp;T&gt;&nbsp;pagingSource,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;<a href="/reference/androidx/paging/PagingSource.LoadResult.Page.html">PagingSource.LoadResult.Page</a>&lt;K,&nbsp;T&gt;&nbsp;initialPage,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/kotlinx/coroutines/CoroutineScope.html">CoroutineScope</a>&nbsp;coroutineScope,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a>&nbsp;notifyDispatcher,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a>&nbsp;fetchDispatcher,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;<a href="/reference/androidx/paging/PagedList.BoundaryCallback.html">PagedList.BoundaryCallback</a>&lt;T&gt;&nbsp;boundaryCallback,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/androidx/paging/PagedList.Config.html">PagedList.Config</a>&nbsp;config,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;K&nbsp;key<br>)</pre>
<p>Create a <code><a href="/reference/androidx/paging/PagedList.html">PagedList</a></code> which loads data from the provided data source on a background thread, posting updates to the main thread.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/androidx/paging/PagedList.html">PagedList</a>&lt;T&gt;</code></td>
<td width="100%">
<p>The newly created <code><a href="/reference/androidx/paging/PagedList.html">PagedList</a></code>, which will page in data from the <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> as needed.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>&lt;K&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>&gt;</code></td>
<td width="100%">
<p>Key type that indicates to the <code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> what data to load.</p>
</td>
</tr>
<tr>
<td><code>&lt;T&nbsp;extends&nbsp;<a href="/reference/java/lang/Object.html">Object</a>&gt;</code></td>
<td width="100%">
<p>Type of items to be held and loaded by the <code><a href="/reference/androidx/paging/PagedList.html">PagedList</a></code>.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a>&lt;K,&nbsp;T&gt;&nbsp;pagingSource</code></td>
<td width="100%">
<p><code><a href="/reference/androidx/paging/PagingSource.html">PagingSource</a></code> providing data to the <code><a href="/reference/androidx/paging/PagedList.html">PagedList</a></code></p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a>&nbsp;notifyDispatcher</code></td>
<td width="100%">
<p><code><a href="/reference/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a></code> that will use and consume data from the <code><a href="/reference/androidx/paging/PagedList.html">PagedList</a></code>. Generally, this is the UI/main thread.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a>&nbsp;fetchDispatcher</code></td>
<td width="100%">
<p>Data loading jobs will be dispatched to this <code><a href="/reference/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a></code> - should be a background thread.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;<a href="/reference/androidx/paging/PagedList.BoundaryCallback.html">PagedList.BoundaryCallback</a>&lt;T&gt;&nbsp;boundaryCallback</code></td>
<td width="100%">
<p>Optional boundary callback to attach to the list.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/androidx/paging/PagedList.Config.html">PagedList.Config</a>&nbsp;config</code></td>
<td width="100%">
<p><code><a href="/reference/androidx/paging/PagedList.Config.html">PagedList.Config</a></code>, which defines how the <code><a href="/reference/androidx/paging/PagedList.html">PagedList</a></code> will load data.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>