I'm currently developing an App that'll be released for Android and IOS. It presents files to the user, allows them to select a file and then presents the content for editing, and finally allows them to run the content.
As part of the development process, I've needed to request information from the user - a file (to open, to save) or folder (to move a file into), a text or numeric value (while adding new content or editing content), a date or time value etc. I've also needed to pop up messages to the user - short "it's done" messages and more complex "here's the situation ... proceed" Yes/No/Cancel messages.
As I've worked through these needs, I've found different/alternative ways to request the input, improving each time. My latest solution has been built into PropertyEditor, a cross-platform solution for presenting object properties or database fields to a user so that they can edit existing or add new records.
But I'm still not satisfied. I want to be able to:
I'll update this main post with the latest build, and I'll add posts detailing what's changed in the build, key decisions I had to make and so on, so that the individual posts chart the development with the latest result available here, in the first post.
Note that this post (and the individual posts) will focus on the development from an IOS perspective. There is another thread in the Android forums that focuses on the development from an Android perspective: https://www.b4x.com/android/forum/t...orm-dialog-class-with-input-validation.84983/
Feel free to follow along or to comment if you have a suggestion or a question - this isn't meant to be an example of perfect development (is there such a thing?), rather it's meant to be an example of how I, personally, approached the above requirements, resulting in a class that all of us might choose to use in an App development.
Planned "sprints"/iterations
As a way of getting my thoughts in order (and a preview of where I'm headed), I thought I'd list out the plans. Comments and feedback welcomed!
As part of the development process, I've needed to request information from the user - a file (to open, to save) or folder (to move a file into), a text or numeric value (while adding new content or editing content), a date or time value etc. I've also needed to pop up messages to the user - short "it's done" messages and more complex "here's the situation ... proceed" Yes/No/Cancel messages.
As I've worked through these needs, I've found different/alternative ways to request the input, improving each time. My latest solution has been built into PropertyEditor, a cross-platform solution for presenting object properties or database fields to a user so that they can edit existing or add new records.
But I'm still not satisfied. I want to be able to:
- Have a single cross-platform solution for displaying messages and requesting input;
- Validate user input so that the user sees when something is invalid and can correct it at point of entry;
- Leverage the current standard solution for Dialogs - the CustomDialogLayout available in the latest B4A/B4i releases; and,
- Develop the class incrementally so that it has immediate use and each iteration works on both platforms.
I'll update this main post with the latest build, and I'll add posts detailing what's changed in the build, key decisions I had to make and so on, so that the individual posts chart the development with the latest result available here, in the first post.
Note that this post (and the individual posts) will focus on the development from an IOS perspective. There is another thread in the Android forums that focuses on the development from an Android perspective: https://www.b4x.com/android/forum/t...orm-dialog-class-with-input-validation.84983/
Feel free to follow along or to comment if you have a suggestion or a question - this isn't meant to be an example of perfect development (is there such a thing?), rather it's meant to be an example of how I, personally, approached the above requirements, resulting in a class that all of us might choose to use in an App development.
Planned "sprints"/iterations
As a way of getting my thoughts in order (and a preview of where I'm headed), I thought I'd list out the plans. Comments and feedback welcomed!
- DONE. Basic structure. Toast DialogType. CharSequence (CS)/AttributedString (AS) integration.
- DONE. Message DialogType. Dialog layout. Callback/_Result event. CS/AS Message and Buttons.
- Add Icon/Color/Style properties.
- Custom DialogType. Receive a panel containing controls where calling routine handles control events and can set dialog to indicate valid/invalid. Implemented first to be able to leverage when implementing other types.
- Number DialogType (subtypes Integer, Decimal). Value check (>,>= etc.) Range check (In, NotIn).
- Text DialogType (subtypes Singleline, Multiline). Length check (At least, At most) Substring check (In, NotIn) RegExp check (contains, matches etc.)
- Choice DialogType (subtypes Single, Multi). Able to provide initial choice(s) and receive choice(s) back.
- FileFolder DialogType (subtypes File, Folder). Able to browse entire hierarchy or 1 level at a time.
- DateTime DialogType (subtypes Date, Time, DateTime). Extend Value and Range checks.
- B4i 4.30 (or later)
- iHUD https://www.b4x.com/android/forum/threads/ihud-library-toast-messages-and-progress-dialogs.46103/
- iCustomDialog 1.00 https://www.b4x.com/android/forum/threads/custom-dialogs-with-icustomdialog-library.83526/
- iXUI https://www.b4x.com/android/forum/threads/b4x-xui-cross-platform-native-ui-library.84359/#content
Attachments
Last edited: