-1

Now i going on with the MergeAdapter to show the list of data in vertical view and successfully showed it.Now what i need to show it in MergeAdapter horizontal list and also search a lot for MergeAdapter horizontal listview.

Is it possible to show listview in MergeAdapter horizontal view if there please help me.

Should achieve this by MergeAdapter horizontal listview.

sikan
  • 76
  • 9

2 Answers2

0

There is no supported horizontal listView in android. I have no idea about MArgeAdapter but if you want to use Horizontal you need to constructer a xml like that

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

    <HorizontalScrollView
        android:id="@+id/horizontalScrollView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:paddingTop="@dimen/paddingTop">

        <LinearLayout
            android:id="@+id/scrollViewContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="horizontal" >
        </LinearLayout>
    </HorizontalScrollView>

</LinearLayout>

and add views inside scrollViewContainer. Also check this How can I make a horizontal ListView in Android?

Community
  • 1
  • 1
Mucahit
  • 573
  • 1
  • 6
  • 16
  • i need to achieve this with the help merge Adapter can u please help to solve it by merger – sikan Mar 17 '15 at 11:16
  • You cant set adapter to LinearLayout. And there is no supported horizontal listview in android. So you need to do something like this. You already have got your data set, so in a for loop you can add all item inside scrollViewContainer – Mucahit Mar 17 '15 at 11:18
0

MergeAdapter has nothing to do with being vertical or horizontal. MergeAdapter is just an Adapter. The visual representation of the collection is up to the AdapterView, which can do scrolling vertically, horizontally, bi-directionally, diagonally, or not have scrolling at all.

So, find yourself an AdapterView that can serve as a horizontal ListView. Or, use RecyclerView for the horizontal-scrolling list and handle your merging by some other means.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • ok let me try for mean can you provide any links with the adapter with merger example – sikan Mar 17 '15 at 11:21
  • I had did this HorizontalListView extends AdapterView but it causes me array out of index exception can u please provide me any links for horizontal view – sikan Mar 17 '15 at 11:31
  • @sikan: I have never used a horizontal `ListView` implementation. – CommonsWare Mar 17 '15 at 11:41