From 913cf5fba3ccce8e8befcd3684d612aed66a36a4 Mon Sep 17 00:00:00 2001 From: RD Rama Devi <122200035+Rd4dev@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:51:26 +0530 Subject: [PATCH] Fix #5204 - Inconsistent Layout Lint Warning (#5218) ## Explanation Fix #5204 - [Part of #5169] To address the lint warnings, two potential solutions were considered. 1. Initially, there was an option to include the missing IDs, ensuring consistency across different layout configurations [[**Link**](https://github.com/Rd4dev/oppia-android/commit/f8977e686fcbbf362aea4a8d1a472c487bafeb0f)]. However, it was observed that implementing this solution led to functional disruptions within the current working application, as confirmed through comprehensive testing procedures (refer to the attached assets for a detailed overview). https://github.com/oppia/oppia-android/assets/122200035/82172eaf-a555-4e76-b1ae-8f0db7ddb924 2. The second option was to suppress the lint warnings for the specific views in the layout-sw600dp configuration files [[**Link**](https://github.com/Rd4dev/oppia-android/commit/a0f5b1ed9100ecc0f578c6c4a38f4df6566724ec)] to maintain the seamless functionality of the application . This was achieved by incorporating the attribute **`tools:ignore="InconsistentLayout"`** for relevant views, without impacting the current operational stability of the application. https://github.com/oppia/oppia-android/assets/122200035/93a65422-3526-4d76-873f-c08d24abc3ee Taking the necessary action, I proceeded to implement the suppression of lint warnings by submitting a pull request. ## 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". - [ ] 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)) - For PRs introducing new UI elements or color changes, both light and dark mode screenshots must be included - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing Co-authored-by: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com> --- .../layout-sw600dp/administrator_controls_activity.xml | 3 ++- app/src/main/res/layout-sw600dp/help_activity.xml | 9 ++++++--- app/src/main/res/layout-sw600dp/option_activity.xml | 6 ++++-- .../layout-sw600dp/options_without_drawer_activity.xml | 7 +++++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml b/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml index c3602b0e946..9b778df86f3 100644 --- a/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml +++ b/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml @@ -85,7 +85,8 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/administrator_controls_guideline" - app:layout_constraintTop_toBottomOf="@id/extra_controls_title" /> + app:layout_constraintTop_toBottomOf="@id/extra_controls_title" + tools:ignore="InconsistentLayout" /> + app:srcCompat="@drawable/ic_arrow_back_black_24_dp" + tools:ignore="InconsistentLayout" /> + app:layout_constraintTop_toTopOf="parent" + tools:ignore="InconsistentLayout" /> + app:layout_constraintTop_toBottomOf="@id/help_multipane_options_title_textview" + tools:ignore="InconsistentLayout" /> + app:layout_constraintTop_toTopOf="parent" + tools:ignore="InconsistentLayout" /> + app:layout_constraintTop_toBottomOf="@id/options_activity_selected_options_title" + tools:ignore="InconsistentLayout" /> @@ -44,7 +45,8 @@ android:textSize="18sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/multipane_guideline" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + tools:ignore="InconsistentLayout" /> + app:layout_constraintTop_toBottomOf="@id/options_activity_selected_options_title" + tools:ignore="InconsistentLayout" />