17

Android Paging

 3 years ago
source link: https://developer.android.com/codelabs/android-paging#0
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Android Paging

About this codelab

subjectLast updated May 18, 2021
account_circleWritten by Florina Muntenescu

1. Introduction

What you'll learn

  • What the main components of Paging 3.0 are.
  • How to add Paging 3.0 to your project.
  • How to add a header or footer to your list using the Paging 3.0 API.
  • How to add list separators using the Paging 3.0 API.
  • How to page from network and database

What you'll build

In this codelab, you start with a sample app that already displays a list of GitHub repositories. Whenever the user scrolls to the end of the displayed list, a new network request is triggered and its result is displayed on the screen.

You will add code through a series of steps, to achieve the following:

  • Migrate to the Paging library components.
  • Add a loading status header and footer to your list.
  • Show loading progress between every new repository search.
  • Add separators in your list.
  • Add database support for paging from network and database

Here's what your app will look like in the end:

e662a697dd078356.png

What you'll need

For an introduction to Architecture Components, check out the Room with a View codelab. For an introduction to Flow, check out the Advanced Coroutines with Kotlin Flow and LiveData codelab.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK