Skip to content

Commit

Permalink
Fixes #4193: Added dark mode support to ProfileProgressActivity, Rece…
Browse files Browse the repository at this point in the history
…ntlyPlayedActivity, CompletedStoryListActivity and OngoingTopicListActivity (#4612)

* dark mode to profile_progress, recently_played, topics_in_progress and completed_stories

* nit changes

* removed duplicate colors

* removed duplicate colors
  • Loading branch information
bhaktideshmukh authored Oct 6, 2022
1 parent 8892584 commit 49babed
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 37 deletions.
16 changes: 9 additions & 7 deletions app/src/main/res/layout-land/profile_progress_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
android:layout_marginTop="12dp"
android:fontFamily="sans-serif-medium"
android:text="@{viewModel.profile.name}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_profile_name_text_color"
android:textSize="28sp"
app:layout_constraintEnd_toEndOf="@id/completed_stories_container"
app:layout_constraintStart_toStartOf="@+id/ongoing_topics_container"
Expand All @@ -74,6 +74,7 @@
android:clickable="@{viewModel.ongoingTopicCount > 0}"
android:importantForAccessibility="yes"
android:onClick="@{() -> viewModel.clickOnOngoingTopicCount()}"
app:cardBackgroundColor="@color/component_color_profile_progress_activity_stories_progress_background_color"
app:cardElevation="4dp"
app:contentPadding="8dp"
app:layout_constraintEnd_toStartOf="@+id/completed_stories_container"
Expand All @@ -96,7 +97,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@{Integer.toString(viewModel.ongoingTopicCount)}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="24sp" />

<TextView
Expand All @@ -106,7 +107,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@{viewModel.ongoingTopicCount != 1 ? @string/topics_in_progress : @string/topic_in_progress}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="12sp" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
Expand All @@ -122,6 +123,7 @@
android:clickable="@{viewModel.completedStoryCount > 0}"
android:importantForAccessibility="yes"
android:onClick="@{() -> viewModel.clickOnCompletedStoryCount()}"
app:cardBackgroundColor="@color/component_color_profile_progress_activity_stories_progress_background_color"
app:cardElevation="4dp"
app:contentPadding="8dp"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -144,7 +146,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@{Integer.toString(viewModel.completedStoryCount)}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="24sp" />

<TextView
Expand All @@ -154,7 +156,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@{viewModel.completedStoryCount != 1 ? @string/stories_completed : @string/story_completed}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="12sp" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
Expand All @@ -168,7 +170,7 @@
android:fontFamily="sans-serif-medium"
android:minHeight="48dp"
android:text="@string/recently_played_stories"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_recently_played_stories_text_color"
android:textSize="18sp"
android:visibility="@{viewModel.headerTextVisibility}"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -185,7 +187,7 @@
android:onClick="@{() -> viewModel.clickOnViewAll()}"
android:text="@string/view_all"
android:textAllCaps="true"
android:textColor="@color/oppia_primary"
android:textColor="@color/component_color_profile_progress_activity_view_all_text_color"
android:textSize="14sp"
android:visibility="@{viewModel.viewAllButtonVisibility}"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
16 changes: 9 additions & 7 deletions app/src/main/res/layout-sw600dp/profile_progress_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
android:layout_marginEnd="@dimen/profile_name_text_view_layout_margin_end"
android:fontFamily="sans-serif-medium"
android:text="@{viewModel.profile.name}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_profile_name_text_color"
android:textSize="28sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/profile_edit_image"
Expand All @@ -75,6 +75,7 @@
android:clickable="@{viewModel.ongoingTopicCount > 0}"
android:importantForAccessibility="yes"
android:onClick="@{() -> viewModel.clickOnOngoingTopicCount()}"
app:cardBackgroundColor="@color/component_color_profile_progress_activity_stories_progress_background_color"
app:cardElevation="4dp"
app:contentPadding="8dp"
app:layout_constraintEnd_toStartOf="@+id/completed_stories_container"
Expand All @@ -97,7 +98,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@{Integer.toString(viewModel.ongoingTopicCount)}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="24sp" />

<TextView
Expand All @@ -107,7 +108,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@{viewModel.ongoingTopicCount != 1 ? @string/topics_in_progress : @string/topic_in_progress}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="12sp" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
Expand All @@ -122,6 +123,7 @@
android:clickable="@{viewModel.completedStoryCount > 0}"
android:importantForAccessibility="yes"
android:onClick="@{() -> viewModel.clickOnCompletedStoryCount()}"
app:cardBackgroundColor="@color/component_color_profile_progress_activity_stories_progress_background_color"
app:cardElevation="4dp"
app:contentPadding="8dp"
app:layout_constraintEnd_toEndOf="@+id/profile_name_text_view"
Expand All @@ -144,7 +146,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@{Integer.toString(viewModel.completedStoryCount)}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="24sp" />

<TextView
Expand All @@ -154,7 +156,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@{viewModel.completedStoryCount != 1 ? @string/stories_completed : @string/story_completed}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="12sp" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
Expand All @@ -169,7 +171,7 @@
android:fontFamily="sans-serif-medium"
android:minHeight="48dp"
android:text="@string/recently_played_stories"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="18sp"
android:visibility="@{viewModel.headerTextVisibility}"
app:layout_constraintEnd_toStartOf="@+id/view_all_text_view"
Expand All @@ -188,7 +190,7 @@
android:onClick="@{() -> viewModel.clickOnViewAll()}"
android:text="@string/view_all"
android:textAllCaps="true"
android:textColor="@color/oppia_primary"
android:textColor="@color/component_color_profile_progress_activity_view_all_text_color"
android:textSize="14sp"
android:visibility="@{viewModel.viewAllButtonVisibility}"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/completed_story_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_def_white"
android:background="@color/component_color_completed_progress_activity_completed_story_card_color"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -69,7 +69,7 @@
android:maxLines="2"
android:minLines="2"
android:text="@{viewModel.completedStoryName}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_completed_progress_activity_completed_story_card_text_color"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -90,7 +90,7 @@
android:paddingBottom="12dp"
android:text="@{viewModel.topicName}"
android:textAllCaps="true"
android:textColor="@color/color_def_oppia_stroke_black"
android:textColor="@color/component_color_completed_progress_activity_completed_story_card_text_color"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/completed_story_name_text_view" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/completed_story_list_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_def_white">
android:background="@color/component_color_completed_progress_activity_background_color">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/completed_story_list_app_bar_layout"
Expand All @@ -27,7 +27,7 @@
android:id="@+id/completed_story_list_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:background="@color/component_color_completed_progress_activity_toolbar_color"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
app:navigationContentDescription="@string/navigate_up"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/ongoing_story_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_def_white"
android:background="@color/component_color_recently_played_activity_recently_played_story_card_color"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -65,6 +65,7 @@
android:ellipsize="end"
android:lines="2"
android:text="@{viewModel.storyTitle}"
android:textColor="@color/component_color_recently_played_activity_recently_played_story_card_text_color"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -82,6 +83,7 @@
android:fontFamily="sans-serif-light"
android:maxLines="1"
android:text="@{viewModel.topicTitle}"
android:textColor="@color/component_color_recently_played_activity_recently_played_story_card_text_color"
android:textAllCaps="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/ongoing_topic_list_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_def_white">
android:background="@color/component_color_ongoing_progress_activity_background_color">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/ongoing_topic_list_app_bar_layout"
Expand All @@ -27,7 +27,7 @@
android:id="@+id/ongoing_topic_list_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:background="@color/component_color_ongoing_progress_activity_toolbar_color"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
app:navigationContentDescription="@string/navigate_up"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/profile_progress_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/component_color_profile_progress_activity_background_color">

<FrameLayout
android:layout_width="match_parent"
Expand Down
16 changes: 9 additions & 7 deletions app/src/main/res/layout/profile_progress_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
android:layout_marginTop="12dp"
android:fontFamily="sans-serif-medium"
android:text="@{viewModel.profile.name}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_profile_name_text_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/completed_stories_container"
app:layout_constraintStart_toStartOf="@+id/ongoing_topics_container"
Expand All @@ -76,6 +76,7 @@
android:clickable="@{viewModel.ongoingTopicCount > 0}"
android:importantForAccessibility="yes"
android:onClick="@{() -> viewModel.clickOnOngoingTopicCount()}"
app:cardBackgroundColor="@color/component_color_profile_progress_activity_stories_progress_background_color"
app:cardElevation="2dp"
app:contentPadding="8dp"
app:layout_constraintEnd_toStartOf="@+id/completed_stories_container"
Expand All @@ -98,7 +99,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@{Integer.toString(viewModel.ongoingTopicCount)}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="24sp" />

<TextView
Expand All @@ -109,7 +110,7 @@
android:fontFamily="sans-serif"
android:minWidth="60dp"
android:text="@{viewModel.ongoingTopicCount != 1 ? @string/topics_in_progress : @string/topic_in_progress}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="12sp" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
Expand All @@ -124,6 +125,7 @@
android:clickable="@{viewModel.completedStoryCount > 0}"
android:importantForAccessibility="yes"
android:onClick="@{() -> viewModel.clickOnCompletedStoryCount()}"
app:cardBackgroundColor="@color/component_color_profile_progress_activity_stories_progress_background_color"
app:cardElevation="2dp"
app:contentPadding="8dp"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -146,7 +148,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@{Integer.toString(viewModel.completedStoryCount)}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="24sp" />

<TextView
Expand All @@ -157,7 +159,7 @@
android:fontFamily="sans-serif"
android:minWidth="60dp"
android:text="@{viewModel.completedStoryCount != 1 ? @string/stories_completed : @string/story_completed}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="12sp" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
Expand All @@ -172,7 +174,7 @@
android:fontFamily="sans-serif-medium"
android:minHeight="48dp"
android:text="@string/recently_played_stories"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_profile_progress_activity_recently_played_stories_text_color"
android:textSize="18sp"
android:visibility="@{viewModel.headerTextVisibility}"
app:layout_constraintEnd_toStartOf="@+id/view_all_text_view"
Expand All @@ -192,7 +194,7 @@
android:onClick="@{() -> viewModel.clickOnViewAll()}"
android:text="@string/view_all"
android:textAllCaps="true"
android:textColor="@color/oppia_primary"
android:textColor="@color/component_color_profile_progress_activity_view_all_text_color"
android:textSize="14sp"
android:visibility="@{viewModel.viewAllButtonVisibility}"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_def_white"
android:background="@color/component_color_recently_played_activity_recently_played_story_card_color"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -65,7 +65,7 @@
android:fontFamily="sans-serif"
android:lines="2"
android:text="@{viewModel.storyTitle}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_recently_played_activity_recently_played_story_card_text_color"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -86,7 +86,7 @@
android:maxLines="1"
android:text="@{viewModel.topicTitle}"
android:textAllCaps="true"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_recently_played_activity_recently_played_story_card_text_color"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
Empty file modified app/src/main/res/layout/promoted_story_list.xml
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/recently_played_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_def_white"
android:background="@color/component_color_recently_played_activity_background_color"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/section_title.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
android:layout_marginEnd="@dimen/section_title_text_view_layout_margin_end"
android:fontFamily="sans-serif-medium"
android:text="@{viewModel.sectionTitleText}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_recently_played_activity_section_title_color"
android:textSize="18sp" />
</LinearLayout>
</layout>
Loading

0 comments on commit 49babed

Please sign in to comment.