1
0
mirror of https://github.com/tateisu/SubwayTooter synced 2025-01-31 11:04:56 +01:00

OpenStickerロード中の表示を追加

This commit is contained in:
tateisu 2023-03-20 05:58:35 +09:00
parent 12f129a878
commit 04ca3d017a

View File

@ -31,23 +31,25 @@ class ColumnTask_Loading(
internal var listPinned: ArrayList<TimelineItem>? = null
private fun fireProgress(s:String){
runOnMainLooper {
if (isCancelled) return@runOnMainLooper
column.taskProgress = s
column.fireShowContent(reason = "loading progress", changeList = ArrayList())
}
}
override suspend fun background(): TootApiResult? {
ctStarted.set(true)
if (PrefB.bpOpenSticker.value) {
fireProgress("loading openSticker")
OpenSticker.loadAndWait()
}
val client = TootApiClient(context, callback = object : TootApiCallback {
override suspend fun isApiCancelled() = isCancelled || column.isDispose.get()
override suspend fun publishApiProgress(s: String) {
runOnMainLooper {
if (isCancelled) return@runOnMainLooper
column.taskProgress = s
column.fireShowContent(reason = "loading progress", changeList = ArrayList())
}
}
override suspend fun publishApiProgress(s: String) = fireProgress(s)
})
client.account = accessInfo