Add Migrate button marginTop and implement Hide not found manga for mass migration (#372)
* Add Migrate button marginTop and implement Hide not found manga in mass migration * if else change * move variable to adapter * horizontal scroll view for checkboxes in migration_bottom_sheet.xml
This commit is contained in:
parent
1cf48b3ab7
commit
c123df4637
@ -236,6 +236,8 @@ object PreferenceKeys {
|
||||
|
||||
const val skipPreMigration = "skip_pre_migration"
|
||||
|
||||
const val hideNotFoundMigration = "hide_not_found_migration"
|
||||
|
||||
const val eh_showSyncIntro = "eh_show_sync_intro"
|
||||
|
||||
const val eh_readOnlySync = "eh_sync_read_only"
|
||||
|
@ -356,6 +356,8 @@ class PreferencesHelper(val context: Context) {
|
||||
|
||||
fun skipPreMigration() = flowPrefs.getBoolean(Keys.skipPreMigration, false)
|
||||
|
||||
fun hideNotFoundMigration() = flowPrefs.getBoolean(Keys.hideNotFoundMigration, false)
|
||||
|
||||
fun isHentaiEnabled() = flowPrefs.getBoolean(Keys.eh_is_hentai_enabled, true)
|
||||
|
||||
fun enableExhentai() = flowPrefs.getBoolean(Keys.eh_enableExHentai, false)
|
||||
|
@ -39,6 +39,7 @@ class MigrationBottomSheetDialog(activity: Activity, private val listener: Start
|
||||
|
||||
binding.fab.setOnClickListener {
|
||||
preferences.skipPreMigration().set(binding.skipStep.isChecked)
|
||||
preferences.hideNotFoundMigration().set(binding.HideNotFoundManga.isChecked)
|
||||
listener.startMigration(
|
||||
if (binding.useSmartSearch.isChecked && binding.extraSearchParamText.text.isNotBlank()) {
|
||||
binding.extraSearchParamText.toString()
|
||||
@ -72,6 +73,7 @@ class MigrationBottomSheetDialog(activity: Activity, private val listener: Start
|
||||
binding.sourceGroup.bindToPreference(preferences.useSourceWithMost())
|
||||
|
||||
binding.skipStep.isChecked = preferences.skipPreMigration().get()
|
||||
binding.HideNotFoundManga.isChecked = preferences.hideNotFoundMigration().get()
|
||||
binding.skipStep.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
(listener as? Controller)?.activity?.toast(
|
||||
|
@ -312,7 +312,9 @@ class MigrationListController(bundle: Bundle? = null) :
|
||||
)
|
||||
)
|
||||
}
|
||||
router.popCurrentController()
|
||||
if (adapter?.hideNotFound == false) {
|
||||
router.popCurrentController()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,8 @@ class MigrationProcessAdapter(
|
||||
|
||||
val menuItemListener: MigrationProcessInterface = controller
|
||||
|
||||
val hideNotFound = preferences.hideNotFoundMigration().get()
|
||||
|
||||
override fun updateDataSet(items: List<MigrationProcessItem>?) {
|
||||
this.items = items.orEmpty()
|
||||
super.updateDataSet(items)
|
||||
|
@ -113,9 +113,13 @@ class MigrationProcessHolder(
|
||||
}
|
||||
.launchIn(adapter.controller.viewScope)
|
||||
} else {
|
||||
binding.migrationMangaCardTo.loadingGroup.isVisible = false
|
||||
binding.migrationMangaCardTo.title.text = view.context.applicationContext
|
||||
.getString(R.string.no_alternatives_found)
|
||||
if (adapter.hideNotFound) {
|
||||
adapter.removeManga(bindingAdapterPosition)
|
||||
} else {
|
||||
binding.migrationMangaCardTo.loadingGroup.isVisible = false
|
||||
binding.migrationMangaCardTo.title.text = view.context.applicationContext
|
||||
.getString(R.string.no_alternatives_found)
|
||||
}
|
||||
}
|
||||
binding.migrationMenu.isVisible = true
|
||||
binding.skipManga.isVisible = false
|
||||
|
@ -24,67 +24,72 @@
|
||||
android:id="@+id/data_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/data_to_include_in_migration"
|
||||
android:textAppearance="@style/TextAppearance.Medium.Body2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/mig_chapters"
|
||||
android:layout_width="wrap_content"
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/migration_data_scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/chapters"
|
||||
app:layout_constraintStart_toStartOf="@+id/data_label"
|
||||
app:layout_constraintTop_toBottomOf="@+id/data_label" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/mig_categories"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/categories"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/mig_chapters"
|
||||
app:layout_constraintStart_toEndOf="@+id/mig_chapters"
|
||||
app:layout_constraintTop_toTopOf="@+id/mig_chapters" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/mig_tracking"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/track"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/mig_categories"
|
||||
app:layout_constraintStart_toEndOf="@+id/mig_categories"
|
||||
app:layout_constraintTop_toTopOf="@+id/mig_categories" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/mig_extra"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/log_extra"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/mig_tracking"
|
||||
android:scrollbars="none"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toEndOf="@+id/mig_tracking"
|
||||
app:layout_constraintTop_toTopOf="@+id/mig_tracking" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/data_label">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/mig_chapters"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/chapters" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/mig_categories"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/categories" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/mig_tracking"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/track" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/mig_extra"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/log_extra" />
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/options_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/action_settings"
|
||||
android:textAppearance="@style/TextAppearance.Medium.Body2"
|
||||
app:layout_constraintStart_toStartOf="@+id/mig_chapters"
|
||||
app:layout_constraintTop_toBottomOf="@+id/mig_chapters" />
|
||||
app:layout_constraintStart_toStartOf="@+id/migration_data_scrollView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/migration_data_scrollView" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/sourceGroup"
|
||||
@ -154,18 +159,30 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/skip_this_step_next_time"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/extra_search_param"
|
||||
app:layout_constraintStart_toStartOf="@+id/extra_search_param"
|
||||
app:layout_constraintTop_toBottomOf="@+id/extra_search_param_text" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/Hide_not_found_manga"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/hide_not_found_manga"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/skip_step"
|
||||
app:layout_constraintStart_toStartOf="@+id/skip_step"
|
||||
app:layout_constraintTop_toBottomOf="@+id/skip_step" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:minWidth="0dp"
|
||||
android:text="@string/action_migrate"
|
||||
app:icon="@drawable/ic_arrow_forward_24dp"
|
||||
app:layout_anchor="@id/constraintLayout"
|
||||
|
@ -404,6 +404,7 @@
|
||||
<string name="use_most_chapters">Use source with the most chapters (slower)</string>
|
||||
<string name="use_first_source">Use first source with alternative</string>
|
||||
<string name="skip_this_step_next_time">Skip this step next time</string>
|
||||
<string name="hide_not_found_manga">Hide not found manga</string>
|
||||
<string name="search_parameter">Search parameter (e.g. language:english)</string>
|
||||
<string name="latest_">Latest: %1$s</string>
|
||||
<string name="migrating_to">migrating to</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user