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

The text is not displayed on the sub-layouts. #86

Open i-petro opened 9 years ago

i-petro commented 9 years ago

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:baselineAligned="false">

<LinearLayout
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_margin="@dimen/film_padding"
    android:layout_weight="1"
    android:background="@color/element_bg_color"
    android:paddingBottom="0dp"
    android:paddingLeft="0dp"
    android:paddingRight="0dp"
    android:paddingTop="0dp">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:weightSum="4">

        <ImageView
            android:id="@+id/adapter_comment_like"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|center_horizontal"
            android:layout_marginBottom="-10dp"
            android:layout_marginTop="-5dp"
            android:scaleType="fitXY"
            android:src="@mipmap/ic_like_icon" />

        <TextView
            android:id="@+id/adapter_comment_rating"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="2"
            android:gravity="center_horizontal"
            android:text="-255"
            android:textAppearance="?android:textAppearanceLarge"
            android:textColor="@color/text_color_dark"
            android:textStyle="bold|italic" />

        <ImageView
            android:id="@+id/adapter_comment_unlike"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|center_horizontal"
            android:layout_marginBottom="-5dp"
            android:layout_marginTop="-10dp"
            android:scaleType="fitXY"
            android:src="@mipmap/ic_unlike_icon" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_margin="0dp"
        android:layout_weight="5"
        android:orientation="vertical"
        android:paddingLeft="20px"
        android:weightSum="3">

        <TextView
            android:id="@+id/adapter_comment_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="start|center_vertical"
            android:layout_margin="1dip"
            android:gravity="start"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="@color/text_color_dark" />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <android.support.v7.widget.AppCompatRatingBar
                android:id="@+id/adapter_comment_film_rating"
                style="?android:attr/ratingBarStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="2dp"
                android:numStars="5"
                android:rating="1" />

            <TextView
                android:id="@+id/adapter_comment_date"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="1dip"
                android:layout_weight="2"
                android:paddingLeft="5dp"
                android:text="02.02.2015"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@color/text_color_hint_dark" />
        </LinearLayout>

        <com.bluejamesbond.text.DocumentView
            android:id="@+id/adapter_comment_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall"
            app:documentView_textColor="@color/text_color_dark" />
    </LinearLayout>

</LinearLayout>

phbraga commented 9 years ago

i have the same problem.

andreyluiz commented 8 years ago

In my case, when using weight with width of 0dp in a horizontal layout, the text is cut.

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:id="@+id/sobre_aparelho_info_header">

    <ImageView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="0.2"
        android:layout_gravity="center_vertical"
        android:src="@drawable/ic_info_outline_black_48dp"
        android:contentDescription="@string/info_header_image_content_description"
        android:id="@+id/sobre_aparelho_info_header_image"/>

    <com.bluejamesbond.text.DocumentView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="0.8"
        ext:documentView_textAlignment="justified"
        ext:documentView_antialias="true"
        ext:documentView_text="@string/sobre_aparelho_info_header_text"
        ext:documentView_textColor="@color/original_android_text"
        android:id="@+id/sobre_aparelho_info_header_text" />

</LinearLayout>
kangkitty commented 5 years ago

I also face it,how to solve this problem?