|
|
@ -117,7 +117,6 @@ class EditHabitActivity : AppCompatActivity() {
|
|
|
|
binding.notesInput.setText(habit.description)
|
|
|
|
binding.notesInput.setText(habit.description)
|
|
|
|
binding.unitInput.setText(habit.unit)
|
|
|
|
binding.unitInput.setText(habit.unit)
|
|
|
|
binding.targetInput.setText(habit.targetValue.toString())
|
|
|
|
binding.targetInput.setText(habit.targetValue.toString())
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
habitType = HabitType.fromInt(intent.getIntExtra("habitType", HabitType.YES_NO.value))
|
|
|
|
habitType = HabitType.fromInt(intent.getIntExtra("habitType", HabitType.YES_NO.value))
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -366,16 +365,17 @@ class EditHabitActivity : AppCompatActivity() {
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressLint("StringFormatMatches")
|
|
|
|
@SuppressLint("StringFormatMatches")
|
|
|
|
private fun populateWidgetAction() {
|
|
|
|
private fun populateWidgetAction() {
|
|
|
|
binding.widgetActionPicker.text = when (increment){
|
|
|
|
binding.widgetActionPicker.text = when (increment) {
|
|
|
|
0.0 -> getString(R.string.widget_action_dialog)
|
|
|
|
0.0 -> getString(R.string.widget_action_dialog)
|
|
|
|
else -> getString(R.string.widget_action_increment)
|
|
|
|
else -> getString(R.string.widget_action_increment)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
binding.incrementInput.setText(increment.toString())
|
|
|
|
binding.incrementInput.setText(increment.toString())
|
|
|
|
if (increment != 0.0)
|
|
|
|
if (increment != 0.0) {
|
|
|
|
binding.incrementRightBox.visibility = View.VISIBLE
|
|
|
|
binding.incrementRightBox.visibility = View.VISIBLE
|
|
|
|
else
|
|
|
|
} else {
|
|
|
|
binding.incrementRightBox.visibility = View.GONE
|
|
|
|
binding.incrementRightBox.visibility = View.GONE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun populateTargetType() {
|
|
|
|
private fun populateTargetType() {
|
|
|
|
binding.targetTypePicker.text = when (targetType) {
|
|
|
|
binding.targetTypePicker.text = when (targetType) {
|
|
|
@ -411,7 +411,7 @@ class EditHabitActivity : AppCompatActivity() {
|
|
|
|
putInt("reminderHour", reminderHour)
|
|
|
|
putInt("reminderHour", reminderHour)
|
|
|
|
putInt("reminderMin", reminderMin)
|
|
|
|
putInt("reminderMin", reminderMin)
|
|
|
|
putInt("reminderDays", reminderDays.toInteger())
|
|
|
|
putInt("reminderDays", reminderDays.toInteger())
|
|
|
|
putDouble("increment",increment)
|
|
|
|
putDouble("increment", increment)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|