Skip to content

Commit

Permalink
Fix #5283 :Revision cards overlapping. (#5289)
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
Fixes #5283, changed wrap_content to fixed width for cardview width.
<!--
- 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.
  -->

After Fix, accessibility check not suggesting text scaling( Referencing
issue #4736)

![WhatsApp Image 2023-12-23 at 5 43 08
PM](https://github.com/oppia/oppia-android/assets/76042077/acd91e4d-43fa-4589-b353-7e8d167e4cf0)



## Essential Checklist
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [ ] 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.
- [ ] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [ ] 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)).
- [ ] 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
| Before| After|
|--------|--------|

|![concept_card_overlaping](https://github.com/oppia/oppia-android/assets/76042077/b76e6a0d-ac11-420c-8c67-2580c27b316c)|
![overlapfix](https://github.com/oppia/oppia-android/assets/76042077/37e24271-8008-4618-97d4-889bc4ff9512)
|

|![cardoverlapbeforetablet](https://github.com/oppia/oppia-android/assets/76042077/c8f8ee4b-26e0-477d-b241-620146bab551)|
![tabletcardoverlap](https://github.com/oppia/oppia-android/assets/76042077/74cdb540-d050-489e-b19f-e8c586780afe)
|


<!-- 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
Vishwajith-Shettigar authored Jan 3, 2024
1 parent adecba9 commit d1b77c9
Showing 2 changed files with 8 additions and 12 deletions.
6 changes: 2 additions & 4 deletions app/src/main/res/layout-sw600dp/revision_card_fragment.xml
Original file line number Diff line number Diff line change
@@ -61,14 +61,13 @@

<com.google.android.material.card.MaterialCardView
android:id="@+id/previous_navigation_card"
android:layout_width="wrap_content"
android:layout_width="144dp"
android:layout_height="wrap_content"
android:layout_marginStart="28dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="28dp"
android:layout_marginBottom="@dimen/topic_revision_summary_view_container_margin_bottom"
android:clipToPadding="true"
android:maxWidth="144dp"
android:onClick="@{() -> viewModel.onPreviousCardClicked()}"
android:visibility="@{viewModel.subtopicId == 1 ? View.GONE : View.VISIBLE}"
app:cardBackgroundColor="@color/component_color_shared_revision_card_background_color"
@@ -120,14 +119,13 @@

<com.google.android.material.card.MaterialCardView
android:id="@+id/next_navigation_card"
android:layout_width="wrap_content"
android:layout_width="144dp"
android:layout_height="wrap_content"
android:layout_marginStart="28dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="28dp"
android:layout_marginBottom="@dimen/topic_revision_summary_view_container_margin_bottom"
android:clipToPadding="true"
android:maxWidth="144dp"
android:onClick="@{() -> viewModel.onNextCardClicked()}"
android:visibility="@{viewModel.subtopicId &lt; viewModel.subtopicListSize ? View.VISIBLE : View.GONE}"
app:cardBackgroundColor="@color/component_color_shared_revision_card_background_color"
14 changes: 6 additions & 8 deletions app/src/main/res/layout/revision_card_fragment.xml
Original file line number Diff line number Diff line change
@@ -57,9 +57,8 @@

<com.google.android.material.card.MaterialCardView
android:id="@+id/previous_navigation_card"
android:layout_width="wrap_content"
android:layout_width="144dp"
android:layout_height="wrap_content"
android:maxWidth="144dp"
android:layout_marginStart="28dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="28dp"
@@ -96,17 +95,17 @@
style="@style/TextViewStart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minWidth="144dp"
android:background="@color/component_color_shared_revision_card_text_background_color"
android:contentDescription="@{viewModel.computeContentDescriptionText(viewModel.previousSubtopicLiveData)}"
android:ellipsize="end"
android:fontFamily="sans-serif"
android:minWidth="144dp"
android:minLines="3"
android:paddingStart="@dimen/topic_revision_summary_view_subtopic_title_text_view_padding_start"
android:paddingTop="8dp"
android:paddingEnd="@dimen/topic_revision_summary_view_subtopic_title_text_view_padding_end"
android:paddingBottom="16dp"
android:text="@{viewModel.computeTitleText(viewModel.previousSubtopicLiveData)}"
android:contentDescription="@{viewModel.computeContentDescriptionText(viewModel.previousSubtopicLiveData)}"
android:textColor="@color/component_color_shared_secondary_4_text_color"
android:textSize="14sp"
android:textStyle="bold"
@@ -116,9 +115,8 @@

<com.google.android.material.card.MaterialCardView
android:id="@+id/next_navigation_card"
android:layout_width="wrap_content"
android:layout_width="144dp"
android:layout_height="wrap_content"
android:maxWidth="144dp"
android:layout_marginStart="28dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="28dp"
@@ -155,17 +153,17 @@
style="@style/TextViewStart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minWidth="144dp"
android:background="@color/component_color_shared_revision_card_text_background_color"
android:contentDescription="@{viewModel.computeContentDescriptionText(viewModel.nextSubtopicLiveData)}"
android:ellipsize="end"
android:fontFamily="sans-serif"
android:minWidth="144dp"
android:minLines="3"
android:paddingStart="@dimen/topic_revision_summary_view_subtopic_title_text_view_padding_start"
android:paddingTop="8dp"
android:paddingEnd="@dimen/topic_revision_summary_view_subtopic_title_text_view_padding_end"
android:paddingBottom="16dp"
android:text="@{viewModel.computeTitleText(viewModel.nextSubtopicLiveData)}"
android:contentDescription="@{viewModel.computeContentDescriptionText(viewModel.nextSubtopicLiveData)}"
android:textColor="@color/component_color_shared_secondary_4_text_color"
android:textSize="14sp"
android:textStyle="bold"

0 comments on commit d1b77c9

Please sign in to comment.