From 77a99be2ddbc9fe2cbdc1e3fcc93fa30e66ac0c7 Mon Sep 17 00:00:00 2001 From: hungngo97 Date: Tue, 2 Jul 2019 19:44:54 -0700 Subject: [PATCH 1/2] Added minor UI fixes --- .../rdt_reader/ImageQualityActivity.java | 13 +------------ app/src/main/res/drawable/rounded_button.xml | 16 ++++++++++++++++ .../res/layout/activity_image_quality_opencv.xml | 14 +++++++------- app/src/main/res/layout/activity_main.xml | 4 ++++ app/src/main/res/values/colors.xml | 2 +- app/src/main/res/values/strings.xml | 14 +++++++------- app/src/main/res/values/styles.xml | 2 +- build.gradle | 2 +- openCVLibrary341/build.gradle | 2 +- openCVLibrary341/src/main/AndroidManifest.xml | 2 +- 10 files changed, 40 insertions(+), 31 deletions(-) create mode 100644 app/src/main/res/drawable/rounded_button.xml diff --git a/app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/ImageQualityActivity.java b/app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/ImageQualityActivity.java index 00344d79..4be85f8a 100644 --- a/app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/ImageQualityActivity.java +++ b/app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/ImageQualityActivity.java @@ -1302,25 +1302,14 @@ private void displayQualityResult (boolean[] isCorrectPosSize, boolean isBlur, b } mImageQualityFeedbackView.setText(Html.fromHtml(message)); - if (isCorrectPosSize[0] && isCorrectPosSize[1] && isCorrectPosSize[2] && !isBlur && !isOverExposed && !isUnderExposed && !isShadow) { - if (mViewport.getBackgroundColorId() != R.color.green_overlay) { - mViewport.setBackgroundColoId(R.color.green_overlay); - } - } else { - if (mViewport.getBackgroundColorId() != R.color.red_overlay) { - mViewport.setBackgroundColoId(R.color.red_overlay); - } - } } else if (currFocusState == FocusState.INACTIVE) { mInstructionText.setText(getResources().getString(R.string.instruction_pos)); - mViewport.setBackgroundColoId(R.color.red_overlay); } else if (currFocusState == FocusState.UNFOCUSED) { mInstructionText.setText(getResources().getString(R.string.instruction_unfocused)); - mViewport.setBackgroundColoId(R.color.red_overlay); } else if (currFocusState == FocusState.FOCUSING) { mInstructionText.setText(getResources().getString(R.string.instruction_focusing)); - mViewport.setBackgroundColoId(R.color.red_overlay); } + mViewport.setBackgroundColoId(R.color.black_overlay); } diff --git a/app/src/main/res/drawable/rounded_button.xml b/app/src/main/res/drawable/rounded_button.xml new file mode 100644 index 00000000..654ce9fb --- /dev/null +++ b/app/src/main/res/drawable/rounded_button.xml @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_image_quality_opencv.xml b/app/src/main/res/layout/activity_image_quality_opencv.xml index 35071704..f5d3f086 100644 --- a/app/src/main/res/layout/activity_image_quality_opencv.xml +++ b/app/src/main/res/layout/activity_image_quality_opencv.xml @@ -56,12 +56,12 @@ style="?android:attr/progressBarStyle" android:layout_width="80dp" android:layout_height="80dp" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" + android:layout_marginEnd="8dp" + android:layout_marginBottom="8dp" android:indeterminate="true" - android:visibility="visible" + android:visibility="invisible" app:layout_constraintBottom_toBottomOf="@+id/img_quality_check_viewport" app:layout_constraintEnd_toEndOf="@+id/img_quality_check_viewport" app:layout_constraintStart_toStartOf="@+id/img_quality_check_viewport" @@ -71,9 +71,9 @@ android:id="@+id/progressText" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" + android:layout_marginEnd="8dp" android:text="@string/progress_initialization" android:textAlignment="center" android:textAppearance="@android:style/TextAppearance.Material.Medium" @@ -106,10 +106,10 @@ style="?android:attr/progressBarStyleHorizontal" android:layout_width="50dp" android:layout_height="50dp" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" + android:layout_marginEnd="8dp" + android:layout_marginBottom="8dp" android:background="@drawable/circular_shape" android:indeterminate="false" android:max="10" @@ -120,6 +120,6 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - tools:visibility="visible" /> + tools:visibility="invisible" /> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 48b7f52c..0049e634 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -15,6 +15,7 @@ android:layout_marginTop="16dp" android:text="@string/exp_date_check" android:theme="@style/PrimaryButton" + android:background="@drawable/rounded_button" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -28,6 +29,7 @@ android:layout_marginTop="8dp" android:text="@string/image_quality" android:theme="@style/PrimaryButton" + android:background="@drawable/rounded_button" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/expdateButton" /> @@ -41,6 +43,7 @@ android:layout_marginStart="8dp" android:text="@string/settings" android:theme="@style/PrimaryButton" + android:background="@drawable/rounded_button" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> @@ -54,6 +57,7 @@ android:layout_marginTop="8dp" android:text="Test Camera2" android:theme="@style/PrimaryButton" + android:background="@drawable/rounded_button" android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 4855240a..4e8cb8db 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -9,7 +9,7 @@ #00000000 #33000000 #66FF0000 - #6600FF00 + #662ead2e #cc4285f4 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e0109cf0..2873dda4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -4,19 +4,19 @@ Camera2TestActivity Stay still… Captured! Analyzing the image… - Place the RDT inside the rectangle. + Fit RDT in the rectangle. Hold still... - TOO BRIGHT - TOO DARK - SHARPNESS: %s
BRIGHTNESS: %s
NO SHADOW: %s]]>
- - - + Too bright + Too dark +
%s Sharpness

%s Brightness

%s No shadow]]>
+ + + Strict Loose Expiration Date diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index f84b855f..e59f4b94 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,7 +1,7 @@ -