Forced LTR across the app and widgets.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:supportsRtl="false"
|
||||
android:theme="@style/Theme.NGXHttpMonitoringClient"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity
|
||||
|
||||
@@ -4,11 +4,15 @@ import android.Manifest
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.platform.LocalLayoutDirection
|
||||
import androidx.compose.ui.unit.LayoutDirection
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import net.rodakot.ngxhttpmonitoringclient.ui.MonitorApp
|
||||
@@ -18,6 +22,7 @@ class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
setTheme(R.style.Theme_NGXHttpMonitoringClient)
|
||||
super.onCreate(savedInstanceState)
|
||||
window.decorView.layoutDirection = View.LAYOUT_DIRECTION_LTR
|
||||
enableEdgeToEdge()
|
||||
requestNotificationPermission()
|
||||
setContent {
|
||||
@@ -26,10 +31,12 @@ class MainActivity : ComponentActivity() {
|
||||
onDispose { controller.close() }
|
||||
}
|
||||
NGXHttpMonitoringClientTheme {
|
||||
CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Ltr) {
|
||||
MonitorApp(controller)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun requestNotificationPermission() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) return
|
||||
|
||||
@@ -36,6 +36,7 @@ abstract class BaseWidgetConfigureActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
window.decorView.layoutDirection = View.LAYOUT_DIRECTION_LTR
|
||||
setResult(RESULT_CANCELED)
|
||||
appWidgetId = intent?.extras?.getInt(
|
||||
AppWidgetManager.EXTRA_APPWIDGET_ID,
|
||||
@@ -50,6 +51,8 @@ abstract class BaseWidgetConfigureActivity : Activity() {
|
||||
val servers = repository.servers()
|
||||
val root = LinearLayout(this).apply {
|
||||
orientation = LinearLayout.VERTICAL
|
||||
layoutDirection = View.LAYOUT_DIRECTION_LTR
|
||||
textDirection = View.TEXT_DIRECTION_LTR
|
||||
setPadding(32, 32, 32, 32)
|
||||
setBackgroundColor(Color.rgb(14, 17, 22))
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/widget_background"
|
||||
android:layoutDirection="ltr"
|
||||
android:textDirection="ltr"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/widget_background"
|
||||
android:layoutDirection="ltr"
|
||||
android:textDirection="ltr"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/widget_background"
|
||||
android:layoutDirection="ltr"
|
||||
android:textDirection="ltr"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/widget_background"
|
||||
android:layoutDirection="ltr"
|
||||
android:textDirection="ltr"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/widget_background"
|
||||
android:layoutDirection="ltr"
|
||||
android:textDirection="ltr"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -51,7 +51,8 @@ Signed upload bundle, after signing values are configured:
|
||||
|
||||
```powershell
|
||||
$env:GRADLE_USER_HOME='C:\Users\meghdad\AndroidStudioProjects\NGXhttpMonitoringClient\.gradle-user'
|
||||
.\gradlew.bat :app:bundleRelease --console=plain
|
||||
.\gradlew.bat :app:bundleRelease --console=plain # for bulding aab
|
||||
.\gradlew.bat :app:assembleRelease --console=plain # for bulding apk
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
@@ -13,5 +13,5 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# org.gradle.parallel=true
|
||||
# Kotlin code style for this project: "official" or "obsolete":
|
||||
kotlin.code.style=official
|
||||
VERSION_CODE=1
|
||||
VERSION_NAME=1.0.0
|
||||
VERSION_CODE=102000
|
||||
VERSION_NAME=1.2.0
|
||||
|
||||
Reference in New Issue
Block a user