Dusan Dimitrijevic
Dusan Dimitrijevic

Reputation: 3219

Problems with positioning items in row of ListView

I'm populating this listView with Json and in second activity i'm passing data from listView in first Activity. I couldn't find any other way to get description for example in second activity for each movie in list, so i insert textView in first activity and make it invisible and pass it to second activity, but because of long text, i'm getting some weird look of listView. First item in listView is good because text is short. Last two textView are invisible and the first one is description of movie, so what could i do to fix this?

Here is the xml file of first Activity:

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/lista_preporuka_selector"
    android:padding="8dp" >

    <!-- Thumbnail Image -->
    <com.android.volley.toolbox.NetworkImageView
        android:id="@+id/thumbnail"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_alignParentLeft="true"
        android:layout_marginRight="8dp" />

    <!-- Movie Title -->
    <TextView
        android:id="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/thumbnail"
        android:layout_toRightOf="@+id/thumbnail"
        android:textSize="@dimen/title"
        android:textStyle="bold" />

    <!-- Rating -->
    <TextView
        android:id="@+id/rating"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/title"
        android:layout_marginTop="1dip"
        android:layout_toRightOf="@+id/thumbnail"
        android:textSize="@dimen/rating" />

    <!-- Genre -->
    <TextView
        android:id="@+id/genre"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/rating"
        android:layout_marginTop="5dp"
        android:layout_toRightOf="@+id/thumbnail"
        android:textColor="@color/genre"
        android:textSize="@dimen/genre" />

    <!-- Release Year -->
    <TextView
        android:id="@+id/releaseYear"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:textColor="@color/year"
        android:textSize="@dimen/year" />

    <!-- Opis Filma -->
    <TextView 
        android:id="@+id/opis"        
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:visibility="invisible"/>

    <!-- Url video klipa -->
    <TextView 
        android:id="@+id/url"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="invisible"/>

</RelativeLayout>

First Activity Second Activity

Upvotes: 1

Views: 45

Answers (2)

Amit Vaghela
Amit Vaghela

Reputation: 22945

Add scrollview to your description. it will look better than you are getting.

Upvotes: 1

Pavan
Pavan

Reputation: 5136

In this case you can set TextView visibility to GONE rather INVISIBLE

Upvotes: 1

Related Questions