mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 14:26:00 +00:00
fix: Arabic text reads right to left when it mixes in English words (#1568)
This commit is contained in:
1 parent
645dc3e781
commit
1f3f1ebc6a
2 files changed
+23
-2
No files matched your search
@@ -1969,7 +1969,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
|||||||
repairOffered = hint?.repair == true
|
repairOffered = hint?.repair == true
|
||||||
loading.showEnded(
|
loading.showEnded(
|
||||||
hint?.text ?: stopped,
|
hint?.text ?: stopped,
|
||||||
getString(R.string.session_ended_detail, status, SessionState.logFile?.path ?: getString(R.string.session_ended_no_log)),
|
getString(R.string.session_ended_detail, status,
|
||||||
|
SessionState.logFile?.path?.let { android.text.BidiFormatter.getInstance().unicodeWrap(it, android.text.TextDirectionHeuristics.LTR) }
|
||||||
|
?: getString(R.string.session_ended_no_log)),
|
||||||
)
|
)
|
||||||
focusEndedScreen()
|
focusEndedScreen()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ package com.droiddeck.launcher.ui
|
|||||||
|
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.ProvideTextStyle
|
||||||
|
import androidx.compose.material3.Typography
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
|
import androidx.compose.ui.text.style.TextDirection
|
||||||
import androidx.compose.material3.darkColorScheme
|
import androidx.compose.material3.darkColorScheme
|
||||||
import androidx.compose.animation.core.LinearEasing
|
import androidx.compose.animation.core.LinearEasing
|
||||||
import androidx.compose.animation.core.RepeatMode
|
import androidx.compose.animation.core.RepeatMode
|
||||||
@@ -164,7 +168,22 @@ fun DroidDeckTheme(theme: String? = null, appScale: Int = AppUiPrefs.DEFAULT_SCA
|
|||||||
LocalPalette provides p,
|
LocalPalette provides p,
|
||||||
LocalDensity provides density,
|
LocalDensity provides density,
|
||||||
LocalConfiguration provides configuration,
|
LocalConfiguration provides configuration,
|
||||||
) { MaterialTheme(colorScheme = scheme, content = content) }
|
) {
|
||||||
|
MaterialTheme(colorScheme = scheme, typography = ContentDirected) {
|
||||||
|
ProvideTextStyle(TextStyle(textDirection = TextDirection.Content), content)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val ContentDirected = Typography().run {
|
||||||
|
fun TextStyle.byContent() = copy(textDirection = TextDirection.Content)
|
||||||
|
Typography(
|
||||||
|
displayLarge.byContent(), displayMedium.byContent(), displaySmall.byContent(),
|
||||||
|
headlineLarge.byContent(), headlineMedium.byContent(), headlineSmall.byContent(),
|
||||||
|
titleLarge.byContent(), titleMedium.byContent(), titleSmall.byContent(),
|
||||||
|
bodyLarge.byContent(), bodyMedium.byContent(), bodySmall.byContent(),
|
||||||
|
labelLarge.byContent(), labelMedium.byContent(), labelSmall.byContent(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Turns the colour wheel on the system's own animation clock; with animations off, in the app or in Android, the colour holds still. */
|
/** Turns the colour wheel on the system's own animation clock; with animations off, in the app or in Android, the colour holds still. */
|
||||||
|
|||||||
Reference in new issue
Block a user