-
Notifications
You must be signed in to change notification settings - Fork 506
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 #2093: [Mobile-Landscape] High-fi StoryActivity Updated UI #2685
Conversation
@FareesHussain are there any changes, I should make? |
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.
@anshbajpai Add few comments please check
Update the PR description add Fixes #2093
android:fontFamily="sans-serif-medium" | ||
android:fontFamily="sans-serif" |
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.
Is this change according to the mock.
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.
no, the mock uses Roboto font, but I used sans-serif as it was being used earlier. Can I change it to Roboto?
android:maxLines="2" | ||
android:text="@{String.format(@string/chapter_name, (viewModel.index + 1), viewModel.name)}" | ||
android:text="@{titleContent}" |
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.
Why are you updating the title here. The issue is only related to the borders right.
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.
yeah, but also if some pre-requisites are not completed, the title has to be changed to - "to unlock this chapter, you have to finish this chapter", hence I used the title here
str, | ||
binding.chapterTitle | ||
) | ||
|
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.
Remove this extra line. This is causing the lint test error.
To avoid this I suggest to setup the ktlint pre-push for the project
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.
sure
val str = if (storyItemViewModel.chapterSummary.chapterPlayState == | ||
ChapterPlayState.NOT_PLAYABLE_MISSING_PREREQUISITES | ||
) { | ||
String.format( | ||
HtmlCompat.toHtml( | ||
SpannedString | ||
.valueOf(view.context.getText(R.string.unlock_chapter)), | ||
HtmlCompat.TO_HTML_PARAGRAPH_LINES_CONSECUTIVE | ||
), | ||
storyItemViewModel.index, | ||
storyItemViewModel.missingPrerequisiteChapter.name | ||
) | ||
} else { | ||
String.format( | ||
HtmlCompat.toHtml( | ||
SpannedString.valueOf( | ||
view.context | ||
.getText(R.string.chapter_name) | ||
), | ||
HtmlCompat.TO_HTML_PARAGRAPH_LINES_CONSECUTIVE | ||
), | ||
storyItemViewModel.index + 1, | ||
storyItemViewModel.name | ||
) | ||
} | ||
binding.storyChapterCard.strokeWidth = | ||
when (storyItemViewModel.chapterSummary.chapterPlayState) { | ||
ChapterPlayState.NOT_PLAYABLE_MISSING_PREREQUISITES -> | ||
view.context.resources.getDimension(R.dimen.space_0dp).toInt() | ||
else -> | ||
view.context.resources.getDimension(R.dimen.story_chapter_stroke_width).toInt() | ||
} | ||
binding.titleContent = | ||
htmlParserFactory.create( | ||
resourceBucketName, | ||
entityType, | ||
storyItemViewModel.storyId, | ||
imageCenterAlign = true | ||
).parseOppiaHtml( | ||
str, | ||
binding.chapterTitle | ||
) |
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 can be done with Data binding only, we want to abstract away this as much as possible, so try doing it with data binding only.
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.
Sure.
@prayutsu I have updated the code and now it's only using data binding |
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.
There are some issues with the mocks. Adding @mschanteltc for clarifications:
- In the locked chapter the portrait mock contains Chapter name and landscape mode does not which is inconsistent especially for A11y cases. So I think we should add Chapter name title in both cases.
- In the statement "Complete Chapter 2: The Meaning of “Equal Parts” to unlock this chapter." we are using two types of fonts: Regular and Medium. Is this possible to update this to Regular and Bold so that it because easy on android side to implement this.
@mschanteltc WDYT about above points?
<!-- android:layout_marginBottom="8dp"--> | ||
<!-- android:background="@color/chapterCardShadow"--> | ||
<!-- android:padding="8dp"--> | ||
<!-- android:visibility="@{viewModel.chapterSummary.chapterPlayState == ChapterPlayState.NOT_PLAYABLE_MISSING_PREREQUISITES ? View.VISIBLE : View.INVISIBLE}" />--> |
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.
Remove these comments.
app/src/main/res/values/strings.xml
Outdated
@@ -64,6 +64,7 @@ | |||
<string name="chapter_name">Chapter %s: %s</string> | |||
<string name="chapter_completed">Chapter %s: %s is completed.</string> | |||
<string name="chapter_prerequisite_title_label">Complete Chapter %s: %s to unlock this chapter.</string> | |||
<string name="empty_string"> </string> |
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.
This is not correct. We should not use empty_strings
.
@@ -422,4 +423,6 @@ | |||
</string> | |||
<string name="smallest_text_size_content_description">Smallest text size</string> | |||
<string name="largest_text_size_content_description">Largest text size</string> | |||
<string name="unlock_chapter">"Complete <![CDATA[<b>Chapter %s: %s</b>]]> to unlock this chapter."</string> | |||
<string name="chapter_land_name"><![CDATA[<b>Chapter %s: %s</b>]]></string> |
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.
This is incorrect. Making the text bold is not same as Roboto-Medium
.
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.
@rt4914 I agree, but I was not sure whether I can use Roboto-Medium or not, as it's an external font
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.
This solution will work for now.
|
@mschanteltc @rt4914 should I change the font to Roboto for the landscape version according to the mock, if yes - should I add the font as a downloadable font or simply add it in the project ? |
@mschanteltc We can do that but the technical cost might be too much which might not be needed for this feature. Adding @BenHenning for his input. @BenHenning Do you think we should apply what Chantel has suggested? |
@rt4914 I think that might be a nice stretch project, but shouldn't be a hard blocker. It can be implemented similarly to how we implement non-interactive links elsewhere in the app (e.g. using a custom tag). It seems like a nice improvement. |
@anshbajpai Have a look at this mock: https://xd.adobe.com/view/e8aa4198-3940-47f9-514a-f41cc54457f6-9e9b/screen/5abb0ace-19ee-48b8-8154-919154f924d2/ As per the third card in this. The |
@anshbajpai any updates on this? |
yeah , i am working on it, will update the pr in 1 - 2 days probably |
@anshbajpai Any updates on this? |
Closing this because of no updates in 2 weeks. |
Explanation
Fixes #2093
![Incomplete1](https://user-images.githubusercontent.com/65030524/107658227-ed37da00-6cab-11eb-9953-483dec6918c5.jpeg)
![Complete1](https://user-images.githubusercontent.com/65030524/107658245-f163f780-6cab-11eb-933a-eb66940134ef.jpeg)
Updated, landscape UI according to the given changes.
Updated Screenshots:
Checklist