Skip to content

Commit

Permalink
Fix 5273: Unused Attribute Lint Warning (#5662)
Browse files Browse the repository at this point in the history
<!-- READ ME FIRST: Please fill in the explanation section below and
check off every point from the Essential Checklist! -->
## Explanation
<!--
- Explain what your PR does. If this PR fixes an existing bug, please
include
- "Fixes #bugnum:" in the explanation so that GitHub can auto-close the
issue
  - when this PR is merged.
  -->
Fixes #5273 - Unused Attribute Lint Warning
Here’s a summary of the changes I made:

In "bottom_sheet_options_menu_fragment.xml", fixed "android:drawableTint
to app:drawableTint" at 3 places.
In "circular_progress_indicator_adapters_test_activity.xml", fixed
android:min by using tools:targetApi="26".
In "content_item.xml", fixed android:breakStrategy by using
tools:targetApi="23".
In "feedback_item.xml", fixed android:breakStrategy by using
tools:targetApi="23".
In "profile_list_control_buttons.xml", fixed android:min by using
tools:targetApi="26".
In "profile_progress_recently_played_story_card.xml", fixed
android:forceDarkAllowed by using tools:targetApi="29".
In "promoted_story_card.xml", fixed android:forceDarkAllowed by using
tools:targetApi="29".
In "recently_played_story_card.xml", fixed android:forceDarkAllowed by
using tools:targetApi="29".
In "resume_lesson_fragment.xml", changed android:drawableTint to
appdrawableTint at 2 places.
Inside the Android -> Lint -> Correctness (showing error):
Changed the android:tint to app:tint in 5 XML files:
"add_profile_activity.xml"
"administrator_controls_activity.xml"
"drag_drop_interaction_items.xml"
"drawer_fragment.xml"
"help_activity.xml"

Unused Attributes Fixed :-
drawableTint
min
breakStrategy
forceDarkAllowed

Here are the screenshots of Code Inspect before and after the changes.
**Screenshot Before Changes:**

![Screenshot 2025-01-24
005141](https://github.com/user-attachments/assets/79549066-483e-434c-b286-9a2f195aada5)

**Screenshot After Changes:**

![Screenshot 2025-01-24
013730](https://github.com/user-attachments/assets/020f6677-cdae-4c43-bc79-014c332405ca)


## Essential Checklist
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [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
<!-- Delete these section if this PR does not include UI-related
changes. -->
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 <[email protected]>
  • Loading branch information
kavyanshkhandelwal and adhiamboperes authored Jan 28, 2025
1 parent db0094a commit 0717ce8
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/src/main/res/layout-land/resume_lesson_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/state_button_primary_background"
android:drawableTint="@color/component_color_shared_white_background_color"
app:drawableTint="@color/component_color_shared_white_background_color"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:minWidth="144dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/state_button_primary_background"
android:drawableTint="@color/component_color_shared_white_background_color"
app:drawableTint="@color/component_color_shared_white_background_color"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:minWidth="144dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="8dp"
android:drawableTint="@color/component_color_shared_multipane_icon_color"
app:drawableTint="@color/component_color_shared_multipane_icon_color"
android:gravity="center_vertical"
android:minHeight="48dp"
android:text="@string/menu_options"
Expand All @@ -28,7 +28,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="8dp"
android:drawableTint="@color/component_color_shared_multipane_icon_color"
app:drawableTint="@color/component_color_shared_multipane_icon_color"
android:gravity="center_vertical"
android:minHeight="48dp"
android:text="@string/menu_help"
Expand All @@ -41,7 +41,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="8dp"
android:drawableTint="@color/component_color_shared_multipane_icon_color"
app:drawableTint="@color/component_color_shared_multipane_icon_color"
android:gravity="center_vertical"
android:minHeight="48dp"
android:text="@string/bottom_sheet_options_menu_close"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?><!-- TODO(#59): Make this layout only accessible to tests. -->
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

Expand All @@ -20,13 +21,15 @@
android:layout_height="wrap_content"
android:max="@{viewModel.defaultMaximum}"
android:min="@{viewModel.defaultMinimum}"
tools:targetApi="26"
app:animatedProgress="@{viewModel.currentAutoProgress}" />

<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/circular_progress_indicator_test_unbound_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:max="@{viewModel.defaultMaximum}"
android:min="@{viewModel.defaultMinimum}" />
android:min="@{viewModel.defaultMinimum}"
tools:targetApi="26"/>
</LinearLayout>
</layout>
4 changes: 3 additions & 1 deletion app/src/main/res/layout/content_item.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

Expand Down Expand Up @@ -44,6 +45,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:breakStrategy="simple"
tools:targetApi="23"
android:fontFamily="sans-serif"
android:minWidth="48dp"
android:minHeight="48dp"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/feedback_item.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

Expand Down Expand Up @@ -44,6 +45,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:breakStrategy="simple"
tools:targetApi="23"
android:fontFamily="sans-serif"
android:minWidth="48dp"
android:minHeight="48dp"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/profile_list_control_buttons.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

Expand Down Expand Up @@ -52,6 +53,7 @@
android:layout_height="wrap_content"
android:max="@{viewModel.forceUploadProgress.totalEventsToUpload}"
android:min="0"
tools:targetApi="26"
app:animatedProgress="@{viewModel.forceUploadProgress.eventsUploaded}"
android:visibility="@{viewModel.forceUploadProgress.hasEventsToUpload() ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintBottom_toBottomOf="@+id/learner_analytics_upload_logs_now_button"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

Expand Down Expand Up @@ -38,6 +39,7 @@
app:entityId="@{viewModel.promotedStory.storyId}"
app:entityType="@{viewModel.entityType}"
android:forceDarkAllowed="false"
tools:targetApi="29"
app:layout_constraintDimensionRatio="4:3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/promoted_story_card.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

Expand Down Expand Up @@ -36,6 +37,7 @@
app:entityId="@{viewModel.promotedStory.storyId}"
app:entityType="@{viewModel.entityType}"
android:forceDarkAllowed="false"
tools:targetApi="29"
app:layout_constraintDimensionRatio="H, 16:9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/recently_played_story_card.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

Expand Down Expand Up @@ -39,6 +40,7 @@
app:entityId="@{viewModel.promotedStory.storyId}"
app:entityType="@{viewModel.entityType}"
android:forceDarkAllowed="false"
tools:targetApi="29"
app:layout_constraintDimensionRatio="4:3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down

0 comments on commit 0717ce8

Please sign in to comment.