diff --git a/app/src/main/java/io/legado/app/model/CheckSource.kt b/app/src/main/java/io/legado/app/model/CheckSource.kt index e3d313bca..c43aafe33 100644 --- a/app/src/main/java/io/legado/app/model/CheckSource.kt +++ b/app/src/main/java/io/legado/app/model/CheckSource.kt @@ -38,6 +38,12 @@ object CheckSource { } } + fun resume(context: Context) { + context.startService { + action = IntentAction.resume + } + } + fun putConfig() { CacheManager.put("checkSourceTimeout", timeout) CacheManager.put("checkSearch", checkSearch) diff --git a/app/src/main/java/io/legado/app/service/CheckSourceService.kt b/app/src/main/java/io/legado/app/service/CheckSourceService.kt index 44c3de4b6..bb92871fc 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -69,6 +69,7 @@ class CheckSourceService : BaseService() { IntentAction.start -> intent.getStringArrayListExtra("selectIds")?.let { check(it) } + IntentAction.resume -> upNotification() else -> stopSelf() } return super.onStartCommand(intent, flags, startId) diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index 02f750699..6f79b5d5c 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -1,11 +1,10 @@ package io.legado.app.ui.book.source.manage import android.annotation.SuppressLint +import android.content.Context +import android.hardware.display.DisplayManager import android.os.Bundle -import android.view.Menu -import android.view.MenuItem -import android.view.SubMenu -import android.view.WindowManager +import android.view.* import androidx.activity.viewModels import androidx.appcompat.app.AlertDialog import androidx.appcompat.widget.PopupMenu @@ -29,6 +28,7 @@ import io.legado.app.lib.theme.primaryColor import io.legado.app.lib.theme.primaryTextColor import io.legado.app.model.CheckSource import io.legado.app.model.Debug +import io.legado.app.service.CheckSourceService import io.legado.app.ui.association.ImportBookSourceDialog import io.legado.app.ui.book.local.rule.TxtTocRuleActivity import io.legado.app.ui.book.source.debug.BookSourceDebugActivity @@ -70,6 +70,9 @@ class BookSourceActivity : VMBaseActivity