Merge "Fix app version name RTL issue" into udc-dev am: e15322347a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23407776 Change-Id: I8bd31033882d3eb898ff95b29236407a7fb1f127 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -76,7 +76,7 @@ class AppInfoProvider(private val packageInfo: PackageInfo) {
|
|||||||
private fun AppVersion() {
|
private fun AppVersion() {
|
||||||
if (packageInfo.versionName == null) return
|
if (packageInfo.versionName == null) return
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
SettingsBody(packageInfo.versionName)
|
SettingsBody(packageInfo.versionNameBidiWrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -84,10 +84,15 @@ class AppInfoProvider(private val packageInfo: PackageInfo) {
|
|||||||
if (packageInfo.versionName == null) return
|
if (packageInfo.versionName == null) return
|
||||||
Divider()
|
Divider()
|
||||||
Box(modifier = Modifier.padding(SettingsDimension.itemPadding)) {
|
Box(modifier = Modifier.padding(SettingsDimension.itemPadding)) {
|
||||||
val versionName = BidiFormatter.getInstance().unicodeWrap(packageInfo.versionName)
|
SettingsBody(stringResource(R.string.version_text, packageInfo.versionNameBidiWrapped))
|
||||||
SettingsBody(stringResource(R.string.version_text, versionName))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
/** Wrapped the version name, so its directionality still keep same when RTL. */
|
||||||
|
val PackageInfo.versionNameBidiWrapped: String
|
||||||
|
get() = BidiFormatter.getInstance().unicodeWrap(versionName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
|||||||
Reference in New Issue
Block a user