Skip to content

Commit

Permalink
Custom text selects custom (#36)
Browse files Browse the repository at this point in the history
* This commit fixes a stale design choice I wanted to remove where the custom text cannot be used until it is selected.
  • Loading branch information
Tyler-Lopez authored Feb 25, 2023
1 parent c1391da commit acc1a6f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit acc1a6f

Please sign in to comment.