From cd5a527223503ca911032521ed3e888320e64d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=A8=E5=BD=A6?= Date: Tue, 7 Jun 2022 15:11:52 +0800 Subject: [PATCH] feat: add task complete callback --- README.md | 6 +++++- sample/src/main/java/me/wcy/init/sample/MainApplication.kt | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a1bbaa..dafc882 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,11 @@ class AppApplication : Application() { override fun onCreate() { super.onCreate() - CTaskManager.start(this) + CTaskManager.start(this, onTaskComplete = { + Log.i("WCY", "task complete: $it") + }) { + Log.i("WCY", "all task complete") + } } } ``` diff --git a/sample/src/main/java/me/wcy/init/sample/MainApplication.kt b/sample/src/main/java/me/wcy/init/sample/MainApplication.kt index 4db6a8b..3d6a9e0 100644 --- a/sample/src/main/java/me/wcy/init/sample/MainApplication.kt +++ b/sample/src/main/java/me/wcy/init/sample/MainApplication.kt @@ -1,6 +1,7 @@ package me.wcy.init.sample import android.app.Application +import android.util.Log import me.wcy.init.api.CTaskManager /** @@ -10,6 +11,10 @@ class MainApplication : Application() { override fun onCreate() { super.onCreate() - CTaskManager.start(this) + CTaskManager.start(this, onTaskComplete = { + Log.i("WCY", "task complete: $it") + }) { + Log.i("WCY", "all task complete") + } } } \ No newline at end of file