Minor cleanup
This commit is contained in:
parent
eba7d137ee
commit
b44afb6013
@ -27,10 +27,7 @@ class MigrationMangaDialog<T>(bundle: Bundle? = null) : DialogController(bundle)
|
|||||||
confirmRes,
|
confirmRes,
|
||||||
mangaSet,
|
mangaSet,
|
||||||
mangaSet,
|
mangaSet,
|
||||||
(
|
(if (mangaSkipped > 0) " " + applicationContext?.getString(R.string.skipping_, mangaSkipped) else ""),
|
||||||
if (mangaSkipped > 0) " " + applicationContext?.getString(R.string.skipping_, mangaSkipped)
|
|
||||||
else ""
|
|
||||||
),
|
|
||||||
).orEmpty()
|
).orEmpty()
|
||||||
return MaterialAlertDialogBuilder(activity!!)
|
return MaterialAlertDialogBuilder(activity!!)
|
||||||
.setMessage(confirmString)
|
.setMessage(confirmString)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package eu.kanade.tachiyomi.ui.browse.migration.advanced.process
|
package eu.kanade.tachiyomi.ui.browse.migration.advanced.process
|
||||||
|
|
||||||
import android.content.pm.ActivityInfo
|
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
@ -97,12 +96,6 @@ class MigrationListController(bundle: Bundle? = null) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
|
||||||
super.onDestroy()
|
|
||||||
|
|
||||||
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun enableButtons() {
|
private fun enableButtons() {
|
||||||
activity?.invalidateOptionsMenu()
|
activity?.invalidateOptionsMenu()
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import android.os.Parcelable
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import eu.kanade.presentation.browse.BrowseTabWrapper
|
import eu.kanade.presentation.browse.BrowseTabWrapper
|
||||||
import eu.kanade.tachiyomi.R
|
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.FullComposeController
|
import eu.kanade.tachiyomi.ui.base.controller.FullComposeController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.requestPermissionsSafe
|
import eu.kanade.tachiyomi.ui.base.controller.requestPermissionsSafe
|
||||||
import eu.kanade.tachiyomi.util.system.getParcelableCompat
|
import eu.kanade.tachiyomi.util.system.getParcelableCompat
|
||||||
@ -16,15 +15,6 @@ class SourcesController(bundle: Bundle? = null) : FullComposeController<SourcesP
|
|||||||
private val smartSearchConfig = args.getParcelableCompat<SmartSearchConfig>(SMART_SEARCH_CONFIG)
|
private val smartSearchConfig = args.getParcelableCompat<SmartSearchConfig>(SMART_SEARCH_CONFIG)
|
||||||
private val mode = if (smartSearchConfig == null) Mode.CATALOGUE else Mode.SMART_SEARCH
|
private val mode = if (smartSearchConfig == null) Mode.CATALOGUE else Mode.SMART_SEARCH
|
||||||
|
|
||||||
override fun getTitle(): String? {
|
|
||||||
// SY -->
|
|
||||||
return when (mode) {
|
|
||||||
Mode.CATALOGUE -> applicationContext?.getString(R.string.label_sources)
|
|
||||||
Mode.SMART_SEARCH -> applicationContext?.getString(R.string.find_in_another_source)
|
|
||||||
}
|
|
||||||
// SY <--
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun createPresenter() = SourcesPresenterWrapper(controllerMode = mode, smartSearchConfig = smartSearchConfig)
|
override fun createPresenter() = SourcesPresenterWrapper(controllerMode = mode, smartSearchConfig = smartSearchConfig)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
@ -113,11 +113,16 @@ class LibraryController(
|
|||||||
// SY -->
|
// SY -->
|
||||||
onClickCleanTitles = ::cleanTitles,
|
onClickCleanTitles = ::cleanTitles,
|
||||||
onClickMigrate = {
|
onClickMigrate = {
|
||||||
val skipPre = Injekt.get<PreferencesHelper>().skipPreMigration().get()
|
val selectedMangaIds = presenter.selection
|
||||||
val selectedMangaIds = presenter.selection.filterNot { it.source == MERGED_SOURCE_ID }.mapNotNull { it.id }
|
.filterNot { it.source == MERGED_SOURCE_ID }
|
||||||
|
.mapNotNull { it.id }
|
||||||
presenter.clearSelection()
|
presenter.clearSelection()
|
||||||
if (selectedMangaIds.isNotEmpty()) {
|
if (selectedMangaIds.isNotEmpty()) {
|
||||||
PreMigrationController.navigateToMigration(skipPre, router, selectedMangaIds)
|
PreMigrationController.navigateToMigration(
|
||||||
|
Injekt.get<PreferencesHelper>().skipPreMigration().get(),
|
||||||
|
router,
|
||||||
|
selectedMangaIds,
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
activity?.toast(R.string.no_valid_manga)
|
activity?.toast(R.string.no_valid_manga)
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,6 @@ class SmartSearchController(bundle: Bundle) : FullComposeController<SmartSearchP
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun getTitle() = source.name
|
|
||||||
|
|
||||||
override fun createPresenter() = SmartSearchPresenter(source, smartSearchConfig)
|
override fun createPresenter() = SmartSearchPresenter(source, smartSearchConfig)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user