Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Compatible with AndroidX (Empty screen) #70

Open
geekykant opened this issue Dec 13, 2019 · 1 comment
Open

Not Compatible with AndroidX (Empty screen) #70

geekykant opened this issue Dec 13, 2019 · 1 comment

Comments

@geekykant
Copy link

The following sample code provided doesn't output anything on the screen or the studio live preview.

Versions:

  • expandableTextView:0.1.4
  • gradle:3.5.0
<com.ms.square.android.expandabletextview.ExpandableTextView xmlns:expandableTextView="http://schemas.android.com/apk/res-auto"
                android:id="@+id/expand_text_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                expandableTextView:maxCollapsedLines="4"
                expandableTextView:animDuration="200">

                <TextView
                    android:id="@id/expandable_text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:textSize="16sp"
                    android:text="asdkjbaskjda\nsadasdasdas\nasdasdasdasd\nasdasdasdas\nasdas\nadsas\nadsas"
                    android:textColor="#666666" />

                <ImageButton
                    android:id="@id/expand_collapse"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="16dp"
                    android:layout_gravity="end|bottom"
                    android:background="@android:color/transparent" />
            </com.ms.square.android.expandabletextview.ExpandableTextView>
@Kalzeroth
Copy link

I think you have to set the text in code. I'm using AndroidX and this library and I do have output in the emulator/device screen. No live preview though as you pointed out.

_expandableTextView?.text = getString(R.string.tos_1)
<com.ms.square.android.expandabletextview.ExpandableTextView
                android:id="@+id/_expandableTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_marginEnd="16dp"
                expandableTextView:animAlphaStart="1"
                expandableTextView:animDuration="300"
                expandableTextView:maxCollapsedLines="2">

                <LinearLayout
                    android:layout_marginTop="16dp"
                    android:layout_marginBottom="16dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:id="@id/expandable_text"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:textColor="@color/white"
                        android:textSize="16sp" />

                    <ImageButton
                        android:id="@id/expand_collapse"
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:layout_gravity="center_vertical|end"
                        android:background="@android:color/transparent"
                        android:padding="16dp"
                        android:src="@drawable/ic_keyboard_arrow_down_white_24dp"
                        android:tint="@color/white" />

                </LinearLayout>

</com.ms.square.android.expandabletextview.ExpandableTextView>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants