Skip to content
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 part of #2132: Chapter List Page Issues #2232

Merged
merged 18 commits into from
Dec 17, 2020
Merged

Fix part of #2132: Chapter List Page Issues #2232

merged 18 commits into from
Dec 17, 2020

Conversation

viktoriias
Copy link
Contributor

@viktoriias viktoriias commented Dec 7, 2020

@anandwana001 PTAL

Explanation

Fixes part of #2132

  • Elevate the inactive cards
  • Active cards show full description.
  • Inactive cards should show Chapter name and description show prerequisites to unlock it.
  • Blur thumbnails of inactive cards

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @viktoriias for your first Pull Request.

Added a few changes, PTAL

app/src/main/res/layout/story_chapter_view.xml Outdated Show resolved Hide resolved
app/src/main/res/layout/story_chapter_view.xml Outdated Show resolved Hide resolved
app/src/main/res/layout/story_chapter_view.xml Outdated Show resolved Hide resolved
app/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
@anandwana001 anandwana001 removed their assignment Dec 7, 2020
@prayutsu
Copy link
Contributor

prayutsu commented Dec 7, 2020

@viktoriias Can you please update the PR title to follow our conventional format?
e.g. - Fix part of #2132: Chapter List Page Issues

@viktoriias viktoriias changed the title Fix part of #2132 Fix part of #2132: Chapter List Page Issues Dec 7, 2020
@anandwana001
Copy link
Contributor

anandwana001 commented Dec 8, 2020

@viktoriias no changes required in .idea/codeStyles/Project.xml file.

@viktoriias
Copy link
Contributor Author

@viktoriias no changes required in .idea/codeStyles/Project.xml file.
How do I remove this file from here?

@anandwana001
Copy link
Contributor

@viktoriias no changes required in .idea/codeStyles/Project.xml file.
How do I remove this file from here?

https://stackoverflow.com/questions/36763274/how-to-remove-a-file-from-git-pull-request/42405903
This might help, removing an unwanted file from a pull request.

@viktoriias
Copy link
Contributor Author

viktoriias commented Dec 8, 2020

@viktoriias no changes required in .idea/codeStyles/Project.xml file.
How do I remove this file from here?

https://stackoverflow.com/questions/36763274/how-to-remove-a-file-from-git-pull-request/42405903
This might help, removing an unwanted file from a pull request.

Ok thanks, I think I removed it.

@BenHenning BenHenning self-assigned this Dec 10, 2020
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @viktoriias! I think this is a great start. I have a few comments, one of which will required changes to part of the overall approach.

Beyond that, can you also add a test to verify that the previous chapter text is correctly computed & used in the expected cases?

@BenHenning BenHenning removed their assignment Dec 10, 2020
Remove blurring thumbnails of inactive cards - this change will be done separately.
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @viktoriias! As a reminder, please also add a test to verify these changes. And, can you please take a look at @anandwana001's reply to my comment thread above about the data potentially being empty in some cases? (I think this might be intentional & correct, but I haven't looked the case closely).

model/src/main/proto/topic.proto Outdated Show resolved Hide resolved
app/src/main/res/layout-land/story_chapter_view.xml Outdated Show resolved Hide resolved
@BenHenning BenHenning removed their assignment Dec 12, 2020
@viktoriias
Copy link
Contributor Author

Thanks @viktoriias. Overall, this looks great! I have one nit, and one main comment: you added a test for TopicControllerTest, but can you also add a UI-facing test to make sure the binding logic in story_chapter_view is tested? I think that would require a new test in StoryFragmentTest. Please add a test for both portrait & landscape (the latter can be done by changing orientation--see testStoryFragment_changeConfiguration_chapterSummaryIsShownCorrectly).

I looked into this test file initially, per @anandwana001's advice. It marks first story as completed, so prerequisite didn't show up. I'll need to remove markPartialStoryProgressForFractions to be able to test summary for the second story.

@anandwana001
Copy link
Contributor

Thanks @viktoriias. Overall, this looks great! I have one nit, and one main comment: you added a test for TopicControllerTest, but can you also add a UI-facing test to make sure the binding logic in story_chapter_view is tested? I think that would require a new test in StoryFragmentTest. Please add a test for both portrait & landscape (the latter can be done by changing orientation--see testStoryFragment_changeConfiguration_chapterSummaryIsShownCorrectly).

I looked into this test file initially, per @anandwana001's advice. It marks first story as completed, so prerequisite didn't show up. I'll need to remove markPartialStoryProgressForFractions to be able to test summary for the second story.

Removing markPartialStoryProgressForFractions might cause failure for other test. I think what we can do here is to shift it from the @Before to all the required test before launching the test. This way we can have test specific weather or not we require partial progress.

@viktoriias
Copy link
Contributor Author

viktoriias commented Dec 15, 2020

Thanks @viktoriias. Overall, this looks great! I have one nit, and one main comment: you added a test for TopicControllerTest, but can you also add a UI-facing test to make sure the binding logic in story_chapter_view is tested? I think that would require a new test in StoryFragmentTest. Please add a test for both portrait & landscape (the latter can be done by changing orientation--see testStoryFragment_changeConfiguration_chapterSummaryIsShownCorrectly).

