item entries in the create menu now spawn dialogs

pull/498/head
Thomas Saedt 6 years ago
parent 29950ff28a
commit ef22fd8dce

@ -73,6 +73,16 @@ class ListHabitsMenu @Inject constructor(
return true
}
R.id.actionCreateBooleanHabit -> {
behavior.onCreateBooleanHabit()
return true
}
R.id.actionCreateNumeralHabit -> {
behavior.onCreateNumericalHabit()
return true
}
R.id.actionFAQ -> {
behavior.onViewFAQ()
return true

@ -137,11 +137,16 @@ class ListHabitsScreen
activity.startActivity(intent)
}
fun showCreateBooleanHabitScreen() {
override fun showCreateBooleanHabitScreen() {
val dialog = editHabitDialogFactory.createBoolean()
activity.showDialog(dialog, "editHabit")
}
override fun showCreateNumericalHabitScreen() {
val dialog = editHabitDialogFactory.createNumerical()
activity.showDialog(dialog, "editHabit")
}
override fun showCreateHabitScreen() {
if (!preferences.isNumericalHabitsFeatureEnabled) {
showCreateBooleanHabitScreen()
@ -236,11 +241,6 @@ class ListHabitsScreen
}
}
private fun showCreateNumericalHabitScreen() {
val dialog = editHabitDialogFactory.createNumerical()
activity.showDialog(dialog, "editHabit")
}
private fun onImportData(file: File, onFinished: () -> Unit) {
taskRunner.execute(importTaskFactory.create(file) { result ->
if (result == ImportDataTask.SUCCESS) {

@ -74,6 +74,16 @@ public class ListHabitsMenuBehavior
}
}
public void onCreateBooleanHabit()
{
screen.showCreateBooleanHabitScreen();
}
public void onCreateNumericalHabit()
{
screen.showCreateNumericalHabitScreen();
}
public void onViewFAQ()
{
screen.showFAQScreen();
@ -155,6 +165,10 @@ public class ListHabitsMenuBehavior
void showCreateHabitScreen();
void showCreateBooleanHabitScreen();
void showCreateNumericalHabitScreen();
void showFAQScreen();
void showSettingsScreen();

Loading…
Cancel
Save