diff --git a/app/src/main/res/layout-sw600dp-land/faq_single_activity.xml b/app/src/main/res/layout-sw600dp-land/faq_single_activity.xml
index 43e9dddbb6d..e37111661f0 100644
--- a/app/src/main/res/layout-sw600dp-land/faq_single_activity.xml
+++ b/app/src/main/res/layout-sw600dp-land/faq_single_activity.xml
@@ -19,7 +19,7 @@
+ android:baselineAligned="false"
+ android:orientation="horizontal">
+ android:layout_weight="1"
+ android:background="@color/component_color_resume_lesson_activity_background_color">
-
diff --git a/app/src/main/res/layout-sw600dp/help_activity.xml b/app/src/main/res/layout-sw600dp/help_activity.xml
index 6608535b50e..f39a382d510 100644
--- a/app/src/main/res/layout-sw600dp/help_activity.xml
+++ b/app/src/main/res/layout-sw600dp/help_activity.xml
@@ -43,10 +43,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" />
diff --git a/app/src/main/res/layout-sw600dp/option_activity.xml b/app/src/main/res/layout-sw600dp/option_activity.xml
index 767faf4a5dc..abb585e8a4c 100644
--- a/app/src/main/res/layout-sw600dp/option_activity.xml
+++ b/app/src/main/res/layout-sw600dp/option_activity.xml
@@ -87,9 +87,10 @@
diff --git a/app/src/main/res/layout-sw600dp/story_fragment.xml b/app/src/main/res/layout-sw600dp/story_fragment.xml
index 2480192d109..66fb3c73a8c 100644
--- a/app/src/main/res/layout-sw600dp/story_fragment.xml
+++ b/app/src/main/res/layout-sw600dp/story_fragment.xml
@@ -28,7 +28,7 @@
diff --git a/app/src/main/res/layout/app_language_activity.xml b/app/src/main/res/layout/app_language_activity.xml
index b4e0066560b..6667ff04848 100644
--- a/app/src/main/res/layout/app_language_activity.xml
+++ b/app/src/main/res/layout/app_language_activity.xml
@@ -18,7 +18,7 @@
diff --git a/app/src/main/res/layout/exploration_activity.xml b/app/src/main/res/layout/exploration_activity.xml
index e8f070619a3..5da95d484d3 100755
--- a/app/src/main/res/layout/exploration_activity.xml
+++ b/app/src/main/res/layout/exploration_activity.xml
@@ -27,7 +27,7 @@
-
diff --git a/app/src/main/res/layout/faq_single_activity.xml b/app/src/main/res/layout/faq_single_activity.xml
index 76371a3dc8a..22bf7a86930 100644
--- a/app/src/main/res/layout/faq_single_activity.xml
+++ b/app/src/main/res/layout/faq_single_activity.xml
@@ -19,7 +19,7 @@
diff --git a/app/src/main/res/layout/hints_and_solution_fragment.xml b/app/src/main/res/layout/hints_and_solution_fragment.xml
index 5226f9e0d13..161860f39a6 100644
--- a/app/src/main/res/layout/hints_and_solution_fragment.xml
+++ b/app/src/main/res/layout/hints_and_solution_fragment.xml
@@ -27,7 +27,7 @@
diff --git a/app/src/main/res/layout/license_text_viewer_activity.xml b/app/src/main/res/layout/license_text_viewer_activity.xml
index 3c52db29068..868662524de 100644
--- a/app/src/main/res/layout/license_text_viewer_activity.xml
+++ b/app/src/main/res/layout/license_text_viewer_activity.xml
@@ -16,7 +16,7 @@
@@ -40,7 +42,7 @@
-
+
diff --git a/app/src/main/res/layout/mark_chapters_completed_fragment.xml b/app/src/main/res/layout/mark_chapters_completed_fragment.xml
index e7bbd5fe6fb..fc5c60c372c 100644
--- a/app/src/main/res/layout/mark_chapters_completed_fragment.xml
+++ b/app/src/main/res/layout/mark_chapters_completed_fragment.xml
@@ -31,8 +31,9 @@
diff --git a/app/src/main/res/layout/pin_password_activity.xml b/app/src/main/res/layout/pin_password_activity.xml
index 8819be7d779..36d3f8258c9 100644
--- a/app/src/main/res/layout/pin_password_activity.xml
+++ b/app/src/main/res/layout/pin_password_activity.xml
@@ -31,7 +31,7 @@
@@ -98,6 +98,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
+ android:minWidth="60dp"
android:text="@{Integer.toString(viewModel.ongoingTopicCount)}"
android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color"
android:textSize="24sp" />
@@ -105,9 +106,10 @@
@@ -153,9 +155,10 @@
diff --git a/app/src/main/res/layout/profile_rename_activity.xml b/app/src/main/res/layout/profile_rename_activity.xml
index b1265610492..d3936c473c0 100644
--- a/app/src/main/res/layout/profile_rename_activity.xml
+++ b/app/src/main/res/layout/profile_rename_activity.xml
@@ -20,7 +20,7 @@
12dp
60dp
60dp
- 280dp
20dp
20dp
28dp
@@ -541,7 +540,10 @@
8dp
8dp
- 280dp
+
+ 280sp
+
+ 280sp
16sp
8dp
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 4a0e5f652aa..eebc151f544 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -414,6 +414,7 @@
- wrap_content
- 12dp
- 12dp
+ - 144dp
- @drawable/start_over_button_background
- sans-serif-medium
- @drawable/ic_start_over_24dp
@@ -430,6 +431,7 @@
- 4dp
- 12dp
- 12dp
+ - 144dp
- @drawable/state_button_primary_background
- @drawable/ic_arrow_right_alt_24dp
- @color/color_def_white
diff --git a/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt
index bd0def48687..22973649017 100644
--- a/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt
+++ b/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt
@@ -4,6 +4,7 @@ import android.app.Application
import android.content.Context
import android.content.Intent
import android.content.res.Configuration
+import android.util.TypedValue
import android.view.View
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
@@ -52,6 +53,7 @@ import org.oppia.android.app.application.ApplicationInjectorProvider
import org.oppia.android.app.application.ApplicationModule
import org.oppia.android.app.application.ApplicationStartupListenerModule
import org.oppia.android.app.application.testing.TestingBuildFlavorModule
+import org.oppia.android.app.customview.LessonThumbnailImageView
import org.oppia.android.app.devoptions.DeveloperOptionsModule
import org.oppia.android.app.devoptions.DeveloperOptionsStarterModule
import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity
@@ -62,6 +64,7 @@ import org.oppia.android.app.model.OppiaLanguage.BRAZILIAN_PORTUGUESE_VALUE
import org.oppia.android.app.model.OppiaLanguage.ENGLISH
import org.oppia.android.app.model.OppiaLanguage.ENGLISH_VALUE
import org.oppia.android.app.model.ProfileId
+import org.oppia.android.app.model.ReadingTextSize
import org.oppia.android.app.model.ScreenName
import org.oppia.android.app.player.state.itemviewmodel.SplitScreenInteractionModule
import org.oppia.android.app.profile.ProfileChooserActivity
@@ -75,6 +78,7 @@ import org.oppia.android.app.topic.TopicActivity
import org.oppia.android.app.translation.AppLanguageLocaleHandler
import org.oppia.android.app.translation.testing.ActivityRecreatorTestModule
import org.oppia.android.app.translation.testing.TestActivityRecreator
+import org.oppia.android.app.utility.FontScaleConfigurationUtil
import org.oppia.android.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.android.data.backends.gae.NetworkConfigProdModule
import org.oppia.android.data.backends.gae.NetworkModule
@@ -198,6 +202,9 @@ class HomeActivityTest {
@Inject
lateinit var dataProviderTestMonitor: DataProviderTestMonitor.Factory
+ @Inject
+ lateinit var fontScaleConfigurationUtil: FontScaleConfigurationUtil
+
private val internalProfileId: Int = 0
private val internalProfileId1: Int = 1
private val longNameInternalProfileId: Int = 3
@@ -893,6 +900,39 @@ class HomeActivityTest {
}
}
+ @Test
+ @RunOn(TestPlatform.ROBOLECTRIC) // TODO(#4700): Make this test work on Espresso.
+ fun testHomeActivity_promotedStoryHasScalableWidth() {
+ fontScaleConfigurationUtil.adjustFontScale(context, ReadingTextSize.EXTRA_LARGE_TEXT_SIZE)
+ fakeOppiaClock.setFakeTimeMode(FakeOppiaClock.FakeTimeMode.MODE_UPTIME_MILLIS)
+ storyProgressTestHelper.markInProgressSavedFractionsStory0Exp0(
+ profileId = profileId1,
+ timestampOlderThanOneWeek = false
+ )
+ logIntoUserTwice()
+ launch(createHomeActivityIntent(internalProfileId1)).use {
+ testCoroutineDispatchers.runCurrent()
+ scrollToPosition(position = 1)
+ onView(
+ atPositionOnView(
+ recyclerViewId = R.id.home_recycler_view,
+ position = 1,
+ targetViewId = R.id.promoted_story_list_recycler_view
+ )
+ ).check { view, _ ->
+ val promotedStoryCard =
+ view.findViewById(R.id.lesson_thumbnail)
+ val promotedStoryCardWidth = promotedStoryCard?.width?.toFloat()
+ val expectedWidthInPixels = TypedValue.applyDimension(
+ TypedValue.COMPLEX_UNIT_SP,
+ 280F,
+ context.resources.displayMetrics
+ )
+ assertThat(promotedStoryCardWidth).isWithin(1e-5f).of(expectedWidthInPixels)
+ }
+ }
+ }
+
@Test
fun testHomeActivity_promotedCard_topicNameIsCorrect() {
fakeOppiaClock.setFakeTimeMode(FakeOppiaClock.FakeTimeMode.MODE_UPTIME_MILLIS)