Skip to content

Commit

Permalink
Fix part of #2003: Replacing space_128dp (#2111)
Browse files Browse the repository at this point in the history
* Fixes part of #2003: Replacing space_128dp

This PR replaces the use of space_128dp with dimensions of contextful names

* Failing Tests

* Overriding for sw600dp-port

* Failing Tests
  • Loading branch information
Arjupta authored Nov 19, 2020
1 parent 5724bca commit 9d8606a
Show file tree
Hide file tree
Showing 18 changed files with 92 additions and 37 deletions.
4 changes: 2 additions & 2 deletions app/src/main/res/layout-sw600dp-port/content_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
app:questionSplitViewPaddingTop="@{@dimen/space_0dp}"
app:questionViewMarginApplicable="@{!viewModel.hasConversationView && !viewModel.isSplitView}"
app:questionViewMarginBottom="@{@dimen/space_0dp}"
app:questionViewMarginEnd="@{@dimen/space_128dp}"
app:questionViewMarginStart="@{@dimen/space_128dp}"
app:questionViewMarginEnd="@{@dimen/content_item_question_view_margin_end}"
app:questionViewMarginStart="@{@dimen/content_item_question_view_margin_start}"
app:questionViewMarginTop="@{@dimen/content_item_question_view_margin_top}"
app:questionViewPaddingApplicable="@{!viewModel.hasConversationView && !viewModel.isSplitView}"
app:questionViewPaddingBottom="@{@dimen/space_0dp}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
app:questionSplitViewPaddingTop="@{@dimen/space_0dp}"
app:questionViewMarginApplicable="@{!viewModel.hasConversationView && !viewModel.isSplitView}"
app:questionViewMarginBottom="@{@dimen/space_0dp}"
app:questionViewMarginEnd="@{@dimen/space_128dp}"
app:questionViewMarginStart="@{@dimen/space_128dp}"
app:questionViewMarginEnd="@{@dimen/continue_interaction_item_question_view_margin_end}"
app:questionViewMarginStart="@{@dimen/continue_interaction_item_question_view_margin_start}"
app:questionViewMarginTop="@{@dimen/continue_item_question_view_margin_top}"
app:questionViewPaddingApplicable="@{!viewModel.hasConversationView && !viewModel.isSplitView}"
app:questionViewPaddingBottom="@{@dimen/space_0dp}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
app:questionSplitViewPaddingTop="@{@dimen/space_0dp}"
app:questionViewMarginApplicable="@{!buttonViewModel.hasConversationView && !buttonViewModel.isSplitView}"
app:questionViewMarginBottom="@{@dimen/space_0dp}"
app:questionViewMarginEnd="@{@dimen/space_128dp}"
app:questionViewMarginStart="@{@dimen/space_128dp}"
app:questionViewMarginEnd="@{@dimen/continue_navigation_item_question_view_margin_end}"
app:questionViewMarginStart="@{@dimen/continue_navigation_item_question_view_margin_start}"
app:questionViewMarginTop="@{@dimen/continue_navigation_item_question_view_margin_top}"
app:questionViewPaddingApplicable="@{!buttonViewModel.hasConversationView && !buttonViewModel.isSplitView}"
app:questionViewPaddingBottom="@{@dimen/space_0dp}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
app:questionSplitViewMarginTop="@{@dimen/space_40dp}"
app:questionViewMarginApplicable="@{!viewModel.hasConversationView && !viewModel.splitView}"
app:questionViewMarginBottom="@{@dimen/space_0dp}"
app:questionViewMarginEnd="@{@dimen/space_128dp}"
app:questionViewMarginStart="@{@dimen/space_128dp}"
app:questionViewMarginEnd="@{@dimen/drag_drop_item_question_view_margin_end}"
app:questionViewMarginStart="@{@dimen/drag_drop_item_question_view_margin_start}"
app:questionViewMarginTop="@{@dimen/space_24dp}">

