-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2132: Chapter List Page Issues (#2232) - Blur and lock thumbnails of inactive cards. #2422
Conversation
@anandwana001 @BenHenning Please review first draft. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @viktoriias! Took a high-level pass & focused generally less on nits/readability.
app/src/main/java/org/oppia/android/app/customview/LessonThumbnailImageView.kt
Outdated
Show resolved
Hide resolved
domain/src/test/java/org/oppia/android/domain/topic/TopicControllerTest.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/parser/BlurTransformation.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/parser/ImageLoader.kt
Outdated
Show resolved
Hide resolved
@BenHenning PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @viktoriias! Other than the open questions around the blur transformation itself, I think this is looking good. Had some additional minor comments. Also, we should add tests for the new blurring behavior. To do this, I think you can provide a mock ImageLoader (e.g. using Mockito) by creating a test module rather than including GlideImageLoaderModule. By doing this, you can verify that the system being tested is properly blurring the image by verifying that it correctly passes the BLUR image transformation in the situations we're interested in.
I think just having tests for story_chapter_view is sufficient, but we should make sure to cover the portrait/landscape and handset/tablet scenarios (e.g. if any of the four XML files change, the tests should fail).
utility/src/main/java/org/oppia/android/util/parser/ImageLoader.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/parser/GlideImageLoader.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/android/app/customview/LessonThumbnailImageView.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/parser/BlurTransformation.kt
Outdated
Show resolved
Hide resolved
@BenHenning @anandwana001 I have some questions regarding testing. This PR is causing Another question is about StoryFragmentTest, where I believe I would add tests for new blurring behavior. I didn't realize StoryFragmentTest wasn't included in |
@viktoriias For Glide in testing, please have a look at this oppia-android/app/src/sharedTest/java/org/oppia/android/app/player/state/StateFragmentTest.kt Line 175 in 70c486f
Also need to check if our |
It's included oppia-android/.github/workflows/main.yml Line 106 in 70c486f
|
Oh, you're right. Found it and it failed with the same error: |
Both the tests are different. One is for port and one is for landscape. fun testRecentlyPlayedTestActivity_changeConfiguration_recyclerViewItem1_lessonThumbnailIsCorrect()
fun testRecentlyPlayedTestActivity_recyclerViewItem1_lessonThumbnailIsCorrect() |
Done.
Done, I included |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @viktoriias! This seems pretty close to being wrapped up. Just had a few nits.
Also, please note the failing Robolectric tests in CI.
utility/src/main/java/org/oppia/android/util/parser/GlideImageLoader.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/parser/TestGlideImageLoader.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/parser/TestGlideImageLoader.kt
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/story/StoryFragmentTest.kt
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/story/StoryFragmentTest.kt
Outdated
Show resolved
Hide resolved
…entTest.kt Co-authored-by: Ben Henning <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @viktoriias! Just nits left, then I think this will LGTM.
utility/src/main/java/org/oppia/android/util/parser/TestGlideImageLoader.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/parser/TestGlideImageLoader.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/parser/TestGlideImageLoader.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/parser/TestGlideImageLoader.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @viktoriias! This looks great!
Adding @rt4914 for codeowners. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks @viktoriias
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
Explanation
Fixes #2132. Here I blur and lock thumbnails of inactive cards.
LessonThumbnailImageView
loads images infun loadLessonThumbnail()
:Checklist
Test runs relevant to this PR: