Skip to content

Commit

Permalink
Fix #3586: Merge topic_practice_subtopic.xml into a single xml file (#…
Browse files Browse the repository at this point in the history
…3835)

* merge topic_practice_subtopic xml files & create variables in dimens.xml file

* revert unnecessary changes

* modify files for mob-landscape view

* changes dimens.xml

* revert .idea file

* modify xml file for tablet mode
  • Loading branch information
kritigupta45 committed Oct 3, 2021
1 parent 1173afc commit 4171e0d
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 193 deletions.
50 changes: 0 additions & 50 deletions app/src/main/res/layout-land/topic_practice_subtopic.xml

This file was deleted.

55 changes: 0 additions & 55 deletions app/src/main/res/layout-sw600dp-land/topic_practice_subtopic.xml

This file was deleted.

55 changes: 0 additions & 55 deletions app/src/main/res/layout-sw600dp-port/topic_practice_subtopic.xml

This file was deleted.

79 changes: 46 additions & 33 deletions app/src/main/res/layout/topic_practice_subtopic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,52 @@
type="org.oppia.android.app.topic.practice.practiceitemviewmodel.TopicPracticeSubtopicViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginEnd="48dp"
app:barrierDirection="end"
app:constraint_referenced_ids="button_example,text_view_status">

<androidx.constraintlayout.widget.Barrier
android:id="@+id/topic_practice_subtopic_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="subtopic_check_box" />

<CheckBox
android:id="@+id/subtopic_check_box"
android:layout_height="wrap_content">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:button="@drawable/selector_checkbox"
android:checked="@{isChecked}"
android:drawableStart="@android:color/transparent"
android:drawablePadding="20dp"
android:fontFamily="sans-serif"
android:gravity="start|top"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@{viewModel.subtopic.title}"
android:textAlignment="viewStart"
android:textColor="@color/oppiaPrimaryText"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_height="wrap_content">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/topic_practice_subtopic_layout_width"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/topic_practice_subtopic_layout_margin_start"
android:layout_marginEnd="@dimen/topic_practice_subtopic_layout_margin_end"
app:barrierDirection="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<androidx.constraintlayout.widget.Barrier
android:id="@+id/topic_practice_subtopic_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="subtopic_check_box" />

<CheckBox
android:id="@+id/subtopic_check_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:button="@drawable/selector_checkbox"
android:checked="@{isChecked}"
android:drawableStart="@android:color/transparent"
android:drawablePadding="20dp"
android:fontFamily="sans-serif"
android:gravity="start|top"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@{viewModel.subtopic.title}"
android:textAlignment="viewStart"
android:textColor="@color/oppiaPrimaryText"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</layout>
5 changes: 5 additions & 0 deletions app/src/main/res/values-land/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@
<dimen name="promoted_story_card_text_size">14sp</dimen>
<dimen name="promoted_story_card_margin_top">8dp</dimen>

<!-- Topic Practice -->
<dimen name="topic_practice_subtopic_layout_margin_start">104dp</dimen>
<dimen name="topic_practice_subtopic_layout_margin_end">96dp</dimen>

<!-- Topic Lessons Fragment -->
<dimen name="topic_lessons_fragment_layout_padding_bottom">80dp</dimen>

</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values-sw600dp-land/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,12 @@
<dimen name="promoted_story_card_text_size">16sp</dimen>
<dimen name="promoted_story_card_margin_top">4dp</dimen>

<!-- Topic Practice -->
<dimen name="topic_practice_subtopic_layout_margin_start">8dp</dimen>
<dimen name="topic_practice_subtopic_layout_margin_end">0dp</dimen>
<dimen name="topic_practice_subtopic_layout_width">360dp</dimen>

<!-- Topic Lessons Fragment -->
<dimen name="topic_lessons_fragment_layout_padding_bottom">100dp</dimen>

</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values-sw600dp-port/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@
<dimen name="promoted_story_card_text_size">16sp</dimen>
<dimen name="promoted_story_card_margin_top">4dp</dimen>

<!-- Topic Practice -->
<dimen name="topic_practice_subtopic_layout_margin_start">8dp</dimen>
<dimen name="topic_practice_subtopic_layout_margin_end">0dp</dimen>
<dimen name="topic_practice_subtopic_layout_width">360dp</dimen>

<!-- Topic Lessons Fragment -->
<dimen name="topic_lessons_fragment_layout_padding_bottom">100dp</dimen>

</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,12 @@
<dimen name="promoted_story_card_text_size">16sp</dimen>
<dimen name="promoted_story_card_margin_top">8dp</dimen>

<!-- Topic Practice -->
<dimen name="topic_practice_subtopic_layout_margin_start">40dp</dimen>
<dimen name="topic_practice_subtopic_layout_margin_end">48dp</dimen>
<dimen name="topic_practice_subtopic_layout_width">0dp</dimen>

<!-- Topic Lessons Fragment -->
<dimen name="topic_lessons_fragment_layout_padding_bottom">128dp</dimen>

</resources>

0 comments on commit 4171e0d

Please sign in to comment.