From 262b49d025286a38a734dc9549d1ee0e93d317ba Mon Sep 17 00:00:00 2001 From: Dharanish Date: Sun, 26 May 2024 10:03:59 +0200 Subject: [PATCH] Adding Habitgroup to type selection screen --- .../activities/habits/edit/HabitTypeDialog.kt | 6 + .../res/layout/activity_edit_habit_group.xml | 163 ++++++++++++++++++ .../src/main/res/layout/select_habit_type.xml | 19 ++ .../src/main/res/values/strings.xml | 4 + 4 files changed, 192 insertions(+) create mode 100644 uhabits-android/src/main/res/layout/activity_edit_habit_group.xml diff --git a/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/edit/HabitTypeDialog.kt b/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/edit/HabitTypeDialog.kt index 350509207..d7acd8f03 100644 --- a/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/edit/HabitTypeDialog.kt +++ b/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/edit/HabitTypeDialog.kt @@ -51,6 +51,12 @@ class HabitTypeDialog : AppCompatDialogFragment() { dismiss() } + binding.buttonHabitGroup.setOnClickListener { + val intent = IntentFactory().startEditGroupActivity(requireActivity()) + startActivity(intent) + dismiss() + } + binding.background.setOnClickListener { dismiss() } diff --git a/uhabits-android/src/main/res/layout/activity_edit_habit_group.xml b/uhabits-android/src/main/res/layout/activity_edit_habit_group.xml new file mode 100644 index 000000000..758df4849 --- /dev/null +++ b/uhabits-android/src/main/res/layout/activity_edit_habit_group.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/uhabits-android/src/main/res/layout/select_habit_type.xml b/uhabits-android/src/main/res/layout/select_habit_type.xml index 95775cb29..dd5a8a370 100644 --- a/uhabits-android/src/main/res/layout/select_habit_type.xml +++ b/uhabits-android/src/main/res/layout/select_habit_type.xml @@ -67,6 +67,25 @@ android:text="@string/measurable_example" /> + + + + + + + diff --git a/uhabits-android/src/main/res/values/strings.xml b/uhabits-android/src/main/res/values/strings.xml index 5f632e03c..6332a1370 100644 --- a/uhabits-android/src/main/res/values/strings.xml +++ b/uhabits-android/src/main/res/values/strings.xml @@ -64,6 +64,8 @@ Off Create habit Edit habit + Create habit group + Edit habit group Check Later Welcome @@ -208,6 +210,8 @@ e.g. Did you wake up early today? Did you exercise? Did you play chess? Measurable e.g. How many miles did you run today? How many pages did you read? + Habit Group + A group to organize similar habits together. E.g. Exercise: Running, Cycling, Gym, etc. %d times per week %d times per month %d times in %d days