Skip to content

Commit

Permalink
Fix part of #41: Hifi Story List (#615)
Browse files Browse the repository at this point in the history
* Changes in UI of header and list item in story list screen.

* Updated UI of story chapter.

* Changes in aspect ratio of image in story chapter

* Removed unused ic_check_primary icon

* reverted changes in project.xml and misc.xml files

* removed Project_Default.xml file
  • Loading branch information
Luffy18346 authored and rt4914 committed Jan 21, 2020
1 parent 7e52d4d commit 8ebd05b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 26 deletions.
9 changes: 0 additions & 9 deletions app/src/main/res/drawable/ic_check_primary.xml

This file was deleted.

30 changes: 16 additions & 14 deletions app/src/main/res/layout/story_chapter_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="28dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="28dp"
android:layout_marginStart="28dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="28dp"
android:layout_marginBottom="16dp"
android:clickable="@{viewModel.chapterSummary.chapterPlayState != ChapterPlayState.NOT_PLAYABLE_MISSING_PREREQUISITES}"
android:onClick="@{(v) -> viewModel.onExplorationClicked()}"
app:cardCornerRadius="4dp"
Expand All @@ -40,13 +40,10 @@
<ImageView
android:id="@+id/chapter_thumbnail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@{viewModel.name}"
android:paddingStart="40dp"
android:paddingEnd="40dp"
android:scaleType="centerCrop"
android:layout_height="0dp"
android:scaleType="centerInside"
android:src="@{viewModel.chapterThumbnail.thumbnailGraphic}"
app:layout_constraintDimensionRatio="H,4:3"
app:layout_constraintDimensionRatio="16:9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand Down Expand Up @@ -76,8 +73,11 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp"
android:ellipsize="end"
android:fontFamily="sans-serif-medium"
android:maxLines="2"
android:text="@{String.format(@string/chapter_name, (viewModel.index + 1), viewModel.name)}"
android:textColor="@color/oppiaPrimaryText"
android:textSize="18sp"
Expand All @@ -92,7 +92,9 @@
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ellipsize="end"
android:fontFamily="sans-serif"
android:maxLines="4"
android:text="@{viewModel.summary}"
android:textColor="@color/oppiaPrimaryText"
android:textSize="16sp"
Expand All @@ -105,11 +107,11 @@
android:id="@+id/chapter_completed_tick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:contentDescription="@{String.format(@string/chapter_completed, (viewModel.index + 1), viewModel.name)}"
android:src="@drawable/ic_check_primary"
android:visibility="@{viewModel.chapterSummary.chapterPlayState == ChapterPlayState.COMPLETED ? View.VISIBLE : View.INVISIBLE}"
android:src="@drawable/ic_check_24dp"
android:visibility="@{viewModel.chapterSummary.chapterPlayState == ChapterPlayState.COMPLETED ? View.VISIBLE : View.GONE}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/story_header_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
android:id="@+id/story_progress_chapter_completed_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="36dp"
android:layout_marginEnd="24dp"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="8dp"
android:fontFamily="sans-serif-medium"
android:text="@{@plurals/story_total_chapters(viewModel.totalChapters, viewModel.completedChapters, viewModel.totalChapters)}"
Expand Down

0 comments on commit 8ebd05b

Please sign in to comment.