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 369 forks source link

Would this work in a RecyclerView? #120

Open aryehsinger opened 8 years ago

aryehsinger commented 8 years ago

Would this method work efficiently in a RecyclerView? So that each list-item would contain one DocumentView and the holder will use the span methods to set the justification?

mathew-kurian commented 8 years ago

Ideally it should. I have not tried it with a RecyclerView so I can't be for sure. If you can provide some test results, it would be great!

Nedeos commented 8 years ago

It works but it has an issue: Once you scroll back and forth the entire textview pops up, if the recyclerview item appears on screen, instead of getting smoothly presenting when scrolling in. So the rest of the screen is suddenly shifted to make space for the textview field.

shejishi commented 7 years ago

@Nedeos I meet the same problem, have you deal with this?

yccheok commented 7 years ago

I use a very simple test case.

    <com.bluejamesbond.text.DocumentView xmlns:ext="http://schemas.android.com/apk/res-auto"
        android:layout_marginBottom="24dp"
        android:id="@+id/body_text_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        ext:documentView_antialias="true"
        ext:documentView_cacheConfig="auto_quality"
        ext:documentView_hyphen="-"
        ext:documentView_lineHeightMultiplier="1.2"
        ext:documentView_reverse="false"
        android:text="@string/upgrade_live_account_body"
        ext:documentView_textAlignment="justified"
        ext:documentView_textColor="?attr/primaryTextColor"
        ext:documentView_textFormat="plain"
        ext:documentView_textSize="16sp"
        ext:documentView_textSubPixel="true"
        ext:documentView_textTypefacePath="fonts/Roboto-Light.ttf" />

It doesn't really work well with RecyclerView. When I call notifyDataSetChanged, there will be flickering effect. If I replace com.bluejamesbond.text.DocumentView back to normal TextView, flickering effect gone.