4

I want to display a 'read more' link when the obtained text increases to a certain limit, so that if user wants to read in detail, they can click on read more just like the Application installation page of Play Store

Like Read More in this page

Please suggest me on how to implement this

Ed Holloway-George
  • 5,092
  • 2
  • 37
  • 66
Manikanta
  • 3,421
  • 4
  • 30
  • 51
  • possible duplicate of [Add "View More" at the end of textview after 3 lines](http://stackoverflow.com/questions/19675331/add-view-more-at-the-end-of-textview-after-3-lines) – Ed Holloway-George May 14 '15 at 13:29

3 Answers3

1

You can refer this. Layout available on git hub

https://github.com/traex/ExpandableLayout

Moinkhan
  • 12,732
  • 5
  • 48
  • 65
0

Thank you all for giving answer, here is how i solved it. There is a property called android:maxLines="" using this property we can add Read More text view below the text view by making it clickable so that when user clicks on the text view we can perform any action we wanted Example:

<TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="Device supports NFS etc....."
        android:maxLines="4"
        android:id="@+id/description" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="Read More"
        android:layout_gravity="center_horizontal"
        android:textColor="#0066FF"
        android:id="@+id/readmore" />

I hope this helps.

Manikanta
  • 3,421
  • 4
  • 30
  • 51
-1

Look like on google play this link opens other activity. So, it is just button with startActivity() behavior.

Yevgen Kulik
  • 5,713
  • 2
  • 22
  • 44