From c5b11fe5126072e929f9bfaab8bb42074016a3c9 Mon Sep 17 00:00:00 2001 From: MOHIT GUPTA <76530270+MohitGupta121@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:13:29 -0600 Subject: [PATCH 1/3] Fix #5094 : [Wiki update] Bazel build failed in mac m1 (#5139) ## Explanation Fix #5094 : [Wiki update] Bazel build failed in mac m1 ## Essential Checklist - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [ ] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only If your PR includes UI-related changes, then: - Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes - For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see [RTL guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines)) - Add a video showing the full UX flow with a screen reader enabled (see [accessibility guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide)) - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing --- wiki/Troubleshooting-Installation.md | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/wiki/Troubleshooting-Installation.md b/wiki/Troubleshooting-Installation.md index 55d14907a1d..d88c4bf01ad 100644 --- a/wiki/Troubleshooting-Installation.md +++ b/wiki/Troubleshooting-Installation.md @@ -10,10 +10,13 @@ Here are some general troubleshooting tips for oppia-android. The specific platf 1. If you find any error related to `cURL`, please set up cURL on your machine. For Linux, you can use `sudo apt install curl`. No need to set up `cURL` for Windows as you are using git bash command line.
+ 2. If you find any error which says `java: command not found`, please check you have Java installed correctly in your machine and the [environment path variable](https://www.java.com/en/download/help/path.html) is also set up correctly. + 3. If you find any error related to Kotlin or Java/Checkstyle while pushing the code, please check [this link](https://github.com/oppia/oppia-android/wiki/Android-Studio-UI-based-Github-workflow#how-to-fix-push-failures). + 4. If you see the error ``` @@ -22,6 +25,7 @@ Here are some general troubleshooting tips for oppia-android. The specific platf then please follow the 2nd step mentioned in [this wiki](https://github.com/oppia/oppia-android/wiki/Installing-Oppia-Android#install-oppia-android) for Mac with Apple silicon(M1/M2) chips. + 5. If you see the error ``` @@ -70,6 +74,7 @@ Here are some general troubleshooting tips for oppia-android. The specific platf ``` [Steps](https://docs.bazel.build/versions/main/tutorial/android-app.html#integrate-with-the-android-sdk) to add ANDROID_HOME environment variable. + 2. If you encounter the following: ``` @@ -79,11 +84,42 @@ Here are some general troubleshooting tips for oppia-android. The specific platf Try to delete the `.bazelrc` file to solve the above error. + 3. **java.lang.ClassNotFoundException: com.android.tools.r8.compatdx.CompatDx** If, when building the app binary, you encounter a failure that indicates that the CompatDx file cannot be found, this is likely due to you using a newer version of the Android build tools. You can manually downgrade to an older version of build-tools (particularly 29.0.2). Unfortunately, this can't be done through Android Studio but it can be done over a terminal. Follow the instructions listed [here](https://github.com/oppia/oppia-android/issues/3024#issuecomment-884513455) to downgrade your build tools & then try to build the app again. +4. If you encounter this error while building bazel in Mac M1: + ``` + ERROR: /Users/OpenSource/oppia-android/model/src/main/proto/BUILD.bazel:167:20: Generating JavaLite proto_library //model/src/main/proto:profile_proto failed: (Segmentation fault): protoc failed: error executing command bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc '--proto_path=bazel-out/android-armeabi-v7a-fastbuild/bin/model/src/main/proto/_virtual_imports/languages_proto' ... (remaining 8 argument(s) skipped) + + Use --sandbox_debug to see verbose messages from the sandbox protoc failed: error executing command bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc '--proto_path=bazel-out/android-armeabi-v7a-fastbuild/bin/model/src/main/proto/_virtual_imports/languages_proto' ... (remaining 8 argument(s) skipped) + ``` +Bazel requires Xcode commandline tools to build on M1, and the Xcode license also needs to be accepted. + + **Follow these steps to solve this error:** + +- Install the commandline tools: `xcode-select --install` + +- Accept the Xcode licence: `sudo xcodebuild -licence` + +- Reset the xcode select path: `sudo xcode-select -r ` + + - Set the xcode select path to use CommandLineTools: `sudo xcode-select -s /Library/Developer/CommandLineTools` + +- Confirm that the path was correctly set. The expected output is: `/Library/Developer/CommandLineTools` + + xcode-select -p + +After successfully running the above commands, build the app using Bazel by running the following command: + + ``` + bazel clean --expunge + bazel build //:oppia --noexperimental_check_desugar_deps + ``` +The `--noexperimental_check_desugar_deps` flag is explained in the [bazel blog](https://blog.bazel.build/2018/12/19/bazel-0.21.html#android). + ### Can’t find a particular issue? If the error you get is not in the Troubleshooting section above, please create an issue providing all the necessary information and assign it to **@MohitGupta121**. From 7668bf08235faca71c07858293158766487aa0bf Mon Sep 17 00:00:00 2001 From: Vishwajith Shettigar <76042077+Vishwajith-Shettigar@users.noreply.github.com> Date: Wed, 6 Sep 2023 02:25:41 +0530 Subject: [PATCH 2/3] Fix #4735 Text unit is set in dp instead of sp (#5134) ## Explanation Fix #4735 , Added toolbar in admin_pin_activity xml file inorder to control the title size using sp. ## Essential Checklist - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only Before fix Admin pin activity | Light mode| |--------| |![before light](https://github.com/oppia/oppia-android/assets/76042077/e80cd747-b04c-43c5-96b9-848dc5db3400) | After fix |Light mode| Dark mode| |-----------|--------------| | ![afterlightmode](https://github.com/oppia/oppia-android/assets/76042077/4445ebd1-3fde-40f4-a4cb-cb3716aad43e) | ![afterdarkmode](https://github.com/oppia/oppia-android/assets/76042077/98bd0994-5f4d-464f-b170-d21e167a9eaa) | Co-authored-by: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com> --- app/src/main/AndroidManifest.xml | 1 + .../android/app/profile/AdminPinActivity.kt | 5 ++++ .../app/profile/AdminPinActivityPresenter.kt | 10 ++++--- .../main/res/layout/admin_pin_activity.xml | 26 ++++++++++++++++--- app/src/main/res/values/styles.xml | 4 +++ 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a27551a2005..897fc034879 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -138,6 +138,7 @@ (activity, R.layout.admin_pin_activity) + activity.setSupportActionBar(binding.adminPinToolbar) + activity.supportActionBar?.setDisplayHomeAsUpEnabled(true) + activity.supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_close_white_24dp) + activity.supportActionBar?.setHomeActionContentDescription(R.string.admin_auth_close) + binding.apply { lifecycleOwner = activity viewModel = adminViewModel } + binding.adminPinToolbar.title = resourceHandler + .getStringInLocale(R.string.admin_auth_activity_add_profiles_title) // [onTextChanged] is a extension function defined at [TextInputEditTextHelper] binding.adminPinInputPinEditText.onTextChanged { pin -> pin?.let { diff --git a/app/src/main/res/layout/admin_pin_activity.xml b/app/src/main/res/layout/admin_pin_activity.xml index e40ed050b9d..f22760b80dd 100644 --- a/app/src/main/res/layout/admin_pin_activity.xml +++ b/app/src/main/res/layout/admin_pin_activity.xml @@ -13,14 +13,32 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + + + + android:scrollbars="none" + android:background="@color/component_color_shared_screen_secondary_background_color" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/admin_pin_toolbar" + > @anim/slide_up @anim/slide_down + + From a1ba8bd3dab65d4213192918b8d4216330cb5a7e Mon Sep 17 00:00:00 2001 From: Vishwajith Shettigar <76042077+Vishwajith-Shettigar@users.noreply.github.com> Date: Thu, 7 Sep 2023 18:06:05 +0530 Subject: [PATCH 3/3] Fix #5142 Edit text foreground and background contrast ratio issue in Light mode (#5144) ## Explanation Fix #5142, changed text input default stroke color. Added color resource file names component_color_text_layout.xml in order to give stroke color ## Essential Checklist - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only Berore fix | Light mode| Dark mode| |--------|--------| | ![contarstlight_before](https://github.com/oppia/oppia-android/assets/76042077/0fcb4613-a7fb-4320-ae88-792704d61950)|![contastdark_before](https://github.com/oppia/oppia-android/assets/76042077/d36c6c13-654a-4603-8cef-80472dacf0d3)| Afterfix | Light mode| Dark mode| |--------|--------| |![newnew](https://github.com/oppia/oppia-android/assets/76042077/ef50252b-7c21-41ab-baee-2f244e87644b)|![contrastdark_after](https://github.com/oppia/oppia-android/assets/76042077/e4418fb6-9fb1-4c32-8c54-339235303abb)| Screen recording after fix Light mode https://github.com/oppia/oppia-android/assets/76042077/943629a3-2b4a-4459-bbf9-0f0246860ffd Dark mode https://github.com/oppia/oppia-android/assets/76042077/c85256a0-5f99-4577-82e4-b95ce0d24027 If your PR includes UI-related changes, then: - Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes - For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see [RTL guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines)) - Add a video showing the full UX flow with a screen reader enabled (see [accessibility guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide)) - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing --- app/src/main/res/color/component_color_text_layout.xml | 5 +++++ app/src/main/res/values-night/color_palette.xml | 2 ++ app/src/main/res/values/color_palette.xml | 2 ++ app/src/main/res/values/styles.xml | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/color/component_color_text_layout.xml diff --git a/app/src/main/res/color/component_color_text_layout.xml b/app/src/main/res/color/component_color_text_layout.xml new file mode 100644 index 00000000000..9795672d6eb --- /dev/null +++ b/app/src/main/res/color/component_color_text_layout.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/values-night/color_palette.xml b/app/src/main/res/values-night/color_palette.xml index 7bb64f94cb7..299d498bfc6 100644 --- a/app/src/main/res/values-night/color_palette.xml +++ b/app/src/main/res/values-night/color_palette.xml @@ -225,4 +225,6 @@ @color/color_def_white @color/color_def_oppia_green @color/color_def_pale_green + @color/color_def_black_87 + @color/color_def_white diff --git a/app/src/main/res/values/color_palette.xml b/app/src/main/res/values/color_palette.xml index 50e8f6caa30..13113daf937 100644 --- a/app/src/main/res/values/color_palette.xml +++ b/app/src/main/res/values/color_palette.xml @@ -265,4 +265,6 @@ @color/color_def_chooser_grey @color/color_def_persian_green @color/color_def_grey + @color/color_def_black_87 + @color/color_def_black_87 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 2be703def67..149d87fd1d1 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -170,7 +170,7 @@ @dimen/text_input_layout_corner_radius @dimen/text_input_layout_corner_radius @dimen/text_input_layout_corner_radius - @color/component_color_shared_text_input_layout_stroke_color + @color/component_color_text_layout @dimen/text_input_layout_stroke_width true @color/component_color_shared_text_input_layout_error_color