enter code here
i have a problom on my preview xml i see the card view like that also on emulator is it the correct
i like 1 textview will by on the right side and the sec textview will be on the left side
my phone in Hebrew
but on my phone i see it like that
how can i fix that ?
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:cardCornerRadius="6dp"
android:elevation="6dp"
app:cardUseCompatPadding="true">
<LinearLayout
android:layout_width="372dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:orientation="vertical"
android:background="@color/white">
//airplane
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@ id/airplanetitl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:padding="1dp"
android:text="Airplane:"
android:textColor="@color/black"
android:textSize="26sp"
android:textStyle="bold" />
<TextView
android:id="@ id/Airplanename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="8dp"
android:text="676"
android:textColor="@color/black"
android:textSize="26sp" />
</LinearLayout>
CodePudding user response:
Does textview.setTextDirection(View.TEXT_DIRECTION_LTR);
works for you?
CodePudding user response:
I chance my galaxy note 5 Ultra language from Hebrew to English and the View is OK!
So I know the problem is my phone System Language , how I fix that? I like to leave the system language as Hebrew ,but my App will work like the Phone at English system language
How I do it?