0

I'm trying to create an birthday reminder app and I have on MainActivity one RecyclerView with grid view of items. And it looks like this:

Image

And I have maximized TextView inside to 5 characters for reducing it and not exceed this note. How could I do this without maximizing characters of TextView to 5 characters and make this to look better?

This is my layout of grid_row_item:

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        card_view:cardBackgroundColor="#00000000"
        card_view:cardElevation="0.01dp">

        <RelativeLayout
            android:background="@android:color/transparent"
            android:id="@+id/top_layout"
            android:layout_width="match_parent"
            android:layout_height="140dp">

            <ImageView
                android:background="@drawable/note3"
                android:id="@+id/img_thumbnail"
                android:layout_width="320dp"
                android:layout_height="180dp"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true" />

            <helper.CustomTextView
                android:id="@+id/first_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Test"
                android:textColor="#000000"
                android:textSize="18sp"
                android:maxLength="7"
                android:ellipsize="end"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="48dp" />

            <helper.CustomTextView
                android:id="@+id/last_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Test"
                android:textSize="18sp"
                android:maxLength="6"
                android:ellipsize="end"
                android:textColor="#000000"
                android:layout_below="@+id/first_name"
                android:layout_alignLeft="@+id/first_name"
                android:layout_alignStart="@+id/first_name" />

            <TextView
                android:id="@+id/date_of_birthday"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"/>

            <TextView
                android:id="@+id/gender"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"/>

        </RelativeLayout>
    </android.support.v7.widget.CardView>
</LinearLayout>
MSU_Bulldog
  • 3,501
  • 5
  • 37
  • 73
Dusan Dimitrijevic
  • 3,169
  • 6
  • 22
  • 46
  • Also i would like to mention that this grid items look very small and text inside is not verz viewable – Dusan Dimitrijevic Nov 11 '15 at 19:38
  • you can see the issue is you have slanted post it notes image and you want to place the text center. What i suggest is to open the image in a paint package and draw a rectangle inside so that you get a reference where the text should go inside – Tasos Nov 11 '15 at 19:45
  • you could also rotate the textview to same degree as the image so it looks right and may avoid the overflow -- http://stackoverflow.com/questions/8959069/how-to-rotate-textview-90-degrees-and-display – Tasos Nov 11 '15 at 19:47

0 Answers0