Skip to content

Commit

Permalink
Fixed #4791 : Dark Mode the white corners of Stories Cards (#4847)
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

 Fixed #4791 :  Dark Mode the white corners of Stories Cards


<!--
- 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.
  -->

## 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: ...".)
- [ ] 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

### Stories Cards corners

<img
src="https://user-images.githubusercontent.com/76530270/213464300-0d5c18b2-0a8b-4e08-b96b-52c68ce97325.png"
height="400" style="max-width: 100%"> <img
src="https://user-images.githubusercontent.com/76530270/213464215-2f7de45d-14ef-47ae-a490-e3120f5f0e4a.png"
height="400" style="max-width: 100%">

<img
src="https://user-images.githubusercontent.com/76530270/213464821-e2d733a2-deed-4dd0-a6d1-85c41942a058.png"
height="400" style="max-width: 100%"> <img
src="https://user-images.githubusercontent.com/76530270/213464703-97c30e6c-4587-4fe2-85ee-4ed749577b93.png"
height="400" style="max-width: 100%">

<img
src="https://user-images.githubusercontent.com/76530270/213465037-71f02778-f74e-4211-bea5-e0905a9cf62a.png"
height="400" style="max-width: 100%"> <img
src="https://user-images.githubusercontent.com/76530270/213465137-aa020700-78e1-40f0-b6a4-e991f9ea2bc7.png"
height="400" style="max-width: 100%">

<img
src="https://user-images.githubusercontent.com/76530270/213465432-f52e47fe-319a-49ac-bd9c-b2130f329db2.png"
height="400" style="max-width: 100%"> <img
src="https://user-images.githubusercontent.com/76530270/213465300-df7196ce-296f-4a88-b818-0a87521ce2c7.png"
height="400" style="max-width: 100%">



<!-- 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))
- Add a screenshot demonstrating that you ran affected Espresso tests
locally & that they're passing
  • Loading branch information
MohitGupta121 authored Jan 25, 2023
1 parent 71e769b commit 21dd212
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/profile_chooser_profile_view_margin"
android:padding="@dimen/profile_chooser_profile_view_parent_padding"
app:layoutMarginBottom="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/space_0dp}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_parent_margin_start_profile_not_added}"
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_parent_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_parent_margin_start_profile_not_added}">
app:layoutMarginBottom="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/space_0dp}">

<LinearLayout
android:id="@+id/profile_chooser_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER}"
android:orientation="@{hasProfileEverBeenAddedValue ? LinearLayout.VERTICAL : LinearLayout.HORIZONTAL}"
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_margin_end_profile_already_added : @dimen/profile_view_not_added_margin}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_margin_start_profile_already_added : @dimen/profile_view_not_added_margin}"
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_margin_end_profile_already_added : @dimen/profile_view_not_added_margin}"
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_margin_top_profile_not_added}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand All @@ -46,19 +46,19 @@
android:id="@+id/profile_avatar_img"
android:layout_width="108dp"
android:layout_height="108dp"
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_circular_image_margin_top_profile_already_added : @dimen/space_0dp}"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.RoundedShape"
app:strokeColor="@color/component_color_profile_chooser_activity_avatar_border_color"
app:strokeWidth="1dp"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.RoundedShape"
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_circular_image_margin_top_profile_already_added : @dimen/space_0dp}"
profile:src="@{viewModel.profile.avatar}" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER_VERTICAL}"
android:orientation="vertical"
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}"
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_end_profile_not_added}">

<TextView
android:id="@+id/profile_name_text"
Expand All @@ -70,7 +70,6 @@
android:text="@{viewModel.profile.name}"
android:textColor="@color/component_color_profile_chooser_activity_white_text_color"
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_name_margin_top_profile_already_added : @dimen/space_0dp}" />

<!-- Note: The style set here is without the Gravity property, as the gravity set for this TextView is conditional and its not doable through styles. -->
<TextView
android:id="@+id/profile_last_visited"
Expand All @@ -83,7 +82,6 @@
android:visibility="@{viewModel.profile.lastLoggedInTimestampMs > 0 ? View.VISIBLE : View.GONE}"
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_last_visited_margin_top_profile_already_added : @dimen/profile_chooser_profile_view_last_visited_margin_top_profile_not_added}"
profile:lastVisited="@{viewModel.profile.lastLoggedInTimestampMs}" />

<!-- Note: The style set here is without the Gravity property, as the gravity set for this TextView is conditional and its not doable through styles. -->
<TextView
android:id="@+id/profile_is_admin_text"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/coming_soon_topic_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
android:layout_width="144dp"
android:layout_height="wrap_content"
app:cardCornerRadius="4dp"
app:layoutMarginEnd="@{viewModel.endMargin}">
app:layoutMarginEnd="@{viewModel.endMargin}"
app:cardBackgroundColor="@android:color/transparent">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/completed_story_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
android:clickable="true"
android:focusable="true"
android:onClick="@{(v) -> viewModel.onCompletedStoryItemClicked()}"
app:cardBackgroundColor="@android:color/transparent"
app:cardCornerRadius="4dp"
app:cardElevation="4dp">

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/ongoing_topic_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
android:clickable="true"
android:focusable="true"
android:onClick="@{(v) -> viewModel.onTopicItemClicked()}"
app:cardBackgroundColor="@android:color/transparent"
app:cardCornerRadius="4dp"
app:cardElevation="4dp">

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/promoted_story_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
android:layout_marginStart="@dimen/promoted_story_card_layout_margin_start"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:cardBackgroundColor="@android:color/transparent"
app:cardCornerRadius="4dp"
app:cardElevation="4dp"
app:promotedStoryIndex="@{viewModel.index}">
Expand All @@ -25,8 +26,7 @@
android:id="@+id/promoted_story_card_container"
android:layout_width="@{viewModel.computeLayoutWidth(), default=match_parent}"
android:layout_height="wrap_content"
android:onClick="@{(v) -> viewModel.clickOnStoryTile()}"
app:roundedRectDrawableWithColor="@{viewModel.promotedStory.lessonThumbnail.backgroundColorRgb}">
android:onClick="@{(v) -> viewModel.clickOnStoryTile()}">

<org.oppia.android.app.customview.LessonThumbnailImageView
android:id="@+id/lesson_thumbnail"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/topic_summary_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
android:id="@+id/topic_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@android:color/transparent"
app:cardCornerRadius="4dp"
app:layoutMarginBottom="@{@dimen/topic_list_item_margin_top_bottom}"
app:layoutMarginEnd="@{viewModel.computeEndMargin()}"
Expand Down

0 comments on commit 21dd212

Please sign in to comment.