From acc1a6f7c80d57e372316e66d7be9ee9b5acde03 Mon Sep 17 00:00:00 2001 From: Tyler Lopez <77797048+Tyler-Lopez@users.noreply.github.com> Date: Sat, 25 Feb 2023 14:35:46 -0500 Subject: [PATCH] Custom text selects custom (#36) * This commit fixes a stale design choice I wanted to remove where the custom text cannot be used until it is selected. --- app/build.gradle | 4 ++-- .../editArtScreen/EditArtViewModel.kt | 15 ++++++++++++--- .../subscreens/type/EditArtTypeScreen.kt | 5 ----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0b8b9a19..5f771aa9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,8 +18,8 @@ android { applicationId "com.activityartapp" minSdk 26 targetSdk 33 - versionCode 15 - versionName "1.4.0" + versionCode 16 + versionName "1.4.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/app/src/main/java/com/activityartapp/presentation/editArtScreen/EditArtViewModel.kt b/app/src/main/java/com/activityartapp/presentation/editArtScreen/EditArtViewModel.kt index e020105c..3e65b3d7 100644 --- a/app/src/main/java/com/activityartapp/presentation/editArtScreen/EditArtViewModel.kt +++ b/app/src/main/java/com/activityartapp/presentation/editArtScreen/EditArtViewModel.kt @@ -713,9 +713,18 @@ class EditArtViewModel @Inject constructor( } copyLastState { when (event.section) { - LEFT -> copy(typeLeftCustomText = newText ?: typeLeftCustomText) - CENTER -> copy(typeCenterCustomText = newText ?: typeCenterCustomText) - RIGHT -> copy(typeRightCustomText = newText ?: typeRightCustomText) + LEFT -> copy( + typeLeftCustomText = newText ?: typeLeftCustomText, + typeLeftSelected = CUSTOM + ) + CENTER -> copy( + typeCenterCustomText = newText ?: typeCenterCustomText, + typeCenterSelected = CUSTOM + ) + RIGHT -> copy( + typeRightCustomText = newText ?: typeRightCustomText, + typeRightSelected = CUSTOM + ) } }.push() } diff --git a/app/src/main/java/com/activityartapp/presentation/editArtScreen/subscreens/type/EditArtTypeScreen.kt b/app/src/main/java/com/activityartapp/presentation/editArtScreen/subscreens/type/EditArtTypeScreen.kt index 6d8ee360..bc8eb69e 100644 --- a/app/src/main/java/com/activityartapp/presentation/editArtScreen/subscreens/type/EditArtTypeScreen.kt +++ b/app/src/main/java/com/activityartapp/presentation/editArtScreen/subscreens/type/EditArtTypeScreen.kt @@ -86,11 +86,6 @@ fun EditArtTypeScreen( ), singleLine = true, maxLines = 1, - enabled = EditArtTypeType.CUSTOM == when (section) { - EditArtTypeSection.LEFT -> selectedEditArtTypeTypeLeft - EditArtTypeSection.CENTER -> selectedEditArtTypeTypeCenter - EditArtTypeSection.RIGHT -> selectedEditArtTypeTypeRight - }, modifier = Modifier.sizeIn(maxWidth = 254.dp) ) Text(