Skip to content

Commit

Permalink
Fix #3585: Merge topic_practice_header_view.xml into single xml file. (
Browse files Browse the repository at this point in the history
…#4159)

* Deleted topic_practice_header landscape for mobile and tablet

* added margin end in topic_practice_header for rtl support

* Adding constraint layout as parent in phone xml to match the tablet layout

* Adding constraint layout as parent in phone xml to match the tablet layout

* extract dimens resources in phone and tablet layout

* extract layout width from phone and tablet layout

* merge topic_practice_header_view into one xml

Co-authored-by: ishant904 <[email protected]>
  • Loading branch information
ishant904 and ishant904 authored Apr 12, 2022
1 parent 84e277a commit b75c9ea
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 134 deletions.
36 changes: 0 additions & 36 deletions app/src/main/res/layout-land/topic_practice_header_view.xml

This file was deleted.

This file was deleted.

This file was deleted.

44 changes: 26 additions & 18 deletions app/src/main/res/layout/topic_practice_header_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,34 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="24dp"
android:paddingBottom="24dp">
android:layout_marginTop="@dimen/topic_practice_header_parent_constraint_layout_margin_top"
android:paddingBottom="@dimen/topic_practice_header_parent_constraint_layout_padding_bottom">

<TextView
android:id="@+id/master_skills_text_view"
style="@style/Heading2ViewStart"
android:layout_marginEnd="88dp"
android:text="@string/topic_practice_master_these_skills"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/topic_practice_header_child_constraint_layout_width"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/topic_practice_header_child_constraint_layout_margin_start"
android:layout_marginEnd="@dimen/topic_practice_header_child_constraint_layout_margin_end"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent">

<TextView
android:id="@+id/skills_description_text_view"
style="@style/Subtitle1ViewStart"
android:layout_marginTop="4dp"
android:text="@string/topic_practice_skills_description"
android:textColor="@color/oppia_secondary_text"
app:layout_constraintStart_toStartOf="@+id/master_skills_text_view"
app:layout_constraintTop_toBottomOf="@+id/master_skills_text_view" />
<TextView
android:id="@+id/master_skills_text_view"
style="@style/Heading2ViewStart"
android:layout_marginEnd="@dimen/master_skills_text_view_margin_end"
android:text="@string/topic_practice_master_these_skills"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/skills_description_text_view"
style="@style/Subtitle1ViewStart"
android:layout_marginTop="4dp"
android:text="@string/topic_practice_skills_description"
android:textColor="@color/oppia_secondary_text"
app:layout_constraintStart_toStartOf="@+id/master_skills_text_view"
app:layout_constraintTop_toBottomOf="@+id/master_skills_text_view" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
6 changes: 6 additions & 0 deletions app/src/main/res/values-land/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,12 @@
<dimen name="topic_lessons_title_margin_start">100dp</dimen>
<dimen name="topic_lessons_title_margin_end">100dp</dimen>

<!-- TopicPracticeHeader -->
<dimen name="topic_practice_header_child_constraint_layout_margin_start">96dp</dimen>
<dimen name="topic_practice_header_parent_constraint_layout_margin_top">32dp</dimen>
<dimen name="topic_practice_header_child_constraint_layout_margin_end">96dp</dimen>
<dimen name="topic_practice_header_parent_constraint_layout_padding_bottom">24dp</dimen>

<!-- ProfileProgressRecentlyPlayedStoryCard -->
<dimen name="profile_progress_recently_played_story_card_layout_margin_start">16dp</dimen>
<dimen name="profile_progress_recently_played_story_card_layout_margin_end">16dp</dimen>
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/values-sw600dp-land/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,18 @@
<dimen name="administrator_controls_download_permissions_view_auto_update_topic_constraint_layout_padding_end">16dp</dimen>
<dimen name="administrator_controls_download_permissions_view_auto_update_topic_widget_switch_compat_margin_end">4dp</dimen>

<!-- TopicPracticeHeader -->
<dimen name="topic_practice_header_parent_constraint_layout_margin_top">32dp</dimen>
<dimen name="topic_practice_header_parent_constraint_layout_padding_bottom">20dp</dimen>
<dimen name="topic_practice_header_child_constraint_layout_margin_start">0dp</dimen>
<dimen name="topic_practice_header_child_constraint_layout_margin_end">0dp</dimen>
<dimen name="master_skills_text_view_margin_end">0dp</dimen>
<dimen name="topic_practice_header_child_constraint_layout_width">360dp</dimen>

<!-- OptionAudioLanguage -->
<dimen name="option_audio_language_padding_start">16dp</dimen>
<dimen name="option_audio_language_padding_end">16dp</dimen>

<!-- OptionsStoryTextSize -->
<dimen name="option_story_text_size_padding_start">16dp</dimen>
<dimen name="option_story_text_size_padding_end">16dp</dimen>
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/values-sw600dp-port/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,18 @@
<dimen name="administrator_controls_download_permissions_view_auto_update_topic_constraint_layout_padding_end">16dp</dimen>
<dimen name="administrator_controls_download_permissions_view_auto_update_topic_widget_switch_compat_margin_end">4dp</dimen>

<!-- TopicPracticeHeader -->
<dimen name="topic_practice_header_parent_constraint_layout_margin_top">32dp</dimen>
<dimen name="topic_practice_header_parent_constraint_layout_padding_bottom">20dp</dimen>
<dimen name="topic_practice_header_child_constraint_layout_margin_start">0dp</dimen>
<dimen name="topic_practice_header_child_constraint_layout_margin_end">0dp</dimen>
<dimen name="master_skills_text_view_margin_end">0dp</dimen>
<dimen name="topic_practice_header_child_constraint_layout_width">360dp</dimen>

<!-- OptionAudioLanguage -->
<dimen name="option_audio_language_padding_start">16dp</dimen>
<dimen name="option_audio_language_padding_end">16dp</dimen>

<!-- OptionsStoryTextSize -->
<dimen name="option_story_text_size_padding_start">16dp</dimen>
<dimen name="option_story_text_size_padding_end">16dp</dimen>
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,14 @@
<dimen name="topic_lessons_title_margin_top">32dp</dimen>
<dimen name="topic_lessons_title_margin_end">32dp</dimen>

<!-- TopicPracticeHeader -->
<dimen name="topic_practice_header_child_constraint_layout_margin_start">32dp</dimen>
<dimen name="topic_practice_header_parent_constraint_layout_margin_top">32dp</dimen>
<dimen name="topic_practice_header_child_constraint_layout_margin_end">24dp</dimen>
<dimen name="topic_practice_header_parent_constraint_layout_padding_bottom">24dp</dimen>
<dimen name="master_skills_text_view_margin_end">88dp</dimen>
<dimen name="topic_practice_header_child_constraint_layout_width">0dp</dimen>

<!-- ProfileProgressRecentlyPlayedStoryCard -->
<dimen name="profile_progress_recently_played_story_card_layout_margin_start">8dp</dimen>
<dimen name="profile_progress_recently_played_story_card_layout_margin_end">8dp</dimen>
Expand Down

0 comments on commit b75c9ea

Please sign in to comment.