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 #4362, #1491: When reading text size is extra large, resume lesson page and revision tabs content is seen in normal size #5290
base: develop
Are you sure you want to change the base?
Conversation
@adhiamboperes, 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 @Vishwajith-Shettigar!!
Please update the PR description and add before/after screenshots for mobile and tablets so that I can verify that the solution works.
Unassigning @adhiamboperes since the review is done. |
Hi @Vishwajith-Shettigar, it looks like some changes were requested on this pull request by @adhiamboperes. PTAL. Thanks! |
Unassigning @Vishwajith-Shettigar since a re-review was requested. @Vishwajith-Shettigar, please make sure you have addressed all review comments. Thanks! |
@adhiamboperes, 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 @Vishwajith-Shettigar! This is an intyeresting solution.
I have some thoughts:
- When thinking about possible User journey, it seems less likely that a user may want to change the text size on the resume lesson page, and more that they would expect it to show the same as the text size they selected the last time they were in a lesson.
- As such, we would want to not add the option to change the text sie in the toolbar, but to retrieve the saved exploration reading text size, and apply it to this activity as well.
Please let me know if you have questions on how to go about this.
app/src/main/java/org/oppia/android/app/resumelesson/ResumeLessonActivity.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 @Vishwajith-Shettigar!
I have taken another full pass at this and left some comments. Most of them revolve around removing changes that do not contribute to the feature.
@@ -110,7 +110,6 @@ class ResumeLessonActivity : | |||
} | |||
|
|||
override fun onBackPressed() { | |||
super.onBackPressed() |
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.
I believe this is needed for this lifecycle method
} | ||
|
||
/** Action for onOptionsItemSelected. */ | ||
fun handleOnOptionsItemSelected(itemId: Int): Boolean { | ||
setReadingTextSizeMedium() |
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.
I think this should remain the same as the current selected font size, for consistency purposes.
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.
We are only scaling content of the app, i don't think scaling option or help activity is necessary.
Would like to hear your opinion.
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.
I don't really understand your comment in response to mine.
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.
If we remove setReadingTextSizeMedium()
from line no 135
, option activity and help activity font size will also scale.
Below i have attached screen recording, PTAL.
OptionActivity.webm
app/src/main/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivity.kt
Show resolved
Hide resolved
app/src/main/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivityPresenter.kt
Show resolved
Hide resolved
app/src/main/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivityPresenter.kt
Show resolved
Hide resolved
app/src/main/java/org/oppia/android/app/topic/revisioncard/RevisionCardFragmentPresenter.kt
Show resolved
Hide resolved
app/src/main/java/org/oppia/android/app/resumelesson/ResumeLessonActivity.kt
Show resolved
Hide resolved
@@ -87,6 +90,7 @@ class ResumeLessonActivity : | |||
parentScreen: ExplorationActivityParams.ParentScreen, | |||
isCheckpointingEnabled: Boolean | |||
) { | |||
resumeLessonActivityPresenter.setReadingTextSizeNormal() |
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.
I believe there is no need to reset the size here.
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.
If we don't set text size medium it will affect the exploration tool bar title text size.
Resume.webm
app/src/main/java/org/oppia/android/app/resumelesson/ResumeLessonActivityPresenter.kt
Show resolved
Hide resolved
app/src/main/java/org/oppia/android/app/resumelesson/ResumeLessonActivityPresenter.kt
Show resolved
Hide resolved
onView(withId(R.id.revision_card_explanation_text)).check( | ||
matches( | ||
withFontSize( | ||
round( | ||
context.resources.getDimension( | ||
R.dimen.revision_card_fragment_font_scale_content_extra_large_text_size | ||
) | ||
) | ||
) | ||
) | ||
) | ||
} | ||
} |
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.
In our discussion we had agreed to hardcode the values, e.g below.
onView(withId(R.id.revision_card_explanation_text)).check( | |
matches( | |
withFontSize( | |
round( | |
context.resources.getDimension( | |
R.dimen.revision_card_fragment_font_scale_content_extra_large_text_size | |
) | |
) | |
) | |
) | |
) | |
} | |
} | |
onView(withId(R.id.revision_card_explanation_text)).check( | |
matches( | |
withFontSize( | |
62.0F | |
) | |
) | |
) |
I came up with 62F by logging the calculated value in the FontSizeMatcher.kt
util class and checking logcat:
class FontSizeMatcher(private val expectedSize: Float) :
TypeSafeMatcher<View?>(View::class.java) {
override fun matchesSafely(target: View?): Boolean {
if (target !is TextView) {
return false
}
println("Textsize ${target.textSize}")
return target.textSize.equals(expectedSize)
}
You'll be able to find the appropriate values for other scale sizes too. Hope this helps.
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.
Thank you.
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.
I resolved some comments after verifying, and left some that I believe are still valid. PTAL.
Hi @Vishwajith-Shettigar, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
Hi @Vishwajith-Shettigar, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
Explanation
Fixes #4362
Fixes #1491
Support resizable reading text in resume lesson, question player and revision card.
Question Player
questionPLayer.webm
Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then: