Fix: custom theme color in various AndroidView (#656)
* Fix: background color of download list when using custom theme * Fix background color in Migration's source list * Fix custom theme color in manga's Edit Info * Fix custom theme color in manga's Migration Config * Fix custom theme color in manga's Migration Config * Fix custom theme color & relayout merge setting's dialog * using CustomColorScheme for DownloadQueue * using CustomColorScheme for metadata source
This commit is contained in:
parent
c7c76d22dd
commit
5b775366b8
24 changed files with 508 additions and 276 deletions
|
|
@ -0,0 +1,55 @@
|
|||
package eu.kanade.presentation.components
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.LayoutRes
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
|
||||
// KMK -->
|
||||
internal class SpinnerAdapter(
|
||||
context: Context,
|
||||
@LayoutRes val resource: Int,
|
||||
objects: List<String>,
|
||||
val colorScheme: AndroidViewColorScheme,
|
||||
) : ArrayAdapter<String>(context, resource, objects) {
|
||||
private val mInflater = LayoutInflater.from(context)
|
||||
|
||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||
return createViewFromResource(mInflater, position, convertView, parent, resource)
|
||||
}
|
||||
|
||||
override fun getDropDownView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||
return createViewFromResource(mInflater, position, convertView, parent, resource)
|
||||
}
|
||||
|
||||
private fun createViewFromResource(
|
||||
inflater: LayoutInflater,
|
||||
position: Int,
|
||||
convertView: View?,
|
||||
parent: ViewGroup,
|
||||
resource: Int,
|
||||
): View {
|
||||
val text: TextView
|
||||
|
||||
val view = convertView ?: inflater.inflate(resource, parent, false)
|
||||
|
||||
try {
|
||||
// If no custom field is assigned, assume the whole resource is a TextView
|
||||
text = view as TextView
|
||||
} catch (e: ClassCastException) {
|
||||
throw IllegalStateException("ArrayAdapter requires the resource ID to be a TextView", e)
|
||||
}
|
||||
|
||||
val item: String? = getItem(position)
|
||||
if (item != null) text.text = item
|
||||
|
||||
text.setTextColor(colorScheme.textColor)
|
||||
text.setBackgroundColor(colorScheme.dropdownBgColor)
|
||||
|
||||
return view
|
||||
}
|
||||
}
|
||||
|
|
@ -2,9 +2,16 @@ package eu.kanade.presentation.theme.colorscheme
|
|||
|
||||
import android.app.UiModeManager
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.os.Build
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.compose.material3.ColorScheme
|
||||
import androidx.compose.material3.surfaceColorAtElevation
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.core.content.getSystemService
|
||||
import com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
import com.materialkolor.Contrast
|
||||
import com.materialkolor.PaletteStyle
|
||||
import com.materialkolor.dynamicColorScheme
|
||||
|
|
@ -51,3 +58,179 @@ private class CustomCompatColorScheme(
|
|||
},
|
||||
)
|
||||
}
|
||||
|
||||
class AndroidViewColorScheme(
|
||||
colorScheme: ColorScheme,
|
||||
) {
|
||||
@ColorInt val primary: Int = colorScheme.primary.toArgb()
|
||||
|
||||
@ColorInt val onPrimary: Int = colorScheme.onPrimary.toArgb()
|
||||
|
||||
@ColorInt val primaryContainer: Int = colorScheme.primaryContainer.toArgb()
|
||||
|
||||
@ColorInt val onPrimaryContainer: Int = colorScheme.onPrimaryContainer.toArgb()
|
||||
|
||||
@ColorInt val inversePrimary: Int = colorScheme.inversePrimary.toArgb()
|
||||
|
||||
@ColorInt val secondary: Int = colorScheme.secondary.toArgb()
|
||||
|
||||
@ColorInt val onSecondary: Int = colorScheme.onSecondary.toArgb()
|
||||
|
||||
@ColorInt val secondaryContainer: Int = colorScheme.secondaryContainer.toArgb()
|
||||
|
||||
@ColorInt val onSecondaryContainer: Int = colorScheme.onSecondaryContainer.toArgb()
|
||||
|
||||
@ColorInt val tertiary: Int = colorScheme.tertiary.toArgb()
|
||||
|
||||
@ColorInt val onTertiary: Int = colorScheme.onTertiary.toArgb()
|
||||
|
||||
@ColorInt val tertiaryContainer: Int = colorScheme.tertiaryContainer.toArgb()
|
||||
|
||||
@ColorInt val onTertiaryContainer: Int = colorScheme.onTertiaryContainer.toArgb()
|
||||
|
||||
@ColorInt val background: Int = colorScheme.background.toArgb()
|
||||
|
||||
@ColorInt val onBackground: Int = colorScheme.onBackground.toArgb()
|
||||
|
||||
@ColorInt val surface: Int = colorScheme.surface.toArgb()
|
||||
|
||||
@ColorInt val onSurface: Int = colorScheme.onSurface.toArgb()
|
||||
|
||||
@ColorInt val surfaceVariant: Int = colorScheme.surfaceVariant.toArgb()
|
||||
|
||||
@ColorInt val onSurfaceVariant: Int = colorScheme.onSurfaceVariant.toArgb()
|
||||
|
||||
@ColorInt val surfaceTint: Int = colorScheme.surfaceTint.toArgb()
|
||||
|
||||
@ColorInt val inverseSurface: Int = colorScheme.inverseSurface.toArgb()
|
||||
|
||||
@ColorInt val inverseOnSurface: Int = colorScheme.inverseOnSurface.toArgb()
|
||||
|
||||
@ColorInt val error: Int = colorScheme.error.toArgb()
|
||||
|
||||
@ColorInt val onError: Int = colorScheme.onError.toArgb()
|
||||
|
||||
@ColorInt val errorContainer: Int = colorScheme.errorContainer.toArgb()
|
||||
|
||||
@ColorInt val onErrorContainer: Int = colorScheme.onErrorContainer.toArgb()
|
||||
|
||||
@ColorInt val outline: Int = colorScheme.outline.toArgb()
|
||||
|
||||
@ColorInt val outlineVariant: Int = colorScheme.outlineVariant.toArgb()
|
||||
|
||||
@ColorInt val scrim: Int = colorScheme.scrim.toArgb()
|
||||
|
||||
@ColorInt val surfaceBright: Int = colorScheme.surfaceBright.toArgb()
|
||||
|
||||
@ColorInt val surfaceDim: Int = colorScheme.surfaceDim.toArgb()
|
||||
|
||||
@ColorInt val surfaceContainer: Int = colorScheme.surfaceContainer.toArgb()
|
||||
|
||||
@ColorInt val surfaceContainerHigh: Int = colorScheme.surfaceContainerHigh.toArgb()
|
||||
|
||||
@ColorInt val surfaceContainerHighest: Int = colorScheme.surfaceContainerHighest.toArgb()
|
||||
|
||||
@ColorInt val surfaceContainerLow: Int = colorScheme.surfaceContainerLow.toArgb()
|
||||
|
||||
@ColorInt val surfaceContainerLowest: Int = colorScheme.surfaceContainerLowest.toArgb()
|
||||
|
||||
@ColorInt
|
||||
val textColor: Int = onSurfaceVariant
|
||||
|
||||
@ColorInt
|
||||
val textHighlightColor: Int = inversePrimary
|
||||
|
||||
@ColorInt
|
||||
val iconColor: Int = primary
|
||||
|
||||
@ColorInt
|
||||
val tagColor: Int = outlineVariant
|
||||
|
||||
@ColorInt
|
||||
val tagTextColor: Int = onSurfaceVariant
|
||||
|
||||
@ColorInt
|
||||
val btnTextColor: Int = onPrimary
|
||||
|
||||
@ColorInt
|
||||
val btnBgColor: Int = surfaceTint
|
||||
|
||||
@ColorInt
|
||||
val dropdownBgColor: Int = surfaceContainerHighest
|
||||
|
||||
@ColorInt
|
||||
val dialogBgColor: Int = surfaceContainerHigh
|
||||
|
||||
@ColorInt
|
||||
val surfaceElevation = colorScheme.surfaceColorAtElevation(4.dp).toArgb()
|
||||
|
||||
@ColorInt
|
||||
val ratingBarColor = primary
|
||||
|
||||
@ColorInt
|
||||
val ratingBarSecondaryColor = outlineVariant
|
||||
|
||||
/* MaterialSwitch */
|
||||
val trackTintList = ColorStateList(
|
||||
arrayOf(
|
||||
intArrayOf(android.R.attr.state_checked),
|
||||
intArrayOf(-android.R.attr.state_checked),
|
||||
),
|
||||
intArrayOf(
|
||||
primary,
|
||||
surface,
|
||||
),
|
||||
)
|
||||
val thumbTintList = ColorStateList(
|
||||
arrayOf(
|
||||
intArrayOf(android.R.attr.state_checked),
|
||||
intArrayOf(-android.R.attr.state_checked),
|
||||
),
|
||||
intArrayOf(
|
||||
onPrimary,
|
||||
onSurface,
|
||||
),
|
||||
)
|
||||
|
||||
val checkboxTintList = ColorStateList(
|
||||
arrayOf(
|
||||
intArrayOf(android.R.attr.state_checked),
|
||||
intArrayOf(-android.R.attr.state_checked),
|
||||
),
|
||||
intArrayOf(
|
||||
primary,
|
||||
onSurface,
|
||||
),
|
||||
)
|
||||
|
||||
val editTextBackgroundTintList = ColorStateList(
|
||||
arrayOf(
|
||||
intArrayOf(android.R.attr.state_focused),
|
||||
intArrayOf(-android.R.attr.state_focused),
|
||||
),
|
||||
intArrayOf(
|
||||
primary,
|
||||
onSurface,
|
||||
),
|
||||
)
|
||||
|
||||
val imageButtonTintList = ColorStateList(
|
||||
arrayOf(
|
||||
intArrayOf(android.R.attr.state_pressed), // Pressed state
|
||||
intArrayOf(android.R.attr.state_focused), // Focused state
|
||||
intArrayOf(), // Default state
|
||||
),
|
||||
intArrayOf(
|
||||
primary, // Pressed color
|
||||
primary, // Focused color
|
||||
primary, // Default color
|
||||
),
|
||||
)
|
||||
|
||||
companion object {
|
||||
fun LinearProgressIndicator.setColors(colorScheme: AndroidViewColorScheme) {
|
||||
trackColor = colorScheme.secondaryContainer
|
||||
setIndicatorColor(colorScheme.primary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package eu.kanade.tachiyomi.ui.browse.migration.advanced.design
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Build
|
||||
import android.view.LayoutInflater
|
||||
|
|
@ -15,10 +14,10 @@ import androidx.compose.runtime.State
|
|||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberUpdatedState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.core.view.isVisible
|
||||
import eu.kanade.presentation.components.AdaptiveSheet
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.tachiyomi.databinding.MigrationBottomSheetBinding
|
||||
import eu.kanade.tachiyomi.ui.browse.migration.MigrationFlags
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
|
|
@ -49,10 +48,7 @@ fun MigrationBottomSheetDialog(
|
|||
}
|
||||
|
||||
// KMK -->
|
||||
val primaryColor = MaterialTheme.colorScheme.primary.toArgb()
|
||||
val onSurface = MaterialTheme.colorScheme.onSurface.toArgb()
|
||||
val surface = MaterialTheme.colorScheme.surface.toArgb()
|
||||
val textHighlightColor = MaterialTheme.colorScheme.inversePrimary.toArgb()
|
||||
val colorScheme = AndroidViewColorScheme(MaterialTheme.colorScheme)
|
||||
// KMK <--
|
||||
|
||||
AdaptiveSheet(onDismissRequest = onDismissRequest) {
|
||||
|
|
@ -61,75 +57,48 @@ fun MigrationBottomSheetDialog(
|
|||
val binding = MigrationBottomSheetBinding.inflate(LayoutInflater.from(factoryContext))
|
||||
state.initPreferences(binding)
|
||||
// KMK -->
|
||||
binding.migrateBtn.setBackgroundColor(primaryColor)
|
||||
binding.dataLabel.setTextColor(primaryColor)
|
||||
binding.optionsLabel.setTextColor(primaryColor)
|
||||
binding.migrateBtn.setBackgroundColor(colorScheme.primary)
|
||||
binding.dataLabel.setTextColor(colorScheme.primary)
|
||||
binding.optionsLabel.setTextColor(colorScheme.primary)
|
||||
|
||||
val buttonTintList = ColorStateList(
|
||||
arrayOf(
|
||||
intArrayOf(android.R.attr.state_checked),
|
||||
intArrayOf(-android.R.attr.state_checked),
|
||||
),
|
||||
intArrayOf(
|
||||
primaryColor,
|
||||
onSurface,
|
||||
),
|
||||
)
|
||||
binding.migChapters.buttonTintList = colorScheme.checkboxTintList
|
||||
binding.migCategories.buttonTintList = colorScheme.checkboxTintList
|
||||
binding.migTracking.buttonTintList = colorScheme.checkboxTintList
|
||||
binding.migCustomCover.buttonTintList = colorScheme.checkboxTintList
|
||||
binding.migExtra.buttonTintList = colorScheme.checkboxTintList
|
||||
binding.migDeleteDownloaded.buttonTintList = colorScheme.checkboxTintList
|
||||
|
||||
binding.migChapters.buttonTintList = buttonTintList
|
||||
binding.migCategories.buttonTintList = buttonTintList
|
||||
binding.migTracking.buttonTintList = buttonTintList
|
||||
binding.migCustomCover.buttonTintList = buttonTintList
|
||||
binding.migExtra.buttonTintList = buttonTintList
|
||||
binding.migDeleteDownloaded.buttonTintList = buttonTintList
|
||||
binding.radioButton.buttonTintList = colorScheme.checkboxTintList
|
||||
binding.radioButton2.buttonTintList = colorScheme.checkboxTintList
|
||||
|
||||
binding.radioButton.buttonTintList = buttonTintList
|
||||
binding.radioButton2.buttonTintList = buttonTintList
|
||||
binding.useSmartSearch.trackTintList = colorScheme.trackTintList
|
||||
binding.extraSearchParam.trackTintList = colorScheme.trackTintList
|
||||
binding.skipStep.trackTintList = colorScheme.trackTintList
|
||||
binding.HideNotFoundManga.trackTintList = colorScheme.trackTintList
|
||||
binding.OnlyShowUpdates.trackTintList = colorScheme.trackTintList
|
||||
|
||||
val trackTintList = ColorStateList(
|
||||
arrayOf(
|
||||
intArrayOf(android.R.attr.state_checked),
|
||||
intArrayOf(-android.R.attr.state_checked),
|
||||
),
|
||||
intArrayOf(
|
||||
primaryColor,
|
||||
surface,
|
||||
),
|
||||
)
|
||||
|
||||
binding.useSmartSearch.trackTintList = trackTintList
|
||||
binding.extraSearchParam.trackTintList = trackTintList
|
||||
binding.skipStep.trackTintList = trackTintList
|
||||
binding.HideNotFoundManga.trackTintList = trackTintList
|
||||
binding.OnlyShowUpdates.trackTintList = trackTintList
|
||||
|
||||
val editTextBackgroundTintList = ColorStateList(
|
||||
arrayOf(
|
||||
intArrayOf(android.R.attr.state_focused),
|
||||
intArrayOf(-android.R.attr.state_focused),
|
||||
),
|
||||
intArrayOf(
|
||||
primaryColor,
|
||||
onSurface,
|
||||
),
|
||||
)
|
||||
binding.useSmartSearch.thumbTintList = colorScheme.thumbTintList
|
||||
binding.extraSearchParam.thumbTintList = colorScheme.thumbTintList
|
||||
binding.skipStep.thumbTintList = colorScheme.thumbTintList
|
||||
binding.HideNotFoundManga.thumbTintList = colorScheme.thumbTintList
|
||||
binding.OnlyShowUpdates.thumbTintList = colorScheme.thumbTintList
|
||||
|
||||
with(binding.extraSearchParamText) {
|
||||
highlightColor = textHighlightColor
|
||||
backgroundTintList = editTextBackgroundTintList
|
||||
highlightColor = colorScheme.textHighlightColor
|
||||
backgroundTintList = colorScheme.editTextBackgroundTintList
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
textCursorDrawable = ColorDrawable(primaryColor)
|
||||
textCursorDrawable = ColorDrawable(colorScheme.primary)
|
||||
textSelectHandle?.let { drawable ->
|
||||
drawable.setTint(primaryColor)
|
||||
drawable.setTint(colorScheme.primary)
|
||||
setTextSelectHandle(drawable)
|
||||
}
|
||||
textSelectHandleLeft?.let { drawable ->
|
||||
drawable.setTint(primaryColor)
|
||||
drawable.setTint(colorScheme.primary)
|
||||
setTextSelectHandleLeft(drawable)
|
||||
}
|
||||
textSelectHandleRight?.let { drawable ->
|
||||
drawable.setTint(primaryColor)
|
||||
drawable.setTint(colorScheme.primary)
|
||||
setTextSelectHandleRight(drawable)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.download
|
|||
import android.view.MenuItem
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
|
||||
/**
|
||||
* Adapter storing a list of downloads.
|
||||
|
|
@ -12,8 +13,7 @@ import eu.davidea.flexibleadapter.items.AbstractFlexibleItem
|
|||
class DownloadAdapter(
|
||||
val downloadItemListener: DownloadItemListener,
|
||||
// KMK -->
|
||||
val progressIndicatorColor: Int,
|
||||
val progressTrackColor: Int,
|
||||
val colorScheme: AndroidViewColorScheme,
|
||||
// KMK <--
|
||||
) : FlexibleAdapter<AbstractFlexibleItem<*>>(
|
||||
null,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.download
|
|||
import android.view.View
|
||||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import eu.davidea.viewholders.FlexibleViewHolder
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme.Companion.setColors
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.download.model.Download
|
||||
import eu.kanade.tachiyomi.databinding.DownloadItemBinding
|
||||
|
|
@ -52,8 +53,7 @@ class DownloadHolder(private val view: View, val adapter: DownloadAdapter) :
|
|||
notifyDownloadedPages()
|
||||
}
|
||||
// KMK -->
|
||||
binding.downloadProgress.trackColor = adapter.progressTrackColor
|
||||
binding.downloadProgress.setIndicatorColor(adapter.progressIndicatorColor)
|
||||
binding.downloadProgress.setColors(adapter.colorScheme)
|
||||
// KMK <--
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import androidx.compose.runtime.setValue
|
|||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
||||
import androidx.compose.ui.input.nestedscroll.NestedScrollSource
|
||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
|
|
@ -51,6 +50,7 @@ import eu.kanade.presentation.components.AppBar
|
|||
import eu.kanade.presentation.components.AppBarActions
|
||||
import eu.kanade.presentation.components.DropdownMenu
|
||||
import eu.kanade.presentation.components.NestedMenuItem
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.presentation.util.Screen
|
||||
import eu.kanade.tachiyomi.databinding.DownloadListBinding
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
|
|
@ -260,8 +260,7 @@ object DownloadQueueScreen : Screen() {
|
|||
val bottom = with(density) { contentPadding.calculateBottomPadding().toPx().roundToInt() }
|
||||
|
||||
// KMK -->
|
||||
val progressIndicatorColor = MaterialTheme.colorScheme.primary.toArgb()
|
||||
val progressTrackColor = MaterialTheme.colorScheme.secondaryContainer.toArgb()
|
||||
val colorScheme = AndroidViewColorScheme(MaterialTheme.colorScheme)
|
||||
// KMK <--
|
||||
|
||||
Box(modifier = Modifier.nestedScroll(nestedScrollConnection)) {
|
||||
|
|
@ -272,8 +271,7 @@ object DownloadQueueScreen : Screen() {
|
|||
screenModel.adapter = DownloadAdapter(
|
||||
screenModel.listener,
|
||||
// KMK -->
|
||||
progressIndicatorColor = progressIndicatorColor,
|
||||
progressTrackColor = progressTrackColor,
|
||||
colorScheme,
|
||||
// KMK <--
|
||||
)
|
||||
screenModel.controllerBinding.root.adapter = screenModel.adapter
|
||||
|
|
|
|||
|
|
@ -2,15 +2,12 @@ package eu.kanade.tachiyomi.ui.manga
|
|||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.AdapterView
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
|
|
@ -32,7 +29,6 @@ import androidx.compose.runtime.remember
|
|||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.core.content.ContextCompat
|
||||
|
|
@ -44,7 +40,9 @@ import com.google.android.material.chip.Chip
|
|||
import com.google.android.material.chip.ChipGroup
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import eu.kanade.domain.ui.UiPreferences
|
||||
import eu.kanade.presentation.components.SpinnerAdapter
|
||||
import eu.kanade.presentation.manga.components.RatioSwitchToPanorama
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.presentation.track.components.TrackLogoIcon
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.track.EnhancedTracker
|
||||
|
|
@ -105,19 +103,11 @@ fun EditMangaDialog(
|
|||
val getTracks = remember { Injekt.get<GetTracks>() }
|
||||
val trackerManager = remember { Injekt.get<TrackerManager>() }
|
||||
val tracks = remember { mutableStateOf(emptyList<Pair<Track, Tracker>>()) }
|
||||
|
||||
// KMK -->
|
||||
val colors = EditMangaDialogColors(
|
||||
textColor = MaterialTheme.colorScheme.onSurfaceVariant.toArgb(),
|
||||
textHighlightColor = MaterialTheme.colorScheme.inversePrimary.toArgb(),
|
||||
iconColor = MaterialTheme.colorScheme.primary.toArgb(),
|
||||
tagColor = MaterialTheme.colorScheme.outlineVariant.toArgb(),
|
||||
tagTextColor = MaterialTheme.colorScheme.onSurfaceVariant.toArgb(),
|
||||
btnTextColor = MaterialTheme.colorScheme.onPrimary.toArgb(),
|
||||
btnBgColor = MaterialTheme.colorScheme.surfaceTint.toArgb(),
|
||||
dropdownBgColor = MaterialTheme.colorScheme.surfaceVariant.toArgb(),
|
||||
dialogBgColor = MaterialTheme.colorScheme.surfaceContainerHigh.toArgb(),
|
||||
)
|
||||
val colorScheme = AndroidViewColorScheme(MaterialTheme.colorScheme)
|
||||
// KMK <--
|
||||
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
confirmButton = {
|
||||
|
|
@ -176,7 +166,7 @@ fun EditMangaDialog(
|
|||
tracks,
|
||||
showTrackerSelectionDialogue,
|
||||
// KMK -->
|
||||
colors,
|
||||
colorScheme,
|
||||
coverRatio = coverRatio,
|
||||
// KMK <--
|
||||
)
|
||||
|
|
@ -242,20 +232,6 @@ private fun TrackerSelectDialog(
|
|||
)
|
||||
}
|
||||
|
||||
// KMK -->
|
||||
data class EditMangaDialogColors(
|
||||
@ColorInt val textColor: Int,
|
||||
@ColorInt val textHighlightColor: Int,
|
||||
@ColorInt val iconColor: Int,
|
||||
@ColorInt val tagColor: Int,
|
||||
@ColorInt val tagTextColor: Int,
|
||||
@ColorInt val btnTextColor: Int,
|
||||
@ColorInt val btnBgColor: Int,
|
||||
@ColorInt val dropdownBgColor: Int,
|
||||
@ColorInt val dialogBgColor: Int,
|
||||
)
|
||||
// KMK <--
|
||||
|
||||
private fun onViewCreated(
|
||||
manga: Manga,
|
||||
context: Context,
|
||||
|
|
@ -266,7 +242,7 @@ private fun onViewCreated(
|
|||
tracks: MutableState<List<Pair<Track, Tracker>>>,
|
||||
showTrackerSelectionDialogue: MutableState<Boolean>,
|
||||
// KMK -->
|
||||
colors: EditMangaDialogColors,
|
||||
colorScheme: AndroidViewColorScheme,
|
||||
coverRatio: MutableFloatState,
|
||||
// KMK <--
|
||||
) {
|
||||
|
|
@ -294,7 +270,7 @@ private fun onViewCreated(
|
|||
MR.strings.on_hiatus,
|
||||
).map { context.stringResource(it) },
|
||||
// KMK -->
|
||||
colors,
|
||||
colorScheme,
|
||||
// KMK <--
|
||||
)
|
||||
|
||||
|
|
@ -318,13 +294,13 @@ private fun onViewCreated(
|
|||
// Set Spinner's selected item's background color to transparent
|
||||
binding.status.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(parent: AdapterView<*>, view: View?, pos: Int, id: Long) {
|
||||
if (view != null) (view as TextView).setBackgroundColor(0x00000000)
|
||||
if (view != null) (view as TextView).setBackgroundColor(Color.TRANSPARENT)
|
||||
}
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) = Unit
|
||||
}
|
||||
|
||||
// Set Spinner's dropdown caret color
|
||||
binding.status.backgroundTintList = ColorStateList.valueOf(colors.iconColor)
|
||||
binding.status.backgroundTintList = ColorStateList.valueOf(colorScheme.iconColor)
|
||||
// KMK
|
||||
|
||||
if (manga.isLocal()) {
|
||||
|
|
@ -337,7 +313,7 @@ private fun onViewCreated(
|
|||
binding.mangaArtist.setText(manga.artist.orEmpty())
|
||||
binding.thumbnailUrl.setText(manga.thumbnailUrl.orEmpty())
|
||||
binding.mangaDescription.setText(manga.description.orEmpty())
|
||||
binding.mangaGenresTags.setChips(manga.genre.orEmpty().dropBlank(), scope, colors)
|
||||
binding.mangaGenresTags.setChips(manga.genre.orEmpty().dropBlank(), scope, colorScheme)
|
||||
} else {
|
||||
if (manga.title != manga.ogTitle) {
|
||||
binding.title.append(manga.title)
|
||||
|
|
@ -354,7 +330,7 @@ private fun onViewCreated(
|
|||
if (manga.description != manga.ogDescription) {
|
||||
binding.mangaDescription.append(manga.description.orEmpty())
|
||||
}
|
||||
binding.mangaGenresTags.setChips(manga.genre.orEmpty().dropBlank(), scope, colors)
|
||||
binding.mangaGenresTags.setChips(manga.genre.orEmpty().dropBlank(), scope, colorScheme)
|
||||
|
||||
binding.title.hint = context.stringResource(SYMR.strings.title_hint, manga.ogTitle)
|
||||
|
||||
|
|
@ -383,20 +359,20 @@ private fun onViewCreated(
|
|||
binding.thumbnailUrl,
|
||||
binding.mangaDescription,
|
||||
).forEach {
|
||||
it.setTextColor(colors.textColor)
|
||||
it.highlightColor = colors.textHighlightColor
|
||||
it.setTextColor(colorScheme.textColor)
|
||||
it.highlightColor = colorScheme.textHighlightColor
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
it.textSelectHandle?.let { drawable ->
|
||||
drawable.setTint(colors.iconColor)
|
||||
drawable.setTint(colorScheme.iconColor)
|
||||
it.setTextSelectHandle(drawable)
|
||||
}
|
||||
it.textSelectHandleLeft?.let { drawable ->
|
||||
drawable.setTint(colors.iconColor)
|
||||
drawable.setTint(colorScheme.iconColor)
|
||||
it.setTextSelectHandleLeft(drawable)
|
||||
}
|
||||
it.textSelectHandleRight?.let { drawable ->
|
||||
drawable.setTint(colors.iconColor)
|
||||
drawable.setTint(colorScheme.iconColor)
|
||||
it.setTextSelectHandleRight(drawable)
|
||||
}
|
||||
}
|
||||
|
|
@ -408,23 +384,23 @@ private fun onViewCreated(
|
|||
binding.thumbnailUrlOutline,
|
||||
binding.mangaDescriptionOutline,
|
||||
).forEach {
|
||||
it.boxStrokeColor = colors.iconColor
|
||||
it.boxStrokeColor = colorScheme.iconColor
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
it.cursorColor = ColorStateList.valueOf(colors.iconColor)
|
||||
it.cursorColor = ColorStateList.valueOf(colorScheme.iconColor)
|
||||
}
|
||||
}
|
||||
|
||||
binding.autofillFromTracker.setTextColor(colors.btnTextColor)
|
||||
binding.autofillFromTracker.setBackgroundColor(colors.btnBgColor)
|
||||
binding.resetTags.setTextColor(colors.btnTextColor)
|
||||
binding.resetTags.setBackgroundColor(colors.btnBgColor)
|
||||
binding.resetInfo.setTextColor(colors.btnTextColor)
|
||||
binding.resetInfo.setBackgroundColor(colors.btnBgColor)
|
||||
binding.autofillFromTracker.setTextColor(colorScheme.btnTextColor)
|
||||
binding.autofillFromTracker.setBackgroundColor(colorScheme.btnBgColor)
|
||||
binding.resetTags.setTextColor(colorScheme.btnTextColor)
|
||||
binding.resetTags.setBackgroundColor(colorScheme.btnBgColor)
|
||||
binding.resetInfo.setTextColor(colorScheme.btnTextColor)
|
||||
binding.resetInfo.setBackgroundColor(colorScheme.btnBgColor)
|
||||
// KMK <--
|
||||
|
||||
binding.resetTags.setOnClickListener { resetTags(manga, binding, scope, colors) }
|
||||
binding.resetInfo.setOnClickListener { resetInfo(manga, binding, scope, colors) }
|
||||
binding.resetTags.setOnClickListener { resetTags(manga, binding, scope, colorScheme) }
|
||||
binding.resetInfo.setOnClickListener { resetInfo(manga, binding, scope, colorScheme) }
|
||||
binding.autofillFromTracker.setOnClickListener {
|
||||
scope.launch {
|
||||
getTrackers(manga, binding, context, getTracks, trackerManager, tracks, showTrackerSelectionDialogue)
|
||||
|
|
@ -481,13 +457,13 @@ private fun resetTags(
|
|||
binding: EditMangaDialogBinding,
|
||||
scope: CoroutineScope,
|
||||
// KMK -->
|
||||
colors: EditMangaDialogColors,
|
||||
colorScheme: AndroidViewColorScheme,
|
||||
// KMK <--
|
||||
) {
|
||||
if (manga.genre.isNullOrEmpty() || manga.isLocal()) {
|
||||
binding.mangaGenresTags.setChips(emptyList(), scope, colors)
|
||||
binding.mangaGenresTags.setChips(emptyList(), scope, colorScheme)
|
||||
} else {
|
||||
binding.mangaGenresTags.setChips(manga.ogGenre.orEmpty(), scope, colors)
|
||||
binding.mangaGenresTags.setChips(manga.ogGenre.orEmpty(), scope, colorScheme)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -518,7 +494,7 @@ private fun resetInfo(
|
|||
binding: EditMangaDialogBinding,
|
||||
scope: CoroutineScope,
|
||||
// KMK -->
|
||||
colors: EditMangaDialogColors,
|
||||
colorScheme: AndroidViewColorScheme,
|
||||
// KMK <--
|
||||
) {
|
||||
binding.title.text?.clear()
|
||||
|
|
@ -526,33 +502,33 @@ private fun resetInfo(
|
|||
binding.mangaArtist.text?.clear()
|
||||
binding.thumbnailUrl.text?.clear()
|
||||
binding.mangaDescription.text?.clear()
|
||||
resetTags(manga, binding, scope, colors)
|
||||
resetTags(manga, binding, scope, colorScheme)
|
||||
}
|
||||
|
||||
private fun ChipGroup.setChips(
|
||||
items: List<String>,
|
||||
scope: CoroutineScope,
|
||||
// KMK -->
|
||||
colors: EditMangaDialogColors,
|
||||
colorScheme: AndroidViewColorScheme,
|
||||
// KMK <--
|
||||
) {
|
||||
removeAllViews()
|
||||
|
||||
// KMK -->
|
||||
val colorStateList = ColorStateList.valueOf(colors.tagColor)
|
||||
val colorStateList = ColorStateList.valueOf(colorScheme.tagColor)
|
||||
// KMK <--
|
||||
|
||||
items.asSequence().map { item ->
|
||||
Chip(context).apply {
|
||||
text = item
|
||||
// KMK -->
|
||||
setTextColor(colors.tagTextColor)
|
||||
setTextColor(colorScheme.tagTextColor)
|
||||
// KMK <--
|
||||
|
||||
isCloseIconVisible = true
|
||||
// KMK -->
|
||||
// closeIcon?.setTint(context.getResourceColor(R.attr.colorAccent))
|
||||
closeIcon?.setTint(colors.iconColor)
|
||||
closeIcon?.setTint(colorScheme.iconColor)
|
||||
// KMK <--
|
||||
setOnCloseIconClickListener {
|
||||
removeView(this)
|
||||
|
|
@ -569,14 +545,14 @@ private fun ChipGroup.setChips(
|
|||
val addTagChip = Chip(context).apply {
|
||||
text = SYMR.strings.add_tags.getString(context)
|
||||
// KMK -->
|
||||
setTextColor(colors.tagTextColor)
|
||||
setTextColor(colorScheme.tagTextColor)
|
||||
// KMK <--
|
||||
|
||||
chipIcon = ContextCompat.getDrawable(context, R.drawable.ic_add_24dp)?.apply {
|
||||
isChipIconVisible = true
|
||||
// KMK -->
|
||||
// setTint(context.getResourceColor(R.attr.colorAccent))
|
||||
setTint(colors.iconColor)
|
||||
setTint(colorScheme.iconColor)
|
||||
// KMK <--
|
||||
}
|
||||
|
||||
|
|
@ -597,7 +573,7 @@ private fun ChipGroup.setChips(
|
|||
// KMK <--
|
||||
val newTags = it.trimOrNull()
|
||||
newTags?.let { tags ->
|
||||
setChips(items + tags.split(",").mapNotNull { tag -> tag.trimOrNull() }, scope, colors)
|
||||
setChips(items + tags.split(",").mapNotNull { tag -> tag.trimOrNull() }, scope, colorScheme)
|
||||
}
|
||||
// KMK -->
|
||||
}
|
||||
|
|
@ -605,7 +581,7 @@ private fun ChipGroup.setChips(
|
|||
dialog?.dismissDialog()
|
||||
}
|
||||
.setTextEdit()
|
||||
.setColors(colors)
|
||||
.setColors(colorScheme)
|
||||
|
||||
dialog = builder.create()
|
||||
dialog.setView(binding.root)
|
||||
|
|
@ -623,49 +599,3 @@ private fun ChipGroup.getTextStrings(): List<String> = children.mapNotNull {
|
|||
null
|
||||
}
|
||||
}.toList()
|
||||
|
||||
// KMK -->
|
||||
private class SpinnerAdapter(
|
||||
context: Context,
|
||||
@LayoutRes val resource: Int,
|
||||
objects: List<String>,
|
||||
val colors: EditMangaDialogColors,
|
||||
) : ArrayAdapter<String>(context, resource, objects) {
|
||||
private val mInflater = LayoutInflater.from(context)
|
||||
|
||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||
return createViewFromResource(mInflater, position, convertView, parent, resource)
|
||||
}
|
||||
|
||||
override fun getDropDownView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||
return createViewFromResource(mInflater, position, convertView, parent, resource)
|
||||
}
|
||||
|
||||
private fun createViewFromResource(
|
||||
inflater: LayoutInflater,
|
||||
position: Int,
|
||||
convertView: View?,
|
||||
parent: ViewGroup,
|
||||
resource: Int,
|
||||
): View {
|
||||
val text: TextView
|
||||
|
||||
val view = convertView ?: inflater.inflate(resource, parent, false)
|
||||
|
||||
try {
|
||||
// If no custom field is assigned, assume the whole resource is a TextView
|
||||
text = view as TextView
|
||||
} catch (e: ClassCastException) {
|
||||
throw IllegalStateException("ArrayAdapter requires the resource ID to be a TextView", e)
|
||||
}
|
||||
|
||||
val item: String? = getItem(position)
|
||||
if (item != null) text.text = item
|
||||
|
||||
text.setTextColor(colors.textColor)
|
||||
text.setBackgroundColor(colors.dropdownBgColor)
|
||||
|
||||
return view
|
||||
}
|
||||
}
|
||||
// KMK <--
|
||||
|
|
|
|||
|
|
@ -1,14 +1,21 @@
|
|||
package eu.kanade.tachiyomi.ui.manga.merged
|
||||
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
|
||||
/**
|
||||
* Adapter storing a list of merged manga.
|
||||
*
|
||||
* @param controller the context of the fragment containing this adapter.
|
||||
* @param listener the context of the fragment containing this adapter.
|
||||
* @param isPriorityOrder if deduplication mode is based on priority
|
||||
*/
|
||||
class EditMergedMangaAdapter(listener: EditMergedSettingsState, var isPriorityOrder: Boolean) :
|
||||
class EditMergedMangaAdapter(
|
||||
listener: EditMergedSettingsState,
|
||||
var isPriorityOrder: Boolean,
|
||||
// KMK -->
|
||||
val colorScheme: AndroidViewColorScheme,
|
||||
// KMK <--
|
||||
) :
|
||||
FlexibleAdapter<EditMergedMangaItem>(null, listener, true),
|
||||
EditMergedSettingsHeaderAdapter.SortingListener {
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@ import coil3.load
|
|||
import coil3.request.transformations
|
||||
import coil3.transform.RoundedCornersTransformation
|
||||
import eu.davidea.viewholders.FlexibleViewHolder
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.EditMergedSettingsItemBinding
|
||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||
import exh.ui.metadata.adapters.MetadataUIUtil.getResourceColor
|
||||
import tachiyomi.domain.manga.model.MergedMangaReference
|
||||
import tachiyomi.domain.source.service.SourceManager
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
|
@ -50,6 +48,11 @@ class EditMergedMangaHolder(view: View, val adapter: EditMergedMangaAdapter) : F
|
|||
binding.subtitle.text = item.mergedManga?.title
|
||||
updateDownloadChaptersIcon(item.mergedMangaReference.downloadChapters)
|
||||
updateChapterUpdatesIcon(item.mergedMangaReference.getChapterUpdates)
|
||||
|
||||
// KMK -->
|
||||
binding.holder.setCardBackgroundColor(adapter.colorScheme.surfaceElevation)
|
||||
binding.remove.imageTintList = adapter.colorScheme.imageButtonTintList
|
||||
// KMK <--
|
||||
}
|
||||
|
||||
fun setHandelAlpha(isPriorityOrder: Boolean) {
|
||||
|
|
@ -61,9 +64,11 @@ class EditMergedMangaHolder(view: View, val adapter: EditMergedMangaAdapter) : F
|
|||
|
||||
fun updateDownloadChaptersIcon(setTint: Boolean) {
|
||||
val color = if (setTint) {
|
||||
itemView.context.getResourceColor(R.attr.colorAccent)
|
||||
// KMK -->
|
||||
adapter.colorScheme.secondary
|
||||
} else {
|
||||
itemView.context.getResourceColor(R.attr.colorOnSurface)
|
||||
adapter.colorScheme.onSurface
|
||||
// KMK <--
|
||||
}
|
||||
|
||||
binding.download.drawable.setTint(color)
|
||||
|
|
@ -71,9 +76,11 @@ class EditMergedMangaHolder(view: View, val adapter: EditMergedMangaAdapter) : F
|
|||
|
||||
fun updateChapterUpdatesIcon(setTint: Boolean) {
|
||||
val color = if (setTint) {
|
||||
itemView.context.getResourceColor(R.attr.colorAccent)
|
||||
// KMK -->
|
||||
adapter.colorScheme.secondary
|
||||
} else {
|
||||
itemView.context.getResourceColor(R.attr.colorOnSurface)
|
||||
adapter.colorScheme.onSurface
|
||||
// KMK <--
|
||||
}
|
||||
|
||||
binding.getChapterUpdates.drawable.setTint(color)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
|
|
@ -22,6 +23,7 @@ import androidx.compose.ui.window.DialogProperties
|
|||
import androidx.recyclerview.widget.ConcatAdapter
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.tachiyomi.databinding.EditMergedSettingsDialogBinding
|
||||
import eu.kanade.tachiyomi.ui.manga.MergedMangaData
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
|
|
@ -49,6 +51,9 @@ class EditMergedSettingsState(
|
|||
binding: EditMergedSettingsDialogBinding,
|
||||
mergedManga: List<Manga>,
|
||||
mergedReferences: List<MergedMangaReference>,
|
||||
// KMK -->
|
||||
colorScheme: AndroidViewColorScheme,
|
||||
// KMK <--
|
||||
) {
|
||||
if (mergedReferences.isEmpty() || mergedReferences.size == 1) {
|
||||
context.toast(SYMR.strings.merged_references_invalid)
|
||||
|
|
@ -62,8 +67,20 @@ class EditMergedSettingsState(
|
|||
val isPriorityOrder =
|
||||
mergeReference?.let { it.chapterSortMode == MergedMangaReference.CHAPTER_SORT_PRIORITY } ?: false
|
||||
|
||||
mergedMangaAdapter = EditMergedMangaAdapter(this, isPriorityOrder)
|
||||
mergedMangaHeaderAdapter = EditMergedSettingsHeaderAdapter(this, mergedMangaAdapter!!)
|
||||
mergedMangaAdapter = EditMergedMangaAdapter(
|
||||
this,
|
||||
isPriorityOrder,
|
||||
// KMK -->
|
||||
colorScheme,
|
||||
// KMK <--
|
||||
)
|
||||
mergedMangaHeaderAdapter = EditMergedSettingsHeaderAdapter(
|
||||
this,
|
||||
mergedMangaAdapter!!,
|
||||
// KMK -->
|
||||
colorScheme,
|
||||
// KMK <--
|
||||
)
|
||||
|
||||
binding.recycler.adapter = ConcatAdapter(mergedMangaHeaderAdapter, mergedMangaAdapter)
|
||||
binding.recycler.layoutManager = LinearLayoutManager(context)
|
||||
|
|
@ -176,6 +193,10 @@ fun EditMergedSettingsDialog(
|
|||
onDeleteClick: (MergedMangaReference) -> Unit,
|
||||
onPositiveClick: (List<MergedMangaReference>) -> Unit,
|
||||
) {
|
||||
// KMK -->
|
||||
val colorScheme = AndroidViewColorScheme(MaterialTheme.colorScheme)
|
||||
// KMK <--
|
||||
|
||||
val context = LocalContext.current
|
||||
val state = remember {
|
||||
EditMergedSettingsState(context, onDeleteClick, onDismissRequest, onPositiveClick)
|
||||
|
|
@ -201,7 +222,15 @@ fun EditMergedSettingsDialog(
|
|||
AndroidView(
|
||||
factory = { factoryContext ->
|
||||
val binding = EditMergedSettingsDialogBinding.inflate(LayoutInflater.from(factoryContext))
|
||||
state.onViewCreated(factoryContext, binding, mergedData.manga.values.toList(), mergedData.references)
|
||||
state.onViewCreated(
|
||||
factoryContext,
|
||||
binding,
|
||||
mergedData.manga.values.toList(),
|
||||
mergedData.references,
|
||||
// KMK -->
|
||||
colorScheme,
|
||||
// KMK <--
|
||||
)
|
||||
binding.root
|
||||
},
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
package eu.kanade.tachiyomi.ui.manga.merged
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.AdapterView
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import eu.kanade.presentation.components.SpinnerAdapter
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.tachiyomi.databinding.EditMergedSettingsHeaderBinding
|
||||
import exh.log.xLogD
|
||||
import tachiyomi.core.common.i18n.stringResource
|
||||
|
|
@ -14,7 +18,13 @@ import tachiyomi.domain.source.service.SourceManager
|
|||
import tachiyomi.i18n.sy.SYMR
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
class EditMergedSettingsHeaderAdapter(private val state: EditMergedSettingsState, adapter: EditMergedMangaAdapter) : RecyclerView.Adapter<EditMergedSettingsHeaderAdapter.HeaderViewHolder>() {
|
||||
class EditMergedSettingsHeaderAdapter(
|
||||
private val state: EditMergedSettingsState,
|
||||
adapter: EditMergedMangaAdapter,
|
||||
// KMK -->
|
||||
private val colorScheme: AndroidViewColorScheme,
|
||||
// KMK <--
|
||||
) : RecyclerView.Adapter<EditMergedSettingsHeaderAdapter.HeaderViewHolder>() {
|
||||
|
||||
private val sourceManager: SourceManager by injectLazy()
|
||||
|
||||
|
|
@ -37,19 +47,24 @@ class EditMergedSettingsHeaderAdapter(private val state: EditMergedSettingsState
|
|||
holder.bind()
|
||||
}
|
||||
|
||||
inner class HeaderViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
inner class HeaderViewHolder(val view: View) : RecyclerView.ViewHolder(view) {
|
||||
fun bind() {
|
||||
val dedupeAdapter: ArrayAdapter<String> = ArrayAdapter(
|
||||
itemView.context,
|
||||
android.R.layout.simple_spinner_item,
|
||||
// KMK -->
|
||||
// val dedupeAdapter: ArrayAdapter<String> = ArrayAdapter(
|
||||
val dedupeAdapter = SpinnerAdapter(
|
||||
view.context,
|
||||
android.R.layout.simple_spinner_dropdown_item,
|
||||
// KMK <--
|
||||
listOfNotNull(
|
||||
itemView.context.stringResource(SYMR.strings.no_dedupe),
|
||||
itemView.context.stringResource(SYMR.strings.dedupe_priority),
|
||||
itemView.context.stringResource(SYMR.strings.dedupe_most_chapters),
|
||||
itemView.context.stringResource(SYMR.strings.dedupe_highest_chapter),
|
||||
),
|
||||
// KMK -->
|
||||
colorScheme,
|
||||
// KMK <--
|
||||
)
|
||||
dedupeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
binding.dedupeModeSpinner.adapter = dedupeAdapter
|
||||
state.mergeReference?.let {
|
||||
binding.dedupeModeSpinner.setSelection(
|
||||
|
|
@ -62,6 +77,7 @@ class EditMergedSettingsHeaderAdapter(private val state: EditMergedSettingsState
|
|||
},
|
||||
)
|
||||
}
|
||||
|
||||
binding.dedupeModeSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(
|
||||
parent: AdapterView<*>?,
|
||||
|
|
@ -80,6 +96,9 @@ class EditMergedSettingsHeaderAdapter(private val state: EditMergedSettingsState
|
|||
)
|
||||
xLogD(state.mergeReference?.chapterSortMode)
|
||||
editMergedMangaItemSortingListener.onSetPrioritySort(canMove())
|
||||
|
||||
// Set Spinner's selected item's background color to transparent
|
||||
if (view != null) (view as TextView).setBackgroundColor(Color.TRANSPARENT)
|
||||
}
|
||||
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {
|
||||
|
|
@ -91,14 +110,19 @@ class EditMergedSettingsHeaderAdapter(private val state: EditMergedSettingsState
|
|||
|
||||
val mergedMangas = state.mergedMangas
|
||||
|
||||
val mangaInfoAdapter: ArrayAdapter<String> = ArrayAdapter(
|
||||
itemView.context,
|
||||
android.R.layout.simple_spinner_item,
|
||||
// KMK -->
|
||||
// val mangaInfoAdapter: ArrayAdapter<String> = ArrayAdapter(
|
||||
val mangaInfoAdapter = SpinnerAdapter(
|
||||
view.context,
|
||||
android.R.layout.simple_spinner_dropdown_item,
|
||||
// KMK <--
|
||||
mergedMangas.map {
|
||||
sourceManager.getOrStub(it.second.mangaSourceId).toString() + " " + it.first?.title
|
||||
},
|
||||
// KMK -->
|
||||
colorScheme,
|
||||
// KMK <--
|
||||
)
|
||||
mangaInfoAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
binding.mangaInfoSpinner.adapter = mangaInfoAdapter
|
||||
|
||||
mergedMangas.indexOfFirst { it.second.isInfoManga }.let {
|
||||
|
|
@ -121,6 +145,9 @@ class EditMergedSettingsHeaderAdapter(private val state: EditMergedSettingsState
|
|||
isInfoManga = reference.id == mergedMangas.getOrNull(position)?.second?.id,
|
||||
)
|
||||
}
|
||||
|
||||
// Set Spinner's selected item's background color to transparent
|
||||
if (view != null) (view as TextView).setBackgroundColor(Color.TRANSPARENT)
|
||||
}
|
||||
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {
|
||||
|
|
@ -158,6 +185,19 @@ class EditMergedSettingsHeaderAdapter(private val state: EditMergedSettingsState
|
|||
true -> 1F
|
||||
false -> 0.5F
|
||||
}
|
||||
|
||||
// KMK -->
|
||||
binding.dedupeSwitchLabel.setTextColor(colorScheme.textColor)
|
||||
binding.dedupeModeLabel.setTextColor(colorScheme.primary)
|
||||
binding.mangaInfoLabel.setTextColor(colorScheme.primary)
|
||||
|
||||
binding.dedupeSwitch.trackTintList = colorScheme.trackTintList
|
||||
binding.dedupeSwitch.thumbTintList = colorScheme.thumbTintList
|
||||
|
||||
// Set Spinner's dropdown caret color
|
||||
binding.dedupeModeSpinner.backgroundTintList = ColorStateList.valueOf(colorScheme.iconColor)
|
||||
binding.mangaInfoSpinner.backgroundTintList = ColorStateList.valueOf(colorScheme.iconColor)
|
||||
// KMK <--
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ import android.widget.TextView
|
|||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.core.content.getSystemService
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.tachiyomi.databinding.DialogStubTextinputBinding
|
||||
import eu.kanade.tachiyomi.ui.manga.EditMangaDialogColors
|
||||
|
||||
// KMK -->
|
||||
@Suppress("UnusedReceiverParameter")
|
||||
|
|
@ -73,7 +73,7 @@ fun DialogStubTextinputBinding.setTextEdit(prefill: String? = null): DialogStubT
|
|||
return this
|
||||
}
|
||||
|
||||
fun DialogStubTextinputBinding.setColors(colors: EditMangaDialogColors): DialogStubTextinputBinding {
|
||||
fun DialogStubTextinputBinding.setColors(colors: AndroidViewColorScheme): DialogStubTextinputBinding {
|
||||
textField.boxStrokeColor = colors.iconColor
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.DescriptionAdapterEhBinding
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaScreenModel.State
|
||||
|
|
@ -34,9 +35,11 @@ fun EHentaiDescription(
|
|||
) {
|
||||
val context = LocalContext.current
|
||||
// KMK -->
|
||||
val iconColor = MaterialTheme.colorScheme.primary.toArgb()
|
||||
val colorScheme = AndroidViewColorScheme(MaterialTheme.colorScheme)
|
||||
val iconColor = colorScheme.iconColor
|
||||
val ratingBarColor = colorScheme.ratingBarColor
|
||||
val ratingBarSecondaryColor = colorScheme.ratingBarSecondaryColor
|
||||
val textColor = LocalContentColor.current.toArgb()
|
||||
val ratingBarSecondaryColor = MaterialTheme.colorScheme.outlineVariant.toArgb()
|
||||
// KMK <--
|
||||
AndroidView(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
|
|
@ -116,7 +119,7 @@ fun EHentaiDescription(
|
|||
binding.rating.text =
|
||||
(ratingFloat ?: 0F).toString() + " - " + MetadataUIUtil.getRatingString(context, ratingFloat?.times(2))
|
||||
// KMK -->
|
||||
binding.ratingBar.supportProgressTintList = ColorStateList.valueOf(iconColor)
|
||||
binding.ratingBar.supportProgressTintList = ColorStateList.valueOf(ratingBarColor)
|
||||
binding.ratingBar.supportSecondaryProgressTintList = ColorStateList.valueOf(ratingBarSecondaryColor)
|
||||
binding.rating.setTextColor(textColor)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.DescriptionAdapter8mBinding
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaScreenModel.State
|
||||
|
|
@ -22,8 +23,9 @@ import tachiyomi.i18n.sy.SYMR
|
|||
fun EightMusesDescription(state: State.Success, openMetadataViewer: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
// KMK -->
|
||||
val colorScheme = AndroidViewColorScheme(MaterialTheme.colorScheme)
|
||||
val iconColor = colorScheme.iconColor
|
||||
val titleColor = MaterialTheme.colorScheme.primary.toArgb()
|
||||
val iconColor = MaterialTheme.colorScheme.primary.toArgb()
|
||||
// KMK <--
|
||||
AndroidView(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.DescriptionAdapterHbBinding
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaScreenModel.State
|
||||
|
|
@ -23,7 +24,8 @@ import tachiyomi.i18n.sy.SYMR
|
|||
fun HBrowseDescription(state: State.Success, openMetadataViewer: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
// KMK -->
|
||||
val iconColor = MaterialTheme.colorScheme.primary.toArgb()
|
||||
val colorScheme = AndroidViewColorScheme(MaterialTheme.colorScheme)
|
||||
val iconColor = colorScheme.iconColor
|
||||
val textColor = LocalContentColor.current.toArgb()
|
||||
// KMK <--
|
||||
AndroidView(
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import androidx.compose.ui.graphics.toArgb
|
|||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.core.view.isVisible
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.DescriptionAdapterMdBinding
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaScreenModel.State
|
||||
|
|
@ -27,9 +28,11 @@ import kotlin.math.round
|
|||
fun MangaDexDescription(state: State.Success, openMetadataViewer: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
// KMK -->
|
||||
val iconColor = MaterialTheme.colorScheme.primary.toArgb()
|
||||
val colorScheme = AndroidViewColorScheme(MaterialTheme.colorScheme)
|
||||
val iconColor = colorScheme.iconColor
|
||||
val ratingBarColor = colorScheme.ratingBarColor
|
||||
val ratingBarSecondaryColor = colorScheme.ratingBarSecondaryColor
|
||||
val textColor = LocalContentColor.current.toArgb()
|
||||
val ratingBarSecondaryColor = MaterialTheme.colorScheme.outlineVariant.toArgb()
|
||||
// KMK <--
|
||||
AndroidView(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
|
|
@ -50,7 +53,7 @@ fun MangaDexDescription(state: State.Success, openMetadataViewer: () -> Unit) {
|
|||
binding.rating.isVisible = ratingFloat != null
|
||||
binding.ratingBar.isVisible = ratingFloat != null
|
||||
// KMK -->
|
||||
binding.ratingBar.supportProgressTintList = ColorStateList.valueOf(iconColor)
|
||||
binding.ratingBar.supportProgressTintList = ColorStateList.valueOf(ratingBarColor)
|
||||
binding.ratingBar.supportSecondaryProgressTintList = ColorStateList.valueOf(ratingBarSecondaryColor)
|
||||
binding.rating.setTextColor(textColor)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.DescriptionAdapterNhBinding
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaScreenModel.State
|
||||
|
|
@ -30,7 +31,8 @@ import java.time.ZonedDateTime
|
|||
fun NHentaiDescription(state: State.Success, openMetadataViewer: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
// KMK -->
|
||||
val iconColor = MaterialTheme.colorScheme.primary.toArgb()
|
||||
val colorScheme = AndroidViewColorScheme(MaterialTheme.colorScheme)
|
||||
val iconColor = colorScheme.iconColor
|
||||
val textColor = LocalContentColor.current.toArgb()
|
||||
// KMK <--
|
||||
AndroidView(
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.DescriptionAdapterPuBinding
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaScreenModel.State
|
||||
|
|
@ -28,9 +29,11 @@ import kotlin.math.round
|
|||
fun PururinDescription(state: State.Success, openMetadataViewer: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
// KMK -->
|
||||
val iconColor = MaterialTheme.colorScheme.primary.toArgb()
|
||||
val colorScheme = AndroidViewColorScheme(MaterialTheme.colorScheme)
|
||||
val iconColor = colorScheme.iconColor
|
||||
val ratingBarColor = colorScheme.ratingBarColor
|
||||
val ratingBarSecondaryColor = colorScheme.ratingBarSecondaryColor
|
||||
val textColor = LocalContentColor.current.toArgb()
|
||||
val ratingBarSecondaryColor = MaterialTheme.colorScheme.outlineVariant.toArgb()
|
||||
// KMK <--
|
||||
AndroidView(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
|
|
@ -78,7 +81,7 @@ fun PururinDescription(state: State.Success, openMetadataViewer: () -> Unit) {
|
|||
(round((ratingFloat ?: 0F) * 100.0) / 100.0).toString() + " - " +
|
||||
MetadataUIUtil.getRatingString(context, ratingFloat?.times(2))
|
||||
// KMK -->
|
||||
binding.ratingBar.supportProgressTintList = ColorStateList.valueOf(iconColor)
|
||||
binding.ratingBar.supportProgressTintList = ColorStateList.valueOf(ratingBarColor)
|
||||
binding.ratingBar.supportSecondaryProgressTintList = ColorStateList.valueOf(ratingBarSecondaryColor)
|
||||
binding.rating.setTextColor(textColor)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import eu.kanade.presentation.theme.colorscheme.AndroidViewColorScheme
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.DescriptionAdapterTsBinding
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaScreenModel.State
|
||||
|
|
@ -29,9 +30,11 @@ import kotlin.math.round
|
|||
fun TsuminoDescription(state: State.Success, openMetadataViewer: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
// KMK -->
|
||||
val iconColor = MaterialTheme.colorScheme.primary.toArgb()
|
||||
val colorScheme = AndroidViewColorScheme(MaterialTheme.colorScheme)
|
||||
val iconColor = colorScheme.iconColor
|
||||
val ratingBarColor = colorScheme.ratingBarColor
|
||||
val ratingBarSecondaryColor = colorScheme.ratingBarSecondaryColor
|
||||
val textColor = LocalContentColor.current.toArgb()
|
||||
val ratingBarSecondaryColor = MaterialTheme.colorScheme.outlineVariant.toArgb()
|
||||
// KMK <--
|
||||
AndroidView(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
|
|
@ -81,7 +84,7 @@ fun TsuminoDescription(state: State.Success, openMetadataViewer: () -> Unit) {
|
|||
(round((meta.averageRating ?: 0F) * 100.0) / 100.0).toString() + " - " +
|
||||
MetadataUIUtil.getRatingString(context, meta.averageRating?.times(2))
|
||||
// KMK -->
|
||||
binding.ratingBar.supportProgressTintList = ColorStateList.valueOf(iconColor)
|
||||
binding.ratingBar.supportProgressTintList = ColorStateList.valueOf(ratingBarColor)
|
||||
binding.ratingBar.supportSecondaryProgressTintList = ColorStateList.valueOf(ratingBarSecondaryColor)
|
||||
binding.rating.setTextColor(textColor)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:cardBackgroundColor="?android:attr/colorBackground"
|
||||
app:cardBackgroundColor="@android:color/transparent"
|
||||
app:cardElevation="0dp"
|
||||
app:cardForegroundColor="@color/draggable_card_foreground">
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="?android:attr/colorBackground"
|
||||
app:cardBackgroundColor="@android:color/transparent"
|
||||
app:cardElevation="0dp"
|
||||
app:cardForegroundColor="@color/draggable_card_foreground">
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
android:layout_gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dedupe_switch_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/allow_deduplication"
|
||||
|
|
@ -28,39 +29,36 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dedupe_mode_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/deduplication_mode"
|
||||
android:padding="8dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/deduplication_mode"
|
||||
android:padding="8dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center"/>
|
||||
<Spinner
|
||||
android:id="@+id/dedupe_mode_spinner"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="8dp"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatSpinner
|
||||
android:id="@+id/dedupe_mode_spinner"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="8dp"
|
||||
style="@style/Widget.AppCompat.Spinner.DropDown"/>
|
||||
<TextView
|
||||
android:id="@+id/manga_info_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/deduplication_entry_info"
|
||||
android:padding="8dp"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/deduplication_entry_info"
|
||||
android:padding="8dp"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatSpinner
|
||||
android:id="@+id/manga_info_spinner"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="8dp"
|
||||
style="@style/Widget.AppCompat.Spinner.DropDown"/>
|
||||
<Spinner
|
||||
android:id="@+id/manga_info_spinner"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="8dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
android:id="@+id/holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="?android:attr/colorBackground"
|
||||
android:layout_marginVertical="4dp"
|
||||
app:cardBackgroundColor="@android:color/transparent"
|
||||
app:cardElevation="0dp"
|
||||
app:cardForegroundColor="@color/draggable_card_foreground">
|
||||
|
||||
|
|
@ -16,38 +17,37 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/reorder"
|
||||
android:layout_width="56dp"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_gravity="start"
|
||||
android:scaleType="center"
|
||||
android:alpha="1"
|
||||
android:scaleType="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_drag_handle_24dp"
|
||||
app:tint="?android:attr/textColorHint" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="90dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="w,2:3"
|
||||
app:layout_constraintStart_toEndOf="@+id/reorder"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@mipmap/ic_launcher" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/infoLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="80dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/reorder"
|
||||
app:layout_constraintStart_toEndOf="@+id/cover"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="h,3:2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@mipmap/ic_launcher" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cover"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
android:layout_height="40dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/reorder"
|
||||
app:layout_constraintStart_toEndOf="@+id/cover"
|
||||
app:layout_constraintTop_toBottomOf="@+id/infoLayout">
|
||||
|
||||
<ImageButton
|
||||
|
|
@ -101,8 +101,7 @@
|
|||
app:layout_constraintEnd_toStartOf="@+id/download"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_delete_24dp"
|
||||
app:tint="?android:attr/textColorPrimary" />
|
||||
app:srcCompat="@drawable/ic_delete_24dp" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/download"
|
||||
|
|
@ -115,8 +114,7 @@
|
|||
app:layout_constraintEnd_toStartOf="@+id/get_chapter_updates"
|
||||
app:layout_constraintStart_toEndOf="@+id/remove"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_get_app_24dp"
|
||||
app:tint="?android:attr/textColorPrimary" />
|
||||
app:srcCompat="@drawable/ic_get_app_24dp" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/get_chapter_updates"
|
||||
|
|
@ -129,8 +127,7 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/download"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_sync_24dp"
|
||||
app:tint="?android:attr/textColorPrimary" />
|
||||
app:srcCompat="@drawable/ic_sync_24dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:backgroundTint="@android:color/transparent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_item_selector_background">
|
||||
|
|
|
|||
Loading…
Reference in a new issue