pull/32/head
kunfei 5 years ago
parent d134c7e7c3
commit 68aeaa5ecb
  1. 5
      app/src/main/java/io/legado/app/help/BookHelp.kt
  2. 12
      app/src/main/java/io/legado/app/ui/read/ReadViewModel.kt

@ -21,7 +21,10 @@ object BookHelp {
fun formatAuthor(author: String?): String { fun formatAuthor(author: String?): String {
return author?.replace("\\s*者[\\s::]*".toRegex(), "")?.replace("\\s+".toRegex(), " ")?.trim { it <= ' ' } return author
?.replace("\\s*者[\\s::]*".toRegex(), "")
?.replace("\\s+".toRegex(), " ")
?.trim { it <= ' ' }
?: "" ?: ""
} }

@ -1,8 +1,20 @@
package io.legado.app.ui.read package io.legado.app.ui.read
import android.app.Application import android.app.Application
import android.content.Intent
import androidx.lifecycle.MutableLiveData
import io.legado.app.base.BaseViewModel import io.legado.app.base.BaseViewModel
import io.legado.app.data.entities.Book
class ReadViewModel(application: Application) : BaseViewModel(application) { class ReadViewModel(application: Application) : BaseViewModel(application) {
val bookData = MutableLiveData<Book>()
fun initData(intent: Intent) {
val bookUrl = intent.getStringExtra("bookUrl")
if (!bookUrl.isNullOrEmpty()) {
}
}
} }
Loading…
Cancel
Save