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 return true
} }
R.id.actionCreateBooleanHabit -> {
behavior.onCreateBooleanHabit()
return true
}
R.id.actionCreateNumeralHabit -> {
behavior.onCreateNumericalHabit()
return true
}
R.id.actionFAQ -> { R.id.actionFAQ -> {
behavior.onViewFAQ() behavior.onViewFAQ()
return true return true

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

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

Loading…
Cancel
Save