Main activity theming

This commit is contained in:
Zakhar Timoshenko
2023-06-30 21:27:20 +03:00
parent 0098bdd07e
commit f01fd18711
26 changed files with 267 additions and 166 deletions

View File

@@ -28,13 +28,12 @@ class SegmentedBarView @JvmOverloads constructor(
private val paint = Paint(Paint.ANTI_ALIAS_FLAG) private val paint = Paint(Paint.ANTI_ALIAS_FLAG)
private val segmentsData = ArrayList<Segment>() private val segmentsData = ArrayList<Segment>()
private val segmentsSizes = ArrayList<Float>() private val segmentsSizes = ArrayList<Float>()
private val outlineColor = context.getThemeColor(materialR.attr.colorOutline)
private var cornerSize = 0f private var cornerSize = 0f
private var scaleFactor = 1f private var scaleFactor = 1f
private var scaleAnimator: ValueAnimator? = null private var scaleAnimator: ValueAnimator? = null
init { init {
paint.strokeWidth = context.resources.resolveDp(1f) paint.strokeWidth = context.resources.resolveDp(0f)
outlineProvider = OutlineProvider() outlineProvider = OutlineProvider()
clipToOutline = true clipToOutline = true
} }
@@ -57,12 +56,10 @@ class SegmentedBarView @JvmOverloads constructor(
paint.style = Paint.Style.FILL paint.style = Paint.Style.FILL
val segmentWidth = segmentsSizes[i] val segmentWidth = segmentsSizes[i]
canvas.drawRoundRect(0f, 0f, x + cornerSize, height.toFloat(), cornerSize, cornerSize, paint) canvas.drawRoundRect(0f, 0f, x + cornerSize, height.toFloat(), cornerSize, cornerSize, paint)
paint.color = outlineColor
paint.style = Paint.Style.STROKE paint.style = Paint.Style.STROKE
canvas.drawRoundRect(0f, 0f, x + cornerSize, height.toFloat(), cornerSize, cornerSize, paint) canvas.drawRoundRect(0f, 0f, x + cornerSize, height.toFloat(), cornerSize, cornerSize, paint)
x -= segmentWidth x -= segmentWidth
} }
paint.color = outlineColor
paint.style = Paint.Style.STROKE paint.style = Paint.Style.STROKE
canvas.drawRoundRect(0f, 0f, w, height.toFloat(), cornerSize, cornerSize, paint) canvas.drawRoundRect(0f, 0f, w, height.toFloat(), cornerSize, cornerSize, paint)
} }

View File

@@ -105,12 +105,12 @@ class ExploreFragment :
R.id.button_history -> HistoryActivity.newIntent(v.context) R.id.button_history -> HistoryActivity.newIntent(v.context)
R.id.button_local -> MangaListActivity.newIntent(v.context, MangaSource.LOCAL) R.id.button_local -> MangaListActivity.newIntent(v.context, MangaSource.LOCAL)
R.id.button_bookmarks -> BookmarksActivity.newIntent(v.context) R.id.button_bookmarks -> BookmarksActivity.newIntent(v.context)
R.id.button_suggestions -> SuggestionsActivity.newIntent(v.context) //R.id.button_suggestions -> SuggestionsActivity.newIntent(v.context)
R.id.button_favourites -> FavouriteCategoriesActivity.newIntent(v.context) R.id.button_favourites -> FavouriteCategoriesActivity.newIntent(v.context)
R.id.button_random -> { //R.id.button_random -> {
viewModel.openRandom() // viewModel.openRandom()
return // return
} //}
else -> return else -> return
} }

View File

