|
|
@@ -5,14 +5,12 @@ import com.github.kr328.clash.common.util.intent
|
|
|
import com.github.kr328.clash.common.util.ticker
|
|
|
import com.github.kr328.clash.design.MainDesign
|
|
|
import com.github.kr328.clash.design.ui.ToastDuration
|
|
|
-import com.github.kr328.clash.store.TipsStore
|
|
|
import com.github.kr328.clash.util.startClashService
|
|
|
import com.github.kr328.clash.util.stopClashService
|
|
|
import com.github.kr328.clash.util.withClash
|
|
|
import com.github.kr328.clash.util.withProfile
|
|
|
import kotlinx.coroutines.Dispatchers
|
|
|
import kotlinx.coroutines.isActive
|
|
|
-import kotlinx.coroutines.launch
|
|
|
import kotlinx.coroutines.selects.select
|
|
|
import kotlinx.coroutines.withContext
|
|
|
import java.util.concurrent.TimeUnit
|
|
|
@@ -23,10 +21,6 @@ class MainActivity : BaseActivity<MainDesign>() {
|
|
|
|
|
|
setContentDesign(design)
|
|
|
|
|
|
- launch(Dispatchers.IO) {
|
|
|
- showUpdatedTips(design)
|
|
|
- }
|
|
|
-
|
|
|
design.fetch()
|
|
|
|
|
|
val ticker = ticker(TimeUnit.SECONDS.toMillis(1))
|
|
|
@@ -75,20 +69,6 @@ class MainActivity : BaseActivity<MainDesign>() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private suspend fun showUpdatedTips(design: MainDesign) {
|
|
|
- val tips = TipsStore(this)
|
|
|
-
|
|
|
- if (tips.primaryVersion != TipsStore.CURRENT_PRIMARY_VERSION) {
|
|
|
- tips.primaryVersion = TipsStore.CURRENT_PRIMARY_VERSION
|
|
|
-
|
|
|
- val pkg = packageManager.getPackageInfo(packageName, 0)
|
|
|
-
|
|
|
- if (pkg.firstInstallTime != pkg.lastUpdateTime) {
|
|
|
- design.showUpdatedTips()
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
private suspend fun MainDesign.fetch() {
|
|
|
setClashRunning(clashRunning)
|
|
|
|