Skip to content

Commit 7a320d4

Browse files
committed
remove 0 as default count goal
1 parent 4c3402c commit 7a320d4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

features/feature_change_goals/src/main/java/com/example/util/simpletimetracker/feature_change_goals/mapper/GoalsViewDataMapper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ class GoalsViewDataMapper @Inject constructor(
108108
val position = goalTypeList.indexOf(goalViewData)
109109
.takeUnless { it == -1 }.orZero()
110110
val value = when (goal) {
111-
is RecordTypeGoal.Type.Duration -> toDurationGoalText(goal.value.orZero())
112-
is RecordTypeGoal.Type.Count -> goal.value.orZero().toString()
111+
is RecordTypeGoal.Type.Duration -> toDurationGoalText(goal.value)
112+
is RecordTypeGoal.Type.Count -> goal.value.takeUnless { it == 0L }?.toString().orEmpty()
113113
}
114114
val items = goalTypeList.map {
115115
when (it) {

features/feature_change_goals/views/src/main/res/layout/change_goal_layout.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
style="@style/ChangeItemNameEditText"
146146
android:layout_width="match_parent"
147147
android:layout_height="match_parent"
148-
android:inputType="numberDecimal"
148+
android:inputType="number"
149149
android:paddingVertical="0dp"
150150
tools:text="10" />
151151

0 commit comments

Comments
 (0)