mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
Fixed UnnecessaryAbstractClass issue of detekt
This commit is contained in:
parent
1806495674
commit
7493b842b7
@ -560,6 +560,7 @@ class CustomPageIndicator @JvmOverloads constructor(
|
||||
/**
|
||||
* A [ValueAnimator] that starts once a given predicate returns true.
|
||||
*/
|
||||
@Suppress("UnnecessaryAbstractClass")
|
||||
abstract inner class PendingStartAnimator(private var predicate: StartPredicate) :
|
||||
ValueAnimator() {
|
||||
private var hasStarted = false
|
||||
|
@ -32,6 +32,7 @@ import org.kiwix.kiwixmobile.core.downloader.DownloadMonitor
|
||||
import org.kiwix.kiwixmobile.core.utils.files.FileLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
@Suppress("UnnecessaryAbstractClass")
|
||||
abstract class CoreApp : Application() {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
|
@ -24,6 +24,7 @@ import org.kiwix.kiwixmobile.core.base.BaseContract.View
|
||||
/**
|
||||
* All presenters should inherit from this presenter.
|
||||
*/
|
||||
@Suppress("UnnecessaryAbstractClass")
|
||||
abstract class BasePresenter<T : View<*>?> : Presenter<T> {
|
||||
@JvmField val compositeDisposable = CompositeDisposable()
|
||||
@JvmField var view: T? = null
|
||||
|
@ -40,6 +40,7 @@ import org.kiwix.kiwixmobile.core.main.CoreMainActivity
|
||||
import org.kiwix.kiwixmobile.core.utils.CONTACT_EMAIL_ADDRESS
|
||||
import org.kiwix.kiwixmobile.core.utils.LanguageUtils.Companion.getCurrentLocale
|
||||
|
||||
@Suppress("UnnecessaryAbstractClass")
|
||||
abstract class HelpFragment : BaseFragment() {
|
||||
private var fragmentHelpBinding: FragmentHelpBinding? = null
|
||||
protected open fun rawTitleDescriptionMap(): List<Pair<Int, Int>> = emptyList()
|
||||
|
@ -100,25 +100,28 @@ class CustomDownloadFragment : BaseFragment(), FragmentActivityExtensions {
|
||||
activity?.finish()
|
||||
}
|
||||
|
||||
private fun render(state: State) {
|
||||
private fun render(state: State): Unit? {
|
||||
return when (state) {
|
||||
DownloadRequired ->
|
||||
fragmentCustomDownloadBinding?.cdViewAnimator?.setDistinctDisplayedChild(0)
|
||||
|
||||
is DownloadInProgress -> {
|
||||
fragmentCustomDownloadBinding?.cdViewAnimator?.setDistinctDisplayedChild(1)
|
||||
render(state.downloads[0])
|
||||
showDownloadingProgress(state.downloads[0])
|
||||
}
|
||||
|
||||
is DownloadFailed -> {
|
||||
fragmentCustomDownloadBinding?.cdViewAnimator?.setDistinctDisplayedChild(2)
|
||||
fragmentCustomDownloadBinding?.customDownloadError?.cdErrorText?.text =
|
||||
context?.let(state.downloadState::toReadableState)
|
||||
}
|
||||
|
||||
DownloadComplete ->
|
||||
fragmentCustomDownloadBinding?.cdViewAnimator?.setDistinctDisplayedChild(3)
|
||||
}!!
|
||||
}
|
||||
}
|
||||
|
||||
private fun render(downloadItem: DownloadItem) {
|
||||
private fun showDownloadingProgress(downloadItem: DownloadItem) {
|
||||
fragmentCustomDownloadBinding?.customDownloadInProgress?.apply {
|
||||
cdDownloadState.text = downloadItem.readableEta
|
||||
cdEta.text = context?.let(downloadItem.downloadState::toReadableState)
|
||||
|
Loading…
x
Reference in New Issue
Block a user