Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: Creating an image gallery
    primarykey
    data
    text
    <p>For the Android application I am currently creating I would like to have a simple image gallery. Ideally it would be a single line of images with a horizontal scroll bar (much like this: <a href="http://www.appszoom.com/android_applications/multimedia/3d-gallery_hbij.html" rel="nofollow">http://www.appszoom.com/android_applications/multimedia/3d-gallery_hbij.html</a> although the 3D effect isn't necessary).</p> <p>I know that the Android API used to have the <code>Gallery</code> Class which would have been perfect, but now this has been deprecated. Now I have managed to create a simple gallery using <code>LinearLayout</code> and <code>HorizontalScrollView</code> as such</p> <p>XML: </p> <pre><code> &lt;HorizontalScrollView android:id="@+id/hor_scroll_view" android:layout_width="match_parent" android:layout_height="wrap_content"&gt; &lt;LinearLayout android:id="@+id/gallery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" /&gt; &lt;/HorizontalScrollView&gt; </code></pre> <p>Aesthetically this is perfect; looking exactly how I want it to (I don't see the significance of posting my code but I am more than happy to upon request). The problem with this lies in the functionality. It's important that the user has the ability to select an image from the gallery list but this seems to be impossible using my current approach. I have read that a <code>ViewPager</code> could also be used but from my understanding it seems that this would also be impossible to select individual images from. <code>GridView</code> would be my next choice as one can implement the <code>OnItemClickListener</code> however surely this will pose a problem of dynamically adding columns when the user takes a photo.</p> <p>So my question is simply: how do I go about achieving this functionality of selecting individual images?</p> <p>As a final note: I am fairly new to Android programming but am highly proficient with Java.</p>
    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.
 

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