Skip to content

Commit

Permalink
Merge branch 'master' into refactorEntityLoaderTask
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1g5 authored Dec 4, 2024
2 parents bd1f227 + d4d32c8 commit 7c041ff
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 35 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ jobs:
with:
fetch-depth: 0

- name: Get changed files
id: files
uses: octokit/[email protected]
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:
Expand All @@ -29,3 +37,5 @@ jobs:
IGNORE_GITIGNORED_FILES: true
VALIDATE_JSCPD: false
JAVA_FILE_NAME: checkstyle.xml
with:
changed_files: ${{ steps.files.outputs.files }}
4 changes: 4 additions & 0 deletions app/res/drawable/icon_chevron_left_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<vector android:height="12dp" android:viewportHeight="12.0"
android:viewportWidth="8.0" android:width="8dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M7.70492 1.41L6.29492 0L0.294922 6L6.29492 12L7.70492 10.59L3.12492 6L7.70492 1.41Z"/>
</vector>
4 changes: 4 additions & 0 deletions app/res/drawable/icon_chevron_right_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<vector android:height="12dp" android:viewportHeight="12.0"
android:viewportWidth="8.0" android:width="8dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M1.70492 0L0.294922 1.41L4.87492 6L0.294922 10.59L1.70492 12L7.70492 6L1.70492 0Z"/>
</vector>
4 changes: 4 additions & 0 deletions app/res/drawable/icon_close_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<vector android:height="14dp" android:viewportHeight="14.0"
android:viewportWidth="14.0" android:width="14dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z"/>
</vector>
14 changes: 8 additions & 6 deletions app/res/drawable/progressbar_modern.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="4dp" />
<gradient
android:startColor="@color/cc_neutral_bg"
android:endColor="@color/cc_neutral_bg"
android:startColor="@color/progress_bar_bg"
android:endColor="@color/progress_bar_bg"
/>
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<scale android:scaleWidth="100%">
<shape>
<corners android:radius="4dp" />
<gradient
android:startColor="@color/cc_brand_color"
android:endColor="@color/cc_brand_color"
android:startColor="@color/white"
android:endColor="@color/white"
/>
</shape>
</clip>
</scale>
</item>
</layer-list>
23 changes: 23 additions & 0 deletions app/res/drawable/progressbar_modern_blue.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="4dp" />
<gradient
android:startColor="@color/progress_bar_bg"
android:endColor="@color/progress_bar_bg"
/>
</shape>
</item>
<item android:id="@android:id/progress">
<scale android:scaleWidth="100%">
<shape>
<corners android:radius="4dp" />
<gradient
android:startColor="@color/start_sync_button"
android:endColor="@color/start_sync_button"
/>
</shape>
</scale>
</item>
</layer-list>
2 changes: 1 addition & 1 deletion app/res/layout-land/update_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<ProgressBar
android:id="@+id/update_progress_bar"
style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal"
android:progressDrawable="@drawable/progressbar_modern"
android:progressDrawable="@drawable/progressbar_modern_blue"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/content_min_margin"
Expand Down
2 changes: 1 addition & 1 deletion app/res/layout/progress_dialog_determinate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/progress_dialog_message"
android:progressDrawable="@drawable/progressbar_modern"
android:progressDrawable="@drawable/progressbar_modern_blue"
android:indeterminate="false"
android:indeterminateOnly="false"/>

Expand Down
33 changes: 17 additions & 16 deletions app/res/layout/screen_form_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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/start_sync_button"
android:minHeight="@dimen/new_progressbar_minheight"
android:paddingLeft="@dimen/content_start"
android:paddingRight="@dimen/content_start"
Expand All @@ -70,53 +70,54 @@
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" />

<ProgressBar
android:id="@+id/nav_prog_bar"
style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/nav_btn_prev"
android:layout_alignParentTop="true"
android:layout_centerInParent="true"
android:id="@+id/nav_prog_bar"
android:indeterminate="false"
android:indeterminateOnly="false"
android:layout_centerVertical="true"
android:layout_height="32dp"
android:layout_marginEnd="@dimen/content_start"
android:layout_marginLeft="@dimen/content_start"
android:layout_marginRight="@dimen/content_start"
android:layout_marginStart="@dimen/content_start"
android:layout_toEndOf="@id/nav_btn_prev"
android:layout_toLeftOf="@+id/nav_btn_next"
android:layout_toRightOf="@id/nav_btn_prev"
android:indeterminate="false"
android:indeterminateOnly="false"
android:layout_toStartOf="@+id/nav_btn_next"

android:layout_width="wrap_content"
android:max="100"
android:paddingBottom="@dimen/content_start"
android:paddingTop="@dimen/content_start"
android:progress="0"
android:progressDrawable="@drawable/progressbar_modern"
android:layout_marginStart="@dimen/content_start"
android:layout_marginEnd="@dimen/content_start"
android:layout_toStartOf="@+id/nav_btn_next"
android:layout_toEndOf="@id/nav_btn_prev" />
android:progressDrawable="@drawable/progressbar_modern" />

<ImageButton
android:rotationY="@integer/locale_mirror_flip"
android:id="@+id/nav_btn_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/selector_button_press"
android:minHeight="@dimen/new_progressbar_button_minheight"
android:minWidth="@dimen/new_progressbar_button_minwidth"
android:paddingLeft="@dimen/new_progressbar_button_padding"
android:paddingRight="@dimen/content_start"
app:srcCompat="@drawable/icon_chevron_right_brand"
app:srcCompat="@drawable/icon_chevron_right_white"
android:paddingEnd="@dimen/content_start"
android:paddingStart="@dimen/new_progressbar_button_padding"
android:layout_alignParentEnd="true" />
Expand Down
2 changes: 1 addition & 1 deletion app/res/layout/update_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />

Expand Down
2 changes: 2 additions & 0 deletions app/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,7 @@
<color name="start_sync_dark_button">#3b4fb6</color>
<color name="start_logout_button">#373534</color>

<!-- Progress bar colors -->
<color name="progress_bar_bg">#33000000</color>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
}

Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,6 @@ private static String buildKeyNameWhereClause(String[] names) {

private static void populateEntitySet(SQLiteDatabase db, String sqlStatement, String[] args,
Hashtable<String, AsyncEntity> 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"));
Expand Down

0 comments on commit 7c041ff

Please sign in to comment.