From 0e2d6aeb3a805cfd05ec244213a436acc23d3f55 Mon Sep 17 00:00:00 2001 From: vend Date: Fri, 7 Jan 2022 17:30:32 +0500 Subject: [PATCH 1/3] added button text field to change the optibp button text --- .../com/vijay/jsonwizard/constants/JsonFormConstants.java | 1 + .../com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/constants/JsonFormConstants.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/constants/JsonFormConstants.java index e9638f06d..ef4fa5753 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/constants/JsonFormConstants.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/constants/JsonFormConstants.java @@ -326,6 +326,7 @@ public static class OptibpConstants { public static final String OPTIBP_KEY_CLIENT_OPENSRP_ID = "clientOpenSRPId"; public static final String OPTIBP_KEY_BUTTON_BG_COLOR = "optibp_button_bg_color"; public static final String OPTIBP_KEY_BUTTON_TEXT_COLOR = "optibp_button_text_color"; + public static final String OPTIBP_KEY_BUTTON_TEXT = "optibp_button_text"; } public static class EDIT_TEXT_TYPE { diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java index db0d6760b..9e6ffa89b 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java @@ -164,6 +164,12 @@ private void formatButtonWidget(Button button, JSONObject jsonObject) throws JSO String colorString = jsonObject.getString(JsonFormConstants.OptibpConstants.OPTIBP_KEY_BUTTON_TEXT_COLOR); button.setTextColor(Color.parseColor(colorString)); } + if(jsonObject.has(JsonFormConstants.OptibpConstants.OPTIBP_KEY_BUTTON_TEXT)) + { + String buttonText = jsonObject.getString(JsonFormConstants.OptibpConstants.OPTIBP_KEY_BUTTON_TEXT); + button.setText(buttonText); + } + } public void setUpOptiBpActivityResultListener(final WidgetArgs widgetArgs, int requestCode, final LinearLayout rootLayout, final EditText systolicEditText, final EditText diastolicEditText) { From 8bec79efc3fbfc9657ecf2aa0c6fde898b2f6de9 Mon Sep 17 00:00:00 2001 From: vend Date: Mon, 10 Jan 2022 14:28:40 +0500 Subject: [PATCH 2/3] increased version to 2.1.15 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 02f37824f..014527c99 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=2.1.13-SNAPSHOT +VERSION_NAME=2.1.15-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Native Form Json Wizard From 60c36f8c8fa4e2667e69b1f1b49243e148970cce Mon Sep 17 00:00:00 2001 From: vend Date: Mon, 10 Jan 2022 15:32:55 +0500 Subject: [PATCH 3/3] updated the optibp-button text conditional block. --- .../java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java index 9e6ffa89b..1e4525377 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java @@ -164,8 +164,7 @@ private void formatButtonWidget(Button button, JSONObject jsonObject) throws JSO String colorString = jsonObject.getString(JsonFormConstants.OptibpConstants.OPTIBP_KEY_BUTTON_TEXT_COLOR); button.setTextColor(Color.parseColor(colorString)); } - if(jsonObject.has(JsonFormConstants.OptibpConstants.OPTIBP_KEY_BUTTON_TEXT)) - { + if(jsonObject.has(JsonFormConstants.OptibpConstants.OPTIBP_KEY_BUTTON_TEXT)) { String buttonText = jsonObject.getString(JsonFormConstants.OptibpConstants.OPTIBP_KEY_BUTTON_TEXT); button.setText(buttonText); }