mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-06 02:35:41 +08:00
Merge code
This commit is contained in:
@@ -120,7 +120,7 @@ object IconRuleManagerTool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
confirmButton {
|
confirmButton {
|
||||||
sync(context) {
|
sync(context, sourceType, customUrl) {
|
||||||
context.modulePrefs.putInt(SOURCE_SYNC_WAY, sourceType)
|
context.modulePrefs.putInt(SOURCE_SYNC_WAY, sourceType)
|
||||||
it()
|
it()
|
||||||
}
|
}
|
||||||
@@ -174,11 +174,16 @@ object IconRuleManagerTool {
|
|||||||
/**
|
/**
|
||||||
* 从在线地址同步规则
|
* 从在线地址同步规则
|
||||||
* @param context 实例
|
* @param context 实例
|
||||||
|
* @param sourceType 同步地址类型
|
||||||
|
* @param customUrl 自定义同步地址
|
||||||
* @param it 成功后回调
|
* @param it 成功后回调
|
||||||
*/
|
*/
|
||||||
fun sync(context: Context, it: () -> Unit) {
|
fun sync(
|
||||||
val sourceType = context.modulePrefs.getInt(SOURCE_SYNC_WAY, TYPE_SOURCE_SYNC_WAY_1)
|
context: Context,
|
||||||
val customUrl = context.modulePrefs.getString(SOURCE_SYNC_WAY_CUSTOM_URL)
|
sourceType: Int = context.modulePrefs.getInt(SOURCE_SYNC_WAY, TYPE_SOURCE_SYNC_WAY_1),
|
||||||
|
customUrl: String = context.modulePrefs.getString(SOURCE_SYNC_WAY_CUSTOM_URL),
|
||||||
|
it: () -> Unit
|
||||||
|
) {
|
||||||
when (sourceType) {
|
when (sourceType) {
|
||||||
TYPE_SOURCE_SYNC_WAY_1 ->
|
TYPE_SOURCE_SYNC_WAY_1 ->
|
||||||
onRefreshing(context, url = "https://raw.fastgit.org/fankes/AndroidNotifyIconAdapt/main", it)
|
onRefreshing(context, url = "https://raw.fastgit.org/fankes/AndroidNotifyIconAdapt/main", it)
|
||||||
|
Reference in New Issue
Block a user