feat: add rotate anim to profile update btn

This commit is contained in:
Steve Johnson
2023-10-30 18:57:51 +08:00
parent b091a87a37
commit 9773ea73d4
6 changed files with 56 additions and 4 deletions

View File

@@ -105,7 +105,7 @@ class MetaFeatureSettingsActivity : BaseActivity<MetaFeatureSettingsDesign>() {
val ext = "." + displayName.substringAfterLast(".")
if(!validDatabaseExtensions.contains(ext))
{
val dialog = MaterialAlertDialogBuilder(this)
MaterialAlertDialogBuilder(this)
.setTitle("Unknown Database Format")
.setMessage("Only ${validDatabaseExtensions.joinToString("/")} are supported")
.setPositiveButton("OK"){ _, _ -> }

View File

@@ -6,8 +6,10 @@ import com.github.kr328.clash.common.util.ticker
import com.github.kr328.clash.design.ProfilesDesign
import com.github.kr328.clash.service.model.Profile
import com.github.kr328.clash.util.withProfile
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext
import java.util.concurrent.TimeUnit
class ProfilesActivity : BaseActivity<ProfilesDesign>() {
@@ -34,9 +36,16 @@ class ProfilesActivity : BaseActivity<ProfilesDesign>() {
startActivity(NewProfileActivity::class.intent)
ProfilesDesign.Request.UpdateAll ->
withProfile {
queryAll().forEach { p ->
if (p.imported && p.type != Profile.Type.File)
update(p.uuid)
try {
queryAll().forEach { p ->
if (p.imported && p.type != Profile.Type.File)
update(p.uuid)
}
}
finally {
withContext(Dispatchers.Main) {
design.finishUpdateAll();
}
}
}
is ProfilesDesign.Request.Update ->