pull/2473/head
parent
4affce176f
commit
f05b057182
@ -1,29 +0,0 @@ |
|||||||
package io.legado.app.ui.book.toc |
|
||||||
|
|
||||||
import android.app.Application |
|
||||||
import io.legado.app.base.BaseViewModel |
|
||||||
import io.legado.app.data.appDb |
|
||||||
import io.legado.app.data.entities.TxtTocRule |
|
||||||
import io.legado.app.help.DefaultData |
|
||||||
|
|
||||||
/** |
|
||||||
* txt目录规则 |
|
||||||
*/ |
|
||||||
class TxtTocRegexViewModel(application: Application) : BaseViewModel(application) { |
|
||||||
|
|
||||||
fun saveRule(rule: TxtTocRule) { |
|
||||||
execute { |
|
||||||
if (rule.serialNumber < 0) { |
|
||||||
rule.serialNumber = appDb.txtTocRuleDao.maxOrder + 1 |
|
||||||
} |
|
||||||
appDb.txtTocRuleDao.insert(rule) |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
fun importDefault() { |
|
||||||
execute { |
|
||||||
DefaultData.importDefaultTocRules() |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1,4 +1,4 @@ |
|||||||
package io.legado.app.ui.book.import.local.rule |
package io.legado.app.ui.book.toc.rule |
||||||
|
|
||||||
import android.annotation.SuppressLint |
import android.annotation.SuppressLint |
||||||
import android.os.Bundle |
import android.os.Bundle |
@ -1,4 +1,4 @@ |
|||||||
package io.legado.app.ui.book.import.local.rule |
package io.legado.app.ui.book.toc.rule |
||||||
|
|
||||||
import android.content.Context |
import android.content.Context |
||||||
import android.os.Bundle |
import android.os.Bundle |
Loading…
Reference in new issue