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 #3691: Adds Resume Lesson Tablet Portrait UI #5175

Merged
merged 4 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
126 changes: 126 additions & 0 deletions app/src/main/res/layout-sw600dp-port/resume_lesson_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<data>

<import type="android.view.View" />

<variable
name="viewModel"
type="org.oppia.android.app.resumelesson.ResumeLessonViewModel" />
</data>

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/component_color_shared_screen_primary_background_color"
android:overScrollMode="never"
android:scrollbars="none">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="24dp">

<org.oppia.android.app.customview.LessonThumbnailImageView
android:id="@+id/resume_lesson_chapter_thumbnail_image_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:adjustViewBounds="true"
app:entityId="@{viewModel.chapterSummary.explorationId}"
app:entityType="@{viewModel.entityType}"
app:layout_constraintDimensionRatio="16:9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:lessonThumbnail="@{viewModel.chapterSummary.chapterThumbnail}" />

<TextView
android:id="@+id/resume_lesson_chapter_title_text_view"
style="@style/TextViewStart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/resume_lesson_chapter_title_text_margin_start"
android:layout_marginTop="@dimen/resume_lesson_chapter_title_text_margin_top"
android:layout_marginEnd="@dimen/resume_lesson_chapter_title_text_margin_end"
android:layout_marginBottom="@dimen/resume_lesson_chapter_title_text_margin_bottom"
android:fontFamily="sans-serif"
android:text="@{viewModel.chapterTitle}"
android:textColor="@color/component_color_shared_primary_text_color"
android:textDirection="locale"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/resume_lesson_chapter_thumbnail_image_view" />

<TextView
android:id="@+id/resume_lesson_chapter_description_text_view"
style="@style/Body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/resume_lesson_chapter_description_text_margin_start"
android:layout_marginTop="@dimen/resume_lesson_chapter_description_text_margin_top"
android:layout_marginEnd="@dimen/resume_lesson_chapter_description_text_margin_end"
android:ellipsize="end"
android:textColor="@color/component_color_shared_secondary_1_text_color"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/resume_lesson_chapter_title_text_view" />

<com.google.android.flexbox.FlexboxLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/resume_lesson_chapter_flexbox_margin_start"
android:layout_marginTop="@dimen/resume_lesson_chapter_flexbox_margin_top"
android:layout_marginEnd="@dimen/resume_lesson_chapter_flexbox_margin_end"
app:alignContent="flex_start"
app:alignItems="center"
app:flexDirection="row"
app:flexWrap="wrap"
app:justifyContent="space_evenly"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/resume_lesson_chapter_description_text_view">

<com.google.android.material.button.MaterialButton
android:id="@+id/resume_lesson_start_over_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/resume_lesson_start_over_button_margin"
android:background="@drawable/secondary_button_background"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:minWidth="144dp"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@string/start_over_lesson_button"
android:textAllCaps="false"
android:textColor="@color/component_color_shared_secondary_button_background_trim_color"
android:textSize="14sp"
app:backgroundTint="@null"
app:icon="@drawable/ic_start_over_24dp"
app:iconGravity="textStart"
app:iconTint="@color/component_color_shared_secondary_button_background_trim_color" />

<com.google.android.material.button.MaterialButton
android:id="@+id/resume_lesson_continue_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/state_button_primary_background"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:minWidth="144dp"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@string/resume_lesson_button"
android:textAllCaps="false"
android:textColor="@color/component_color_shared_secondary_4_text_color"
android:textSize="14sp"
app:backgroundTint="@null"
app:icon="@drawable/ic_arrow_right_alt_24dp"
app:iconGravity="textEnd" />
</com.google.android.flexbox.FlexboxLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</layout>
13 changes: 13 additions & 0 deletions app/src/main/res/values-sw600dp-port/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -511,4 +511,17 @@
<dimen name="profile_chooser_margin_top_profile_not_added">124dp</dimen>
<dimen name="profile_chooser_administrator_controls_margin_bottom">32dp</dimen>
<dimen name="profile_chooser_setting_icon_margin_end">64dp</dimen>

<!-- ResumeLessonFragment-->
<dimen name="resume_lesson_chapter_title_text_margin_start">72dp</dimen>
<dimen name="resume_lesson_chapter_title_text_margin_end">72dp</dimen>
<dimen name="resume_lesson_chapter_title_text_margin_top">32dp</dimen>
<dimen name="resume_lesson_chapter_title_text_margin_bottom">16dp</dimen>
<dimen name="resume_lesson_chapter_description_text_margin_start">72dp</dimen>
<dimen name="resume_lesson_chapter_description_text_margin_end">72dp</dimen>
<dimen name="resume_lesson_chapter_description_text_margin_top">16dp</dimen>
<dimen name="resume_lesson_chapter_flexbox_margin_start">72dp</dimen>
<dimen name="resume_lesson_chapter_flexbox_margin_end">72dp</dimen>
<dimen name="resume_lesson_chapter_flexbox_margin_top">32dp</dimen>
<dimen name="resume_lesson_start_over_button_margin">8dp</dimen>
</resources>
13 changes: 13 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -756,4 +756,17 @@
<dimen name="survey_nps_options_margin">8dp</dimen>
<dimen name="survey_nps_hint_text_margin">16dp</dimen>
<dimen name="survey_button_corner_radius">4dp</dimen>

<!-- ResumeLessonFragment-->
<dimen name="resume_lesson_chapter_title_text_margin_start">32dp</dimen>
<dimen name="resume_lesson_chapter_title_text_margin_end">32dp</dimen>
<dimen name="resume_lesson_chapter_title_text_margin_top">32dp</dimen>
<dimen name="resume_lesson_chapter_title_text_margin_bottom">16dp</dimen>
<dimen name="resume_lesson_chapter_description_text_margin_start">32dp</dimen>
<dimen name="resume_lesson_chapter_description_text_margin_end">32dp</dimen>
<dimen name="resume_lesson_chapter_description_text_margin_top">16dp</dimen>
<dimen name="resume_lesson_chapter_flexbox_margin_start">28dp</dimen>
<dimen name="resume_lesson_chapter_flexbox_margin_end">28dp</dimen>
<dimen name="resume_lesson_chapter_flexbox_margin_top">32dp</dimen>
<dimen name="resume_lesson_start_over_button_margin">8dp</dimen>
</resources>