Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
96759e402d
|
|||
|
ed76fb2fb2
|
|||
|
870278f240
|
|||
|
4eef77bd3b
|
|||
|
2d957db948
|
|||
| 22bed6a961 | |||
|
b443c18a19
|
13
.idea/caches/deviceStreaming.xml
generated
13
.idea/caches/deviceStreaming.xml
generated
@@ -817,6 +817,19 @@
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2424" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="36" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="tokay" />
|
||||
<option name="default" value="true" />
|
||||
<option name="id" value="tokay" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 9" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2424" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="samsung" />
|
||||
|
||||
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="temurin-21" project-jdk-type="JavaSDK" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="temurin-21" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
@@ -8,14 +8,14 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "com.atridad.openclimb"
|
||||
compileSdk = 35
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.atridad.openclimb"
|
||||
minSdk = 31
|
||||
targetSdk = 35
|
||||
versionCode = 11
|
||||
versionName = "0.4.4"
|
||||
targetSdk = 36
|
||||
versionCode = 14
|
||||
versionName = "1.0.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@@ -30,12 +30,19 @@ android {
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "11"
|
||||
jvmTarget = "17"
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
@@ -74,13 +81,16 @@ dependencies {
|
||||
// Image Loading
|
||||
implementation(libs.coil.compose)
|
||||
|
||||
// Charts - Placeholder for future implementation
|
||||
// Charts will be implemented with a stable library in future versions
|
||||
|
||||
// Testing
|
||||
testImplementation(libs.junit)
|
||||
testImplementation(libs.mockk)
|
||||
testImplementation(libs.kotlinx.coroutines.test)
|
||||
androidTestImplementation(libs.androidx.junit)
|
||||
androidTestImplementation(libs.androidx.espresso.core)
|
||||
androidTestImplementation(libs.androidx.test.core)
|
||||
androidTestImplementation(libs.androidx.test.ext)
|
||||
androidTestImplementation(libs.androidx.test.runner)
|
||||
androidTestImplementation(libs.androidx.test.rules)
|
||||
androidTestImplementation(platform(libs.androidx.compose.bom))
|
||||
androidTestImplementation(libs.androidx.ui.test.junit4)
|
||||
debugImplementation(libs.androidx.ui.tooling)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.OpenClimb">
|
||||
android:theme="@style/Theme.OpenClimb.Splash">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.atridad.openclimb.ui.theme.OpenClimbTheme
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setTheme(R.style.Theme_OpenClimb)
|
||||
enableEdgeToEdge()
|
||||
setContent {
|
||||
OpenClimbTheme {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.atridad.openclimb.ui
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material.icons.filled.PlayArrow
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Modifier
|
||||
@@ -67,7 +68,7 @@ fun OpenClimbApp() {
|
||||
LaunchedEffect(gyms, activeSession) {
|
||||
fabConfig = if (gyms.isNotEmpty() && activeSession == null) {
|
||||
FabConfig(
|
||||
icon = Icons.Default.Add,
|
||||
icon = Icons.Default.PlayArrow,
|
||||
contentDescription = "Start Session",
|
||||
onClick = {
|
||||
if (gyms.size == 1) {
|
||||
@@ -151,7 +152,10 @@ fun OpenClimbApp() {
|
||||
SessionDetailScreen(
|
||||
sessionId = args.sessionId,
|
||||
viewModel = viewModel,
|
||||
onNavigateBack = { navController.popBackStack() }
|
||||
onNavigateBack = { navController.popBackStack() },
|
||||
onNavigateToProblemDetail = { problemId ->
|
||||
navController.navigate(Screen.ProblemDetail(problemId))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -177,6 +181,12 @@ fun OpenClimbApp() {
|
||||
onNavigateBack = { navController.popBackStack() },
|
||||
onNavigateToEdit = { gymId ->
|
||||
navController.navigate(Screen.AddEditGym(gymId = gymId))
|
||||
},
|
||||
onNavigateToSessionDetail = { sessionId ->
|
||||
navController.navigate(Screen.SessionDetail(sessionId))
|
||||
},
|
||||
onNavigateToProblemDetail = { problemId ->
|
||||
navController.navigate(Screen.ProblemDetail(problemId))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.atridad.openclimb.ui.components
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material.icons.filled.PlayArrow
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
@@ -13,9 +12,10 @@ import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.atridad.openclimb.data.model.ClimbSession
|
||||
import com.atridad.openclimb.data.model.Gym
|
||||
import com.atridad.openclimb.ui.theme.CustomIcons
|
||||
import kotlinx.coroutines.delay
|
||||
import java.time.LocalDateTime
|
||||
import java.time.temporal.ChronoUnit
|
||||
import kotlinx.coroutines.delay
|
||||
|
||||
@Composable
|
||||
fun ActiveSessionBanner(
|
||||
@@ -95,7 +95,7 @@ fun ActiveSessionBanner(
|
||||
)
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.Close,
|
||||
imageVector = CustomIcons.Stop(MaterialTheme.colorScheme.onError),
|
||||
contentDescription = "End session"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import androidx.lifecycle.viewModelScope
|
||||
import com.atridad.openclimb.data.model.*
|
||||
import com.atridad.openclimb.ui.components.FullscreenImageViewer
|
||||
import com.atridad.openclimb.ui.components.ImageDisplaySection
|
||||
import com.atridad.openclimb.ui.theme.CustomIcons
|
||||
import com.atridad.openclimb.ui.viewmodel.ClimbViewModel
|
||||
import java.time.LocalDateTime
|
||||
import java.time.format.DateTimeFormatter
|
||||
@@ -209,7 +210,12 @@ fun EditAttemptDialog(
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun SessionDetailScreen(sessionId: String, viewModel: ClimbViewModel, onNavigateBack: () -> Unit) {
|
||||
fun SessionDetailScreen(
|
||||
sessionId: String,
|
||||
viewModel: ClimbViewModel,
|
||||
onNavigateBack: () -> Unit,
|
||||
onNavigateToProblemDetail: (String) -> Unit = {}
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val attempts by viewModel.getAttemptsBySession(sessionId).collectAsState(initial = emptyList())
|
||||
val sessions by viewModel.sessions.collectAsState()
|
||||
@@ -283,8 +289,23 @@ fun SessionDetailScreen(sessionId: String, viewModel: ClimbViewModel, onNavigate
|
||||
}
|
||||
}
|
||||
|
||||
IconButton(onClick = { showDeleteDialog = true }) {
|
||||
Icon(Icons.Default.Delete, contentDescription = "Delete")
|
||||
// Show stop icon for active sessions, delete icon for completed sessions
|
||||
if (session?.status == SessionStatus.ACTIVE) {
|
||||
IconButton(onClick = {
|
||||
session?.let { s ->
|
||||
viewModel.endSession(context, s.id)
|
||||
onNavigateBack()
|
||||
}
|
||||
}) {
|
||||
Icon(
|
||||
imageVector = CustomIcons.Stop(MaterialTheme.colorScheme.onSurface),
|
||||
contentDescription = "Stop Session"
|
||||
)
|
||||
}
|
||||
} else {
|
||||
IconButton(onClick = { showDeleteDialog = true }) {
|
||||
Icon(Icons.Default.Delete, contentDescription = "Delete")
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -504,7 +525,8 @@ fun SessionDetailScreen(sessionId: String, viewModel: ClimbViewModel, onNavigate
|
||||
onEditAttempt = { attemptToEdit -> showEditAttemptDialog = attemptToEdit },
|
||||
onDeleteAttempt = { attemptToDelete ->
|
||||
viewModel.deleteAttempt(attemptToDelete)
|
||||
}
|
||||
},
|
||||
onAttemptClick = { onNavigateToProblemDetail(problem.id) }
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -888,7 +910,9 @@ fun GymDetailScreen(
|
||||
gymId: String,
|
||||
viewModel: ClimbViewModel,
|
||||
onNavigateBack: () -> Unit,
|
||||
onNavigateToEdit: (String) -> Unit
|
||||
onNavigateToEdit: (String) -> Unit,
|
||||
onNavigateToSessionDetail: (String) -> Unit = {},
|
||||
onNavigateToProblemDetail: (String) -> Unit = {}
|
||||
) {
|
||||
val gyms by viewModel.gyms.collectAsState()
|
||||
val gym = gyms.find { it.id == gymId }
|
||||
@@ -1119,14 +1143,16 @@ fun GymDetailScreen(
|
||||
|
||||
Card(
|
||||
modifier =
|
||||
Modifier.fillMaxWidth().padding(vertical = 4.dp),
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 4.dp)
|
||||
.clickable { onNavigateToProblemDetail(problem.id) },
|
||||
colors =
|
||||
CardDefaults.cardColors(
|
||||
containerColor =
|
||||
MaterialTheme.colorScheme.surfaceVariant
|
||||
.copy(alpha = 0.3f)
|
||||
containerColor = MaterialTheme.colorScheme.surface
|
||||
),
|
||||
shape = RoundedCornerShape(12.dp)
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp)
|
||||
) {
|
||||
ListItem(
|
||||
headlineContent = {
|
||||
@@ -1192,14 +1218,16 @@ fun GymDetailScreen(
|
||||
|
||||
Card(
|
||||
modifier =
|
||||
Modifier.fillMaxWidth().padding(vertical = 4.dp),
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 4.dp)
|
||||
.clickable { onNavigateToSessionDetail(session.id) },
|
||||
colors =
|
||||
CardDefaults.cardColors(
|
||||
containerColor =
|
||||
MaterialTheme.colorScheme.surfaceVariant
|
||||
.copy(alpha = 0.3f)
|
||||
containerColor = MaterialTheme.colorScheme.surface
|
||||
),
|
||||
shape = RoundedCornerShape(12.dp)
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp)
|
||||
) {
|
||||
ListItem(
|
||||
headlineContent = {
|
||||
@@ -1440,11 +1468,17 @@ fun SessionAttemptCard(
|
||||
attempt: Attempt,
|
||||
problem: Problem,
|
||||
onEditAttempt: (Attempt) -> Unit = {},
|
||||
onDeleteAttempt: (Attempt) -> Unit = {}
|
||||
onDeleteAttempt: (Attempt) -> Unit = {},
|
||||
onAttemptClick: () -> Unit = {}
|
||||
) {
|
||||
var showDeleteDialog by remember { mutableStateOf(false) }
|
||||
|
||||
Card(modifier = Modifier.fillMaxWidth()) {
|
||||
Card(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clickable { onAttemptClick() },
|
||||
elevation = CardDefaults.cardElevation(defaultElevation = 2.dp)
|
||||
) {
|
||||
Column(modifier = Modifier.padding(16.dp)) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
@@ -1495,11 +1529,7 @@ fun SessionAttemptCard(
|
||||
// Delete button
|
||||
IconButton(
|
||||
onClick = { showDeleteDialog = true },
|
||||
modifier = Modifier.size(32.dp),
|
||||
colors =
|
||||
IconButtonDefaults.iconButtonColors(
|
||||
contentColor = MaterialTheme.colorScheme.error
|
||||
)
|
||||
modifier = Modifier.size(32.dp)
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.Delete,
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.atridad.openclimb.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.graphics.vector.path
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
object CustomIcons {
|
||||
fun Stop(color: Color = Color.Black): ImageVector = ImageVector.Builder(
|
||||
name = "Stop",
|
||||
defaultWidth = 24.dp,
|
||||
defaultHeight = 24.dp,
|
||||
viewportWidth = 24f,
|
||||
viewportHeight = 24f
|
||||
).path(
|
||||
fill = SolidColor(color)
|
||||
) {
|
||||
moveTo(6f, 6f)
|
||||
horizontalLineTo(18f)
|
||||
verticalLineTo(18f)
|
||||
horizontalLineTo(6f)
|
||||
close()
|
||||
}.build()
|
||||
}
|
||||
6
app/src/main/res/values-night/colors.xml
Normal file
6
app/src/main/res/values-night/colors.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Splash background (dark) -->
|
||||
<color name="splash_background">#FF121212</color>
|
||||
</resources>
|
||||
|
||||
@@ -7,4 +7,7 @@
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
|
||||
<!-- Splash background (light) -->
|
||||
<color name="splash_background">#FFFFFFFF</color>
|
||||
</resources>
|
||||
@@ -1,5 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.OpenClimb" parent="android:Theme.Material.Light.NoActionBar" />
|
||||
|
||||
<style name="Theme.OpenClimb.Splash" parent="Theme.OpenClimb">
|
||||
<item name="android:windowSplashScreenBackground">@color/splash_background</item>
|
||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_mountains</item>
|
||||
<item name="android:windowSplashScreenAnimationDuration">200</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -1,10 +1,14 @@
|
||||
[versions]
|
||||
agp = "8.9.1"
|
||||
agp = "8.12.1"
|
||||
kotlin = "2.0.21"
|
||||
coreKtx = "1.15.0"
|
||||
junit = "4.13.2"
|
||||
junitVersion = "1.3.0"
|
||||
espressoCore = "3.7.0"
|
||||
androidxTestCore = "1.6.0"
|
||||
androidxTestExt = "1.2.0"
|
||||
androidxTestRunner = "1.6.0"
|
||||
androidxTestRules = "1.6.0"
|
||||
lifecycleRuntimeKtx = "2.9.2"
|
||||
activityCompose = "1.10.1"
|
||||
composeBom = "2024.09.00"
|
||||
@@ -21,6 +25,10 @@ androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref =
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
||||
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||
androidx-test-core = { group = "androidx.test", name = "core", version.ref = "androidxTestCore" }
|
||||
androidx-test-ext = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExt" }
|
||||
androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "androidxTestRunner" }
|
||||
androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "androidxTestRules" }
|
||||
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
|
||||
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
||||
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
||||
@@ -48,6 +56,10 @@ kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-
|
||||
|
||||
# Coroutines
|
||||
kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinxCoroutines" }
|
||||
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" }
|
||||
|
||||
# Testing
|
||||
mockk = { group = "io.mockk", name = "mockk", version = "1.13.8" }
|
||||
|
||||
# Image Loading
|
||||
coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
#Fri Aug 15 11:23:25 MDT 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
Reference in New Issue
Block a user