[优化] 修复崩溃问题
This commit is contained in:
2 files changed
+5
-3
No files matched your search
@@ -67,6 +67,7 @@ import io.legado.app.ui.book.import.remote.RemoteBookViewModel
|
|||||||
import io.legado.app.ui.book.import.remote.ServerConfigViewModel
|
import io.legado.app.ui.book.import.remote.ServerConfigViewModel
|
||||||
import io.legado.app.ui.book.import.remote.ServersViewModel
|
import io.legado.app.ui.book.import.remote.ServersViewModel
|
||||||
import io.legado.app.ui.book.info.BookInfoViewModel
|
import io.legado.app.ui.book.info.BookInfoViewModel
|
||||||
|
import io.legado.app.ui.book.manga.ReadMangaViewModel
|
||||||
import io.legado.app.ui.book.read.ReadBookViewModel
|
import io.legado.app.ui.book.read.ReadBookViewModel
|
||||||
import io.legado.app.ui.book.readRecord.ReadRecordViewModel
|
import io.legado.app.ui.book.readRecord.ReadRecordViewModel
|
||||||
import io.legado.app.ui.book.search.SearchViewModel
|
import io.legado.app.ui.book.search.SearchViewModel
|
||||||
@@ -183,6 +184,7 @@ val appModule = module {
|
|||||||
viewModelOf(::ServerConfigViewModel)
|
viewModelOf(::ServerConfigViewModel)
|
||||||
viewModelOf(::ServersViewModel)
|
viewModelOf(::ServersViewModel)
|
||||||
viewModelOf(::BookInfoViewModel)
|
viewModelOf(::BookInfoViewModel)
|
||||||
|
viewModelOf(::ReadMangaViewModel)
|
||||||
viewModelOf(::ReadBookViewModel)
|
viewModelOf(::ReadBookViewModel)
|
||||||
viewModelOf(::ChangeCoverViewModel)
|
viewModelOf(::ChangeCoverViewModel)
|
||||||
viewModelOf(::ChangeBookSourceComposeViewModel)
|
viewModelOf(::ChangeBookSourceComposeViewModel)
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import android.view.MenuItem
|
|||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import androidx.activity.addCallback
|
import androidx.activity.addCallback
|
||||||
import androidx.activity.viewModels
|
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.core.view.doOnLayout
|
import androidx.core.view.doOnLayout
|
||||||
import androidx.core.view.isGone
|
import androidx.core.view.isGone
|
||||||
@@ -99,6 +98,7 @@ import io.legado.app.utils.visible
|
|||||||
import kotlinx.coroutines.Dispatchers.IO
|
import kotlinx.coroutines.Dispatchers.IO
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
|
import org.koin.androidx.viewmodel.ext.android.viewModel
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ class ReadMangaActivity : VMBaseActivity<ActivityMangaBinding, ReadMangaViewMode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
override val binding by viewBinding(ActivityMangaBinding::inflate)
|
override val binding by viewBinding(ActivityMangaBinding::inflate)
|
||||||
override val viewModel by viewModels<ReadMangaViewModel>()
|
override val viewModel by viewModel<ReadMangaViewModel>()
|
||||||
private val loadingViewVisible get() = binding.flLoading.isVisible
|
private val loadingViewVisible get() = binding.flLoading.isVisible
|
||||||
private val df by lazy {
|
private val df by lazy {
|
||||||
DecimalFormat("0.0%")
|
DecimalFormat("0.0%")
|
||||||
@@ -1105,4 +1105,4 @@ class ReadMangaActivity : VMBaseActivity<ActivityMangaBinding, ReadMangaViewMode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user