<TextView
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout-sw600dp-port/feedback_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
app:questionSplitViewPaddingTop="@{@dimen/space_0dp}"
app:questionViewMarginApplicable="@{!viewModel.hasConversationView &amp;&amp; !viewModel.isSplitView}"
app:questionViewMarginBottom="@{@dimen/space_0dp}"
app:questionViewMarginEnd="@{@dimen/space_128dp}"
app:questionViewMarginStart="@{@dimen/space_128dp}"
app:questionViewMarginEnd="@{@dimen/feedback_item_question_view_margin_end}"
app:questionViewMarginStart="@{@dimen/feedback_item_question_view_margin_start}"
app:questionViewMarginTop="@{@dimen/space_24dp}"
app:questionViewPaddingApplicable="@{!viewModel.hasConversationView &amp;&amp; !viewModel.isSplitView}"
app:questionViewPaddingBottom="@{@dimen/space_0dp}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
android:focusableInTouchMode="true"
android:orientation="vertical"
android:padding="0dp"
app:layoutMarginEnd="@{viewModel.hasConversationView ? @dimen/space_112dp : @dimen/space_128dp}"
app:layoutMarginStart="@{viewModel.hasConversationView ? @dimen/space_144dp : @dimen/space_128dp}">
app:layoutMarginEnd="@{viewModel.hasConversationView ? @dimen/space_112dp : @dimen/fraction_interaction_item_non_conversation_view_margin_end}"
app:layoutMarginStart="@{viewModel.hasConversationView ? @dimen/space_144dp : @dimen/fraction_interaction_item_non_conversation_view_margin_start}">

<org.oppia.android.app.customview.interaction.FractionInputInteractionView
android:id="@+id/fraction_input_interaction_view"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout-sw600dp-port/next_button_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
app:questionSplitViewPaddingTop="@{@dimen/space_0dp}"
app:questionViewMarginApplicable="@{!buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:questionViewMarginBottom="@{@dimen/space_0dp}"
app:questionViewMarginEnd="@{@dimen/space_128dp}"
app:questionViewMarginStart="@{@dimen/space_128dp}"
app:questionViewMarginEnd="@{@dimen/next_button_item_question_view_margin_end}"
app:questionViewMarginStart="@{@dimen/next_button_item_question_view_margin_start}"
app:questionViewMarginTop="@{@dimen/next_button_item_question_view_margin_top}"
app:questionViewPaddingApplicable="@{!buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:questionViewPaddingBottom="@{@dimen/space_0dp}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
android:focusableInTouchMode="true"
android:orientation="vertical"
android:padding="0dp"
app:layoutMarginEnd="@{viewModel.hasConversationView ? @dimen/space_112dp : @dimen/space_128dp}"
app:layoutMarginStart="@{viewModel.hasConversationView ? @dimen/space_144dp : @dimen/space_128dp}">
app:layoutMarginEnd="@{viewModel.hasConversationView ? @dimen/space_112dp : @dimen/numeric_input_interaction_item_non_conversation_view_margin_end}"
app:layoutMarginStart="@{viewModel.hasConversationView ? @dimen/space_144dp : @dimen/numeric_input_interaction_item_non_conversation_view_margin_start}">

