Compare commits

..

7 Commits

Author SHA1 Message Date
2dust
2c2bc86457 Update build.gradle 2022-08-13 08:34:43 +08:00
2dust
68a03a93b5 Merge pull request #1618 from zhaoguomanong/master
Fix app crashing during updating subscribe & translation error
2022-08-12 20:11:34 +08:00
2dust
5127a30ae9 Merge pull request #1617 from Fe3O4-Git/patch-1
tweak toast in UserAssetActivity.kt
2022-08-12 20:02:40 +08:00
zhaoguomanong
8b76a7a4f4 avoid modifying serversCache serverList from multithreading
Bug: app force close during updating subscribe

Reroduce steps: quickly scroll up and down the RecyclerView during updating subscribe
if the server list length is more than the screen height, the bug can be 100% reproduced

Solution: reloadServerList from UI Thread

Signed-off-by: zhaoguomanong <zhaoguomanong@gmail.com>
2022-08-12 15:15:32 +08:00
zhaoguomanong
b6aec3fd63 fix translation error
Signed-off-by: zhaoguomanong <zhaoguomanong@gmail.com>
2022-08-12 11:09:23 +08:00
LiAlH4
18e0dc4546 fix 2022-08-12 08:07:46 +08:00
LiAlH4
129c1db995 tweak toast in UserAssetActivity.kt
add missing space
2022-08-12 08:06:06 +08:00
4 changed files with 7 additions and 11 deletions

View File

@@ -18,8 +18,8 @@ android {
minSdkVersion 21
targetSdkVersion Integer.parseInt("$targetSdkVer")
multiDexEnabled true
versionCode 470
versionName "1.7.17"
versionCode 472
versionName "1.7.18"
}
if (props["sign"]) {

View File

@@ -141,10 +141,10 @@ class UserAssetActivity : BaseActivity() {
val result = downloadGeo(it, 60000, httpPort)
launch(Dispatchers.Main) {
if (result) {
toast(getString(R.string.toast_success) + it)
toast(getString(R.string.toast_success) + " " + it)
binding.recyclerView.adapter?.notifyDataSetChanged()
} else {
toast(getString(R.string.toast_failure) + it)
toast(getString(R.string.toast_failure) + " " + it)
}
}
}

View File

@@ -54,12 +54,8 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
fun reloadServerList() {
serverList = MmkvManager.decodeServerList()
viewModelScope.launch(Dispatchers.Default) {
updateCache()
launch(Dispatchers.Main) {
updateListAction.value = -1
}
}
updateCache()
updateListAction.value = -1
}
fun removeServer(guid: String) {

View File

@@ -31,7 +31,7 @@
<string name="menu_item_import_config_manually_trojan">手動鍵入 [Trojan]</string>
<string name="menu_item_import_config_custom">自訂組態</string>
<string name="menu_item_import_config_custom_clipboard">從剪貼簿匯入自訂組態</string>
<string name="menu_item_import_config_custom_local"> URL 匯入自訂組態</string>
<string name="menu_item_import_config_custom_local">本地匯入自訂組態</string>
<string name="menu_item_import_config_custom_url">從 URL 匯入自訂組態</string>
<string name="menu_item_import_config_custom_url_scan">掃描 URL 匯入自訂組態</string>
<string name="del_config_comfirm">確定刪除?</string>