Skip to content

Commit

Permalink
Fixes oppia#4586: Improve text scaling according to accessibility sca…
Browse files Browse the repository at this point in the history
…nner (oppia#4587)

* Fixed text-scaling issue by setting min Height and width

* Navigation drawer scaling fixed

* text-scaling fixed in promoted-story-card

* Removed minHeight=48dp

* Fixed more text scaling issues

* Optimized code resume lesson

* layout_height set to 0dp

* Updated promoted_story_card
  • Loading branch information
vrajdesai78 authored Sep 20, 2022
1 parent 4f3ca53 commit 91014af
Show file tree
Hide file tree
Showing 41 changed files with 79 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/faq_single_activity_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/component_color_faq_single_activity_toolbar_color"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:baselineAligned="false">
android:baselineAligned="false"
android:orientation="horizontal">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
Expand Down Expand Up @@ -47,8 +47,8 @@
<ScrollView
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@color/component_color_resume_lesson_activity_background_color"
android:layout_weight="1">
android:layout_weight="1"
android:background="@color/component_color_resume_lesson_activity_background_color">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -117,6 +117,5 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

</LinearLayout>
</layout>
7 changes: 4 additions & 3 deletions app/src/main/res/layout-sw600dp/help_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
android:background="@color/component_color_help_activity_background_color"
android:contentDescription="@string/help_activity_back_arrow_description"
android:padding="12dp"
app:srcCompat="@drawable/ic_arrow_back_black_24_dp"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@id/multipane_guideline"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_arrow_back_black_24_dp" />

<TextView
android:id="@+id/help_multipane_options_title_textview"
Expand Down Expand Up @@ -95,9 +95,10 @@
<fragment
android:id="@+id/help_activity_fragment_navigation_drawer"
android:name="org.oppia.android.app.drawer.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:minWidth="@dimen/navigation_drawer_width"
app:layout="@layout/drawer_fragment"
tools:layout="@layout/drawer_fragment" />
</androidx.drawerlayout.widget.DrawerLayout>
3 changes: 2 additions & 1 deletion app/src/main/res/layout-sw600dp/option_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@
<fragment
android:id="@+id/options_activity_fragment_navigation_drawer"
android:name="org.oppia.android.app.drawer.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:minWidth="@dimen/navigation_drawer_width"
app:layout="@layout/drawer_fragment"
tools:layout="@layout/drawer_fragment" />
</androidx.drawerlayout.widget.DrawerLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout-sw600dp/story_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/story_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/component_color_story_activity_toolbar_color"
android:fontFamily="sans-serif"
android:gravity="center_vertical"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/admin_auth_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/admin_auth_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/component_color_admin_auth_activity_toolbar_color"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/administrator_controls_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
<fragment
android:id="@+id/administrator_controls_activity_fragment_navigation_drawer"
android:name="org.oppia.android.app.drawer.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:minWidth="@dimen/navigation_drawer_width"
app:layout="@layout/drawer_fragment"
tools:layout="@layout/drawer_fragment" />
</androidx.drawerlayout.widget.DrawerLayout>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/app_language_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/app_language_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
Expand All @@ -36,7 +36,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/reading_list_app_bar_layout" >
app:layout_constraintTop_toBottomOf="@id/reading_list_app_bar_layout">
</FrameLayout>

<View
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/app_version_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/app_version_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/oppia_primary"
android:minHeight="?attr/actionBarSize"
android:textSize="20sp"
app:navigationContentDescription="@string/navigate_up"
app:navigationIcon="?attr/homeAsUpIndicator"
Expand All @@ -35,8 +36,8 @@
android:layout_height="4dp"
android:layout_gravity="top"
android:background="@drawable/toolbar_drop_shadow"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/app_version_app_bar_layout" />

<FrameLayout
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/audio_language_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/audio_language_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/completed_story_list_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/completed_story_list_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/developer_options_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@
<fragment
android:id="@+id/developer_options_activity_fragment_navigation_drawer"
android:name="org.oppia.android.app.drawer.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:minWidth="@dimen/navigation_drawer_width"
app:layout="@layout/drawer_fragment"
tools:layout="@layout/drawer_fragment" />
</androidx.drawerlayout.widget.DrawerLayout>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/exploration_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/exploration_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/component_color_exploration_activity_toolbar_color"
android:minHeight="?attr/actionBarSize"
android:theme="@style/Widget.AppCompat.ActionBar"
Expand All @@ -53,8 +53,8 @@
android:layout_gravity="end"
android:contentDescription="@{viewModel.isAudioStreamingOn ? @string/audio_player_on : @string/audio_player_off}"
android:scaleType="center"
app:srcCompat="@{viewModel.isAudioStreamingOn ? @drawable/ic_baseline_headset_24 : @drawable/ic_baseline_headset_off_24}"
android:visibility="@{viewModel.showAudioButton ? View.VISIBLE : View.GONE}" />
android:visibility="@{viewModel.showAudioButton ? View.VISIBLE : View.GONE}"
app:srcCompat="@{viewModel.isAudioStreamingOn ? @drawable/ic_baseline_headset_24 : @drawable/ic_baseline_headset_off_24}" />
</LinearLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/faq_single_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/faq_single_activity_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/component_color_faq_single_activity_toolbar_color"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/help_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@
<fragment
android:id="@+id/help_activity_fragment_navigation_drawer"
android:name="org.oppia.android.app.drawer.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:minWidth="@dimen/navigation_drawer_width"
app:layout="@layout/drawer_fragment"
tools:layout="@layout/drawer_fragment" />
</androidx.drawerlayout.widget.DrawerLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/hints_and_solution_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/hints_and_solution_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/color_def_oppia_dark_blue"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/home_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
<fragment
android:id="@+id/home_activity_fragment_navigation_drawer"
android:name="org.oppia.android.app.drawer.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:minWidth="@dimen/navigation_drawer_width"
app:layout="@layout/drawer_fragment"
tools:layout="@layout/drawer_fragment" />
</androidx.drawerlayout.widget.DrawerLayout>
5 changes: 3 additions & 2 deletions app/src/main/res/layout/license_text_viewer_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/license_text_viewer_activity_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
Expand All @@ -29,7 +29,8 @@
style="@style/MarqueeToolbarTitleTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp" />
android:layout_marginEnd="20dp"
android:minHeight="48dp" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/mark_chapters_completed_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/component_color_mark_chapters_completed_primary_toolbar_color"
android:textSize="20sp"
app:navigationContentDescription="@string/navigate_up"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/mark_stories_completed_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/component_color_mark_stories_completed_primary_toolbar_color"
android:textSize="20sp"
app:navigationContentDescription="@string/navigate_up"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/mark_topics_completed_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/mark_topics_completed_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/component_color_mark_topics_completed_primary_toolbar_color"
android:textSize="20sp"
app:navigationContentDescription="@string/navigate_up"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/my_downloads_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/my_downloads_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/oppia_primary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:title="@string/my_downloads_activity_title"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/ongoing_topic_list_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/ongoing_topic_list_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/option_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
<fragment
android:id="@+id/options_activity_fragment_navigation_drawer"
android:name="org.oppia.android.app.drawer.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:minWidth="@dimen/navigation_drawer_width"
app:layout="@layout/drawer_fragment"
tools:layout="@layout/drawer_fragment" />
</androidx.drawerlayout.widget.DrawerLayout>
5 changes: 3 additions & 2 deletions app/src/main/res/layout/pin_password_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/pin_password_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/component_color_pin_password_activity_toolbar_color"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
Expand Down Expand Up @@ -106,9 +106,10 @@
android:id="@+id/pin_password_input_pin"
style="@style/TextInputLayout"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:hint="@{viewModel.profile.isAdmin ? @string/input_pin_password_as_admin : @string/input_pin_password_as_user}"
android:minHeight="56dp"
app:layout_constraintEnd_toStartOf="@id/show_pin"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/policies_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
android:layout_height="wrap_content"
android:layout_gravity="end"
android:background="@color/oppia_primary"
android:minHeight="?attr/actionBarSize"
android:theme="@style/Widget.AppCompat.ActionBar"
app:navigationContentDescription="@string/navigate_up"
app:navigationIcon="@drawable/ic_arrow_back_white_24dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/profile_and_device_id_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/profile_and_device_id_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/oppia_primary"
android:textSize="20sp"
app:navigationContentDescription="@string/navigate_up"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/profile_edit_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/profile_edit_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/oppia_primary"
android:textSize="20sp"
app:navigationContentDescription="@string/navigate_up"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/profile_list_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/profile_list_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:fontFamily="sans-serif"
android:minHeight="?attr/actionBarSize"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/profile_picture_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/profile_picture_activity_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="@color/oppia_primary"
android:textSize="20sp"
app:navigationContentDescription="@string/navigate_up"
Expand Down
Loading

0 comments on commit 91014af

Please sign in to comment.