<org.oppia.android.app.customview.interaction.NumericInputInteractionView
android:id="@+id/numeric_input_interaction_view"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
app:questionViewMarginApplicable="@{!buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:questionViewMarginBottom="@{@dimen/space_0dp}"
app:questionViewMarginEnd="@{@dimen/space_0dp}"
app:questionViewMarginStart="@{@dimen/space_128dp}"
app:questionViewMarginStart="@{@dimen/previous_button_item_question_view_margin_start}"
app:questionViewMarginTop="@{@dimen/previous_button_item_question_view_margin_top}"
app:questionViewPaddingApplicable="@{!buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:questionViewPaddingBottom="@{@dimen/space_0dp}"
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout-sw600dp-port/replay_button_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
app:explorationSplitViewPaddingTop="@{@dimen/space_0dp}"
app:explorationViewMarginApplicable="@{buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:explorationViewMarginBottom="@{@dimen/space_0dp}"
app:explorationViewMarginEnd="@{@dimen/space_128dp}"
app:explorationViewMarginStart="@{@dimen/space_128dp}"
app:explorationViewMarginEnd="@{@dimen/replay_button_item_exploration_view_margin_end}"
app:explorationViewMarginStart="@{@dimen/replay_button_item_exploration_view_margin_start}"
app:explorationViewMarginTop="@{@dimen/replay_button_item_exploration_view_margin_top}"
app:explorationViewPaddingApplicable="@{buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:explorationViewPaddingBottom="@{@dimen/space_0dp}"
Expand All @@ -45,8 +45,8 @@
app:questionSplitViewPaddingTop="@{@dimen/space_0dp}"
app:questionViewMarginApplicable="@{!buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:questionViewMarginBottom="@{@dimen/space_0dp}"
app:questionViewMarginEnd="@{@dimen/space_128dp}"
app:questionViewMarginStart="@{@dimen/space_128dp}"
app:questionViewMarginEnd="@{@dimen/replay_button_item_question_view_margin_end}"
app:questionViewMarginStart="@{@dimen/replay_button_item_question_view_margin_start}"
app:questionViewMarginTop="@{@dimen/replay_button_item_question_view_margin_top}"
app:questionViewPaddingApplicable="@{!buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:questionViewPaddingBottom="@{@dimen/space_0dp}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
app:explorationSplitViewPaddingTop="@{@dimen/space_0dp}"
app:explorationViewMarginApplicable="@{buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:explorationViewMarginBottom="@{@dimen/space_0dp}"
app:explorationViewMarginEnd="@{@dimen/space_128dp}"
app:explorationViewMarginStart="@{@dimen/space_128dp}"
app:explorationViewMarginEnd="@{@dimen/return_to_topic_button_item_exploration_view_margin_end}"
app:explorationViewMarginStart="@{@dimen/return_to_topic_button_item_exploration_view_margin_start}"
app:explorationViewMarginTop="@{@dimen/return_to_topic_item_exploration_view_margin_top}"
app:explorationViewPaddingApplicable="@{buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:explorationViewPaddingBottom="@{@dimen/space_0dp}"
Expand All @@ -47,8 +47,8 @@
app:questionSplitViewPaddingTop="@{@dimen/space_0dp}"
app:questionViewMarginApplicable="@{!buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:questionViewMarginBottom="@{@dimen/space_0dp}"
app:questionViewMarginEnd="@{@dimen/space_128dp}"
app:questionViewMarginStart="@{@dimen/space_128dp}"
app:questionViewMarginEnd="@{@dimen/return_to_topic_button_item_question_view_margin_end}"
app:questionViewMarginStart="@{@dimen/return_to_topic_button_item_question_view_margin_start}"
app:questionViewMarginTop="@{@dimen/space_12dp}"
app:questionViewPaddingApplicable="@{!buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:questionViewPaddingBottom="@{@dimen/space_0dp}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
android:orientation="vertical"
android:paddingTop="12dp"
android:paddingBottom="12dp"
app:layoutMarginEnd="@{viewModel.hasConversationView ? @dimen/space_112dp : @dimen/space_128dp}"
app:layoutMarginStart="@{viewModel.hasConversationView ? @dimen/space_144dp : @dimen/space_128dp}">
app:layoutMarginEnd="@{viewModel.hasConversationView ? @dimen/space_112dp : @dimen/selection_interaction_item_non_conversation_view_margin_end}"
app:layoutMarginStart="@{viewModel.hasConversationView ? @dimen/space_144dp : @dimen/selection_interaction_item_non_conversation_view_margin_start}">

<TextView
android:layout_width="wrap_content"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout-sw600dp-port/state_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="top"
app:layoutMarginEnd="@{viewModel.isSplitView() ? @dimen/space_32dp : @dimen/space_128dp}"
app:layoutMarginStart="@{viewModel.isSplitView() ? @dimen/space_32dp : @dimen/space_128dp}"
app:layoutMarginEnd="@{viewModel.isSplitView() ? @dimen/space_32dp : @dimen/state_fragment_non_split_view_margin_end}"
app:layoutMarginStart="@{viewModel.isSplitView() ? @dimen/space_32dp : @dimen/state_fragment_non_split_view_margin_start}"
app:layout_constraintEnd_toStartOf="@id/center_guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
Expand All @@ -89,7 +89,7 @@
<FrameLayout
android:id="@+id/hints_and_solution_fragment_placeholder"
android:layout_width="match_parent"
android:layout_height="match_parent"></FrameLayout>
android:layout_height="match_parent"/>

