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