Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have created a horizontal <strong>ListView</strong> in every row of <strong>ListView</strong> if you want single You can do the following </p> <p>Here I am just creating <strong>horizontalListView</strong> of Thumbnail of Videos Like this</p> <p><img src="https://i.stack.imgur.com/2w1Tp.jpg" alt="enter image description here"></p> <p>The idea is just continuously add the <strong>ImageView</strong> to the child of LinearLayout in <strong>HorizontalscrollView</strong></p> <p><strong>Note:</strong> remember to fire <strong>.removeAllViews();</strong> before next time load other wise it will add duplicate child</p> <pre><code>Cursor mImageCursor = db.getPlaylistVideoImage(playlistId); mVideosThumbs.removeAllViews(); if (mImageCursor != null &amp;&amp; mImageCursor.getCount() &gt; 0) { for (int index = 0; index &lt; mImageCursor.getCount(); index++) { mImageCursor.moveToPosition(index); ImageView iv = (ImageView) imageViewInfalter.inflate( R.layout.image_view, null); name = mImageCursor.getString(mImageCursor .getColumnIndex("LogoDefaultName")); logoFile = new File(MyApplication.LOCAL_LOGO_PATH, name); if (logoFile.exists()) { Uri uri = Uri.fromFile(logoFile); iv.setImageURI(uri); } iv.setScaleType(ScaleType.FIT_XY); mVideosThumbs.addView(iv); } mImageCursor.close(); mImageCursor = null; } else { ImageView iv = (ImageView) imageViewInfalter.inflate( R.layout.image_view, null); String name = ""; File logoFile; name = mImageCursor.getString(mImageCursor .getColumnIndex("LogoMediumName")); logoFile = new File(MyApplication.LOCAL_LOGO_PATH, name); if (logoFile.exists()) { Uri uri = Uri.fromFile(logoFile); iv.setImageURI(uri); } } </code></pre> <p>My xml for HorizontalListView</p> <pre><code>&lt;HorizontalScrollView android:id="@+id/horizontalScrollView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/linearLayoutTitle" android:background="@drawable/shelf" android:paddingBottom="@dimen/Playlist_TopBottom_margin" android:paddingLeft="@dimen/playlist_RightLeft_margin" android:paddingRight="@dimen/playlist_RightLeft_margin" android:paddingTop="@dimen/Playlist_TopBottom_margin" &gt; &lt;LinearLayout android:id="@+id/linearLayoutVideos" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left|center_vertical" android:orientation="horizontal" &gt; &lt;/LinearLayout&gt; &lt;/HorizontalScrollView&gt; </code></pre> <p>and Also my Image View as each child</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/imageViewThumb" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginRight="20dp" android:adjustViewBounds="true" android:background="@android:color/transparent" android:contentDescription="@string/action_settings" android:cropToPadding="true" android:maxHeight="200dp" android:maxWidth="240dp" android:padding="@dimen/playlist_image_padding" android:scaleType="centerCrop" android:src="@drawable/loading" /&gt; </code></pre> <p>To learn More you can follow the following links which have some easy samples</p> <ol> <li><a href="http://www.dev-smart.com/?p=34" rel="nofollow noreferrer">http://www.dev-smart.com/?p=34</a></li> <li><a href="https://stackoverflow.com/questions/3240331/horizontal-listview-in-android">Horizontal ListView in Android?</a></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload