Merge "Change title to aspect ratio (experimental)" into udc-qpr-dev am: f1c7bf3440
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24799914 Change-Id: Ic630fd0179a9fd06a03df3a9b85ec38b021ac665 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -116,7 +116,7 @@
|
|||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="aspect_ratio_apps"
|
android:key="aspect_ratio_apps"
|
||||||
android:title="@string/aspect_ratio_title"
|
android:title="@string/aspect_ratio_experimental_title"
|
||||||
android:summary="@string/summary_placeholder"
|
android:summary="@string/summary_placeholder"
|
||||||
android:order="22"
|
android:order="22"
|
||||||
settings:controller="com.android.settings.applications.appcompat.UserAspectRatioAppsPreferenceController"
|
settings:controller="com.android.settings.applications.appcompat.UserAspectRatioAppsPreferenceController"
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:title="@string/aspect_ratio_title">
|
android:title="@string/aspect_ratio_experimental_title">
|
||||||
|
|
||||||
<com.android.settingslib.widget.ActionButtonsPreference
|
<com.android.settingslib.widget.ActionButtonsPreference
|
||||||
android:key="header_view" />
|
android:key="header_view" />
|
||||||
|
@@ -41,7 +41,7 @@ fun UserAspectRatioAppPreference(app: ApplicationInfo) {
|
|||||||
if (!presenter.isAvailableFlow.collectAsStateWithLifecycle(initialValue = false).value) return
|
if (!presenter.isAvailableFlow.collectAsStateWithLifecycle(initialValue = false).value) return
|
||||||
|
|
||||||
Preference(object : PreferenceModel {
|
Preference(object : PreferenceModel {
|
||||||
override val title = stringResource(R.string.aspect_ratio_title)
|
override val title = stringResource(R.string.aspect_ratio_experimental_title)
|
||||||
override val summary = presenter.summaryFlow.collectAsStateWithLifecycle(
|
override val summary = presenter.summaryFlow.collectAsStateWithLifecycle(
|
||||||
initialValue = stringResource(R.string.summary_placeholder),
|
initialValue = stringResource(R.string.summary_placeholder),
|
||||||
)
|
)
|
||||||
|
@@ -82,7 +82,7 @@ object UserAspectRatioAppsPageProvider : SettingsPageProvider {
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
fun EntryItem() =
|
fun EntryItem() =
|
||||||
Preference(object : PreferenceModel {
|
Preference(object : PreferenceModel {
|
||||||
override val title = stringResource(R.string.aspect_ratio_title)
|
override val title = stringResource(R.string.aspect_ratio_experimental_title)
|
||||||
override val summary = getSummary().toState()
|
override val summary = getSummary().toState()
|
||||||
override val onClick = navigator(name)
|
override val onClick = navigator(name)
|
||||||
})
|
})
|
||||||
@@ -104,7 +104,7 @@ fun UserAspectRatioAppList(
|
|||||||
= { AppList() },
|
= { AppList() },
|
||||||
) {
|
) {
|
||||||
AppListPage(
|
AppListPage(
|
||||||
title = stringResource(R.string.aspect_ratio_title),
|
title = stringResource(R.string.aspect_ratio_experimental_title),
|
||||||
listModel = rememberContext(::UserAspectRatioAppListModel),
|
listModel = rememberContext(::UserAspectRatioAppListModel),
|
||||||
appList = appList,
|
appList = appList,
|
||||||
header = {
|
header = {
|
||||||
|
@@ -145,7 +145,7 @@ class UserAspectRatioAppPreferenceTest {
|
|||||||
|
|
||||||
composeTestRule.onNode(
|
composeTestRule.onNode(
|
||||||
hasTextExactly(
|
hasTextExactly(
|
||||||
context.getString(R.string.aspect_ratio_title),
|
context.getString(R.string.aspect_ratio_experimental_title),
|
||||||
context.getString(R.string.user_aspect_ratio_app_default)
|
context.getString(R.string.user_aspect_ratio_app_default)
|
||||||
),
|
),
|
||||||
).assertIsDisplayed().assertIsEnabled()
|
).assertIsDisplayed().assertIsEnabled()
|
||||||
|
@@ -60,7 +60,7 @@ class UserAspectRatioAppsPageProviderTest {
|
|||||||
@Test
|
@Test
|
||||||
fun injectEntry_title() {
|
fun injectEntry_title() {
|
||||||
setInjectEntry()
|
setInjectEntry()
|
||||||
composeTestRule.onNodeWithText(context.getString(R.string.aspect_ratio_title))
|
composeTestRule.onNodeWithText(context.getString(R.string.aspect_ratio_experimental_title))
|
||||||
.assertIsDisplayed()
|
.assertIsDisplayed()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +75,8 @@ class UserAspectRatioAppsPageProviderTest {
|
|||||||
@Test
|
@Test
|
||||||
fun injectEntry_onClick_navigate() {
|
fun injectEntry_onClick_navigate() {
|
||||||
setInjectEntry()
|
setInjectEntry()
|
||||||
composeTestRule.onNodeWithText(context.getString(R.string.aspect_ratio_title)).performClick()
|
composeTestRule.onNodeWithText(context.getString(R.string.aspect_ratio_experimental_title))
|
||||||
|
.performClick()
|
||||||
assertThat(fakeNavControllerWrapper.navigateCalledWith).isEqualTo("UserAspectRatioAppsPage")
|
assertThat(fakeNavControllerWrapper.navigateCalledWith).isEqualTo("UserAspectRatioAppsPage")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +94,7 @@ class UserAspectRatioAppsPageProviderTest {
|
|||||||
UserAspectRatioAppList {}
|
UserAspectRatioAppList {}
|
||||||
}
|
}
|
||||||
|
|
||||||
composeTestRule.onNodeWithText(context.getString(R.string.aspect_ratio_title))
|
composeTestRule.onNodeWithText(context.getString(R.string.aspect_ratio_experimental_title))
|
||||||
.assertIsDisplayed()
|
.assertIsDisplayed()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user