<FrameLayout
android:id="@+id/hints_and_solution_fragment_container"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout-sw600dp-port/submit_button_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
app:questionSplitViewPaddingTop="@{@dimen/space_0dp}"
app:questionViewMarginApplicable="@{!buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:questionViewMarginBottom="@{@dimen/space_0dp}"
app:questionViewMarginEnd="@{@dimen/space_128dp}"
app:questionViewMarginStart="@{@dimen/space_128dp}"
app:questionViewMarginEnd="@{@dimen/submit_button_item_question_view_margin_end}"
app:questionViewMarginStart="@{@dimen/submit_button_item_question_view_margin_start}"
app:questionViewMarginTop="@{@dimen/submit_button_item_question_view_margin_top}"
app:questionViewPaddingApplicable="@{!buttonViewModel.hasConversationView &amp;&amp; !buttonViewModel.isSplitView}"
app:questionViewPaddingBottom="@{@dimen/space_0dp}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
app:questionSplitViewPaddingTop="@{@dimen/space_0dp}"
app:questionViewMarginApplicable="@{!viewModel.hasConversationView &amp;&amp; !viewModel.isSplitView}"
app:questionViewMarginBottom="@{@dimen/space_0dp}"
app:questionViewMarginEnd="@{@dimen/space_128dp}"
app:questionViewMarginStart="@{@dimen/space_128dp}"
app:questionViewMarginEnd="@{@dimen/submitted_answer_item_question_view_margin_end}"
app:questionViewMarginStart="@{@dimen/submitted_answer_item_question_view_margin_start}"
app:questionViewMarginTop="@{@dimen/space_24dp}"
app:questionViewPaddingApplicable="@{!viewModel.hasConversationView &amp;&amp; !viewModel.isSplitView}"
app:questionViewPaddingBottom="@{@dimen/space_0dp}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
android:focusableInTouchMode="true"
android:orientation="vertical"
android:padding="0dp"
app:layoutMarginEnd="@{viewModel.hasConversationView ? @dimen/space_112dp : @dimen/space_128dp}"
app:layoutMarginStart="@{viewModel.hasConversationView ? @dimen/space_144dp : @dimen/space_128dp}">
app:layoutMarginEnd="@{viewModel.hasConversationView ? @dimen/space_112dp : @dimen/text_input_interaction_item_non_conversation_view_margin_end}"
app:layoutMarginStart="@{viewModel.hasConversationView ? @dimen/space_144dp : @dimen/text_input_interaction_item_non_conversation_view_margin_start}">

<org.oppia.android.app.customview.interaction.TextInputInteractionView
android:id="@+id/text_input_interaction_view"
Expand Down
35 changes: 35 additions & 0 deletions app/src/main/res/values-sw600dp-port/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,39 @@

