Skip to content

Commit

Permalink
Fixed oppia#4147 : Remove colors_migrating.xml post dark mode impleme…
Browse files Browse the repository at this point in the history
…ntation. (oppia#4876)

<!-- READ ME FIRST: Please fill in the explanation section below and
check off every point from the Essential Checklist! -->
## Explanation

Fixed oppia#4147 : Remove colors_migrating.xml post dark mode implementation.

<!--
- 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: ...".)
- [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))
- Add a screenshot demonstrating that you ran affected Espresso tests
locally & that they're passing
  • Loading branch information
MohitGupta121 authored and supreme96 committed Feb 24, 2023
1 parent 9c65e3b commit 7626f48
Show file tree
Hide file tree
Showing 45 changed files with 193 additions and 283 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ gradlew.bat @BenHenning
# All resource files.
/app/src/main/res/**/*.xml @rt4914
/utility/src/main/res/**/*.xml @rt4914
/app/src/main/res/values/colors_migrating.xml @rt4914

# App UI strings.
/app/src/main/res/values*/strings.xml @BenHenning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor(
super.onDrawerOpened(drawerView)
fragment.activity!!.invalidateOptionsMenu()
StatusBarColor.statusBarColorUpdate(
R.color.slide_drawer_open_status_bar,
R.color.component_color_shared_slide_drawer_open_status_bar_color,
activity,
false
)
Expand All @@ -429,7 +429,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor(
super.onDrawerClosed(drawerView)
fragment.activity!!.invalidateOptionsMenu()
StatusBarColor.statusBarColorUpdate(
R.color.oppia_primary_dark,
R.color.component_color_shared_activity_status_bar_color,
activity,
false
)
Expand All @@ -456,7 +456,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor(
super.onDrawerOpened(drawerView)
fragment.activity!!.invalidateOptionsMenu()
StatusBarColor.statusBarColorUpdate(
R.color.slide_drawer_open_status_bar,
R.color.component_color_shared_slide_drawer_open_status_bar_color,
activity,
false
)
Expand All @@ -466,7 +466,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor(
super.onDrawerClosed(drawerView)
fragment.activity!!.invalidateOptionsMenu()
StatusBarColor.statusBarColorUpdate(
R.color.oppia_primary_dark,
R.color.component_color_shared_activity_status_bar_color,
activity,
false
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,27 +169,27 @@ class OnboardingFragmentPresenter @Inject constructor(
private fun onboardingStatusBarColorUpdate(position: Int) {
when (position) {
0 -> StatusBarColor.statusBarColorUpdate(
R.color.onboarding_1_status_bar,
R.color.component_color_onboarding_1_status_bar_color,
activity,
false
)
1 -> StatusBarColor.statusBarColorUpdate(
R.color.onboarding_2_status_bar,
R.color.component_color_onboarding_2_status_bar_color,
activity,
false
)
2 -> StatusBarColor.statusBarColorUpdate(
R.color.onboarding_3_status_bar,
R.color.component_color_onboarding_3_status_bar_color,
activity,
false
)
3 -> StatusBarColor.statusBarColorUpdate(
R.color.onboarding_4_status_bar,
R.color.component_color_onboarding_4_status_bar_color,
activity,
false
)
else -> StatusBarColor.statusBarColorUpdate(
R.color.oppia_primary_dark,
R.color.component_color_shared_activity_status_bar_color,
activity,
false
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ class AddProfileActivityPresenter @Inject constructor(
isFirstResource: Boolean
): Boolean {
uploadImageView.setColorFilter(
ResourcesCompat.getColor(activity.resources, R.color.avatar_background_11, null),
ResourcesCompat.getColor(
activity.resources,
R.color.color_def_avatar_background_11,
null
),
PorterDuff.Mode.DST_OVER
)
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,30 @@ import org.oppia.android.util.statusbar.StatusBarColor
import javax.inject.Inject

private val COLORS_LIST = listOf(
R.color.avatar_background_1,
R.color.avatar_background_2,
R.color.avatar_background_3,
R.color.avatar_background_4,
R.color.avatar_background_5,
R.color.avatar_background_6,
R.color.avatar_background_7,
R.color.avatar_background_8,
R.color.avatar_background_9,
R.color.avatar_background_10,
R.color.avatar_background_11,
R.color.avatar_background_12,
R.color.avatar_background_13,
R.color.avatar_background_14,
R.color.avatar_background_15,
R.color.avatar_background_16,
R.color.avatar_background_17,
R.color.avatar_background_18,
R.color.avatar_background_19,
R.color.avatar_background_20,
R.color.avatar_background_21,
R.color.avatar_background_22,
R.color.avatar_background_23,
R.color.avatar_background_24
R.color.color_def_avatar_background_1,
R.color.color_def_avatar_background_2,
R.color.color_def_avatar_background_3,
R.color.color_def_avatar_background_4,
R.color.color_def_avatar_background_5,
R.color.color_def_avatar_background_6,
R.color.color_def_avatar_background_7,
R.color.color_def_avatar_background_8,
R.color.color_def_avatar_background_9,
R.color.color_def_avatar_background_10,
R.color.color_def_avatar_background_11,
R.color.color_def_avatar_background_12,
R.color.color_def_avatar_background_13,
R.color.color_def_avatar_background_14,
R.color.color_def_avatar_background_15,
R.color.color_def_avatar_background_16,
R.color.color_def_avatar_background_17,
R.color.color_def_avatar_background_18,
R.color.color_def_avatar_background_19,
R.color.color_def_avatar_background_20,
R.color.color_def_avatar_background_21,
R.color.color_def_avatar_background_22,
R.color.color_def_avatar_background_23,
R.color.color_def_avatar_background_24
)

/** The presenter for [ProfileChooserFragment]. */
Expand All @@ -77,7 +77,9 @@ class ProfileChooserFragmentPresenter @Inject constructor(

/** Binds ViewModel and sets up RecyclerView Adapter. */
fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View? {
StatusBarColor.statusBarColorUpdate(R.color.profile_status_bar, activity, false)
StatusBarColor.statusBarColorUpdate(
R.color.component_color_shared_profile_status_bar_color, activity, false
)
binding = ProfileChooserFragmentBinding.inflate(
inflater,
container,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class ProfilePictureActivityPresenter @Inject constructor(
private lateinit var profileId: ProfileId

fun handleOnCreate(internalProfileId: Int) {
StatusBarColor.statusBarColorUpdate(R.color.profile_status_bar, activity, false)
StatusBarColor.statusBarColorUpdate(
R.color.component_color_shared_profile_status_bar_color, activity, false
)
val binding = DataBindingUtil
.setContentView<ProfilePictureActivityBinding>(
activity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class SpotlightFragment : InjectableFragment(), SpotlightNavigationListener, Spo
if (targetList.isNullOrEmpty()) return
spotlight = Spotlight.Builder(activity)
.setTargets(targetList)
.setBackgroundColorRes(R.color.spotlight_overlay_background)
.setBackgroundColorRes(R.color.component_color_shared_close_spotlight_button_color)
.setDuration(500L)
.setAnimation(AccelerateInterpolator(0.5f))
.setOnSpotlightListener(object : OnSpotlightListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ class WalkthroughActivityPresenter @Inject constructor(
presenter = this@WalkthroughActivityPresenter
lifecycleOwner = activity
}
StatusBarColor.statusBarColorUpdate(R.color.walkthrough_status_bar, activity, true)
StatusBarColor.statusBarColorUpdate(
R.color.component_color_walkthrough_activity_status_bar_color,
activity,
true
)
val currentFragmentIndex = getWalkthroughViewModel().currentProgress.get()?.minus(1)

if (currentFragmentIndex == -1 && getWalkthroughWelcomeFragment() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:topRightRadius="0dp" />
<gradient
android:angle="360"
android:endColor="@color/coming_soon_end"
android:startColor="@color/coming_soon_start"
android:endColor="@color/component_color_coming_soon_rect_background_end_color"
android:startColor="@color/component_color_coming_soon_rect_background_start_color"
android:type="linear" />
</shape>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:topRightRadius="4dp" />
<gradient
android:angle="360"
android:endColor="@color/coming_soon_end"
android:startColor="@color/coming_soon_start"
android:endColor="@color/component_color_coming_soon_rect_background_end_color"
android:startColor="@color/component_color_coming_soon_rect_background_start_color"
android:type="linear" />
</shape>

This file was deleted.

13 changes: 0 additions & 13 deletions app/src/main/res/drawable/edit_text_red_border.xml

This file was deleted.

4 changes: 0 additions & 4 deletions app/src/main/res/drawable/lesson_thumbnail_default.xml

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/drawable/profile_chooser_divider.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size android:height="1dp" />
<solid android:color="@color/oppia_profile_chooser_divider" />
<solid android:color="@color/component_color_shared_divider_color" />
</shape>
10 changes: 0 additions & 10 deletions app/src/main/res/drawable/reading_text_size_seekbar_thumb.xml

This file was deleted.

4 changes: 2 additions & 2 deletions app/src/main/res/drawable/rounded_corners_progress_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<item android:id="@android:id/background">
<shape>
<corners android:radius="8dp"/>
<solid android:color="@color/color_def_grey"/>
<solid android:color="@color/component_color_walkthrough_activity_rounded_corners_color"/>
</shape>
</item>

Expand All @@ -16,7 +16,7 @@
<scale android:scaleWidth="100%">
<shape>
<corners android:radius="8dp"/>
<solid android:color="@color/oppia_primary_dark"/>
<solid android:color="@color/component_color_shared_dialogs_secondary_color"/>
</shape>
</scale>
</item>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/seekbar_progress.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
android:shape="line">
<stroke
android:width="4dp"
android:color="@color/oppia_primary" />
android:color="@color/component_color_shared_secondary_6_text_color" />
</shape>
19 changes: 0 additions & 19 deletions app/src/main/res/drawable/start_button_primary_background.xml

This file was deleted.

16 changes: 8 additions & 8 deletions app/src/main/res/layout-land/walkthrough_final_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_marginStart="28dp"
app:srcCompat="@drawable/ic_portrait_onboarding_0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_portrait_onboarding_0" />

<LinearLayout
android:id="@+id/walkthrough_button_container"
Expand Down Expand Up @@ -56,7 +56,7 @@
android:layout_gravity="center_horizontal"
android:fontFamily="sans-serif"
android:text="@string/no"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="20sp" />

<TextView
Expand All @@ -67,7 +67,7 @@
android:layout_marginTop="40dp"
android:fontFamily="sans-serif"
android:text="@string/pick_a_different_topic"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="12sp" />
</com.google.android.material.card.MaterialCardView>

Expand All @@ -89,7 +89,7 @@
android:layout_gravity="center_horizontal"
android:fontFamily="sans-serif"
android:text="@string/yes"
android:textColor="@color/oppia_primary"
android:textColor="@color/component_color_shared_secondary_6_text_color"
android:textSize="20sp" />

<TextView
Expand All @@ -100,7 +100,7 @@
android:layout_marginTop="40dp"
android:fontFamily="sans-serif"
android:text="@string/lets_get_started"
android:textColor="@color/oppia_primary"
android:textColor="@color/component_color_shared_secondary_6_text_color"
android:textSize="12sp" />
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
Expand All @@ -113,7 +113,7 @@
android:layout_marginTop="4dp"
android:fontFamily="sans-serif"
android:text="@{viewModel.topicTitle}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/walkthrough_final_image_view"
Expand All @@ -126,7 +126,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@string/great"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/walkthrough_final_image_view"
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout-land/walkthrough_welcome_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="@{viewModel.profileName}"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/walkthrough_welcome_image_view"
Expand All @@ -47,7 +47,7 @@
android:layout_marginEnd="56dp"
android:fontFamily="sans-serif"
android:text="@string/walkthrough_welcome_description"
android:textColor="@color/oppia_primary_text"
android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/walkthrough_welcome_image_view"
Expand All @@ -58,10 +58,10 @@
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_marginStart="56dp"
app:srcCompat="@drawable/ic_portrait_onboarding_0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_portrait_onboarding_0" />

<Button
android:id="@+id/walkthrough_welcome_next_button"
Expand Down
Loading

0 comments on commit 7626f48

Please sign in to comment.