Improve migration bottom sheet design
This commit is contained in:
parent
b98dc6e1a5
commit
a0af459cfc
@ -9,7 +9,6 @@ import android.widget.RadioButton
|
|||||||
import android.widget.RadioGroup
|
import android.widget.RadioGroup
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import com.bluelinelabs.conductor.Controller
|
|
||||||
import com.fredporciuncula.flow.preferences.Preference
|
import com.fredporciuncula.flow.preferences.Preference
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||||
@ -19,13 +18,13 @@ import eu.kanade.tachiyomi.util.system.toast
|
|||||||
import eu.kanade.tachiyomi.widget.sheet.BaseBottomSheetDialog
|
import eu.kanade.tachiyomi.widget.sheet.BaseBottomSheetDialog
|
||||||
import uy.kohesive.injekt.injectLazy
|
import uy.kohesive.injekt.injectLazy
|
||||||
|
|
||||||
class MigrationBottomSheetDialog(activity: Activity, private val listener: StartMigrationListener) : BaseBottomSheetDialog(activity) {
|
class MigrationBottomSheetDialog(private val activity: Activity, private val listener: StartMigrationListener) : BaseBottomSheetDialog(activity) {
|
||||||
private val preferences: PreferencesHelper by injectLazy()
|
private val preferences: PreferencesHelper by injectLazy()
|
||||||
|
|
||||||
lateinit var binding: MigrationBottomSheetBinding
|
lateinit var binding: MigrationBottomSheetBinding
|
||||||
|
|
||||||
override fun createView(inflater: LayoutInflater): View {
|
override fun createView(inflater: LayoutInflater): View {
|
||||||
binding = MigrationBottomSheetBinding.inflate(inflater)
|
binding = MigrationBottomSheetBinding.inflate(activity.layoutInflater)
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +36,7 @@ class MigrationBottomSheetDialog(activity: Activity, private val listener: Start
|
|||||||
|
|
||||||
initPreferences()
|
initPreferences()
|
||||||
|
|
||||||
binding.fab.setOnClickListener {
|
binding.migrateBtn.setOnClickListener {
|
||||||
preferences.skipPreMigration().set(binding.skipStep.isChecked)
|
preferences.skipPreMigration().set(binding.skipStep.isChecked)
|
||||||
preferences.hideNotFoundMigration().set(binding.HideNotFoundManga.isChecked)
|
preferences.hideNotFoundMigration().set(binding.HideNotFoundManga.isChecked)
|
||||||
listener.startMigration(
|
listener.startMigration(
|
||||||
@ -76,7 +75,7 @@ class MigrationBottomSheetDialog(activity: Activity, private val listener: Start
|
|||||||
binding.HideNotFoundManga.isChecked = preferences.hideNotFoundMigration().get()
|
binding.HideNotFoundManga.isChecked = preferences.hideNotFoundMigration().get()
|
||||||
binding.skipStep.setOnCheckedChangeListener { _, isChecked ->
|
binding.skipStep.setOnCheckedChangeListener { _, isChecked ->
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
(listener as? Controller)?.activity?.toast(
|
context.toast(
|
||||||
R.string.pre_migration_skip_toast,
|
R.string.pre_migration_skip_toast,
|
||||||
Toast.LENGTH_LONG
|
Toast.LENGTH_LONG
|
||||||
)
|
)
|
||||||
|
@ -4,19 +4,56 @@
|
|||||||
android:id="@+id/constraintLayout"
|
android:id="@+id/constraintLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/transparent"
|
android:clipToPadding="false"
|
||||||
|
android:paddingVertical="8dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/drag_pill"
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="3dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:src="@drawable/oval"
|
||||||
|
app:tint="?attr/colorOnSurfaceVariant"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/migrate_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text="@string/label_migration"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textColor="?attr/colorOnSurface"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/drag_pill"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/title_divider"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="?android:attr/divider"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/migrate_title"/>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout2"
|
android:id="@+id/constraintLayout2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="12dp"
|
||||||
android:background="?attr/colorSurface"
|
android:background="@android:color/transparent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toBottomOf="@id/title_divider"
|
||||||
app:layout_constraintVertical_bias="0.0">
|
app:layout_constraintVertical_bias="0.0">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -26,7 +63,8 @@
|
|||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="@string/data_to_include_in_migration"
|
android:text="@string/data_to_include_in_migration"
|
||||||
android:textAppearance="?attr/textAppearanceTitleSmall"
|
android:textAppearance="?attr/textAppearanceTitleMedium"
|
||||||
|
android:textColor="?attr/colorPrimary"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@ -79,17 +117,29 @@
|
|||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:text="@string/log_extra" />
|
android:text="@string/log_extra" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/migration_data_divider"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:background="?android:attr/divider"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/migration_data_scrollView"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/options_label"
|
android:id="@+id/options_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="16dp"
|
||||||
android:text="@string/action_settings"
|
android:text="@string/action_settings"
|
||||||
android:textAppearance="?attr/textAppearanceTitleSmall"
|
android:textAppearance="?attr/textAppearanceTitleMedium"
|
||||||
|
android:textColor="?attr/colorPrimary"
|
||||||
app:layout_constraintStart_toStartOf="@+id/migration_data_scrollView"
|
app:layout_constraintStart_toStartOf="@+id/migration_data_scrollView"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/migration_data_scrollView" />
|
app:layout_constraintTop_toBottomOf="@+id/migration_data_divider" />
|
||||||
|
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
android:id="@+id/sourceGroup"
|
android:id="@+id/sourceGroup"
|
||||||
@ -114,75 +164,91 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/use_most_chapters" />
|
android:text="@string/use_most_chapters" />
|
||||||
|
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
<View
|
||||||
android:id="@+id/use_smart_search"
|
android:id="@+id/sourceGroup_divider"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="1dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="4dp"
|
||||||
android:text="@string/use_intelligent_search"
|
android:background="?android:attr/divider"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/sourceGroup"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="@+id/sourceGroup"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/sourceGroup" />
|
app:layout_constraintTop_toBottomOf="@id/sourceGroup"/>
|
||||||
|
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
<LinearLayout
|
||||||
android:id="@+id/extra_search_param"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:orientation="vertical"
|
||||||
android:text="@string/include_extra_search_parameter"
|
android:paddingStart="16dp"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/use_smart_search"
|
android:paddingEnd="16dp"
|
||||||
app:layout_constraintStart_toStartOf="@+id/use_smart_search"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/use_smart_search" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/sourceGroup_divider">
|
||||||
|
|
||||||
<EditText
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||||
android:id="@+id/extra_search_param_text"
|
android:id="@+id/use_smart_search"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="16dp"
|
||||||
android:ems="10"
|
android:paddingStart="2dp"
|
||||||
android:hint="@string/search_parameter"
|
android:paddingEnd="2dp"
|
||||||
android:importantForAutofill="no"
|
android:text="@string/use_intelligent_search" />
|
||||||
android:inputType="textPersonName"
|
|
||||||
android:textSize="16sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="@+id/extra_search_param"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/extra_search_param"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/extra_search_param" />
|
|
||||||
|
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||||
android:id="@+id/skip_step"
|
android:id="@+id/extra_search_param"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="@string/skip_this_step_next_time"
|
android:paddingStart="2dp"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/Hide_not_found_manga"
|
android:paddingEnd="2dp"
|
||||||
app:layout_constraintStart_toStartOf="@+id/Hide_not_found_manga"
|
android:text="@string/include_extra_search_parameter" />
|
||||||
app:layout_constraintTop_toBottomOf="@+id/Hide_not_found_manga" />
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/extra_search_param_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:ems="10"
|
||||||
|
android:hint="@string/search_parameter"
|
||||||
|
android:importantForAutofill="no"
|
||||||
|
android:inputType="textPersonName"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||||
|
android:id="@+id/skip_step"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp"
|
||||||
|
android:text="@string/skip_this_step_next_time" />
|
||||||
|
|
||||||
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||||
|
android:id="@+id/Hide_not_found_manga"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="82dp"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp"
|
||||||
|
android:text="@string/hide_not_found_manga" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<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:text="@string/hide_not_found_manga"
|
|
||||||
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" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
<Button
|
||||||
android:id="@+id/fab"
|
android:id="@+id/migrate_btn"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginStart="16dp"
|
||||||
android:minWidth="0dp"
|
android:layout_marginBottom="12dp"
|
||||||
android:text="@string/action_migrate"
|
android:text="@string/action_migrate"
|
||||||
app:icon="@drawable/ic_arrow_forward_24dp"
|
|
||||||
app:layout_anchor="@id/constraintLayout"
|
|
||||||
app:layout_anchorGravity="bottom|end"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/constraintLayout2" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user