<dimen name="previous_responses_item_question_split_view_margin_end">48dp</dimen>
<dimen name="previous_responses_item_exploration_split_view_margin_end">48dp</dimen>
<dimen name="previous_button_item_question_view_margin_start">128dp</dimen>
<dimen name="content_item_question_view_margin_end">128dp</dimen>
<dimen name="content_item_question_view_margin_start">128dp</dimen>
<dimen name="continue_interaction_item_question_view_margin_end">128dp</dimen>
<dimen name="continue_interaction_item_question_view_margin_start">128dp</dimen>
<dimen name="continue_navigation_item_question_view_margin_end">128dp</dimen>
<dimen name="continue_navigation_item_question_view_margin_start">128dp</dimen>
<dimen name="drag_drop_item_question_view_margin_end">128dp</dimen>
<dimen name="drag_drop_item_question_view_margin_start">128dp</dimen>
<dimen name="feedback_item_question_view_margin_end">128dp</dimen>
<dimen name="feedback_item_question_view_margin_start">128dp</dimen>
<dimen name="fraction_interaction_item_non_conversation_view_margin_end">128dp</dimen>
<dimen name="fraction_interaction_item_non_conversation_view_margin_start">128dp</dimen>
<dimen name="next_button_item_question_view_margin_end">128dp</dimen>
<dimen name="next_button_item_question_view_margin_start">128dp</dimen>
<dimen name="numeric_input_interaction_item_non_conversation_view_margin_end">128dp</dimen>
<dimen name="numeric_input_interaction_item_non_conversation_view_margin_start">128dp</dimen>
<dimen name="replay_button_item_exploration_view_margin_end">128dp</dimen>
<dimen name="replay_button_item_exploration_view_margin_start">128dp</dimen>
<dimen name="replay_button_item_question_view_margin_end">128dp</dimen>
<dimen name="replay_button_item_question_view_margin_start">128dp</dimen>
<dimen name="return_to_topic_button_item_exploration_view_margin_end">128dp</dimen>
<dimen name="return_to_topic_button_item_exploration_view_margin_start">128dp</dimen>
<dimen name="return_to_topic_button_item_question_view_margin_end">128dp</dimen>
<dimen name="return_to_topic_button_item_question_view_margin_start">128dp</dimen>
<dimen name="selection_interaction_item_non_conversation_view_margin_end">128dp</dimen>
<dimen name="selection_interaction_item_non_conversation_view_margin_start">128dp</dimen>
<dimen name="state_fragment_non_split_view_margin_end">128dp</dimen>
<dimen name="state_fragment_non_split_view_margin_start">128dp</dimen>
<dimen name="submit_button_item_question_view_margin_end">128dp</dimen>
<dimen name="submit_button_item_question_view_margin_start">128dp</dimen>
<dimen name="submitted_answer_item_question_view_margin_end">128dp</dimen>
<dimen name="submitted_answer_item_question_view_margin_start">128dp</dimen>
<dimen name="text_input_interaction_item_non_conversation_view_margin_end">128dp</dimen>
<dimen name="text_input_interaction_item_non_conversation_view_margin_start">128dp</dimen>
</resources>
22 changes: 21 additions & 1 deletion app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<dimen name="divider_margin_top">8dp</dimen>
<dimen name="divider_margin_bottom">8dp</dimen>
<dimen name="bottom_white_space">160dp</dimen>
<dimen name="space_128dp">128dp</dimen>
<dimen name="space_32dp">32dp</dimen>
<dimen name="space_24dp">24dp</dimen>
<dimen name="space_16dp">16dp</dimen>
Expand Down Expand Up @@ -85,6 +84,27 @@
<dimen name="walkthrough_final_no_button_margin_end">8dp</dimen>
<dimen name="walkthrough_final_yes_button_margin_start">8dp</dimen>

<dimen name="continue_interaction_item_question_view_margin_end">128dp</dimen>
<dimen name="continue_interaction_item_question_view_margin_start">128dp</dimen>
<dimen name="continue_navigation_item_question_view_margin_end">128dp</dimen>
<dimen name="continue_navigation_item_question_view_margin_start">128dp</dimen>
<dimen name="next_button_item_question_view_margin_end">128dp</dimen>
<dimen name="next_button_item_question_view_margin_start">128dp</dimen>
<dimen name="replay_button_item_exploration_view_margin_end">128dp</dimen>
<dimen name="replay_button_item_exploration_view_margin_start">128dp</dimen>
<dimen name="replay_button_item_question_view_margin_end">128dp</dimen>
<dimen name="replay_button_item_question_view_margin_start">128dp</dimen>
<dimen name="return_to_topic_button_item_exploration_view_margin_end">128dp</dimen>
<dimen name="return_to_topic_button_item_exploration_view_margin_start">128dp</dimen>
<dimen name="return_to_topic_button_item_question_view_margin_end">128dp</dimen>
<dimen name="return_to_topic_button_item_question_view_margin_start">128dp</dimen>
<dimen name="state_fragment_non_split_view_margin_end">128dp</dimen>
<dimen name="state_fragment_non_split_view_margin_start">128dp</dimen>
<dimen name="submit_button_item_question_view_margin_end">128dp</dimen>
<dimen name="submit_button_item_question_view_margin_start">128dp</dimen>
<dimen name="submitted_answer_item_question_view_margin_end">128dp</dimen>
<dimen name="submitted_answer_item_question_view_margin_start">128dp</dimen>

<dimen name="continue_item_exploration_split_view_margin_end">64dp</dimen>
<dimen name="continue_item_question_split_view_margin_end">64dp</dimen>
<dimen name="continue_navigation_item_exploration_split_view_margin_end">64dp</dimen>
Expand Down

0 comments on commit 9d8606a

Please sign in to comment.