A modern Android application designed to train memory, concentration, and mental agility through engaging cognitive games. Built with Jetpack Compose and Kotlin, MindPlay offers a stress-free approach to brain training with smooth animations, immersive sound design, and an intuitive user interface.
MindPlay is a collection of six cognitive training games that help users improve various mental skills:
- Memory - Pattern matching and visual memory
- Simon - Sequential memory and pattern reproduction
- Arithmetic - Mental math and numerical reasoning
- Pary (Pairs) - Logical matching and pattern recognition
- Puzzle - Spatial reasoning and problem-solving
- Uwaga (Attention) - Reaction time and focus
The app emphasizes a relaxed, pressure-free experience while still providing challenging gameplay that adapts to user preferences.
- Six Cognitive Games - Each targeting different mental skills
- Smooth Animations - Fade transitions between screens using
AnimatedVisibility - Immersive Audio - Background music and sound effects for user interactions
- Custom Theme System - Consistent design with MindPlay theme colors
- Progress Tracking - Game statistics and performance metrics
- Daily Reminders - Push notifications to encourage regular practice
- Onboarding Flow - Welcome and tutorial screens for first-time users
- Settings Management - Customizable preferences stored locally
- Multiple difficulty levels and grid modes
- Optional stress/time modes for added challenge
- Pause functionality during gameplay
- Detailed result screens with metrics
- Play again or return to menu options
- Intro screens explaining game rules
- Kotlin - Primary programming language
- Jetpack Compose - Modern declarative UI framework
- Material 3 - Design system and components
- Coroutines & Flow - Asynchronous programming and reactive streams
- MVVM Architecture - Clean separation of concerns
- Koin - Dependency injection (v3.5.3)
koin-androidkoin-androidx-compose
- Navigation Compose - Type-safe navigation (v2.7.6)
- DataStore - Preferences storage (v1.0.0)
- Room Database - Local data persistence (v2.6.1)
- Runtime, KTX extensions, and Kapt compiler
- Lifecycle & ViewModel - Android Architecture Components
- Min SDK: 26 (Android 8.0)
- Target SDK: 36
- Compile SDK: 36
- Java Version: 11
- Gradle: Kotlin DSL
app/src/main/java/com/mind/play/
โโโ MainActivity.kt # Entry point with lifecycle management
โโโ MindPlayApp.kt # Application class with Koin setup
โโโ core/
โ โโโ components/ # Reusable UI components
โ โ โโโ AnimatedCard.kt
โ โ โโโ GameResultScreen.kt
โ โ โโโ MindPlayBottomNavigation.kt
โ โ โโโ MindPlayProgressBar.kt
โ โ โโโ MindPlayToggle.kt
โ โ โโโ Buttons (Primary, Secondary)
โ โโโ di/
โ โ โโโ AppModule.kt # Dependency injection modules
โ โโโ navigation/
โ โ โโโ NavGraph.kt # Navigation setup and routes
โ โ โโโ NavigationAnimations.kt
โ โ โโโ Screen.kt # Screen destinations
โ โโโ notifications/
โ โ โโโ NotificationScheduler.kt
โ โ โโโ ReminderReceiver.kt
โ โ โโโ BootReceiver.kt
โ โโโ sound/
โ โโโ SoundManager.kt # Audio playback management
โโโ data/
โ โโโ local/ # Room database entities and DAOs
โ โโโ repository/ # Data layer abstractions
โโโ domain/
โ โโโ models/ # Business logic models
โโโ ui/
โ โโโ dashboard/
โ โ โโโ HomeScreen.kt # Main dashboard
โ โโโ games/
โ โ โโโ GamesScreen.kt # Games selection grid
โ โ โโโ arithmetic/ # Simple arithmetic game
โ โ โโโ memory/ # Card matching game
โ โ โโโ pary/ # Logical pairs game
โ โ โโโ puzzle/ # Sliding puzzle game
โ โ โโโ simon/ # Color sequence game
โ โ โโโ uwaga/ # Attention/reaction game
โ โโโ onboarding/
โ โ โโโ WelcomeScreen.kt
โ โ โโโ OnboardingScreen.kt
โ โโโ settings/
โ โ โโโ SettingsScreen.kt
โ โโโ splash/
โ โ โโโ SplashScreen.kt
โ โโโ theme/
โ โโโ Theme files # Colors, typography, shapes
โโโ res/
โโโ drawable/ # Icons and graphics
โโโ values/ # Strings, colors, themes
โโโ raw/ # Audio files
The app follows MVVM (Model-View-ViewModel) architecture:
View (Composables) โ ViewModel โ Repository โ Data Source
โ
StateFlow/State
Each game module contains:
- Screen.kt - Main composable with game logic
- ViewModel.kt - State management and business logic
- Models.kt - Game state and data classes
- IntroScreen.kt - Game rules and configuration
- components/ - Game-specific UI components
Splash Screen
โ
โโโ Welcome Screen (first launch)
โ โ
โ Onboarding Screen
โ โ
โโโ Home Screen โโ Bottom Navigation
โ โ โ
Dashboard Games Menu Settings
โ
[Individual Games]
โโ Arithmetic
โโ Memory
โโ Pary
โโ Puzzle
โโ Simon
โโ Uwaga
โ
[Game Flow]
Intro โ Gameplay โ Results
- SplashScreen - Initial loading screen with logo
- WelcomeScreen - First-time user greeting
- OnboardingScreen - Interactive tutorial walkthrough
- HomeScreen - Main dashboard with quick access
- GamesScreen - Grid view of all available games
- SettingsScreen - User preferences and app configuration
Each game follows a consistent flow:
- Intro Screen - Game rules, difficulty selection
- Game Screen - Active gameplay with timer, progress, pause
- Result Screen - Performance metrics, play again option
Arithmetic (Prosta arytmetyka)
- Solve addition and subtraction problems
- Multiple choice answers
- Progress tracking with score display
- Optional time limit mode
Memory
- Match pairs of cards by flipping them
- Multiple grid sizes (2x4, 3x4, 4x4)
- Round-based progression
- Time-based challenges
Simon
- Watch and memorize color sequences
- Reproduce the pattern by tapping colors
- Sequences grow longer each round
- Audio-visual feedback
Pary (Pairs)
- Match logical pairs (concepts, opposites, etc.)
- Grid-based selection
- Correct/incorrect visual feedback
- Multiple rounds with increasing difficulty
Puzzle
- Sliding tile puzzle (3x3 or 4x4 grid)
- Move tiles to complete the image
- Move counter and timer
- Win/lose conditions
Uwaga (Attention)
- React to specific stimuli
- Tap correct targets as they appear
- Reaction time tracking
- Configurable difficulty
The app features a comprehensive audio system via SoundManager:
- Background Music - Continuous ambient music during gameplay
- Sound Effects:
- Tap/click sounds for button interactions
- Success sounds for correct answers
- Error sounds for mistakes
- Card flip sounds
- Completion fanfare
Audio playback is managed through the Activity lifecycle:
- Automatically pauses when app goes to background
- Resumes when app returns to foreground
- Properly released on app termination
- User settings (sound, notifications)
- Onboarding completion status
- Theme preferences
- Game progress and statistics
- User performance history
- Achievement tracking
MindPlay uses a custom theme system with:
- Primary Colors - Purple/violet palette
- Secondary Colors - Complementary accents
- Semantic Colors - Success (green), error (red), warning
- Custom Typography - Rubik font family
- Material 3 Components - Modern design language
- Dark/Light Mode Support - Adaptive themes
Theme colors are accessed via MindPlayTheme.colors.*
The app includes a notification system for daily reminders:
- ReminderReceiver - Handles scheduled notifications
- BootReceiver - Restores alarms after device restart
- NotificationScheduler - Manages notification timing
- Permissions:
POST_NOTIFICATIONS,SCHEDULE_EXACT_ALARM,USE_EXACT_ALARM
- Unit Tests - JUnit (implementation included)
- Instrumented Tests - AndroidX Test + Espresso
- Compose Tests - UI testing with
ui-test-junit4
Test packages:
app/src/androidTest/java/ # Instrumented tests
app/src/test/java/ # Unit tests
# Run unit tests
./gradlew test
# Run instrumented tests
./gradlew connectedAndroidTest
# Run specific test
./gradlew test --tests "com.mind.play.ExampleTest"- Android Studio - Hedgehog (2023.1.1) or later
- JDK - Version 11 or higher
- Android SDK - API 26+ (minimum), API 36 (target)
- Gradle - 8.0+ (included via wrapper)
# Clone the repository
git clone <repository-url>
cd MindPlay
# Grant execute permission to Gradle wrapper (macOS/Linux)
chmod +x gradlew
# Build the project
./gradlew build
# Install on connected device/emulator
./gradlew installDebugThe project uses these key configuration files:
build.gradle.kts(project & app level) - Build configurationgradle.properties- Gradle settingssettings.gradle.kts- Project structuregradle/libs.versions.toml- Dependency version cataloglocal.properties- SDK location (generated, not in VCS)proguard-rules.pro- Code obfuscation rules
- Launch Android Studio
- Open the project directory
- Wait for Gradle sync to complete
- Select a device/emulator (API 26+)
- Click Run
โถ๏ธ
The app will display the splash screen, then the welcome/onboarding flow for first-time users.
All screen transitions use fade animations:
enterTransition = { NavigationAnimations.fadeInTransition() }
exitTransition = { NavigationAnimations.fadeOutTransition() }Games use Kotlin StateFlow for reactive UI updates:
val gameState by viewModel.gameState.collectAsState()Koin modules provide singleton instances:
single { SoundManager(androidContext()) }
single { SettingsRepository(get()) }- AnimatedVisibility - Smooth transitions between game phases
- LazyVerticalGrid - Efficient grid layouts for game cards
- remember/mutableStateOf - Local state management
- collectAsState - Flow to Compose state conversion