deano2390/FlowTextView

View.TEXT_DIRECTION_RTL is not working

Opened this issue · 0 comments

If I use
flowTextView.setTextDirection(View.TEXT_DIRECTION_RTL);
it is not working at all

In Code:

FlowTextView flowTextView = (FlowTextView) layout.findViewById(R.id.ftv);
    imgContentSourceUrl = c.getImage();
    Ion.with(con).load(imgContentSourceUrl).intoImageView(iconimg);

                    Spanned html = Html.fromHtml(c.getContentObject());
                    flowTextView.setText(html);
                    flowTextView.setTextSize((float)30);
                    flowTextView.setTextDirection(View.TEXT_DIRECTION_RTL);
                    flowTextView.setGravity(Gravity.RIGHT);

In Xml:

<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:gravity="right"
    >
    <uk.co.deanwild.flowtextview.FlowTextView
        android:id="@+id/ftv"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="10dp"
        android:layout_width="match_parent"
        android:textDirection="rtl"
        android:gravity="right"
        android:padding="5dip"

        android:layout_height="match_parent" >

        <ImageView
            android:id="@+id/img_icon"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:padding="10dip"
            android:src="@drawable/icon"/>


    </uk.co.deanwild.flowtextview.FlowTextView>
</RelativeLayout>

I also asked in stackoverflow:
http://stackoverflow.com/questions/38681810/android-how-to-settext-direction-rtl-in-flowtextview