Skip to content

Commit

Permalink
Fix #3199: [RTL] High-fi Profile chooser screen (#3256)
Browse files Browse the repository at this point in the history
* fixed spacing issue

* fixed tablet portrait

* Update profile_chooser_add_view.xml
  • Loading branch information
veena14cs authored Jun 4, 2021
1 parent 7510a90 commit de758e3
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_parent_margin_start_profile_not_added}"
app:layoutMarginEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_parent_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_parent_margin_start_profile_not_added}"
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_parent_margin_end_profile_not_added}"
android:orientation="vertical">

<LinearLayout
Expand All @@ -31,8 +31,8 @@
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_margin_top_profile_not_added}"
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER}"
android:orientation="@{hasProfileEverBeenAddedValue ? LinearLayout.VERTICAL : LinearLayout.HORIZONTAL}"
app:layoutMarginEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_margin_end_profile_not_added}"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_margin_start_profile_not_added}"
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_margin_start_profile_not_added}"
tools:ignore="RtlSymmetry">

<de.hdodenhof.circleimageview.CircleImageView
Expand All @@ -50,7 +50,8 @@
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER_VERTICAL}"
android:orientation="vertical"
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/profile_view_already_added_description_parent_margin_top : @dimen/space_0dp}"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">

<TextView
android:id="@+id/add_profile_text"
Expand All @@ -65,15 +66,13 @@
android:id="@+id/add_profile_description_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="280dp"
android:layout_gravity="left"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:fontFamily="sans-serif"
android:text="@string/set_up_multiple_profiles_description"
android:textColor="@color/white"
android:textSize="16sp"
android:visibility="@{hasProfileEverBeenAddedValue ? View.GONE : View.VISIBLE}"
tools:ignore="RtlHardcoded" />
android:visibility="@{hasProfileEverBeenAddedValue ? View.GONE : View.VISIBLE}" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@
android:layout_margin="@dimen/profile_chooser_profile_view_margin"
android:padding="@dimen/profile_chooser_profile_view_parent_padding"
app:layoutMarginBottom="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/space_0dp}"
app:layoutMarginEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_parent_margin_end_profile_not_added}"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_parent_margin_start_profile_not_added}">
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_parent_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_parent_margin_start_profile_not_added}">

<LinearLayout
android:id="@+id/profile_chooser_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER}"
android:orientation="@{hasProfileEverBeenAddedValue ? LinearLayout.VERTICAL : LinearLayout.HORIZONTAL}"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_margin_start_profile_not_added}"
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_margin_end_profile_already_added : @dimen/profile_view_not_added_margin}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_margin_start_profile_already_added : @dimen/profile_view_not_added_margin}"
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_margin_top_profile_not_added}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand All @@ -55,7 +56,9 @@
android:layout_height="wrap_content"
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER_VERTICAL}"
android:orientation="vertical"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">

<TextView
android:id="@+id/profile_name_text"
style="@style/Heading2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_parent_margin_start_profile_not_added}"
app:layoutMarginEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_parent_margin_end_profile_not_added}"
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/profile_view_already_added_description_parent_margin_top : @dimen/space_0dp}"
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}"
android:orientation="vertical">

<LinearLayout
Expand All @@ -31,8 +32,8 @@
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_margin_top_profile_not_added}"
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER}"
android:orientation="@{hasProfileEverBeenAddedValue ? LinearLayout.VERTICAL : LinearLayout.HORIZONTAL}"
app:layoutMarginEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_margin_end_profile_not_added}"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_margin_start_profile_not_added}"
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_add_view_margin_start_profile_not_added}"
tools:ignore="RtlSymmetry">

<de.hdodenhof.circleimageview.CircleImageView
Expand All @@ -50,7 +51,8 @@
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER_VERTICAL}"
android:orientation="vertical"
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/profile_view_already_added_description_parent_margin_top : @dimen/space_0dp}"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">

