mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
use view.LAYOUT_DIRECTION_RTL directly (#45152)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45152 As the androidx.core 1.13.1 change, ViewCompat.LAYOUT_DIRECTION_RTL is deprecated. Based on the suggestion from https://developer.android.com/reference/androidx/core/view/ViewCompat#LAYOUT_DIRECTION_RTL(), use view LAYOUT_DIRECTION_RTL directly and they have the same value. {F1716960190} Changelog: [Internal] - Migrating deprecated APIs with AndroidX.Core 1.13.1 Reviewed By: alanleedev Differential Revision: D58953460 fbshipit-source-id: 938200d1d0b1c7cc167f0119cc20ba72d16351a4
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8bd9952eaf
commit
71f8d7608f
+2
-2
@@ -9,8 +9,8 @@ package com.facebook.react.modules.i18nmanager
|
||||
|
||||
import android.content.Context
|
||||
import android.content.pm.ApplicationInfo
|
||||
import android.view.View
|
||||
import androidx.core.text.TextUtilsCompat
|
||||
import androidx.core.view.ViewCompat
|
||||
import java.util.Locale
|
||||
|
||||
public class I18nUtil private constructor() {
|
||||
@@ -63,7 +63,7 @@ public class I18nUtil private constructor() {
|
||||
// Check if the current device language is RTL
|
||||
get() {
|
||||
val directionality = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault())
|
||||
return directionality == ViewCompat.LAYOUT_DIRECTION_RTL
|
||||
return directionality == View.LAYOUT_DIRECTION_RTL
|
||||
}
|
||||
|
||||
private fun isPrefSet(context: Context, key: String, defaultValue: Boolean): Boolean =
|
||||
|
||||
Reference in New Issue
Block a user