oppia / oppia-android

A free, online & offline learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
309 stars 509 forks source link

DisableBaselineAlignment + InefficientWeight + Overdraw + UseCompoundDrawables + UselessLeaf + UselessParent #5261

Open adhiamboperes opened 9 months ago

adhiamboperes commented 9 months ago

@DeonWaju , Re: your comment:

  1. Fix part of [DisableBaselineAlignment + InefficientWeight + Overdraw + UseCompoundDrawables + UselessLeaf + UselessParent] Fix for DisableBaselineAlignment: (A) Add android:baselineAligned="false" to LinearLayout on line 12 in "layout-sw600dp-land/topic_info_fragment.xml" (B) Add android:baselineAligned="false" to LinearLayout on line 91 in " "layout/topic_lessons_story_summary.xml" (C) Add android:baselineAligned="false" to LinearLayout on line 93 in " "layout-sw600dp-land/topic_lessons_story_summary.xml" Example below: Warning: Addressing DisableBaselineAlignment warning on the 13th issue on the list [DisableBaselineAlignment + InefficientWeight + Overdraw + UseCompoundDrawables + UselessLeaf + UselessParent]

I have checked this for an explanation of this lint warning. I'm curious about the usage of weight in these layouts. Is it necessary?

deonwaju commented 9 months ago

I have checked this for an explanation of this lint warning. I'm curious about the usage of weight in these layouts. Is it necessary?

I think the weight assignment indicates that the TextView should take up a proportional amount of space horizontally in the linear layout. An alternative would be to use a constraint layout.

Screenshot 2023-12-06 at 23 43 28
adhiamboperes commented 9 months ago

@DeonWaju, Sure, let's go with your approach.

deonwaju commented 9 months ago

@DeonWaju, Sure, let's go with your approach.

Sorry not clear, the first approach or using a constraint layout?

adhiamboperes commented 9 months ago

The first one for baseline alignment. Pere the SO link, it seems to be a performance improvement, and will require the least effort.