Simplistic-RSS-Demo icon indicating copy to clipboard operation
Simplistic-RSS-Demo copied to clipboard

A support question on custom listview

Open abshkd opened this issue 10 years ago • 2 comments

I like your library better than others. I have tried a great many already. I am going with your particular one and already wrap the call in AsyncTask. I am ok with basic one item lists but I am not able to figure out the best way to put it in a custom view I have in the list. I have used fragments with HashMaps but had to write a complicated Map for it because the source was JSON.

Anyway, i'd appreciate an example which is similar to your screenshot where you show images. Below is my fragment.xml that is used by the simple listview.xml container. I used a custom "position" index to refer to each item within a datalist so i could manipulate the entry before attaching it to listview. In this case I am at a loss.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:textSize="15sp" android:textStyle="bold" />

<ImageView
    android:id="@+id/iv_image"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/title"
    android:layout_centerVertical="true"
    android:padding="5sp"
    />

<TextView
    android:id="@+id/description"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_toRightOf="@id/iv_image"
    android:layout_below="@id/title"  />

<TextView
    android:id="@+id/link"
    android:visibility="invisible"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
     />

Appreciate any clues on this.

abshkd avatar Feb 06 '15 22:02 abshkd

Yeah, sure thing. I think what you should do is implement a custom adapter. The adapter is in charge of how your items get displayed. That will let you customize your views easier. Here is a short guide, but if you need anymore help or if I haven't understood your questions clearly, let me know.

http://www.ezzylearning.com/tutorial/customizing-android-listview-items-with-custom-arrayadapter http://www.vogella.com/tutorials/AndroidListView/article.html

ShirwaM avatar Feb 10 '15 04:02 ShirwaM

Thank you. That helps.

abshkd avatar Feb 10 '15 04:02 abshkd