Update progression screen to use minimalist black/white/theme color scheme

This commit is contained in:
cmclark00 2025-03-27 22:16:37 -04:00
parent 4166fe2b7a
commit 5c10c6d051
4 changed files with 83 additions and 21 deletions

View file

@ -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
}
}

View file

@ -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
}

View file

@ -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) {