mathew-kurian / TextJustify-Android

:page_facing_up: Android Text Full Jusiftication / Wrapping / Justify / Hyphenate - V2.0
https://github.com/bluejamesbond/TextJustify-Android/wiki
Apache License 2.0
1.86k stars 370 forks source link

setText() does not work sometimes #130

Open akshay7692 opened 7 years ago

akshay7692 commented 7 years ago

I am fetching a text file from storage and displaying its contents using Document View's setText()method. However, I noticed that setText() fails to display text sometimes. I tested it several times but once in a while, it just doesn't display anything. I don't get any errors/warnings and I verified that text is always fetched from text file and is not null or empty just before setText() is called.

My DocumentView looks like this :

<com.bluejamesbond.text.DocumentView xmlns:ext="http://schemas.android.com/apk/res-auto"
            android:id="@+id/about_us"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/directors_layout"
            android:layout_marginTop="@dimen/activity_vertical_margin"
            ext:documentView_antialias="true"
            ext:documentView_cacheConfig="no_cache"
            ext:documentView_insetPaddingLeft="@dimen/activity_horizontal_margin"
            ext:documentView_insetPaddingRight="@dimen/activity_horizontal_margin"
            ext:documentView_textAlignment="justified"
            ext:documentView_textColor="@color/secondary_text_color"
            ext:documentView_textSubPixel="true" />