I looked into this test file initially, per @anandwana001's advice. It marks first story as completed, so prerequisite didn't show up. I'll need to remove markPartialStoryProgressForFractions to be able to test summary for the second story.

Removing markPartialStoryProgressForFractions might cause failure for other test. I think what we can do here is to shift it from the @Before to all the required test before launching the test. This way we can have test specific weather or not we require partial progress.

It only affects testStoryFragment_correctStoryCountLoadedInHeader test: 1 of 2 Chapters Completed -> 0 of 2 Chapters Completed. I think it's fine to remove it, let me know what you think.

@anandwana001
Copy link
Contributor

anandwana001 commented Dec 15, 2020

Thanks @viktoriias. Overall, this looks great! I have one nit, and one main comment: you added a test for TopicControllerTest, but can you also add a UI-facing test to make sure the binding logic in story_chapter_view is tested? I think that would require a new test in StoryFragmentTest. Please add a test for both portrait & landscape (the latter can be done by changing orientation--see testStoryFragment_changeConfiguration_chapterSummaryIsShownCorrectly).

I looked into this test file initially, per @anandwana001's advice. It marks first story as completed, so prerequisite didn't show up. I'll need to remove markPartialStoryProgressForFractions to be able to test summary for the second story.

Removing markPartialStoryProgressForFractions might cause failure for other test. I think what we can do here is to shift it from the @Before to all the required test before launching the test. This way we can have test specific weather or not we require partial progress.

It only affects testStoryFragment_correctStoryCountLoadedInHeader test: 1 of 2 Chapters Completed -> 0 of 2 Chapters Completed. I think it's fine to remove it, let me know what you think.

Sounds good, we can shift it to the test before the launch and check if all the tests are passing on espresso and robolectric.

@BenHenning BenHenning self-assigned this Dec 15, 2020
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @viktoriias! Overall, the PR LGTM. Just have one more comment from me to address.

@BenHenning BenHenning removed their assignment Dec 16, 2020
@viktoriias
Copy link
Contributor Author

@anandwana001 please review

Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the UI test cases, Thanks @viktoriias

Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last nit change. Fix ktlint issues.
LGTM, Thanks @viktoriias

Also, just for the future reference, please add 2 screenshots showing that all the tests are passing on Espresso and Robolectric.

@anandwana001 anandwana001 removed their assignment Dec 16, 2020
@viktoriias
Copy link
Contributor Author

Passing tests:
Screen Shot 2020-12-16 at 11 27 57 AM

@anandwana001
Copy link
Contributor

Adding @BenHenning for final merge.

@viktoriias
Copy link
Contributor Author

StoryFragmentTest Robolectric:
Screen Shot 2020-12-16 at 5 52 55 PM

Copy link
Member

@BenHenning BenHenning left a 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! Just one small comment, but otherwise LGTM.

@rt4914 or @anandwana001 feel free to merge this after the last comment is resolved if I miss it.

@anandwana001 anandwana001 merged commit f80a8c2 into oppia:develop Dec 17, 2020
@viktoriias viktoriias deleted the branch2 branch December 17, 2020 04:33
rt4914 pushed a commit that referenced this pull request Feb 3, 2021
…s of inactive cards. (#2422)

* Lock and blur

* Replace color/white with #FFFFFF

* Add \n

* Move isBlurred to LessonThumbnailImageView.

* Remove unused import.

* Move dependency on Glide away from from ImageLoader.

* Remove unneeded line.

* Refactor Transformation-related code, add KDocs.

* Renaming.

* Remove unused import.

* Reformat.

* Add Mockk test

* Add Mockk test - lint

* Add blurring tests.

* Mock ImageLoader in StoryActivityTest.

* Add delay before image loading.

* Nits and improvements.

* Remove unused import.

* Remove unused import.

* Set image resources in LessonThumbnailImageView in addition to calling GlideImageLoader.

* BlurTransformation re-write.

* BlurTransformation re-write.

* Add TestImageLoaderModule to some tests.

* Lint

* Add TestImageLoaderModule to more tests.

* Add TestImageLoaderModule to more tests.

* Update utility/src/main/java/org/oppia/android/util/parser/BlurTransformation.kt

Co-authored-by: Ben Henning <[email protected]>

* Update utility/src/main/java/org/oppia/android/util/parser/BlurTransformation.kt

Co-authored-by: Ben Henning <[email protected]>

* TestGlideImageLoader Refactor.

* Reformat.

* Reformat.

* Reformat.

* Nits and comments.

* Revert changes in landscape design.

* Change BlurTransformation to return a copy instead of 'toTransform'.

* Update app/src/sharedTest/java/org/oppia/android/app/story/StoryFragmentTest.kt

Co-authored-by: Ben Henning <[email protected]>

* Refactor TestGlideImageLoader.

* Nits

Co-authored-by: Ben Henning <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants