1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| package com.xw.common.base
|
| import android.app.Application
|
| abstract class BasePagingViewModel constructor(application: Application) : BaseViewModel(application) {
|
| val refreshLiveData = RefreshLiveData()
|
| protected var pageNo = 1
| protected var pageSize = 10
|
| fun loadMoreData() {
| getDataList(pageNo + 1)
| }
|
| fun refreshData() {
| getDataList(1)
| }
|
| abstract fun getDataList(index: Int)
| }
|
|