You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
csamsclient/background/src/main/java/com/gyf/csams/main/model/ManagerActViewModel.kt

45 lines
1.1 KiB

package com.gyf.csams.main.model
import android.app.Application
import com.gyf.lib.model.ScrollViewModel
import com.gyf.lib.util.ActivityVo
import com.gyf.lib.util.randomChinese
import com.gyf.lib.util.randomDateTime
import com.gyf.lib.util.randomNum
/**
* 活动信息数据管理
*
* @constructor
*
* @param application
*/
class ManagerActViewModel(application: Application) : ScrollViewModel<ActivityVo>(application) {
override val initSize: Int = 10
init {
load()
}
fun load() {
_data.value?.apply {
repeat(initSize) {
add(
ActivityVo(
activityId = randomNum(8).toLong(),
activityName = randomChinese(5),
association = randomChinese(5),
score = (1..5).random(),
activityTime = randomDateTime(),
location = randomChinese(10)
)
)
}
}
}
fun loadMore(callback: (message: String) -> Unit) {
TODO("Not yet implemented")
}
}