From a71d2161e055d009127d07962bbcd7ce45912b0c Mon Sep 17 00:00:00 2001 From: Dave Viggiano Date: Fri, 22 Nov 2024 13:12:03 -0500 Subject: [PATCH 1/8] Updated UI for progress bar and forward/back/close nav buttons in form delivery page. --- app/res/drawable/icon_chevron_left_white.xml | 4 +++ app/res/drawable/icon_chevron_right_white.xml | 4 +++ app/res/drawable/icon_close_white.xml | 4 +++ app/res/drawable/progressbar_modern.xml | 14 ++++---- app/res/layout/screen_form_entry.xml | 33 ++++++++++--------- app/res/values/colors.xml | 2 ++ .../components/FormNavigationUI.java | 4 +-- 7 files changed, 41 insertions(+), 24 deletions(-) create mode 100644 app/res/drawable/icon_chevron_left_white.xml create mode 100644 app/res/drawable/icon_chevron_right_white.xml create mode 100644 app/res/drawable/icon_close_white.xml diff --git a/app/res/drawable/icon_chevron_left_white.xml b/app/res/drawable/icon_chevron_left_white.xml new file mode 100644 index 0000000000..da62f057f0 --- /dev/null +++ b/app/res/drawable/icon_chevron_left_white.xml @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/app/res/drawable/icon_chevron_right_white.xml b/app/res/drawable/icon_chevron_right_white.xml new file mode 100644 index 0000000000..e8d8ed9a60 --- /dev/null +++ b/app/res/drawable/icon_chevron_right_white.xml @@ -0,0 +1,4 @@ + + + diff --git a/app/res/drawable/icon_close_white.xml b/app/res/drawable/icon_close_white.xml new file mode 100644 index 0000000000..e74616b87d --- /dev/null +++ b/app/res/drawable/icon_close_white.xml @@ -0,0 +1,4 @@ + + + diff --git a/app/res/drawable/progressbar_modern.xml b/app/res/drawable/progressbar_modern.xml index 781e4be638..c816eafb60 100644 --- a/app/res/drawable/progressbar_modern.xml +++ b/app/res/drawable/progressbar_modern.xml @@ -2,20 +2,22 @@ + - + + - + \ No newline at end of file diff --git a/app/res/layout/screen_form_entry.xml b/app/res/layout/screen_form_entry.xml index 654f1bcff1..406102f85f 100644 --- a/app/res/layout/screen_form_entry.xml +++ b/app/res/layout/screen_form_entry.xml @@ -56,7 +56,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/nav_badge" - android:background="@color/cc_core_bg" + android:background="@color/cc_brand_color" android:minHeight="@dimen/new_progressbar_minheight" android:paddingLeft="@dimen/content_start" android:paddingRight="@dimen/content_start" @@ -70,40 +70,40 @@ android:id="@+id/nav_btn_prev" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_centerVertical="true" android:layout_alignParentLeft="true" android:background="@drawable/selector_button_press" android:minHeight="@dimen/new_progressbar_button_minheight" android:minWidth="@dimen/new_progressbar_button_minwidth" android:paddingLeft="@dimen/content_start" android:paddingRight="@dimen/new_progressbar_button_padding" - app:srcCompat="@drawable/icon_chevron_left_brand" + app:srcCompat="@drawable/icon_chevron_left_white" android:paddingStart="@dimen/content_start" android:layout_alignParentStart="true" android:paddingEnd="@dimen/new_progressbar_button_padding" /> + android:progressDrawable="@drawable/progressbar_modern" /> diff --git a/app/res/values/colors.xml b/app/res/values/colors.xml index 0b3bdd1533..21d086c516 100644 --- a/app/res/values/colors.xml +++ b/app/res/values/colors.xml @@ -154,5 +154,7 @@ #3b4fb6 #373534 + + #33000000 diff --git a/app/src/org/commcare/activities/components/FormNavigationUI.java b/app/src/org/commcare/activities/components/FormNavigationUI.java index 6411b078bd..75cb520e39 100644 --- a/app/src/org/commcare/activities/components/FormNavigationUI.java +++ b/app/src/org/commcare/activities/components/FormNavigationUI.java @@ -62,10 +62,10 @@ public static void updateNavigationCues(CommCareActivity activity, findViewById(R.id.nav_btn_finish); if (!details.relevantBeforeCurrentScreen) { - prevButton.setImageResource(R.drawable.icon_close_darkwarm); + prevButton.setImageResource(R.drawable.icon_close_white); prevButton.setTag(FormEntryConstants.NAV_STATE_QUIT); } else { - prevButton.setImageResource(R.drawable.icon_chevron_left_brand); + prevButton.setImageResource(R.drawable.icon_chevron_left_white); prevButton.setTag(FormEntryConstants.NAV_STATE_BACK); } From e662e56eb32c45873b34cd88f0361d4f70838f4e Mon Sep 17 00:00:00 2001 From: Shubham Goyal Date: Fri, 29 Nov 2024 15:42:00 +0530 Subject: [PATCH 2/8] Remove misleading comment There is no 1 MB limitaion on data we can can query in sql queries, the only limitaion is that a sql row can't be more than 1 mb --- .../database/user/models/CommCareEntityStorageCache.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/src/org/commcare/models/database/user/models/CommCareEntityStorageCache.java b/app/src/org/commcare/models/database/user/models/CommCareEntityStorageCache.java index b0509bf35a..2e12deadf5 100755 --- a/app/src/org/commcare/models/database/user/models/CommCareEntityStorageCache.java +++ b/app/src/org/commcare/models/database/user/models/CommCareEntityStorageCache.java @@ -254,9 +254,6 @@ private static String buildKeyNameWhereClause(String[] names) { private static void populateEntitySet(SQLiteDatabase db, String sqlStatement, String[] args, Hashtable entitySet) { - //TODO: This will _only_ query up to about a meg of data, which is an un-great limitation. - //Should probably split this up SQL LIMIT based looped - //For reference the current limitation is about 10k rows with 1 field each. Cursor walker = db.rawQuery(sqlStatement, args); while (walker.moveToNext()) { String entityId = walker.getString(walker.getColumnIndex("entity_key")); From 59da77c2a3319709fcf18e820d7ad107a4142cdf Mon Sep 17 00:00:00 2001 From: parthmittal Date: Tue, 3 Dec 2024 10:17:27 +0530 Subject: [PATCH 3/8] - background color change of progress bar --- app/res/layout/screen_form_entry.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/res/layout/screen_form_entry.xml b/app/res/layout/screen_form_entry.xml index 406102f85f..bab82092c8 100644 --- a/app/res/layout/screen_form_entry.xml +++ b/app/res/layout/screen_form_entry.xml @@ -56,7 +56,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/nav_badge" - android:background="@color/cc_brand_color" + android:background="@color/start_sync_button" android:minHeight="@dimen/new_progressbar_minheight" android:paddingLeft="@dimen/content_start" android:paddingRight="@dimen/content_start" From 2a55fd8a42f851fdb5a57b0a5005e5e1c2686e4f Mon Sep 17 00:00:00 2001 From: parthmittal Date: Tue, 3 Dec 2024 15:51:40 +0530 Subject: [PATCH 4/8] -progress bar color change --- app/res/drawable/progressbar_modern_blue.xml | 23 +++++++++++++++++++ app/res/layout-land/update_activity.xml | 2 +- .../layout/progress_dialog_determinate.xml | 2 +- app/res/layout/update_activity.xml | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 app/res/drawable/progressbar_modern_blue.xml diff --git a/app/res/drawable/progressbar_modern_blue.xml b/app/res/drawable/progressbar_modern_blue.xml new file mode 100644 index 0000000000..3362af1acb --- /dev/null +++ b/app/res/drawable/progressbar_modern_blue.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/res/layout-land/update_activity.xml b/app/res/layout-land/update_activity.xml index c767b199fb..0a097bbbc2 100644 --- a/app/res/layout-land/update_activity.xml +++ b/app/res/layout-land/update_activity.xml @@ -62,7 +62,7 @@ diff --git a/app/res/layout/update_activity.xml b/app/res/layout/update_activity.xml index 7b0830dd16..7ed6f81be1 100644 --- a/app/res/layout/update_activity.xml +++ b/app/res/layout/update_activity.xml @@ -62,7 +62,7 @@ android:layout_marginLeft="@dimen/content_min_margin" android:layout_marginRight="@dimen/content_min_margin" android:gravity="center" - android:progressDrawable="@drawable/progressbar_modern" + android:progressDrawable="@drawable/progressbar_modern_blue" android:layout_marginStart="@dimen/content_min_margin" android:layout_marginEnd="@dimen/content_min_margin" /> From 5259fadaa2740b27f4ea6f84237266e96a864730 Mon Sep 17 00:00:00 2001 From: parthmittal Date: Wed, 4 Dec 2024 09:38:51 +0530 Subject: [PATCH 5/8] -radius correction in progress bar --- app/res/drawable/progressbar_modern_blue.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/res/drawable/progressbar_modern_blue.xml b/app/res/drawable/progressbar_modern_blue.xml index 3362af1acb..aa3937eed2 100644 --- a/app/res/drawable/progressbar_modern_blue.xml +++ b/app/res/drawable/progressbar_modern_blue.xml @@ -2,7 +2,7 @@ - + Date: Wed, 4 Dec 2024 09:48:01 +0530 Subject: [PATCH 6/8] logs exceptions encountered while saving image --- .../activities/components/ImageCaptureProcessing.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/org/commcare/activities/components/ImageCaptureProcessing.java b/app/src/org/commcare/activities/components/ImageCaptureProcessing.java index 003c456c91..c36c68b307 100644 --- a/app/src/org/commcare/activities/components/ImageCaptureProcessing.java +++ b/app/src/org/commcare/activities/components/ImageCaptureProcessing.java @@ -127,7 +127,7 @@ public static boolean processCaptureResponse(FormEntryActivity activity, try { return scaleAndSaveImage(originalImage, isImage, instanceFolder, activity); } catch (IOException e) { - e.printStackTrace(); + Logger.exception("Error while trying to save captured image", e); Toast.makeText(activity, Localization.get("image.capture.not.saved"), Toast.LENGTH_LONG).show(); return false; } @@ -177,12 +177,9 @@ private static void processImageGivenFileUri(FormEntryActivity activity, String } catch (FileExtensionNotFoundException e) { Logger.exception("Error while processing chosen image ", e); Toast.makeText(activity, Localization.get("image.selection.invalid.extension"), Toast.LENGTH_LONG).show(); - return; } catch (IOException e) { - e.printStackTrace(); Logger.exception("Error while processing chosen image ", e); Toast.makeText(activity, Localization.get("image.selection.not.saved"), Toast.LENGTH_LONG).show(); - return; } } @@ -198,7 +195,7 @@ private static void processImageGivenFilePath(FormEntryActivity activity, String try { scaleAndSaveImage(originalImage, true, instanceFolder, activity); } catch (IOException e) { - e.printStackTrace(); + Logger.exception("Error while saving chosen image ", e); Toast.makeText(activity, Localization.get("image.selection.not.saved"), Toast.LENGTH_LONG).show(); } } else { From 356df2eb18a50593b7f3b6346dc57be35a8b9bab Mon Sep 17 00:00:00 2001 From: parthmittal Date: Wed, 4 Dec 2024 12:07:19 +0530 Subject: [PATCH 7/8] -radius correction in progress bar --- app/res/drawable/progressbar_modern.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/res/drawable/progressbar_modern.xml b/app/res/drawable/progressbar_modern.xml index c816eafb60..01fb1a2324 100644 --- a/app/res/drawable/progressbar_modern.xml +++ b/app/res/drawable/progressbar_modern.xml @@ -2,7 +2,7 @@ - + Date: Wed, 4 Dec 2024 17:05:58 +0530 Subject: [PATCH 8/8] Lint only changed files in the PR --- .github/workflows/linter.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 56973f2aa9..29703ce577 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -21,6 +21,14 @@ jobs: with: fetch-depth: 0 + - name: Get changed files + id: files + uses: octokit/request-action@v2.4.0 + with: + route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Lint Code Base uses: super-linter/super-linter@v5 env: @@ -29,3 +37,5 @@ jobs: IGNORE_GITIGNORED_FILES: true VALIDATE_JSCPD: false JAVA_FILE_NAME: checkstyle.xml + with: + changed_files: ${{ steps.files.outputs.files }}