mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-29 01:03:46 +00:00
[android] Fix deprecation in RtlUtils
Signed-off-by: Jean-Baptiste Charron <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
committed by
Konstantin Pastbin
parent
c73f357375
commit
d1d81c6b48
@@ -5,7 +5,6 @@ import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.text.TextUtilsCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -18,7 +17,7 @@ public class RtlUtils
|
||||
public static void manageRtl(@NonNull final Activity activity)
|
||||
{
|
||||
final String currentLanguage = Locale.getDefault().getLanguage();
|
||||
final boolean isRTL = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_RTL;
|
||||
final boolean isRTL = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL;
|
||||
if (isRTL && rtlLocalesWithTranslation.contains(currentLanguage))
|
||||
activity.getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user