1
votes

I have a trouble with text alignment on HUAWEI Devices. My Text widgets have right text alignment (with android:gravity="start") Application Tag:

<application
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:allowBackup="true"
    android:name=".ShopApplication"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    />

And TextView XML (for Example)

<TextView
   android:id="@+id/tv_value"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:gravity="start"
   android:text="23.000.000.097"
   android:textColor="@color/background"
   android:textSize="30sp"/>

Application theme:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/primary_text_color</item>
    <item name="colorPrimaryDark">@color/background</item>
    <item name="colorAccent">@color/accent_red_color</item>
    <item name="colorControlNormal">@android:color/white</item>
</style>

When i set gravity END - text appears on left side of TextView.

1 - textview with android:layout_width="match_parent" and android:gravity="end", 2 - textview with wrap_content

Maybe you know how fix it?

I want have standart start - left / end - right gravity

Thx!

Screenshot

1
Try to use gravity="left" or "right" - nhp
When i set gravity left/right - it's works, but i use default alert dialog and title in alert dialog also appear on right side - Boris Vedensky
Sorry your question is unclear. What do you need to fix? - Milos Lulic
Maybe somebody know how fix this forse rtl mode? - Boris Vedensky
Please add screenshots - Anil

1 Answers

0
votes

Solution founded! Huawei have strange behaviour, when i set default locale (it enabled force RTL) When i set Language locale (US,RU,ZH,etc), instead of "default" - RTL disabled