Skip to content

Commit

Permalink
OpenStickerロード中の表示を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
tateisu committed Mar 19, 2023
1 parent 12f129a commit 04ca3d0
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 04ca3d0

Please sign in to comment.