|
|
@ -28,7 +28,7 @@ class ReplaceRuleViewModel(application: Application) : BaseViewModel(application |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun topSelect(rules: LinkedHashSet<ReplaceRule>) { |
|
|
|
fun topSelect(rules: List<ReplaceRule>) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
var minOrder = appDb.replaceRuleDao.minOrder - rules.size |
|
|
|
var minOrder = appDb.replaceRuleDao.minOrder - rules.size |
|
|
|
rules.forEach { |
|
|
|
rules.forEach { |
|
|
@ -45,7 +45,7 @@ class ReplaceRuleViewModel(application: Application) : BaseViewModel(application |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun bottomSelect(rules: LinkedHashSet<ReplaceRule>) { |
|
|
|
fun bottomSelect(rules: List<ReplaceRule>) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
var maxOrder = appDb.replaceRuleDao.maxOrder |
|
|
|
var maxOrder = appDb.replaceRuleDao.maxOrder |
|
|
|
rules.forEach { |
|
|
|
rules.forEach { |
|
|
@ -83,7 +83,7 @@ class ReplaceRuleViewModel(application: Application) : BaseViewModel(application |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun delSelection(rules: LinkedHashSet<ReplaceRule>) { |
|
|
|
fun delSelection(rules: List<ReplaceRule>) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
appDb.replaceRuleDao.delete(*rules.toTypedArray()) |
|
|
|
appDb.replaceRuleDao.delete(*rules.toTypedArray()) |
|
|
|
} |
|
|
|
} |
|
|
|