From a43e74350fbb6c644ae1789da5d8497417e6dd31 Mon Sep 17 00:00:00 2001 From: Veena Date: Fri, 13 Aug 2021 21:02:59 +0530 Subject: [PATCH] Fix #3665: [RTL] High-fi Remove textdirection attribute from all the TextViews and fix text alignment (#3666) * Update selection_interaction_item.xml * Update selection_interaction_item.xml * Update return_to_topic_button_item.xml * Update return_to_topic_button_item.xml * removed textdirection * fixed textview rtl * added tablet portrait for topic summary and fixed rtl * Fixed text alignment * done formatting --- .../res/layout-land/promoted_story_card.xml | 6 +- .../res/layout-land/topic_info_fragment.xml | 24 ++--- .../res/layout-land/topic_summary_view.xml | 15 ++-- .../promoted_story_card.xml | 6 +- .../topic_info_fragment.xml | 23 +++-- .../topic_summary_view.xml | 14 +-- .../promoted_story_card.xml | 6 +- .../topic_info_fragment.xml | 23 +++-- .../topic_summary_view.xml | 90 +++++++++++++++++++ .../main/res/layout/concept_card_fragment.xml | 6 +- .../main/res/layout/promoted_story_card.xml | 6 +- .../main/res/layout/topic_info_fragment.xml | 24 ++--- .../main/res/layout/topic_summary_view.xml | 15 ++-- 13 files changed, 173 insertions(+), 85 deletions(-) create mode 100644 app/src/main/res/layout-sw600dp-port/topic_summary_view.xml diff --git a/app/src/main/res/layout-land/promoted_story_card.xml b/app/src/main/res/layout-land/promoted_story_card.xml index d56c620016c..4b9951015cf 100755 --- a/app/src/main/res/layout-land/promoted_story_card.xml +++ b/app/src/main/res/layout-land/promoted_story_card.xml @@ -56,7 +56,7 @@ @@ -118,9 +118,9 @@ android:gravity="center_vertical" android:text="@string/topic_downloaded" android:textColor="@color/oppiaPrimaryText" - android:textDirection="locale" android:textSize="18sp" app:layout_constraintBottom_toBottomOf="@+id/download_status_image_view" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@+id/download_status_image_view" app:layout_constraintTop_toTopOf="@+id/download_status_image_view" /> @@ -133,10 +133,10 @@ android:fontFamily="sans-serif" android:text="@{String.format(@string/topic_download_text, viewModel.topicSize)}" android:textColor="@color/oppiaPrimaryText" - android:textDirection="locale" android:textSize="18sp" android:textStyle="italic" app:layout_constraintBottom_toBottomOf="@+id/download_status_image_view" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@+id/download_story_count_text_view" app:layout_constraintTop_toTopOf="@+id/download_status_image_view" /> diff --git a/app/src/main/res/layout-land/topic_summary_view.xml b/app/src/main/res/layout-land/topic_summary_view.xml index 3972ba72c02..fde7469f3da 100755 --- a/app/src/main/res/layout-land/topic_summary_view.xml +++ b/app/src/main/res/layout-land/topic_summary_view.xml @@ -13,11 +13,11 @@ android:id="@+id/topic_container" android:layout_width="match_parent" android:layout_height="wrap_content" - app:layoutMarginTop="@{@dimen/topic_list_item_margin_top_bottom}" + app:cardCornerRadius="4dp" app:layoutMarginBottom="@{@dimen/topic_list_item_margin_top_bottom}" - app:layoutMarginStart="@{viewModel.computeStartMargin()}" app:layoutMarginEnd="@{viewModel.computeEndMargin()}" - app:cardCornerRadius="4dp"> + app:layoutMarginStart="@{viewModel.computeStartMargin()}" + app:layoutMarginTop="@{@dimen/topic_list_item_margin_top_bottom}"> @@ -117,6 +115,7 @@ android:textColor="@color/oppiaPrimaryText" android:textSize="18sp" app:layout_constraintBottom_toBottomOf="@+id/download_status_image_view" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@+id/download_status_image_view" app:layout_constraintTop_toTopOf="@+id/download_status_image_view" /> @@ -129,10 +128,10 @@ android:fontFamily="sans-serif" android:text="@{String.format(@string/topic_download_text, viewModel.topicSize)}" android:textColor="@color/oppiaPrimaryText" - android:textDirection="locale" android:textSize="18sp" android:textStyle="italic" app:layout_constraintBottom_toBottomOf="@+id/download_status_image_view" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@+id/download_story_count_text_view" app:layout_constraintTop_toTopOf="@+id/download_status_image_view" /> diff --git a/app/src/main/res/layout-sw600dp-land/topic_summary_view.xml b/app/src/main/res/layout-sw600dp-land/topic_summary_view.xml index 9af2a3d0c3e..e65849af4ea 100644 --- a/app/src/main/res/layout-sw600dp-land/topic_summary_view.xml +++ b/app/src/main/res/layout-sw600dp-land/topic_summary_view.xml @@ -13,11 +13,11 @@ android:id="@+id/topic_container" android:layout_width="match_parent" android:layout_height="wrap_content" - app:layoutMarginTop="@{@dimen/topic_list_item_margin_top_bottom}" + app:cardCornerRadius="4dp" app:layoutMarginBottom="@{@dimen/topic_list_item_margin_top_bottom}" - app:layoutMarginStart="@{viewModel.computeStartMargin()}" app:layoutMarginEnd="@{viewModel.computeEndMargin()}" - app:cardCornerRadius="4dp"> + app:layoutMarginStart="@{viewModel.computeStartMargin()}" + app:layoutMarginTop="@{@dimen/topic_list_item_margin_top_bottom}"> @@ -132,9 +130,9 @@ android:fontFamily="sans-serif" android:text="@string/topic_downloaded" android:textColor="@color/oppiaPrimaryText" - android:textDirection="locale" android:textSize="18sp" app:layout_constraintBottom_toBottomOf="@+id/download_status_image_view" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@+id/download_status_image_view" app:layout_constraintTop_toTopOf="@+id/download_status_image_view" /> @@ -150,6 +148,7 @@ android:textSize="18sp" android:textStyle="italic" app:layout_constraintBottom_toBottomOf="@+id/download_status_image_view" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@+id/download_story_count_text_view" app:layout_constraintTop_toTopOf="@+id/download_status_image_view" /> diff --git a/app/src/main/res/layout-sw600dp-port/topic_summary_view.xml b/app/src/main/res/layout-sw600dp-port/topic_summary_view.xml new file mode 100644 index 00000000000..fde7469f3da --- /dev/null +++ b/app/src/main/res/layout-sw600dp-port/topic_summary_view.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/concept_card_fragment.xml b/app/src/main/res/layout/concept_card_fragment.xml index 5776bad901f..1d0ec5619ff 100644 --- a/app/src/main/res/layout/concept_card_fragment.xml +++ b/app/src/main/res/layout/concept_card_fragment.xml @@ -49,7 +49,7 @@ diff --git a/app/src/main/res/layout/promoted_story_card.xml b/app/src/main/res/layout/promoted_story_card.xml index 7a9f4180c1c..b0d418b0917 100755 --- a/app/src/main/res/layout/promoted_story_card.xml +++ b/app/src/main/res/layout/promoted_story_card.xml @@ -56,7 +56,7 @@ @@ -139,9 +139,9 @@ android:gravity="center_vertical" android:text="@string/topic_downloaded" android:textColor="@color/oppiaPrimaryText" - android:textDirection="locale" android:textSize="18sp" app:layout_constraintBottom_toBottomOf="@+id/download_status_image_view" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@+id/download_status_image_view" app:layout_constraintTop_toTopOf="@+id/download_status_image_view" /> @@ -154,10 +154,10 @@ android:fontFamily="sans-serif" android:text="@{String.format(@string/topic_download_text, viewModel.topicSize)}" android:textColor="@color/oppiaPrimaryText" - android:textDirection="locale" android:textSize="18sp" android:textStyle="italic" app:layout_constraintBottom_toBottomOf="@+id/download_status_image_view" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@+id/download_story_count_text_view" app:layout_constraintTop_toTopOf="@+id/download_status_image_view" /> diff --git a/app/src/main/res/layout/topic_summary_view.xml b/app/src/main/res/layout/topic_summary_view.xml index 3972ba72c02..fde7469f3da 100755 --- a/app/src/main/res/layout/topic_summary_view.xml +++ b/app/src/main/res/layout/topic_summary_view.xml @@ -13,11 +13,11 @@ android:id="@+id/topic_container" android:layout_width="match_parent" android:layout_height="wrap_content" - app:layoutMarginTop="@{@dimen/topic_list_item_margin_top_bottom}" + app:cardCornerRadius="4dp" app:layoutMarginBottom="@{@dimen/topic_list_item_margin_top_bottom}" - app:layoutMarginStart="@{viewModel.computeStartMargin()}" app:layoutMarginEnd="@{viewModel.computeEndMargin()}" - app:cardCornerRadius="4dp"> + app:layoutMarginStart="@{viewModel.computeStartMargin()}" + app:layoutMarginTop="@{@dimen/topic_list_item_margin_top_bottom}">