Commit 73e74fb
Migrate TaskView to compose (#3617)
- Refactor data collection task fragments to use Compose-based layout
- Replace `TaskView` and `TaskViewFactory` with a new `TaskViewLayout` Compose component.
- Remove `onCreateTaskView` from `AbstractTaskFragment` and subclasses, replacing it with a `taskHeader` property.
- Update `AbstractTaskFragment` to use `createComposeView` for the entire fragment view, integrating header, body, and footer into a unified `TaskViewLayout`.
- Migrated all task fragments (Text, Date, Number, Photo, MultipleChoice, Time, Instruction, DrawArea, DropPin, CaptureLocation) to the new layout system.
- Introduce `Header` data class to handle task labels and optional icons in a standardized way.
- Refactor LoiNameDialog to be a Composable function within AbstractTaskFragment
- Move `LoiNameDialog` logic from `renderComposableDialog` into a dedicated `@Composable` function.
- Update `onCreateView` to include `LoiNameDialog` when the task is an "Add LOI" task.
- Simplify `handleNext` to trigger the dialog via the `loiNameDialogOpen` state.
- Consolidate dialog state and value handling within the new `LoiNameDialog` component.
- Refactor instructions dialog to use Compose state and centralized layout
- Refactor the self-intersection dialog in `DrawAreaTaskFragment` to use Compose state
- Refactor PhotoTaskFragment to handle permission dialogs using Compose state
- Refactor location permission dialog in CaptureLocationTaskFragment to use Compose
- Refactor `InstructionsDialog` logic into a dedicated Composable in `AbstractTaskFragment`
- Remove unused xml layouts and associated views
- Use compose to reposition the progress bar
- Update `AbstractTaskFragment` to track footer position when keyboard visibility changes
---------
Co-authored-by: Andreia Ferreira <51242456+andreia-ferreira@users.noreply.github.com>1 parent 34ff9a7 commit 73e74fb
33 files changed
Lines changed: 431 additions & 622 deletions
File tree
- app/src
- main
- java/org/groundplatform/android
- ui/datacollection
- components
- tasks
- date
- instruction
- location
- multiplechoice
- number
- photo
- point
- polygon
- text
- time
- util
- res
- drawable
- layout
- test/java/org/groundplatform/android/ui/datacollection
- tasks
- date
- instruction
- location
- polygon
- time
- core/ui/src/commonMain/kotlin/org/groundplatform/ui/theme
Lines changed: 11 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
95 | 86 | | |
96 | | - | |
| 87 | + | |
97 | 88 | | |
98 | 89 | | |
99 | 90 | | |
| |||
139 | 130 | | |
140 | 131 | | |
141 | 132 | | |
142 | | - | |
143 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
144 | 137 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 138 | + | |
148 | 139 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
| 140 | + | |
| 141 | + | |
157 | 142 | | |
158 | 143 | | |
159 | 144 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| |||
367 | 371 | | |
368 | 372 | | |
369 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
370 | 378 | | |
371 | 379 | | |
372 | 380 | | |
| |||
Lines changed: 34 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | | - | |
34 | 31 | | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
60 | 54 | | |
61 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 0 additions & 52 deletions
This file was deleted.
0 commit comments