<TextView
android:id="@+id/add_profile_text"
Expand All @@ -65,15 +67,13 @@
android:id="@+id/add_profile_description_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="280dp"
android:layout_gravity="left"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:fontFamily="sans-serif"
android:text="@string/set_up_multiple_profiles_description"
android:textColor="@color/white"
android:textSize="16sp"
android:visibility="@{hasProfileEverBeenAddedValue ? View.GONE : View.VISIBLE}"
tools:ignore="RtlHardcoded" />
android:visibility="@{hasProfileEverBeenAddedValue ? View.GONE : View.VISIBLE}" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,16 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/profile_chooser_profile_view_margin"
android:padding="@dimen/profile_chooser_profile_view_parent_padding"
app:layoutMarginBottom="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/space_0dp}"
app:layoutMarginEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_parent_margin_end_profile_not_added}"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_parent_margin_start_profile_not_added}">
app:layoutMarginBottom="@{hasProfileEverBeenAddedValue ? @dimen/profile_view_already_added_margin : @dimen/space_0dp}">

<LinearLayout
<LinearLayout
android:id="@+id/profile_chooser_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER}"
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER_VERTICAL}"
android:orientation="@{hasProfileEverBeenAddedValue ? LinearLayout.VERTICAL : LinearLayout.HORIZONTAL}"
app:layoutMarginEnd="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_margin_end_profile_already_added : @dimen/profile_view_not_added_margin}"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_margin_start_profile_already_added : @dimen/profile_view_not_added_margin}"
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_margin_end_profile_already_added : @dimen/profile_view_not_added_margin}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/profile_chooser_profile_view_margin_start_profile_already_added : @dimen/profile_view_not_added_margin}"
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_profile_view_margin_top_profile_not_added}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand All @@ -56,9 +54,13 @@
android:layout_height="wrap_content"
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER_VERTICAL}"
android:orientation="vertical"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">
<TextView
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">

<TextView
android:id="@+id/profile_name_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Heading2"
android:ellipsize="end"
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER_VERTICAL}"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/profile_chooser_add_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER_VERTICAL}"
android:orientation="vertical"
app:layoutMarginTop="@{hasProfileEverBeenAddedValue ? @dimen/profile_view_already_added_description_parent_margin_top : @dimen/space_0dp}"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">

<TextView
android:id="@+id/add_profile_text"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/profile_chooser_profile_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
android:layout_height="wrap_content"
android:gravity="@{hasProfileEverBeenAddedValue ? Gravity.CENTER_HORIZONTAL : Gravity.CENTER_VERTICAL}"
android:orientation="vertical"
app:layoutMarginStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">
android:paddingEnd="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_end_profile_not_added}"
android:paddingStart="@{hasProfileEverBeenAddedValue ? @dimen/space_0dp : @dimen/profile_chooser_description_margin_start_profile_not_added}">

<TextView
android:id="@+id/profile_name_text"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-sw600dp-land/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<dimen name="profile_chooser_add_view_margin_end_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_add_view_margin_start_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_profile_view_margin_start_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_profile_view_margin_end_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_profile_view_margin_top_profile_not_added">24dp</dimen>
<dimen name="submitted_answer_exploration_split_view_margin_end_no_extra_interaction_answer">24dp</dimen>
<dimen name="submitted_answer_exploration_split_view_margin_top_no_extra_interaction_answer">24dp</dimen>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-sw600dp-port/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<dimen name="profile_chooser_add_view_margin_start_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_fragment_margin_top_profile_already_added">24dp</dimen>
<dimen name="profile_chooser_profile_view_margin_top_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_profile_view_margin_start_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_profile_view_margin_end_profile_not_added">24dp</dimen>
<dimen name="submitted_answer_exploration_split_view_margin_end_no_extra_interaction_answer">24dp</dimen>
<dimen name="submitted_answer_exploration_split_view_margin_top_no_extra_interaction_answer">24dp</dimen>
<dimen name="submitted_answer_exploration_view_margin_top">24dp</dimen>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,13 @@
<dimen name="numeric_input_interaction_item_conversation_view_margin_end">24dp</dimen>
<dimen name="profile_chooser_add_view_margin_top_profile_not_added">84dp</dimen>
<dimen name="profile_chooser_description_margin_start_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_description_margin_end_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_add_view_margin_end_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_add_view_margin_start_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_profile_view_margin_end_profile_already_added">24dp</dimen>
<dimen name="profile_chooser_profile_view_margin_top_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_profile_view_margin_start_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_profile_view_margin_end_profile_not_added">24dp</dimen>
<dimen name="profile_chooser_fragment_margin_top_profile_already_added">24dp</dimen>
<dimen name="ratio_input_interaction_item_conversation_view_margin_end">24dp</dimen>
<dimen name="submitted_answer_exploration_view_margin_end">24dp</dimen>
Expand Down

0 comments on commit de758e3

Please sign in to comment.