From 7bbcd605de3b7305e099f44554d84f2d472023b1 Mon Sep 17 00:00:00 2001 From: Shivendu Mishra <77795429+shivenducs1136@users.noreply.github.com> Date: Thu, 20 Apr 2023 22:59:46 +0530 Subject: [PATCH] Updated ODKInteractor,FormsInteractor interfaces Fix #16 --- odk/extension/README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/odk/extension/README.md b/odk/extension/README.md index 5e4e70dd391..9ce28649b08 100644 --- a/odk/extension/README.md +++ b/odk/extension/README.md @@ -44,6 +44,16 @@ This method opens a saved instance of a form with a given form ID, or creates a

+`fun prefillAndOpenForm(formId: String, tagValueMap: HashMap, context: Context)` + +This method pre-fills a form with data from a given map of key-value pairs, and then opens the form in a given Android context. \ +***Parameters:*** \ +`formId` - A string representing the ID of the form to be opened. \ +`tagValueMap` - A HashMap containing the key-value pairs representing the data to pre-fill the form with. \ +`context` - A Context object representing the Android application context. + +

+ ## FormsDatabaseInteractor Interface The FormsDatabaseInteractor interface provides a set of methods to interact with the local forms database. This interface enables developers to manage the forms that are stored on the device, including retrieving, adding, and deleting forms. @@ -260,22 +270,22 @@ Note: This creates a separate form instance of the original form and does not al
-`updateForm(form: Form, tag: String, tagValue: String, listener: FormsProcessListener)` +`updateForm(formPath: String, tag: String, tagValue: String, listener: FormsProcessListener?)` Prefills the values of a form given a tag and value or a list of tags and values. \ ***Parameters:*** \ -`form`- The form to update. This is an ODK Form object. \ +`formPath`- A string that represents the path of the form. \ `tag`- The tag of the form element to update. This is a string value. \ `tagValue`- The new value to set for the form element. This is a string value. \ `listener`- An optional listener to handle the update process. This is a FormsProcessListener object.
-`updateForm(form: Form, values: HashMap, listener: FormsProcessListener)` +`updateForm(formPath: String, values: HashMap, listener: FormsProcessListener?)` Prefills the values of a form based on a list of a tags and values. \ ***Parameters:*** \ -`form`- The form to update. This is an ODK Form object. \ +`formPath`- A string that represents the path of the form. \ `values`- A HashMap containing tag-value pairs to update the form with. This is a map from string keys to string values. \ `listener`- An optional listener to handle the update process. This is a FormsProcessListener object.