Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Layout is reversed?

Please view the image below:

enter image description here

The first image is the layout I did and it show normally on my device and another test devices. The second image is the layout showed on my friend device, it is reversed. I do not know why, and it just happened on few devices.

This is my layout code on xml.

<?xml version="1.0" encoding="utf-8"?>

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:auto="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/coordinatorLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activities.ComposeSmsActivity">


    <LinearLayout

        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <include
            android:id="@+id/toolbar"
            layout="@layout/toolbar_action" />

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:padding="@dimen/padding_5">

                <com.hnib.smslater.views.FlowLayout
                    android:id="@+id/layout_name_recipient"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/margin_10"
                    android:fontFamily="sans-serif-light"
                    android:orientation="horizontal">

                </com.hnib.smslater.views.FlowLayout>


                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="@dimen/padding_10">

                    <com.hnib.smslater.views.ClearableAutoContactCompleteTextView
                        android:id="@+id/et_recipient"
                        android:layout_width="@dimen/width_et_contact"
                        android:layout_height="@dimen/height_et_default"
                        android:layout_centerVertical="true"
                        android:layout_marginTop="@dimen/margin_10"
                        android:background="@drawable/drawable_radius_gray_gray"
                        android:fontFamily="sans-serif-light"
                        android:hint="@string/to_"
                        android:imeOptions="actionDone"
                        android:padding="@dimen/padding_5"
                        android:textColorHint="@color/gray"
                        android:textSize="18sp"
                        android:textStyle="bold"
                        auto:displayPhotoIfAvailable="false"
                        auto:styleOfTypedLetters="bold"
                        auto:typeOfData="phone"
                        auto:typedLettersHaveDifferentStyle="true" />


                </RelativeLayout>


                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/margin_5"
                    android:layout_marginTop="10dp">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:fontFamily="sans-serif-light"
                        android:text="@string/message"
                        android:textColor="@color/gray"
                        android:textSize="18sp"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/tv_message_length"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentRight="true"
                        android:fontFamily="sans-serif-light"
                        android:text="160/1" />

                </RelativeLayout>


                <com.hnib.smslater.views.ActionEditText
                    android:id="@+id/et_text_content"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/height_et_big"
                    android:layout_marginLeft="@dimen/margin_5"
                    android:background="@drawable/drawable_radius_gray_gray"
                    android:ems="10"
                    android:fontFamily="sans-serif-light"
                    android:gravity="top"
                    android:inputType="textMultiLine"
                    android:maxLines="10"
                    android:padding="@dimen/padding_5"
                    android:scrollbars="vertical" />

                <RelativeLayout
                    android:id="@+id/layout_time"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:padding="@dimen/padding_10"
                    android:showDividers="middle">

                    <TextView
                        android:id="@+id/tv_title_time"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:background="@drawable/drawable_radius_acent_gray"
                        android:fontFamily="sans-serif-light"
                        android:padding="@dimen/padding_5"
                        android:text="@string/time"
                        android:textAllCaps="true" />

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentRight="true"
                        android:layout_toRightOf="@+id/tv_title_time"
                        android:divider="?android:attr/dividerVertical"
                        android:gravity="center_vertical"
                        android:orientation="horizontal"
                        android:padding="@dimen/padding_10"
                        android:showDividers="middle">

                        <TextView
                            android:id="@+id/tv_date"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:background="@drawable/selector_textview"
                            android:fontFamily="sans-serif-light"
                            android:gravity="center_horizontal"
                            android:text="12/06/2016"
                            android:textColor="@color/gray"
                            android:textSize="27sp"
                            android:textStyle="bold" />


                        <TextView
                            android:id="@+id/tv_time"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:background="@drawable/selector_textview"
                            android:fontFamily="sans-serif-light"
                            android:gravity="center_horizontal"
                            android:text="09:10"
                            android:textColor="@color/gray"
                            android:textSize="27sp"
                            android:textStyle="bold" />


                    </LinearLayout>

                </RelativeLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    android:padding="@dimen/padding_10">

                    <TextView
                        android:id="@+id/tv_title_repeat"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_centerVertical="true"
                        android:layout_marginRight="30dp"
                        android:background="@drawable/drawable_radius_acent_gray"
                        android:fontFamily="sans-serif-light"
                        android:padding="@dimen/padding_5"
                        android:text="@string/repeat"
                        android:textAllCaps="true" />

                    <Spinner
                        android:id="@+id/spinner_repeat"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"></Spinner>

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/layout_choose_sim"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    android:padding="@dimen/padding_10">

                    <TextView
                        android:id="@+id/title_choose_sim"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:layout_marginRight="30dp"
                        android:background="@drawable/drawable_radius_acent_gray"
                        android:fontFamily="sans-serif-light"
                        android:padding="@dimen/padding_5"
                        android:text="@string/choose_sim"
                        android:textAllCaps="true" />

                    <Spinner
                        android:id="@+id/spinner_choose_sim"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"></Spinner>
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/layout_confirm"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    android:padding="@dimen/padding_10">

                    <TextView
                        android:id="@+id/tv_title_confirm"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_centerVertical="true"
                        android:layout_marginRight="15dp"
                        android:background="@drawable/drawable_radius_acent_gray"
                        android:fontFamily="sans-serif-light"
                        android:padding="@dimen/padding_5"
                        android:text="@string/ask_before_send"
                        android:textAllCaps="true" />

                    <CheckBox
                        android:id="@+id/checkbox_confirm"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentRight="true"
                        android:layout_marginLeft="20dp"
                        android:layout_toRightOf="@+id/tv_title_confirm" />

                </LinearLayout>


            </LinearLayout>


        </ScrollView>


    </LinearLayout>


</android.support.design.widget.CoordinatorLayout>

Please have a help on this issue. Thanks.

like image 721
CauCuKien Avatar asked Dec 08 '22 21:12

CauCuKien


1 Answers

The language on your friend's phone is probably different from yours, leading to the app giving a read from right to left, rather than your left to right. Does your friend have his phone's settings on language set to Hebrew or Arabic?

Edit: please take note of the answers below mine, those are the viable options for your friend's phone, besides for changing the language of course.

like image 193
Anish Rao Avatar answered Dec 10 '22 13:12

Anish Rao