pull/1960/head
rivago 2 years ago
parent 8b9fc9ebc8
commit 133c98da37

@ -117,7 +117,6 @@ class EditHabitActivity : AppCompatActivity() {
binding.notesInput.setText(habit.description)
binding.unitInput.setText(habit.unit)
binding.targetInput.setText(habit.targetValue.toString())
} else {
habitType = HabitType.fromInt(intent.getIntExtra("habitType", HabitType.YES_NO.value))
}
@ -371,11 +370,12 @@ class EditHabitActivity : AppCompatActivity() {
else -> getString(R.string.widget_action_increment)
}
binding.incrementInput.setText(increment.toString())
if (increment != 0.0)
if (increment != 0.0) {
binding.incrementRightBox.visibility = View.VISIBLE
else
} else {
binding.incrementRightBox.visibility = View.GONE
}
}
private fun populateTargetType() {
binding.targetTypePicker.text = when (targetType) {

@ -41,10 +41,11 @@ open class CheckmarkWidget(
override fun getOnClickPendingIntent(context: Context): PendingIntent? {
return if (habit.isNumerical) {
if (habit.increment == 0.0)
if (habit.increment == 0.0) {
pendingIntentFactory.showNumberPicker(habit, DateUtils.getTodayWithOffset())
else
} else {
pendingIntentFactory.incrementNumerical(habit, null)
}
} else {
pendingIntentFactory.toggleCheckmark(habit, null)
}

Loading…
Cancel
Save