mirror of
https://github.com/cmclark00/mintris.git
synced 2025-05-18 05:15:20 +01:00
UI improvements: Added border to selected theme and centered stats screen
This commit is contained in:
parent
843cae4b75
commit
ed7847ad70
2 changed files with 150 additions and 135 deletions
|
@ -86,6 +86,18 @@ class ThemeSelector @JvmOverloads constructor(
|
||||||
// Set card background color based on theme
|
// Set card background color based on theme
|
||||||
setCardBackgroundColor(themeInfo.primaryColor)
|
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
|
// Set card dimensions
|
||||||
val cardSize = resources.getDimensionPixelSize(R.dimen.theme_card_size)
|
val cardSize = resources.getDimensionPixelSize(R.dimen.theme_card_size)
|
||||||
layoutParams = GridLayout.LayoutParams().apply {
|
layoutParams = GridLayout.LayoutParams().apply {
|
||||||
|
@ -98,11 +110,6 @@ class ThemeSelector @JvmOverloads constructor(
|
||||||
|
|
||||||
// Apply locked/selected state visuals
|
// Apply locked/selected state visuals
|
||||||
alpha = if (isUnlocked) 1.0f else 0.5f
|
alpha = if (isUnlocked) 1.0f else 0.5f
|
||||||
|
|
||||||
// Add stroke for selected theme
|
|
||||||
if (isSelected) {
|
|
||||||
setContentPadding(4, 4, 4, 4)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create theme content container
|
// Create theme content container
|
||||||
|
|
|
@ -1,15 +1,22 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/black">
|
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
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="16dp">
|
android:padding="16dp"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -154,3 +161,4 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Add table
Add a link
Reference in a new issue