Giter Site home page Giter Site logo

jetpackdemo's Introduction

项目说明

参照CodeLabs的Paging示例(官方为Kotlin实现),本项目将会使用Java完整实现网络带数据库缓存的分页列表加载。
所有使用的组件都基于Jetpack,并采用Google官方推荐的唯一可信数据源app架构。
项目中包含两个分支:master、paging_way,便于体现由传统实现向基于paging实现的演进过程。

参考CodeLabs:http://clmirror.storage.googleapis.com/codelabs/android-paging/index.html?index=..%2F..index#0

master分支

基于传统监听Scroll滚动触发分页加载,未使用到DataSource、PagedList、BoundaryCallback实现分页

paging_way分支

基于Paged实现网络带缓存的分页列表加载

知识点

1.基于Android MVVM架构和Jitpack组件集构建Google标准应用架构
2.项目结构
3.ViewModel
4.DataBinding
5.PagedListAdapter
6.PadgedList
7.BoundaryCallback
8.Room & DataSource
9.LiveData & using transformations
1.map:关联两个LiveData,使原数据变化时,调用注入的函数,随之将返回值作为变换后的数据通知
2.switchMap:使转换后数据对象可以同时监听原数据和变换函数返回的数据

其他知识点

1.TextInputLayout组件
2.StaggeradGridLayoutManager(RecyclerView的瀑布流)
3.RecyclerView.Adapter的局部组件刷新:notify(... , Object payload)实现刷新列表项具体某个字段数据

运行截图

image

jetpackdemo's People

Contributors

ideniden avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.