@@ -33,13 +33,13 @@ fun exploreButtonsAD(
binding.buttonBookmarks.setOnClickListener(clickListener) binding.buttonBookmarks.setOnClickListener(clickListener)
binding.buttonHistory.setOnClickListener(clickListener) binding.buttonHistory.setOnClickListener(clickListener)
binding.buttonLocal.setOnClickListener(clickListener) binding.buttonLocal.setOnClickListener(clickListener)
binding.buttonSuggestions.setOnClickListener(clickListener) //binding.buttonSuggestions.setOnClickListener(clickListener)
binding.buttonFavourites.setOnClickListener(clickListener) binding.buttonFavourites.setOnClickListener(clickListener)
binding.buttonRandom.setOnClickListener(clickListener) //binding.buttonRandom.setOnClickListener(clickListener)
bind { //bind {
binding.buttonSuggestions.isVisible = item.isSuggestionsEnabled // binding.buttonSuggestions.isVisible = item.isSuggestionsEnabled
} //}
} }
fun exploreSourcesHeaderAD( fun exploreSourcesHeaderAD(

View File

@@ -364,7 +364,7 @@ class MainActivity :
viewBinding.toolbarCard.background = if (isOpened) { viewBinding.toolbarCard.background = if (isOpened) {
null null
} else { } else {
ContextCompat.getDrawable(this, R.drawable.toolbar_background) ContextCompat.getDrawable(this, R.drawable.search_bar_background)
} }
val padding = if (isOpened) 0 else resources.getDimensionPixelOffset(R.dimen.margin_normal) val padding = if (isOpened) 0 else resources.getDimensionPixelOffset(R.dimen.margin_normal)
viewBinding.appbar.updatePadding(left = padding, right = padding) viewBinding.appbar.updatePadding(left = padding, right = padding)

View File

@@ -2,14 +2,18 @@ package org.koitharu.kotatsu.settings.tools.views
import android.content.Context import android.content.Context
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.graphics.Color
import android.util.AttributeSet import android.util.AttributeSet
import android.view.LayoutInflater import android.view.LayoutInflater
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.annotation.AttrRes
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.core.content.ContextCompat
import androidx.core.graphics.ColorUtils import androidx.core.graphics.ColorUtils
import androidx.core.widget.TextViewCompat import androidx.core.widget.TextViewCompat
import com.google.android.material.color.MaterialColors import com.google.android.material.color.MaterialColors
import okio.ByteString.Companion.decodeHex
import org.koitharu.kotatsu.R import org.koitharu.kotatsu.R
import org.koitharu.kotatsu.core.ui.widgets.SegmentedBarView import org.koitharu.kotatsu.core.ui.widgets.SegmentedBarView
import org.koitharu.kotatsu.core.util.FileSize import org.koitharu.kotatsu.core.util.FileSize
@@ -17,6 +21,7 @@ import org.koitharu.kotatsu.core.util.ext.getThemeColor
import org.koitharu.kotatsu.databinding.LayoutMemoryUsageBinding import org.koitharu.kotatsu.databinding.LayoutMemoryUsageBinding
import org.koitharu.kotatsu.settings.tools.model.StorageUsage import org.koitharu.kotatsu.settings.tools.model.StorageUsage
class MemoryUsageView @JvmOverloads constructor( class MemoryUsageView @JvmOverloads constructor(
context: Context, context: Context,
attrs: AttributeSet? = null attrs: AttributeSet? = null
@@ -35,9 +40,9 @@ class MemoryUsageView @JvmOverloads constructor(
} }
fun bind(usage: StorageUsage?) { fun bind(usage: StorageUsage?) {
val storageSegment = SegmentedBarView.Segment(usage?.savedManga?.percent ?: 0f, segmentColor(1)) val storageSegment = SegmentedBarView.Segment(usage?.savedManga?.percent ?: 0f, segmentColor(com.google.android.material.R.attr.colorPrimary))
val pagesSegment = SegmentedBarView.Segment(usage?.pagesCache?.percent ?: 0f, segmentColor(2)) val pagesSegment = SegmentedBarView.Segment(usage?.pagesCache?.percent ?: 0f, segmentColor(com.google.android.material.R.attr.colorSecondary))
val otherSegment = SegmentedBarView.Segment(usage?.otherCache?.percent ?: 0f, segmentColor(3)) val otherSegment = SegmentedBarView.Segment(usage?.otherCache?.percent ?: 0f, segmentColor(com.google.android.material.R.attr.colorTertiary))
with(binding) { with(binding) {
bar.animateSegments(listOf(storageSegment, pagesSegment, otherSegment).filter { it.percent > 0f }) bar.animateSegments(listOf(storageSegment, pagesSegment, otherSegment).filter { it.percent > 0f })
@@ -67,11 +72,26 @@ class MemoryUsageView @JvmOverloads constructor(
} }
} }
private fun getHue(hex: String): Float {
val r = (hex.substring(0, 2).toInt(16)).toFloat()
val g = (hex.substring(2, 4).toInt(16)).toFloat()
val b = (hex.substring(4, 6).toInt(16)).toFloat()
var hue = 0F
if ((r >= g) && (g >= b)) {
hue = 60 * (g - b) / (r - b)
} else if ((g > r) && (r >= b)) {
hue = 60 * (2 - (r - b) / (g - b))
}
return hue
}
@ColorInt @ColorInt
private fun segmentColor(i: Int): Int { private fun segmentColor(@AttrRes resId: Int): Int {
val hue = (93.6f * i) % 360 val colorHex = String.format("%06x", context.getThemeColor(resId))
val color = ColorUtils.HSLToColor(floatArrayOf(hue, 0.4f, 0.6f)) val hue = getHue(colorHex)
val backgroundColor = context.getThemeColor(com.google.android.material.R.attr.colorSecondaryContainer) val color = ColorUtils.HSLToColor(floatArrayOf(hue, 0.5f, 0.5f))
val backgroundColor = context.getThemeColor(com.google.android.material.R.attr.colorSurfaceContainerHigh)
return MaterialColors.harmonize(color, backgroundColor) return MaterialColors.harmonize(color, backgroundColor)
} }
} }

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:alpha="0.08" android:color="?attr/elevationOverlayColor" /> <item android:color="?attr/colorSurfaceContainerLow" />
</selector> </selector>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:alpha="0.08" android:color="@color/kotatsu_onSurface" /> <item android:color="@color/kotatsu_surfaceContainerLow" />
</selector> </selector>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:alpha="0.7" android:color="?attr/colorSurface" /> <item android:alpha="0.7" android:color="?attr/colorSurfaceContainerHigh" />
</selector> </selector>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Fills the entire area with the divider's color first... -->
<item>
<shape
android:shape="rectangle">
<solid android:color="?attr/colorSecondary"/>
</shape>
</item>
<!-- ..., then draws a rectangle with the container color to cover the area not for the divider. -->
<item
android:bottom="1dp">
<shape
android:shape="rectangle">
<solid android:color="?attr/colorSurfaceContainerHigh"/>
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/colored_button" />
<corners android:radius="100dp" />
</shape>

View File

@@ -1,7 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android" <!-- Fills the entire area with the divider's color first... -->
android:shape="rectangle"> <item>
<solid android:color="@color/colored_button" /> <shape
<corners android:radius="100dp" /> android:shape="rectangle">
</shape> <solid android:color="@color/kotatsu_secondary"/>
</shape>
</item>
<!-- ..., then draws a rectangle with the container color to cover the area not for the divider. -->
<item
android:bottom="1dp">
<shape
android:shape="rectangle">
<solid android:color="@color/kotatsu_surfaceContainerHigh"/>
</shape>
</item>
</layer-list>

View File

@@ -52,7 +52,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="56dp" android:layout_height="56dp"
android:layout_marginVertical="8dp" android:layout_marginVertical="8dp"
android:background="@drawable/toolbar_background" android:background="@drawable/search_bar_background"
android:theme="@style/ThemeOverlay.Kotatsu.MainToolbar" android:theme="@style/ThemeOverlay.Kotatsu.MainToolbar"
app:layout_scrollFlags="scroll|enterAlways|snap"> app:layout_scrollFlags="scroll|enterAlways|snap">

View File

@@ -21,7 +21,7 @@
android:id="@id/toolbar" android:id="@id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@drawable/m3_tabs_background" android:background="@drawable/toolbar_background"
android:theme="?attr/actionBarTheme" android:theme="?attr/actionBarTheme"
app:layout_scrollFlags="noScroll" app:layout_scrollFlags="noScroll"
tools:ignore="PrivateResource" /> tools:ignore="PrivateResource" />

View File

@@ -36,7 +36,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_marginVertical="8dp" android:layout_marginVertical="8dp"
android:background="@drawable/toolbar_background" android:background="@drawable/search_bar_background"
android:theme="@style/ThemeOverlay.Kotatsu.MainToolbar" android:theme="@style/ThemeOverlay.Kotatsu.MainToolbar"
app:layout_scrollFlags="scroll|enterAlways|snap"> app:layout_scrollFlags="scroll|enterAlways|snap">

View File

@@ -30,11 +30,12 @@
tools:ignore="RtlSymmetry"> tools:ignore="RtlSymmetry">
<com.google.android.material.chip.Chip <com.google.android.material.chip.Chip
style="@style/Widget.Material3.Chip.Assist"
android:id="@+id/chip_sort" android:id="@+id/chip_sort"
style="@style/Widget.Material3.Chip.Assist.Elevated"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:visibility="gone"
app:chipBackgroundColor="?attr/colorSurfaceContainerHigh"
app:chipIcon="@drawable/ic_sort" app:chipIcon="@drawable/ic_sort"
app:chipIconEnabled="true" app:chipIconEnabled="true"
app:closeIcon="@drawable/ic_expand_more" app:closeIcon="@drawable/ic_expand_more"

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
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:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@@ -15,61 +16,79 @@
layout="@layout/layout_app_update" layout="@layout/layout_app_update"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_normal" android:layout_marginHorizontal="@dimen/margin_normal"
android:layout_marginTop="@dimen/margin_normal"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible" /> tools:visibility="visible" />
<com.google.android.material.divider.MaterialDivider <com.google.android.material.card.MaterialCardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/margin_small" android:layout_marginTop="@dimen/margin_normal"
android:visibility="gone" android:layout_marginHorizontal="@dimen/margin_normal"
tools:visibility="visible" /> app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
app:cardCornerRadius="21dp">
<org.koitharu.kotatsu.settings.tools.views.MemoryUsageView <org.koitharu.kotatsu.settings.tools.views.MemoryUsageView
android:id="@+id/memory_usage_view" android:id="@+id/memory_usage_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<com.google.android.material.divider.MaterialDivider </com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/margin_small" /> android:layout_marginHorizontal="@dimen/margin_normal"
android:layout_marginTop="@dimen/margin_normal"
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
app:cardCornerRadius="21dp"
app:contentPaddingBottom="8dp"
app:contentPaddingTop="8dp">
<com.google.android.material.materialswitch.MaterialSwitch <LinearLayout
android:id="@+id/switch_incognito" android:layout_width="match_parent"
style="?listItemTextViewStyle" android:layout_height="wrap_content"
android:layout_width="match_parent" android:orientation="vertical">
android:layout_height="?android:listPreferredItemHeightSmall"
android:drawableStart="@drawable/ic_incognito"
android:drawablePadding="?android:listPreferredItemPaddingStart"
android:paddingStart="?android:listPreferredItemPaddingStart"
android:paddingEnd="?android:listPreferredItemPaddingEnd"
android:text="@string/incognito_mode"
android:textAppearance="?attr/textAppearanceButton"
android:textColor="?attr/colorControlNormal" />
<org.koitharu.kotatsu.core.ui.widgets.ListItemTextView <com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/button_downloads" android:id="@+id/switch_incognito"
android:layout_width="match_parent" style="?listItemTextViewStyle"
android:layout_height="?android:listPreferredItemHeightSmall" android:layout_width="match_parent"
android:drawableStart="@drawable/ic_download" android:layout_height="?android:listPreferredItemHeightSmall"
android:drawablePadding="?android:listPreferredItemPaddingStart" android:drawableStart="@drawable/ic_incognito"
android:paddingStart="?android:listPreferredItemPaddingStart" android:drawablePadding="?android:listPreferredItemPaddingStart"
android:paddingEnd="?android:listPreferredItemPaddingEnd" android:paddingStart="?android:listPreferredItemPaddingStart"
android:text="@string/downloads" android:paddingEnd="?android:listPreferredItemPaddingEnd"
android:textAppearance="?attr/textAppearanceButton" /> android:text="@string/incognito_mode"
android:textAppearance="?attr/textAppearanceButton"
android:textColor="?attr/colorControlNormal" />
<org.koitharu.kotatsu.core.ui.widgets.ListItemTextView <org.koitharu.kotatsu.core.ui.widgets.ListItemTextView
android:id="@+id/button_settings" android:id="@+id/button_downloads"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?android:listPreferredItemHeightSmall" android:layout_height="?android:listPreferredItemHeightSmall"
android:drawableStart="@drawable/ic_settings" android:drawableStart="@drawable/ic_download"
android:drawablePadding="?android:listPreferredItemPaddingStart" android:drawablePadding="?android:listPreferredItemPaddingStart"
android:paddingStart="?android:listPreferredItemPaddingStart" android:paddingStart="?android:listPreferredItemPaddingStart"
android:paddingEnd="?android:listPreferredItemPaddingEnd" android:paddingEnd="?android:listPreferredItemPaddingEnd"
android:text="@string/settings" android:text="@string/downloads"
android:textAppearance="?attr/textAppearanceButton" /> android:textAppearance="?attr/textAppearanceButton" />
<org.koitharu.kotatsu.core.ui.widgets.ListItemTextView
android:id="@+id/button_settings"
android:layout_width="match_parent"
android:layout_height="?android:listPreferredItemHeightSmall"
android:drawableStart="@drawable/ic_settings"
android:drawablePadding="?android:listPreferredItemPaddingStart"
android:paddingStart="?android:listPreferredItemPaddingStart"
android:paddingEnd="?android:listPreferredItemPaddingEnd"
android:text="@string/settings"
android:textAppearance="?attr/textAppearanceButton" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout> </LinearLayout>

View File

@@ -37,7 +37,6 @@
<Button <Button
android:id="@+id/button_retry" android:id="@+id/button_retry"
style="@style/Widget.Material3.Button.TonalButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_normal" android:layout_marginTop="@dimen/margin_normal"

View File

@@ -23,14 +23,6 @@
android:text="@string/favourites" android:text="@string/favourites"
app:icon="@drawable/ic_heart_outline" /> app:icon="@drawable/ic_heart_outline" />
<com.google.android.material.button.MaterialButton
android:id="@+id/button_suggestions"
style="@style/Widget.Kotatsu.ExploreButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/suggestions"
app:icon="@drawable/ic_suggestion" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/button_local" android:id="@+id/button_local"
style="@style/Widget.Kotatsu.ExploreButton" style="@style/Widget.Kotatsu.ExploreButton"
@@ -47,19 +39,11 @@
android:text="@string/bookmarks" android:text="@string/bookmarks"
app:icon="@drawable/ic_bookmark" /> app:icon="@drawable/ic_bookmark" />
<com.google.android.material.button.MaterialButton
android:id="@+id/button_random"
style="@style/Widget.Kotatsu.ExploreButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/random"
app:icon="@drawable/ic_dice" />
<androidx.constraintlayout.helper.widget.Flow <androidx.constraintlayout.helper.widget.Flow
android:id="@+id/flow" android:id="@+id/flow"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:constraint_referenced_ids="button_history,button_favourites,button_local,button_bookmarks,button_suggestions,button_random" app:constraint_referenced_ids="button_history,button_favourites,button_local,button_bookmarks"
app:flow_horizontalGap="12dp" app:flow_horizontalGap="12dp"
app:flow_maxElementsWrap="@integer/explore_buttons_columns" app:flow_maxElementsWrap="@integer/explore_buttons_columns"
app:flow_verticalGap="8dp" app:flow_verticalGap="8dp"
@@ -68,4 +52,4 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -3,7 +3,7 @@
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"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
style="@style/Widget.Material3.CardView.Filled" style="@style/Widget.Kotatsu.CardView.Outlined"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clipChildren="false" android:clipChildren="false"

View File

@@ -3,7 +3,8 @@
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:id="@+id/card_update" android:id="@+id/card_update"
style="@style/Widget.Material3.CardView.Filled" app:cardCornerRadius="21dp"
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:contentPadding="@dimen/margin_normal"> app:contentPadding="@dimen/margin_normal">

View File

@@ -7,7 +7,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:baselineAligned="false" android:baselineAligned="false"
android:divider="?attr/colorOutline" android:divider="?attr/colorSecondary"
android:dividerPadding="8dp" android:dividerPadding="8dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"

View File

@@ -13,7 +13,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/screen_padding" android:layout_marginStart="@dimen/screen_padding"
android:layout_marginTop="@dimen/margin_small"> android:layout_marginTop="4dp">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
@@ -35,7 +35,7 @@
<org.koitharu.kotatsu.core.ui.widgets.SegmentedBarView <org.koitharu.kotatsu.core.ui.widgets.SegmentedBarView
android:id="@+id/bar" android:id="@+id/bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="16dp" android:layout_height="18dp"
android:layout_marginStart="@dimen/screen_padding" android:layout_marginStart="@dimen/screen_padding"
android:layout_marginEnd="@dimen/screen_padding" android:layout_marginEnd="@dimen/screen_padding"
android:background="?colorSecondaryContainer" /> android:background="?colorSecondaryContainer" />

View File

@@ -4,29 +4,41 @@
~ M3 colors generated by Material Theme Builder (https://goo.gle/material-theme-builder-web) ~ M3 colors generated by Material Theme Builder (https://goo.gle/material-theme-builder-web)
--> -->
<resources> <resources>
<color name="kotatsu_primary">#A5C8FF</color> <color name="kotatsu_primary">#D0BCFF</color>
<color name="kotatsu_onPrimary">#00315E</color> <color name="kotatsu_primaryContainer">#4F378B</color>
<color name="kotatsu_inversePrimary">#005FAE</color> <color name="kotatsu_onPrimary">#371E73</color>
<color name="kotatsu_primaryContainer">#004785</color> <color name="kotatsu_onPrimaryContainer">#EADDFF</color>
<color name="kotatsu_onPrimaryContainer">#D4E3FF</color> <color name="kotatsu_inversePrimary">#6750A4</color>
<color name="kotatsu_secondary">#BCC7DC</color> <color name="kotatsu_secondary">#CCC2DC</color>
<color name="kotatsu_onSecondary">#263141</color> <color name="kotatsu_secondaryContainer">#4A4458</color>
<color name="kotatsu_secondaryContainer">#3D4758</color> <color name="kotatsu_onSecondary">#332D41</color>
<color name="kotatsu_onSecondaryContainer">#D8E3F8</color> <color name="kotatsu_onSecondaryContainer">#E8DEF8</color>
<color name="kotatsu_tertiary">#DABDE2</color> <color name="kotatsu_tertiary">#EFB8C8</color>
<color name="kotatsu_onTertiary">#3D2946</color> <color name="kotatsu_tertiaryContainer">#633B48</color>
<color name="kotatsu_tertiaryContainer">#553F5E</color> <color name="kotatsu_onTertiary">#492532</color>
<color name="kotatsu_onTertiaryContainer">#F7D8FF</color> <color name="kotatsu_onTertiaryContainer">#FFD8E4</color>
<color name="kotatsu_background">#1A1C1E</color> <color name="kotatsu_surface">#141218</color>
<color name="kotatsu_onBackground">#E3E2E6</color> <color name="kotatsu_surfaceDim">#141218</color>
<color name="kotatsu_surface">#1A1C1E</color> <color name="kotatsu_surfaceBright">#141218</color>
<color name="kotatsu_onSurface">#E3E2E6</color> <color name="kotatsu_surfaceContainerLowest">#0F0D13</color>
<color name="kotatsu_surfaceVariant">#43474E</color> <color name="kotatsu_surfaceContainerLow">#1D1B20</color>
<color name="kotatsu_onSurfaceVariant">#C3C6CF</color> <color name="kotatsu_surfaceContainer">#211F26</color>
<color name="kotatsu_inverseSurface">#E3E2E6</color> <color name="kotatsu_surfaceContainerHigh">#2B2930</color>
<color name="kotatsu_inverseOnSurface">#1A1C1E</color> <color name="kotatsu_surfaceContainerHighest">#36343B</color>
<color name="kotatsu_outline">#8D9199</color> <color name="kotatsu_surfaceVariant">#49454F</color>
<color name="kotatsu_onSurface">#E6E1E5</color>
<color name="kotatsu_onSurfaceVariant">#CAC4D0</color>
<color name="kotatsu_inverseSurface">#E6E1E5</color>
<color name="kotatsu_inverseOnSurface">#313033</color>
<color name="kotatsu_background">#141218</color>
<color name="kotatsu_onBackground">#E6E1E5</color>
<color name="kotatsu_error">#F2B8B5</color>
<color name="kotatsu_errorContainer">#8C1D18</color>
<color name="kotatsu_onError">#601410</color>
<color name="kotatsu_onErrorContainer">#F9DEDC</color>
<color name="kotatsu_outline">#938F99</color>
<color name="kotatsu_outlineVariant">#444746</color>
<color name="kotatsu_shadow">#000000</color> <color name="kotatsu_shadow">#000000</color>
<color name="kotatsu_surfaceTint">#A5C8FF</color> <color name="kotatsu_surfaceTint">#D0BCFF</color>
<color name="kotatsu_surfaceTintColor">#A5C8FF</color> <color name="kotatsu_scrim">#000000</color>
</resources> </resources>

View File

@@ -4,29 +4,41 @@
~ M3 colors generated by Material Theme Builder (https://goo.gle/material-theme-builder-web) ~ M3 colors generated by Material Theme Builder (https://goo.gle/material-theme-builder-web)
--> -->
<resources> <resources>
<color name="kotatsu_primary">#005FAE</color> <color name="kotatsu_primary">#6750A4</color>
<color name="kotatsu_primaryContainer">#EADDFF</color>
<color name="kotatsu_onPrimary">#FFFFFF</color> <color name="kotatsu_onPrimary">#FFFFFF</color>
<color name="kotatsu_inversePrimary">#A5C8FF</color> <color name="kotatsu_onPrimaryContainer">#21005E</color>
<color name="kotatsu_primaryContainer">#D4E3FF</color> <color name="kotatsu_inversePrimary">#D0BCFF</color>
<color name="kotatsu_onPrimaryContainer">#001C3A</color> <color name="kotatsu_secondary">#625B71</color>
<color name="kotatsu_secondary">#545F71</color> <color name="kotatsu_secondaryContainer">#E8DEF8</color>
<color name="kotatsu_onSecondary">#FFFFFF</color> <color name="kotatsu_onSecondary">#FFFFFF</color>
<color name="kotatsu_secondaryContainer">#D8E3F8</color> <color name="kotatsu_onSecondaryContainer">#1E192B</color>
<color name="kotatsu_onSecondaryContainer">#111C2B</color> <color name="kotatsu_tertiary">#7D5260</color>
<color name="kotatsu_tertiary">#6D5676</color> <color name="kotatsu_tertiaryContainer">#FFD8E4</color>
<color name="kotatsu_onTertiary">#FFFFFF</color> <color name="kotatsu_onTertiary">#FFFFFF</color>
<color name="kotatsu_tertiaryContainer">#F7D8FF</color> <color name="kotatsu_onTertiaryContainer">#370B1E</color>
<color name="kotatsu_onTertiaryContainer">#271430</color> <color name="kotatsu_surface">#FEF7FF</color>
<color name="kotatsu_background">#F0F0F3</color> <color name="kotatsu_surfaceDim">#DED8E1</color>
<color name="kotatsu_onBackground">#1A1C1E</color> <color name="kotatsu_surfaceBright">#FEF7FF</color>
<color name="kotatsu_surface">#F0F0F3</color> <color name="kotatsu_surfaceContainerLowest">#FFFFFF</color>
<color name="kotatsu_onSurface">#1A1C1E</color> <color name="kotatsu_surfaceContainerLow">#F7F2FA</color>
<color name="kotatsu_surfaceVariant">#E0E2EC</color> <color name="kotatsu_surfaceContainer">#F3EDF7</color>
<color name="kotatsu_onSurfaceVariant">#43474E</color> <color name="kotatsu_surfaceContainerHigh">#ECE6F0</color>
<color name="kotatsu_inverseSurface">#2F3033</color> <color name="kotatsu_surfaceContainerHighest">#E6E0E9</color>
<color name="kotatsu_inverseOnSurface">#F1F0F4</color> <color name="kotatsu_surfaceVariant">#E7E0EC</color>
<color name="kotatsu_onSurface">#1C1B1F</color>
<color name="kotatsu_onSurfaceVariant">#49454E</color>
<color name="kotatsu_inverseSurface">#313033</color>
<color name="kotatsu_inverseOnSurface">#F4EFF4</color>
<color name="kotatsu_background">#FEF7FF</color>
<color name="kotatsu_onBackground">#1C1B1F</color>
<color name="kotatsu_error">#B3261E</color>
<color name="kotatsu_errorContainer">#F9DEDC</color>
<color name="kotatsu_onError">#FFFFFF</color>
<color name="kotatsu_onErrorContainer">#410E0B</color>
<color name="kotatsu_outline">#74777F</color> <color name="kotatsu_outline">#74777F</color>
<color name="kotatsu_outlineVariant">#C4C7C5</color>
<color name="kotatsu_shadow">#000000</color> <color name="kotatsu_shadow">#000000</color>
<color name="kotatsu_surfaceTint">#005FAE</color> <color name="kotatsu_surfaceTint">#6750A4</color>
<color name="kotatsu_surfaceTintColor">#005FAE</color> <color name="kotatsu_scrim">#000000</color>
</resources> </resources>

View File

@@ -2,10 +2,16 @@
<!--Toolbars--> <!--Toolbars-->
<style name="Widget.Kotatsu.AppBarLayout" parent="@style/Widget.Material3.AppBarLayout">
<item name="android:background">?attr/colorSurfaceContainerHigh</item>
</style>
<!--Navigation Views--> <!--Navigation Views-->
<style name="Widget.Kotatsu.BottomNavigationView" parent="Widget.Material3.BottomNavigationView"> <style name="Widget.Kotatsu.BottomNavigationView" parent="Widget.Material3.BottomNavigationView">
<item name="labelVisibilityMode">labeled</item> <item name="labelVisibilityMode">unlabeled</item>
<item name="android:background">?attr/colorSurfaceContainerHighest</item>
<item name="compatShadowEnabled">false</item>
</style> </style>
<style name="Widget.Kotatsu.BottomNavigationView.ColoredIndicators"> <style name="Widget.Kotatsu.BottomNavigationView.ColoredIndicators">
@@ -61,6 +67,11 @@
<!-- Widget styles --> <!-- Widget styles -->
<style name="Widget.Kotatsu.CardView.Outlined" parent="@style/Widget.Material3.CardView.Outlined">
<item name="strokeColor">?attr/colorSecondary</item>
<item name="cardBackgroundColor">?attr/colorSurfaceContainerLow</item>
</style>
<style name="Widget.Kotatsu.Tabs" parent="@style/Widget.Material3.TabLayout"> <style name="Widget.Kotatsu.Tabs" parent="@style/Widget.Material3.TabLayout">
<item name="tabGravity">center</item> <item name="tabGravity">center</item>
<item name="tabInlineLabel">true</item> <item name="tabInlineLabel">true</item>
@@ -86,7 +97,7 @@
</style> </style>
<style name="Widget.Kotatsu.Chip" parent="Widget.Material3.Chip.Suggestion"> <style name="Widget.Kotatsu.Chip" parent="Widget.Material3.Chip.Suggestion">
<item name="chipSurfaceColor">?attr/colorSurface</item> <item name="chipBackgroundColor">?attr/colorSurfaceContainerHigh</item>
<item name="android:textColor">?attr/colorOnSurfaceVariant</item> <item name="android:textColor">?attr/colorOnSurfaceVariant</item>
<item name="chipStrokeColor">?attr/colorOutline</item> <item name="chipStrokeColor">?attr/colorOutline</item>
<item name="chipIconTint">?attr/colorControlNormal</item> <item name="chipIconTint">?attr/colorControlNormal</item>
@@ -163,16 +174,18 @@
</style> </style>
<style name="Widget.Kotatsu.ExploreButton" parent="Widget.Material3.Button.TonalButton.Icon"> <style name="Widget.Kotatsu.ExploreButton" parent="Widget.Material3.Button.TonalButton.Icon">
<item name="android:minHeight">58dp</item> <item name="android:minHeight">54dp</item>
<item name="android:textColor">?attr/colorOnSurface</item>
<item name="android:singleLine">true</item> <item name="android:singleLine">true</item>
<item name="shapeAppearance">?shapeAppearanceCornerLarge</item> <item name="shapeAppearance">?shapeAppearanceCornerExtraLarge</item>
<item name="android:ellipsize">marquee</item>
<item name="android:marqueeRepeatLimit">marquee_forever</item>
<item name="iconSize">22dp</item> <item name="iconSize">22dp</item>
<item name="iconPadding">16dp</item> <item name="iconPadding">16dp</item>
<item name="iconGravity">start</item> <item name="iconGravity">start</item>
<item name="iconTint">?attr/colorPrimary</item>
<item name="android:textColor">?attr/colorPrimary</item>
<item name="android:insetTop">2dp</item> <item name="android:insetTop">2dp</item>
<item name="android:insetBottom">2dp</item> <item name="android:insetBottom">2dp</item>
<item name="iconTint">?attr/colorPrimaryDark</item>
<item name="android:gravity">start|center_vertical</item> <item name="android:gravity">start|center_vertical</item>
<item name="android:textAppearance">?textAppearanceButton</item> <item name="android:textAppearance">?textAppearanceButton</item>
<item name="backgroundTint">@color/colored_button</item> <item name="backgroundTint">@color/colored_button</item>
@@ -234,7 +247,7 @@
</style> </style>
<style name="ShapeAppearanceOverlay.Kotatsu.Cover.Small" parent=""> <style name="ShapeAppearanceOverlay.Kotatsu.Cover.Small" parent="">
<item name="cornerSize">6dp</item> <item name="cornerSize">21dp</item>
</style> </style>
<style name="ShapeAppearanceOverlay.Kotatsu.Circle" parent=""> <style name="ShapeAppearanceOverlay.Kotatsu.Circle" parent="">

View File

@@ -9,34 +9,41 @@
<!-- Theme Colors --> <!-- Theme Colors -->
<item name="colorPrimary">@color/kotatsu_primary</item> <item name="colorPrimary">@color/kotatsu_primary</item>
<item name="colorOnPrimary">@color/kotatsu_onPrimary</item>
<item name="colorPrimaryContainer">@color/kotatsu_primaryContainer</item> <item name="colorPrimaryContainer">@color/kotatsu_primaryContainer</item>
<item name="colorOnPrimary">@color/kotatsu_onPrimary</item>
<item name="colorOnPrimaryContainer">@color/kotatsu_onPrimaryContainer</item> <item name="colorOnPrimaryContainer">@color/kotatsu_onPrimaryContainer</item>
<item name="colorPrimaryInverse">@color/kotatsu_inversePrimary</item>
<item name="colorSecondary">@color/kotatsu_secondary</item> <item name="colorSecondary">@color/kotatsu_secondary</item>
<item name="colorOnSecondary">@color/kotatsu_onSecondary</item>
<item name="colorSecondaryContainer">@color/kotatsu_secondaryContainer</item> <item name="colorSecondaryContainer">@color/kotatsu_secondaryContainer</item>
<item name="colorOnSecondary">@color/kotatsu_onSecondary</item>
<item name="colorOnSecondaryContainer">@color/kotatsu_onSecondaryContainer</item> <item name="colorOnSecondaryContainer">@color/kotatsu_onSecondaryContainer</item>
<item name="colorTertiary">@color/kotatsu_tertiary</item> <item name="colorTertiary">@color/kotatsu_tertiary</item>
<item name="colorOnTertiary">@color/kotatsu_onTertiary</item>
<item name="colorTertiaryContainer">@color/kotatsu_tertiaryContainer</item> <item name="colorTertiaryContainer">@color/kotatsu_tertiaryContainer</item>
<item name="colorOnTertiary">@color/kotatsu_onTertiary</item>
<item name="colorOnTertiaryContainer">@color/kotatsu_onTertiaryContainer</item> <item name="colorOnTertiaryContainer">@color/kotatsu_onTertiaryContainer</item>
<item name="android:colorBackground">@color/kotatsu_background</item>
<item name="colorOnBackground">@color/kotatsu_onBackground</item>
<item name="colorSurface">@color/kotatsu_surface</item> <item name="colorSurface">@color/kotatsu_surface</item>
<item name="colorOnSurface">@color/kotatsu_onSurface</item> <item name="colorSurfaceDim">@color/kotatsu_surfaceDim</item>
<item name="colorSurfaceBright">@color/kotatsu_surfaceBright</item>
<item name="colorSurfaceContainerLowest">@color/kotatsu_surfaceContainerLowest</item>
<item name="colorSurfaceContainerLow">@color/kotatsu_surfaceContainerLow</item>
<item name="colorSurfaceContainer">@color/kotatsu_surfaceContainer</item>
<item name="colorSurfaceContainerHigh">@color/kotatsu_surfaceContainerHigh</item>
<item name="colorSurfaceContainerHighest">@color/kotatsu_surfaceContainerHighest</item>
<item name="colorSurfaceVariant">@color/kotatsu_surfaceVariant</item> <item name="colorSurfaceVariant">@color/kotatsu_surfaceVariant</item>
<item name="colorOnSurface">@color/kotatsu_onSurface</item>
<item name="colorOnSurfaceVariant">@color/kotatsu_onSurfaceVariant</item> <item name="colorOnSurfaceVariant">@color/kotatsu_onSurfaceVariant</item>
<item name="colorOutline">@color/kotatsu_outline</item>
<item name="colorOnSurfaceInverse">@color/kotatsu_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/kotatsu_inverseSurface</item> <item name="colorSurfaceInverse">@color/kotatsu_inverseSurface</item>
<item name="colorPrimaryInverse">@color/kotatsu_inversePrimary</item> <item name="colorOnSurfaceInverse">@color/kotatsu_inverseOnSurface</item>
<item name="android:colorBackground">@color/kotatsu_surfaceContainerHigh</item>
<item name="colorOnBackground">@color/kotatsu_onSurface</item>
<item name="colorError">@color/error</item> <item name="colorError">@color/error</item>
<item name="colorOnError">@color/onError</item>
<item name="colorErrorContainer">@color/errorContainer</item> <item name="colorErrorContainer">@color/errorContainer</item>
<item name="colorControlHighlight">?attr/colorSurfaceVariant</item> <item name="colorOnError">@color/onError</item>
<item name="colorOnErrorContainer">@color/onErrorContainer</item> <item name="colorOnErrorContainer">@color/onErrorContainer</item>
<item name="colorOutline">@color/kotatsu_outline</item>
<item name="colorOutlineVariant">@color/kotatsu_outline</item>
<item name="android:divider">@color/divider_default</item> <item name="android:divider">@color/kotatsu_outline</item>
<!-- Handles RTL text --> <!-- Handles RTL text -->
<item name="android:textAlignment">gravity</item> <item name="android:textAlignment">gravity</item>
@@ -64,7 +71,7 @@
<item name="chipStyle">@style/Widget.Kotatsu.Chip</item> <item name="chipStyle">@style/Widget.Kotatsu.Chip</item>
<item name="textInputStyle">@style/Widget.Material3.TextInputLayout.OutlinedBox</item> <item name="textInputStyle">@style/Widget.Material3.TextInputLayout.OutlinedBox</item>
<item name="toolbarStyle">@style/Widget.Material3.Toolbar</item> <item name="toolbarStyle">@style/Widget.Material3.Toolbar</item>
<item name="appBarLayoutStyle">@style/Widget.Material3.AppBarLayout</item> <item name="appBarLayoutStyle">@style/Widget.Kotatsu.AppBarLayout</item>
<item name="bottomNavigationStyle">@style/Widget.Kotatsu.BottomNavigationView.ColoredIndicators</item> <item name="bottomNavigationStyle">@style/Widget.Kotatsu.BottomNavigationView.ColoredIndicators</item>
<item name="tabStyle">@style/Widget.Kotatsu.Tabs</item> <item name="tabStyle">@style/Widget.Kotatsu.Tabs</item>
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Filled</item> <item name="materialCardViewStyle">@style/Widget.Material3.CardView.Filled</item>