Reader config dialog
parent
de9e773d2c
commit
646d5df476
@ -1,27 +1,26 @@
|
|||||||
package org.koitharu.kotatsu.ui.details
|
package org.koitharu.kotatsu.ui.details
|
||||||
|
|
||||||
import moxy.MvpView
|
import moxy.MvpView
|
||||||
import moxy.viewstate.strategy.AddToEndSingleStrategy
|
import moxy.viewstate.strategy.alias.AddToEndSingle
|
||||||
import moxy.viewstate.strategy.OneExecutionStateStrategy
|
import moxy.viewstate.strategy.alias.OneExecution
|
||||||
import moxy.viewstate.strategy.StateStrategyType
|
|
||||||
import org.koitharu.kotatsu.core.model.FavouriteCategory
|
import org.koitharu.kotatsu.core.model.FavouriteCategory
|
||||||
import org.koitharu.kotatsu.core.model.Manga
|
import org.koitharu.kotatsu.core.model.Manga
|
||||||
import org.koitharu.kotatsu.core.model.MangaHistory
|
import org.koitharu.kotatsu.core.model.MangaHistory
|
||||||
|
|
||||||
interface MangaDetailsView : MvpView {
|
interface MangaDetailsView : MvpView {
|
||||||
|
|
||||||
@StateStrategyType(AddToEndSingleStrategy::class)
|
@AddToEndSingle
|
||||||
fun onMangaUpdated(manga: Manga)
|
fun onMangaUpdated(manga: Manga)
|
||||||
|
|
||||||
@StateStrategyType(AddToEndSingleStrategy::class)
|
@AddToEndSingle
|
||||||
fun onLoadingStateChanged(isLoading: Boolean)
|
fun onLoadingStateChanged(isLoading: Boolean)
|
||||||
|
|
||||||
@StateStrategyType(OneExecutionStateStrategy::class)
|
@OneExecution
|
||||||
fun onError(e: Exception)
|
fun onError(e: Exception)
|
||||||
|
|
||||||
@StateStrategyType(AddToEndSingleStrategy::class)
|
@AddToEndSingle
|
||||||
fun onHistoryChanged(history: MangaHistory?)
|
fun onHistoryChanged(history: MangaHistory?)
|
||||||
|
|
||||||
@StateStrategyType(AddToEndSingleStrategy::class)
|
@AddToEndSingle
|
||||||
fun onFavouriteChanged(categories: List<FavouriteCategory>)
|
fun onFavouriteChanged(categories: List<FavouriteCategory>)
|
||||||
}
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package org.koitharu.kotatsu.ui.reader
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.View
|
||||||
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
|
import org.koitharu.kotatsu.R
|
||||||
|
import org.koitharu.kotatsu.ui.common.AlertDialogFragment
|
||||||
|
|
||||||
|
class ReaderConfigDialog : AlertDialogFragment(R.layout.dialog_reader_config),
|
||||||
|
View.OnClickListener {
|
||||||
|
|
||||||
|
override fun onBuildDialog(builder: AlertDialog.Builder) {
|
||||||
|
builder//.setTitle(R.string.list_mode)
|
||||||
|
.setCancelable(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClick(v: View) {
|
||||||
|
when (v.id) {
|
||||||
|
R.id.button_ok -> dismiss()
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
private const val TAG = "ReaderConfigDialog"
|
||||||
|
|
||||||
|
fun show(fm: FragmentManager) = ReaderConfigDialog().show(fm, TAG)
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<vector
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:tint="?colorControlNormal"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#000"
|
||||||
|
android:pathData="M19,2L14,6.5V17.5L19,13V2M6.5,5C4.55,5 2.45,5.4 1,6.5V21.16C1,21.41 1.25,21.66 1.5,21.66C1.6,21.66 1.65,21.59 1.75,21.59C3.1,20.94 5.05,20.5 6.5,20.5C8.45,20.5 10.55,20.9 12,22C13.35,21.15 15.8,20.5 17.5,20.5C19.15,20.5 20.85,20.81 22.25,21.56C22.35,21.61 22.4,21.59 22.5,21.59C22.75,21.59 23,21.34 23,21.09V6.5C22.4,6.05 21.75,5.75 21,5.5V7.5L21,13V19C19.9,18.65 18.7,18.5 17.5,18.5C15.8,18.5 13.35,19.15 12,20V13L12,8.5V6.5C10.55,5.4 8.45,5 6.5,5V5Z" />
|
||||||
|
</vector>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<vector
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:tint="?colorControlNormal"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#000"
|
||||||
|
android:pathData="M15,20A1,1 0 0,0 16,19V4H8A1,1 0 0,0 7,5V16H5V5A3,3 0 0,1 8,2H19A3,3 0 0,1 22,5V6H20V5A1,1 0 0,0 19,4A1,1 0 0,0 18,5V9L18,19A3,3 0 0,1 15,22H5A3,3 0 0,1 2,19V18H13A2,2 0 0,0 15,20M9,6H14V8H9V6M9,10H14V12H9V10M9,14H14V16H9V14Z" />
|
||||||
|
</vector>
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButtonToggleGroup
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:selectionRequired="true"
|
||||||
|
app:singleSelection="true">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_standard"
|
||||||
|
style="@style/AppToggleButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/standard"
|
||||||
|
app:icon="@drawable/ic_book_page" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_webtoon"
|
||||||
|
style="@style/AppToggleButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/webtoon"
|
||||||
|
app:icon="@drawable/ic_script" />
|
||||||
|
|
||||||
|
</com.google.android.material.button.MaterialButtonToggleGroup>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_ok"
|
||||||
|
style="@style/Widget.MaterialComponents.Button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:text="@android:string/ok" />
|
||||||
|
</LinearLayout>
|
||||||
Loading…
Reference in New Issue