Skip to content

Commit

Permalink
Fixes #4614: Changed the background color according to accessibility …
Browse files Browse the repository at this point in the history
…scanner. (#5392)

Fixed: Topic Images to match A11YS

<!-- READ ME FIRST: Please fill in the explanation section below and
check off every point from the Essential Checklist! -->
## Explanation
<!--
- 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)).

![WhatsApp Image 2024-04-29 at 01 53
15_47490bfd](https://github.com/oppia/oppia-android/assets/109421165/23c23922-2727-40dc-98c1-128244751c1b)

![WhatsApp Image 2024-05-01 at 00 30
21_96db2eb5](https://github.com/oppia/oppia-android/assets/109421165/80fed08a-8a6c-449c-969e-335f05cea496)

The topic and recently played images no longer have an issue with the
Accessibility Checker.

This is a fix. Resolves
#4614
  • Loading branch information
suyashshenoi authored May 7, 2024
1 parent a0deeea commit 60ed74c
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ import javax.inject.Singleton
private const val ONE_WEEK_IN_DAYS = 7

private const val TOPIC_BG_COLOR = "#C6DCDA"
private const val BAKER_BG_COLOR = "#0F63A3"
private const val DUCK_BG_COLOR = "#05538F"

private const val CHAPTER_BG_COLOR_1 = "#F8BF74"
private const val CHAPTER_BG_COLOR_2 = "#D68F78"
Expand Down Expand Up @@ -875,7 +877,7 @@ internal fun createTopicThumbnail0(): LessonThumbnail {
internal fun createTopicThumbnail1(): LessonThumbnail {
return LessonThumbnail.newBuilder()
.setThumbnailGraphic(LessonThumbnailGraphic.DUCK_AND_CHICKEN)
.setBackgroundColorRgb(Color.parseColor(TOPIC_BG_COLOR))
.setBackgroundColorRgb(Color.parseColor(DUCK_BG_COLOR))
.build()
}

Expand All @@ -889,7 +891,7 @@ internal fun createTopicThumbnail2(): LessonThumbnail {
internal fun createTopicThumbnail3(): LessonThumbnail {
return LessonThumbnail.newBuilder()
.setThumbnailGraphic(LessonThumbnailGraphic.BAKER)
.setBackgroundColorRgb(Color.parseColor(TOPIC_BG_COLOR))
.setBackgroundColorRgb(Color.parseColor(BAKER_BG_COLOR))
.build()
}

Expand All @@ -903,7 +905,7 @@ internal fun createDefaultStoryThumbnail(): LessonThumbnail {
internal fun createStoryThumbnail0(): LessonThumbnail {
return LessonThumbnail.newBuilder()
.setThumbnailGraphic(LessonThumbnailGraphic.DUCK_AND_CHICKEN)
.setBackgroundColorRgb(0xa5d3ec)
.setBackgroundColorRgb(0x0F63A3)
.build()
}

Expand All @@ -924,7 +926,7 @@ internal fun createStoryThumbnail2(): LessonThumbnail {
internal fun createStoryThumbnail3(): LessonThumbnail {
return LessonThumbnail.newBuilder()
.setThumbnailGraphic(LessonThumbnailGraphic.BAKER)
.setBackgroundColorRgb(0xa5a2d3)
.setBackgroundColorRgb(0x0F63A3)
.build()
}

Expand All @@ -945,7 +947,7 @@ internal fun createChapterThumbnail0(): LessonThumbnail {
internal fun createChapterThumbnail1(): LessonThumbnail {
return LessonThumbnail.newBuilder()
.setThumbnailGraphic(LessonThumbnailGraphic.DUCK_AND_CHICKEN)
.setBackgroundColorRgb(Color.parseColor(CHAPTER_BG_COLOR_2))
.setBackgroundColorRgb(Color.parseColor(DUCK_BG_COLOR))
.build()
}

Expand All @@ -966,21 +968,21 @@ internal fun createChapterThumbnail3(): LessonThumbnail {
internal fun createChapterThumbnail4(): LessonThumbnail {
return LessonThumbnail.newBuilder()
.setThumbnailGraphic(LessonThumbnailGraphic.BAKER)
.setBackgroundColorRgb(Color.parseColor(CHAPTER_BG_COLOR_1))
.setBackgroundColorRgb(Color.parseColor(BAKER_BG_COLOR))
.build()
}

internal fun createChapterThumbnail5(): LessonThumbnail {
return LessonThumbnail.newBuilder()
.setThumbnailGraphic(LessonThumbnailGraphic.DUCK_AND_CHICKEN)
.setBackgroundColorRgb(Color.parseColor(CHAPTER_BG_COLOR_2))
.setBackgroundColorRgb(Color.parseColor(DUCK_BG_COLOR))
.build()
}

internal fun createChapterThumbnail8(): LessonThumbnail {
return LessonThumbnail.newBuilder()
.setThumbnailGraphic(LessonThumbnailGraphic.DUCK_AND_CHICKEN)
.setBackgroundColorRgb(Color.parseColor(CHAPTER_BG_COLOR_1))
.setBackgroundColorRgb(Color.parseColor(DUCK_BG_COLOR))
.build()
}

Expand Down

0 comments on commit 60ed74c

Please sign in to comment.