From 9d8606ab1b1e7eca29f45803ea2c39d05f2454b1 Mon Sep 17 00:00:00 2001 From: Arjun Gupta Date: Thu, 19 Nov 2020 11:35:56 +0530 Subject: [PATCH] Fix part of #2003: Replacing space_128dp (#2111) * 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 --- .../res/layout-sw600dp-port/content_item.xml | 4 +-- .../continue_interaction_item.xml | 4 +-- .../continue_navigation_button_item.xml | 4 +-- .../drag_drop_interaction_item.xml | 4 +-- .../res/layout-sw600dp-port/feedback_item.xml | 4 +-- .../fraction_interaction_item.xml | 4 +-- .../layout-sw600dp-port/next_button_item.xml | 4 +-- .../numeric_input_interaction_item.xml | 4 +-- .../previous_button_item.xml | 2 +- .../replay_button_item.xml | 8 ++--- .../return_to_topic_button_item.xml | 8 ++--- .../selection_interaction_item.xml | 4 +-- .../layout-sw600dp-port/state_fragment.xml | 6 ++-- .../submit_button_item.xml | 4 +-- .../submitted_answer_item.xml | 4 +-- .../text_input_interaction_item.xml | 4 +-- .../main/res/values-sw600dp-port/dimens.xml | 35 +++++++++++++++++++ app/src/main/res/values/dimens.xml | 22 +++++++++++- 18 files changed, 92 insertions(+), 37 deletions(-) diff --git a/app/src/main/res/layout-sw600dp-port/content_item.xml b/app/src/main/res/layout-sw600dp-port/content_item.xml index a167240b7fb..a7b6c9a1b40 100644 --- a/app/src/main/res/layout-sw600dp-port/content_item.xml +++ b/app/src/main/res/layout-sw600dp-port/content_item.xml @@ -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}" diff --git a/app/src/main/res/layout-sw600dp-port/continue_interaction_item.xml b/app/src/main/res/layout-sw600dp-port/continue_interaction_item.xml index de5df1802c4..8d43c409725 100644 --- a/app/src/main/res/layout-sw600dp-port/continue_interaction_item.xml +++ b/app/src/main/res/layout-sw600dp-port/continue_interaction_item.xml @@ -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}" diff --git a/app/src/main/res/layout-sw600dp-port/continue_navigation_button_item.xml b/app/src/main/res/layout-sw600dp-port/continue_navigation_button_item.xml index 6eab96f52d2..19a2f1619d5 100644 --- a/app/src/main/res/layout-sw600dp-port/continue_navigation_button_item.xml +++ b/app/src/main/res/layout-sw600dp-port/continue_navigation_button_item.xml @@ -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}" diff --git a/app/src/main/res/layout-sw600dp-port/drag_drop_interaction_item.xml b/app/src/main/res/layout-sw600dp-port/drag_drop_interaction_item.xml index 176d76b6280..ffe8d744361 100644 --- a/app/src/main/res/layout-sw600dp-port/drag_drop_interaction_item.xml +++ b/app/src/main/res/layout-sw600dp-port/drag_drop_interaction_item.xml @@ -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}"> + 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}"> + 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}"> + 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}"> @@ -89,7 +89,7 @@ + android:layout_height="match_parent"/> + 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}"> 48dp 48dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index d979b3e83ee..b096872cbf1 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -15,7 +15,6 @@ 8dp 8dp 160dp - 128dp 32dp 24dp 16dp @@ -85,6 +84,27 @@ 8dp 8dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 128dp + 64dp 64dp 64dp