Fixed UnnecessaryAbstractClass issue of detekt

This commit is contained in:
MohitMali 2023-07-04 19:22:30 +05:30 committed by Kelson
parent 1806495674
commit 7493b842b7
5 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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)