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 #4710 Resume Lesson Fragment Button Responsiveness, Icon Layout, and Dark Mode Color #5116

Merged
merged 18 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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 @@ -4,6 +4,6 @@
<corners android:radius="@dimen/spotlight_done_button_corner_radius" />
<solid android:color="@color/component_color_shared_button_active_solid_color" />
<stroke
android:width="1dp"
android:width="2dp"
android:color="@color/component_color_shared_button_active_stroke_color" />
</shape>
59 changes: 41 additions & 18 deletions app/src/main/res/layout-land/resume_lesson_fragment.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?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">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

Expand Down Expand Up @@ -54,36 +55,58 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/resume_lesson_chapter_title_text_view" />

<androidx.constraintlayout.widget.ConstraintLayout
<com.google.android.flexbox.FlexboxLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginStart="28dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
android:layout_marginEnd="28dp"
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">

<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/resume_lesson_start_over_button"
style="@style/StartOverLessonButton"
android:layout_marginEnd="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/resume_lesson_continue_button"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent" />
android:textAllCaps="true"
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" />

<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/resume_lesson_continue_button"
style="@style/ContinueLessonButton"
android:layout_marginStart="12dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/state_button_primary_background"
android:drawableTint="@color/component_color_shared_white_background_color"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:minWidth="144dp"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@string/resume_lesson_button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/resume_lesson_start_over_button" />
</androidx.constraintlayout.widget.ConstraintLayout>
android:textAllCaps="true"
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>
56 changes: 39 additions & 17 deletions app/src/main/res/layout-sw600dp-land/resume_lesson_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,36 +85,58 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/resume_lesson_chapter_title_text_view" />

<androidx.constraintlayout.widget.ConstraintLayout
<com.google.android.flexbox.FlexboxLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginStart="28dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
android:layout_marginEnd="28dp"
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">

<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/resume_lesson_start_over_button"
style="@style/StartOverLessonButton"
android:layout_marginEnd="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/resume_lesson_continue_button"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent" />
android:textAllCaps="true"
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" />

<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/resume_lesson_continue_button"
style="@style/ContinueLessonButton"
android:layout_marginStart="12dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/state_button_primary_background"
android:drawableTint="@color/component_color_shared_white_background_color"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:minWidth="144dp"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@string/resume_lesson_button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/resume_lesson_start_over_button" />
</androidx.constraintlayout.widget.ConstraintLayout>
android:textAllCaps="true"
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>
</LinearLayout>
Expand Down
56 changes: 39 additions & 17 deletions app/src/main/res/layout/resume_lesson_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,36 +69,58 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/resume_lesson_chapter_title_text_view" />

<androidx.constraintlayout.widget.ConstraintLayout
<com.google.android.flexbox.FlexboxLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginStart="28dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
android:layout_marginEnd="28dp"
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">

<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/resume_lesson_start_over_button"
style="@style/StartOverLessonButton"
android:layout_marginEnd="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
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"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/resume_lesson_continue_button"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent" />
android:textAllCaps="true"
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" />

<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/resume_lesson_continue_button"
style="@style/ContinueLessonButton"
android:layout_marginStart="12dp"
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"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/resume_lesson_start_over_button" />
</androidx.constraintlayout.widget.ConstraintLayout>
android:textAllCaps="true"
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>
26 changes: 2 additions & 24 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -411,39 +411,17 @@
</style>
<!-- Start Over Lesson Button -->
<style name="SecondaryButton" parent="TextAppearance.AppCompat.Widget.Button">
<item name="android:layout_width">144dp</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:paddingEnd">12dp</item>
<item name="android:paddingStart">12dp</item>
<item name="android:minWidth">144dp</item>
<item name="android:background">@drawable/secondary_button_background</item>
<item name="android:fontFamily">sans-serif-medium</item>
<item name="android:minWidth">144dp</item>
<item name="android:drawablePadding">4dp</item>
<item name="drawableTint">@color/component_color_shared_secondary_button_background_trim_color</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/component_color_shared_secondary_button_background_trim_color</item>
<item name="android:textSize">14sp</item>
</style>
<style name="StartOverLessonButton" parent="SecondaryButton">
<item name="drawableStartCompat">@drawable/ic_start_over_24dp</item>
</style>
<!-- Continue Lesson Button -->
<style name="ContinueLessonButton" parent="TextAppearance.AppCompat.Widget.Button">
<item name="android:layout_width">144dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:drawablePadding">4dp</item>
<item name="android:paddingEnd">12dp</item>
<item name="android:paddingStart">12dp</item>
<item name="android:minWidth">144dp</item>
<item name="android:background">@drawable/state_button_primary_background</item>
<item name="drawableEndCompat">@drawable/ic_arrow_right_alt_24dp</item>
<item name="drawableTint">@color/component_color_shared_white_background_color</item>
<item name="android:fontFamily">sans-serif-medium</item>
<item name="android:minHeight">@dimen/clickable_item_min_height</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/component_color_shared_secondary_4_text_color</item>
<item name="android:textSize">14sp</item>
</style>

<style name="BorderlessMaterialButton" parent="Widget.AppCompat.Button.Borderless" />

Expand Down
Loading