From 5c10c6d0515eb25dd3fa7ebe60033b4e126a49ad Mon Sep 17 00:00:00 2001 From: cmclark00 Date: Thu, 27 Mar 2025 22:16:37 -0400 Subject: [PATCH] Update progression screen to use minimalist black/white/theme color scheme --- .../mintris/model/PlayerProgressionManager.kt | 38 +++++++++++++++++-- .../java/com/mintris/ui/ProgressionScreen.kt | 12 +++--- .../main/java/com/mintris/ui/ThemeSelector.kt | 37 ++++++++++++++++-- .../main/res/layout/progression_screen.xml | 17 +++++---- 4 files changed, 83 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/mintris/model/PlayerProgressionManager.kt b/app/src/main/java/com/mintris/model/PlayerProgressionManager.kt index c1ff90c..23921f2 100644 --- a/app/src/main/java/com/mintris/model/PlayerProgressionManager.kt +++ b/app/src/main/java/com/mintris/model/PlayerProgressionManager.kt @@ -286,8 +286,8 @@ class PlayerProgressionManager(context: Context) { private const val KEY_UNLOCKED_BADGES = "unlocked_badges" // XP curve parameters - private const val BASE_XP = 1000.0 // Base XP for level 1 - private const val XP_CURVE_FACTOR = 1.5 // Exponential factor for XP curve + private const val BASE_XP = 2500.0 // Base XP for level 1 (increased from 1000) + private const val XP_CURVE_FACTOR = 2.0 // Exponential factor for XP curve (increased from 1.5) // XP calculation constants private const val LEVEL_MULTIPLIER = 0.1 // 10% bonus per level @@ -296,7 +296,7 @@ class PlayerProgressionManager(context: Context) { private const val PERFECT_CLEAR_XP_BONUS = 200L private const val TIME_XP_PER_MINUTE = 5L - // Theme IDs + // Theme IDs with required levels const val THEME_CLASSIC = "theme_classic" const val THEME_NEON = "theme_neon" const val THEME_MONOCHROME = "theme_monochrome" @@ -304,10 +304,42 @@ class PlayerProgressionManager(context: Context) { const val THEME_MINIMALIST = "theme_minimalist" const val THEME_GALAXY = "theme_galaxy" + // Map of themes to required levels + val THEME_REQUIRED_LEVELS = mapOf( + THEME_CLASSIC to 1, + THEME_NEON to 5, + THEME_MONOCHROME to 10, + THEME_RETRO to 15, + THEME_MINIMALIST to 20, + THEME_GALAXY to 25 + ) + // Power IDs const val POWER_FREEZE_TIME = "power_freeze_time" const val POWER_BLOCK_SWAP = "power_block_swap" const val POWER_SAFE_LANDING = "power_safe_landing" const val POWER_PERFECT_CLEAR = "power_perfect_clear" + + // Map of powers to required levels + val POWER_REQUIRED_LEVELS = mapOf( + POWER_FREEZE_TIME to 8, + POWER_BLOCK_SWAP to 12, + POWER_SAFE_LANDING to 18, + POWER_PERFECT_CLEAR to 30 + ) + } + + /** + * Get the required level for a specific theme + */ + fun getRequiredLevelForTheme(themeId: String): Int { + return THEME_REQUIRED_LEVELS[themeId] ?: 1 + } + + /** + * Get the required level for a specific power + */ + fun getRequiredLevelForPower(powerId: String): Int { + return POWER_REQUIRED_LEVELS[powerId] ?: 1 } } \ No newline at end of file diff --git a/app/src/main/java/com/mintris/ui/ProgressionScreen.kt b/app/src/main/java/com/mintris/ui/ProgressionScreen.kt index 3762b42..c10ac84 100644 --- a/app/src/main/java/com/mintris/ui/ProgressionScreen.kt +++ b/app/src/main/java/com/mintris/ui/ProgressionScreen.kt @@ -130,25 +130,25 @@ class ProgressionScreen @JvmOverloads constructor( */ private fun createRewardCard(rewardText: String): CardView { val card = CardView(context).apply { - radius = 16f - cardElevation = 8f + radius = 0f + cardElevation = 0f useCompatPadding = true - setCardBackgroundColor(Color.parseColor("#FFD700")) // Gold background + setCardBackgroundColor(Color.TRANSPARENT) layoutParams = LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT ).apply { - setMargins(16, 16, 16, 16) + setMargins(16, 8, 16, 8) } } // Add reward text val textView = TextView(context).apply { text = rewardText - setTextColor(Color.BLACK) + setTextColor(Color.WHITE) textSize = 18f - setPadding(32, 24, 32, 24) + setPadding(16, 12, 16, 12) textAlignment = View.TEXT_ALIGNMENT_CENTER } diff --git a/app/src/main/java/com/mintris/ui/ThemeSelector.kt b/app/src/main/java/com/mintris/ui/ThemeSelector.kt index 7f045a9..0803524 100644 --- a/app/src/main/java/com/mintris/ui/ThemeSelector.kt +++ b/app/src/main/java/com/mintris/ui/ThemeSelector.kt @@ -105,6 +105,14 @@ class ThemeSelector @JvmOverloads constructor( } } + // Create theme content container + val container = FrameLayout(context).apply { + layoutParams = FrameLayout.LayoutParams( + FrameLayout.LayoutParams.MATCH_PARENT, + FrameLayout.LayoutParams.MATCH_PARENT + ) + } + // Create the theme preview val themePreview = View(context).apply { layoutParams = FrameLayout.LayoutParams( @@ -133,6 +141,23 @@ class ThemeSelector @JvmOverloads constructor( } } + // Add level requirement for locked themes + val levelRequirement = TextView(context).apply { + text = "Level ${themeInfo.unlockLevel}" + setTextColor(Color.WHITE) + textSize = 12f + textAlignment = View.TEXT_ALIGNMENT_CENTER + visibility = if (isUnlocked) View.GONE else View.VISIBLE + + // Position at the center of the card + layoutParams = FrameLayout.LayoutParams( + FrameLayout.LayoutParams.WRAP_CONTENT, + FrameLayout.LayoutParams.WRAP_CONTENT + ).apply { + gravity = android.view.Gravity.CENTER + } + } + // Add a lock icon if the theme is locked val lockOverlay = View(context).apply { layoutParams = FrameLayout.LayoutParams( @@ -145,10 +170,14 @@ class ThemeSelector @JvmOverloads constructor( visibility = if (isUnlocked) View.GONE else View.VISIBLE } - // Add all elements to the card - card.addView(themePreview) - card.addView(themeLabel) - card.addView(lockOverlay) + // Add all elements to container + container.addView(themePreview) + container.addView(themeLabel) + container.addView(lockOverlay) + container.addView(levelRequirement) + + // Add container to card + card.addView(container) // Set up click listener only for unlocked themes if (isUnlocked) { diff --git a/app/src/main/res/layout/progression_screen.xml b/app/src/main/res/layout/progression_screen.xml index c08f7d7..4738ec3 100644 --- a/app/src/main/res/layout/progression_screen.xml +++ b/app/src/main/res/layout/progression_screen.xml @@ -4,7 +4,7 @@ android:layout_height="match_parent" android:orientation="vertical" android:padding="16dp" - android:background="#1F1F1F"> + android:background="@color/black"> @@ -24,7 +24,7 @@ android:layout_height="wrap_content" android:text="Player Level: 1" android:textSize="20sp" - android:textColor="#FFFFFF" + android:textColor="@color/white" android:gravity="center" android:layout_marginBottom="24dp" /> @@ -56,7 +56,8 @@ android:textColor="#FFD700" android:gravity="center" android:layout_marginTop="8dp" - android:layout_marginBottom="16dp" /> + android:layout_marginBottom="16dp" + android:visibility="gone" /> + android:background="@color/transparent" + android:textColor="@color/white" /> \ No newline at end of file