blob: c6316f5ebdeb4ac30a6e4400475db9577885f69f [file] [log] [blame]
<html devsite="true">
<head>
<title>PagedList.Companion</title>
{% setvar book_path %}/reference/kotlin/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/_kotlin_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 functions</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/paging/PagedList.html">PagedList</a>&lt;T&gt;</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/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;pagingSource:&nbsp;<a href="/reference/kotlin/androidx/paging/PagingSource.html">PagingSource</a>&lt;K,&nbsp;T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;initialPage:&nbsp;<a href="/reference/kotlin/androidx/paging/PagingSource.LoadResult.Page.html">PagingSource.LoadResult.Page</a>&lt;K,&nbsp;T&gt;?,<br>&nbsp;&nbsp;&nbsp;&nbsp;coroutineScope:&nbsp;<a href="/reference/kotlin/kotlinx/coroutines/CoroutineScope.html">CoroutineScope</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;notifyDispatcher:&nbsp;<a href="/reference/kotlin/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;fetchDispatcher:&nbsp;<a href="/reference/kotlin/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;boundaryCallback:&nbsp;<a href="/reference/kotlin/androidx/paging/PagedList.BoundaryCallback.html">PagedList.BoundaryCallback</a>&lt;T&gt;?,<br>&nbsp;&nbsp;&nbsp;&nbsp;config:&nbsp;<a href="/reference/kotlin/androidx/paging/PagedList.Config.html">PagedList.Config</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;key:&nbsp;K?<br>)</code></div>
<p>Create a <code><a href="/reference/kotlin/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 functions</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/kotlin/[JVM root]/&lt;ERROR CLASS&gt;.html">&lt;ERROR CLASS&gt;</a><br>fun&nbsp;<a href="/reference/kotlin/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;pagingSource:&nbsp;<a href="/reference/kotlin/androidx/paging/PagingSource.html">PagingSource</a>&lt;K,&nbsp;T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;initialPage:&nbsp;<a href="/reference/kotlin/androidx/paging/PagingSource.LoadResult.Page.html">PagingSource.LoadResult.Page</a>&lt;K,&nbsp;T&gt;?,<br>&nbsp;&nbsp;&nbsp;&nbsp;coroutineScope:&nbsp;<a href="/reference/kotlin/kotlinx/coroutines/CoroutineScope.html">CoroutineScope</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;notifyDispatcher:&nbsp;<a href="/reference/kotlin/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;fetchDispatcher:&nbsp;<a href="/reference/kotlin/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;boundaryCallback:&nbsp;<a href="/reference/kotlin/androidx/paging/PagedList.BoundaryCallback.html">PagedList.BoundaryCallback</a>&lt;T&gt;?,<br>&nbsp;&nbsp;&nbsp;&nbsp;config:&nbsp;<a href="/reference/kotlin/androidx/paging/PagedList.Config.html">PagedList.Config</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;key:&nbsp;K?<br>):&nbsp;<a href="/reference/kotlin/androidx/paging/PagedList.html">PagedList</a>&lt;T&gt;</pre>
<p>Create a <code><a href="/reference/kotlin/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/kotlin/androidx/paging/PagedList.html">PagedList</a>&lt;T&gt;</code></td>
<td width="100%">
<p>The newly created <code><a href="/reference/kotlin/androidx/paging/PagedList.html">PagedList</a></code>, which will page in data from the <code><a href="/reference/kotlin/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>K</code></td>
<td width="100%">
<p>Key type that indicates to the <code><a href="/reference/kotlin/androidx/paging/PagingSource.html">PagingSource</a></code> what data to load.</p>
</td>
</tr>
<tr>
<td><code>T</code></td>
<td width="100%">
<p>Type of items to be held and loaded by the <code><a href="/reference/kotlin/androidx/paging/PagedList.html">PagedList</a></code>.</p>
</td>
</tr>
<tr>
<td><code>pagingSource</code></td>
<td width="100%">
<p><code><a href="/reference/kotlin/androidx/paging/PagingSource.html">PagingSource</a></code> providing data to the <code><a href="/reference/kotlin/androidx/paging/PagedList.html">PagedList</a></code></p>
</td>
</tr>
<tr>
<td><code>notifyDispatcher</code></td>
<td width="100%">
<p><code><a href="/reference/kotlin/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a></code> that will use and consume data from the <code><a href="/reference/kotlin/androidx/paging/PagedList.html">PagedList</a></code>. Generally, this is the UI/main thread.</p>
</td>
</tr>
<tr>
<td><code>fetchDispatcher</code></td>
<td width="100%">
<p>Data loading jobs will be dispatched to this <code><a href="/reference/kotlin/kotlinx/coroutines/CoroutineDispatcher.html">CoroutineDispatcher</a></code> - should be a background thread.</p>
</td>
</tr>
<tr>
<td><code>boundaryCallback</code></td>
<td width="100%">
<p>Optional boundary callback to attach to the list.</p>
</td>
</tr>
<tr>
<td><code>config</code></td>
<td width="100%">
<p><code><a href="/reference/kotlin/androidx/paging/PagedList.Config.html">PagedList.Config</a></code>, which defines how the <code><a href="/reference/kotlin/androidx/paging/PagedList.html">PagedList</a></code> will load data.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>