Skip to content

zahid-git/Paging3-Image-Loading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paging3 Image Loading Example

This repository demonstrates how to implement efficient pagination with image loading in an Android app using Paging 3, Kotlin, and Jetpack Compose.

Features

  • Pagination with Paging3: Seamlessly load data page by page as the user scrolls.
  • Jetpack Compose UI: Modern, declarative UI with Compose.
  • Image Loading: Efficient and smooth image loading for paged items.
  • Kotlin: Entire project written in idiomatic Kotlin.

Sample

2025-06-17.12.22.21.mp4

Getting Started

Prerequisites

  • Android Studio (Chipmunk or newer recommended)
  • Minimum SDK 21+
  • Kotlin 1.7 or newer

How to Run

  1. Clone the repository:
    git clone https://github.com/zahid-git/Paging3-Image-Loading.git
  2. Open in Android Studio:
    • Select Open an existing Android Studio project and navigate to the cloned folder.
  3. Build and Run:
    • Click the 'Run' button or use Shift+F10 to build and launch the app on your device or emulator.

Key Libraries Used

Example Usage

The app fetches a list of images (e.g., from a mock API), displays them in a vertical list, and automatically loads more as you scroll.

val pager = Pager(
    config = PagingConfig(pageSize = 20),
    pagingSourceFactory = { ImagePagingSource(api) }
).flow.cachedIn(viewModelScope)

Full Instruction

Check on Medium

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages