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
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class StoryViewModel @Inject constructor(
topicId,
storyId,
chapter,
if (index > 0) chapterList.get(index - 1).name else "",
entityType
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class StoryChapterSummaryViewModel(
val topicId: String,
val storyId: String,
val chapterSummary: ChapterSummary,
val previousChapterTitle: String,
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
val entityType: String
) : StoryItemViewModel() {
val explorationId: String = chapterSummary.explorationId
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/layout-land/story_chapter_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:ellipsize="end"
android:fontFamily="sans-serif"
android:maxLines="3"
android:text="@{htmlContent}"
android:text="@{viewModel.chapterSummary.chapterPlayState != ChapterPlayState.NOT_PLAYABLE_MISSING_PREREQUISITES ? htmlContent : String.format(@string/chapter_prerequisite, viewModel.index, viewModel.previousChapterTitle)}"
android:textColor="@color/oppiaPrimaryText"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/res/layout-sw600dp/story_chapter_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
android:id="@+id/chapter_thumbnail"
android:layout_width="match_parent"
android:layout_height="0dp"
android:alpha="@{viewModel.chapterSummary.chapterPlayState != ChapterPlayState.NOT_PLAYABLE_MISSING_PREREQUISITES ? 1.0f : 0.3f}"
android:scaleType="centerInside"
app:entityId="@{viewModel.storyId}"
app:entityType="@{viewModel.entityType}"
Expand Down Expand Up @@ -89,10 +90,8 @@
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:ellipsize="end"
android:fontFamily="sans-serif"
android:maxLines="4"
android:text="@{htmlContent}"
android:text="@{viewModel.chapterSummary.chapterPlayState != ChapterPlayState.NOT_PLAYABLE_MISSING_PREREQUISITES ? htmlContent : String.format(@string/chapter_prerequisite, viewModel.index, viewModel.previousChapterTitle)}"
android:textColor="@color/oppiaPrimaryText"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/res/layout/story_chapter_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
android:id="@+id/chapter_thumbnail"
android:layout_width="match_parent"
android:layout_height="0dp"
android:alpha="@{viewModel.chapterSummary.chapterPlayState != ChapterPlayState.NOT_PLAYABLE_MISSING_PREREQUISITES ? 1.0f : 0.3f}"
android:scaleType="centerInside"
app:entityId="@{viewModel.storyId}"
app:entityType="@{viewModel.entityType}"
Expand Down Expand Up @@ -89,10 +90,8 @@
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:ellipsize="end"
android:fontFamily="sans-serif"
android:maxLines="4"
android:text="@{htmlContent}"
android:text="@{viewModel.chapterSummary.chapterPlayState != ChapterPlayState.NOT_PLAYABLE_MISSING_PREREQUISITES ? htmlContent : String.format(@string/chapter_prerequisite, viewModel.index, viewModel.previousChapterTitle)}"
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
android:textColor="@color/oppiaPrimaryText"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@

<dimen name="story_chapter_card_playable_state_elevation">4dp</dimen>
<dimen name="ongoing_topic_card_elevation">4dp</dimen>
<dimen name="story_chapter_card_not_playable_state_elevation">0dp</dimen>
<dimen name="story_chapter_card_not_playable_state_elevation">2dp</dimen>
<dimen name="profile_chooser_padding_bottom_profile_already_added">224dp</dimen>

<dimen name="continue_item_exploration_split_view_margin_top">72dp</dimen>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<string name="topic_play_chapter_index">%s.</string>
<string name="chapter_name">Chapter %s: %s</string>
<string name="chapter_completed">Chapter %s: %s is completed.</string>
<string name="chapter_prerequisite">Complete Chapter <b>%s: %s</b> to unlock this chapter.</string>
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
<string name="text_input_default_content_description">Enter text.</string>
<string name="fractions_default_hint_text">Enter a fraction in the form x/x, or a mixed number in the form x x/x.</string>
<string name="fractions_default_hint_text_no_integer">Enter a fraction in the form x/x.</string>
Expand Down