UI improvements: Added border to selected theme and centered stats screen

This commit is contained in:
cmclark00 2025-03-27 23:08:38 -04:00
parent 843cae4b75
commit ed7847ad70
2 changed files with 150 additions and 135 deletions

View file

@ -86,6 +86,18 @@ class ThemeSelector @JvmOverloads constructor(
// Set card background color based on theme
setCardBackgroundColor(themeInfo.primaryColor)
// Add stroke for selected theme
if (isSelected) {
setContentPadding(4, 4, 4, 4)
// Create a gradient drawable for the border
val gradientDrawable = android.graphics.drawable.GradientDrawable().apply {
setColor(themeInfo.primaryColor)
setStroke(4, Color.WHITE)
cornerRadius = 12f
}
background = gradientDrawable
}
// Set card dimensions
val cardSize = resources.getDimensionPixelSize(R.dimen.theme_card_size)
layoutParams = GridLayout.LayoutParams().apply {
@ -98,11 +110,6 @@ class ThemeSelector @JvmOverloads constructor(
// Apply locked/selected state visuals
alpha = if (isUnlocked) 1.0f else 0.5f
// Add stroke for selected theme
if (isSelected) {
setContentPadding(4, 4, 4, 4)
}
}
// Create theme content container

View file

@ -1,15 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
android:padding="16dp"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
@ -153,4 +160,5 @@
android:layout_marginTop="16dp"/>
</LinearLayout>
</ScrollView>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>