Skip to content

Commit 5d2f4b8

Browse files
committed
update prompt to mention multi pair dialog
- make fields required for multi pair dialog and single pair dialog
1 parent 2acf3a0 commit 5d2f4b8

File tree

1 file changed

+46
-6
lines changed

1 file changed

+46
-6
lines changed

demo/android_prompt.md

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ Aliases Section (placed after Send In-App Message):
237237
- Each item shows: Label | ID with X button to delete
238238
- Filter out "external_id" and "onesignal_id" from display (these are special)
239239
- "No Aliases Added" text when empty
240-
- ADD ALIAS button → dialog with empty Key and Value fields
240+
- ADD ALIAS button → dialog with empty Key and Value fields (single add)
241+
- ADD ALIASES button → opens multi-pair dialog (see Reusable Multi-Pair Dialog below)
241242
- REMOVE ALL ALIASES button:
242243
- Only visible when at least one alias exists
243244
- Red background color
@@ -279,7 +280,8 @@ Tags Section:
279280
- RecyclerView showing key-value pairs
280281
- Each item shows: Key | Value with X button to delete individually
281282
- "No Tags Added" text when empty
282-
- ADD TAG button → dialog with empty Key and Value fields
283+
- ADD TAG button → dialog with empty Key and Value fields (single add)
284+
- ADD TAGS button → opens multi-pair dialog (see Reusable Multi-Pair Dialog below)
283285
- NO "Remove All" button - tags are removed individually only
284286
```
285287

@@ -302,7 +304,8 @@ Triggers Section:
302304
- RecyclerView showing key-value pairs
303305
- Each item shows: Key | Value with X button to delete individually
304306
- "No Triggers Added" text when empty
305-
- ADD TRIGGER button → dialog with empty Key and Value fields
307+
- ADD TRIGGER button → dialog with empty Key and Value fields (single add)
308+
- ADD TRIGGERS button → opens multi-pair dialog (see Reusable Multi-Pair Dialog below)
306309
- CLEAR TRIGGERS button:
307310
- Only visible when at least 1 trigger exists
308311
- Red background color
@@ -517,18 +520,53 @@ All dialog input fields should be EMPTY by default.
517520
The test automation framework (Appium) will enter these values:
518521
519522
- Login Dialog: External User Id = "test"
520-
- Add Alias Dialog: Key = "Test", Value = "Value"
523+
- Add Aliases Dialog: Key = "Test", Value = "Value" (first row; supports multiple rows)
521524
- Add Email Dialog: Email = "test@onesignal.com"
522525
- Add SMS Dialog: SMS = "123-456-5678"
523-
- Add Tag Dialog: Key = "Test", Value = "Value"
524-
- Add Trigger Dialog: Key = "trigger_key", Value = "trigger_value"
526+
- Add Tags Dialog: Key = "Test", Value = "Value" (first row; supports multiple rows)
527+
- Add Triggers Dialog: Key = "trigger_key", Value = "trigger_value" (first row; supports multiple rows)
525528
- Outcome Dialog: Name = "test_outcome", Value = "1.5"
526529
- Track Event Dialog: Name = "test_event", Value = "test_value"
527530
- Custom Notification Dialog: Title = "Test Title", Body = "Test Body"
528531
```
529532

530533
---
531534

535+
## Reusable Multi-Pair Dialog
536+
537+
```
538+
Tags, Aliases, and Triggers all share a reusable multi-pair dialog for adding multiple
539+
key-value pairs at once.
540+
541+
Dialog layout (dialog_add_multi_pair.xml):
542+
- ScrollView containing a vertical LinearLayout (rows_container) for dynamic rows
543+
- "+ ADD ROW" button below the scroll area (borderless, primary color text)
544+
545+
Row layout (item_dialog_pair_row.xml):
546+
- Horizontal LinearLayout with:
547+
- Key EditText (weight 1, empty hint for Appium)
548+
- Value EditText (weight 1, empty hint for Appium)
549+
- Remove row ImageButton (hidden when only one row exists)
550+
551+
Behavior:
552+
- Dialog opens with one empty key-value row
553+
- "+ ADD ROW" adds another row to the container
554+
- Remove button uses ic_close drawable with colorPrimary tint (same as list item remove buttons)
555+
- Remove button appears on all rows when more than one row exists
556+
- Remove button is hidden when only one row remains (cannot remove the last row)
557+
- ADD button is disabled until ALL key and value fields in every row are filled (both required)
558+
- Validation runs on every text change and after row add/remove
559+
- On "ADD" press, all rows are collected and submitted as a batch
560+
- Batch operations use SDK bulk APIs (addAliases, addTags, addTriggers)
561+
562+
Used by:
563+
- ADD ALIASES button (Aliases section) → calls viewModel.addAliases(pairs)
564+
- ADD TAGS button (Tags section) → calls viewModel.addTags(pairs)
565+
- ADD TRIGGERS button (Triggers section) → calls viewModel.addTriggers(pairs)
566+
```
567+
568+
---
569+
532570
## Key Files Structure
533571

534572
```
@@ -571,9 +609,11 @@ Examples/OneSignalDemo/
571609
│ │ │ ├── activity_main.xml
572610
│ │ │ ├── dialog_login.xml
573611
│ │ │ ├── dialog_add_pair.xml
612+
│ │ │ ├── dialog_add_multi_pair.xml
574613
│ │ │ ├── dialog_single_input.xml
575614
│ │ │ ├── dialog_outcome.xml
576615
│ │ │ ├── dialog_track_event.xml
616+
│ │ │ ├── item_dialog_pair_row.xml
577617
│ │ │ ├── item_pair.xml
578618
│ │ │ ├── item_single.xml
579619
│ │ │ └── item_iam_button.xml

0 commit comments

Comments
 (0)