Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My solution was, in the end, going with @CommonsWare's suggestion to modify the Gallery source code. This is also required copying the following files:</p> <ul> <li><code>AdapterView</code></li> <li><code>AbsSpinner</code></li> </ul> <p>but these are pretty simple.</p> <p>After that I modified code to do the following:</p> <blockquote> <p><code>RecycleBin</code> (<code>AbsSpinner</code>)<br></p> <ul> <li>Place objects in the recycler one after another, rather than according to position</li> <li>Retrieve objects from the bottom of the recycler, regardless of the position requested</li> <li>The existing implementation assumed that each different position in the adapter resulted in a unique view. The changes above are only good if your Gallery contains only one type of item, if not you'll need to add some sort of key based on item type and the amount of that type required</li> </ul> <p><code>Gallery</code></p> <ul> <li>Used reflection (ugh) to modify the private <code>mGroupFlags</code> variable of <code>ViewGroup</code> to allow child re-ordering - I also set a boolean value indicating whether the field access succeeded which I test before using the component.</li> <li>Removed all calls to <code>mRecycler.clear()</code></li> <li>The number of items the gallery has to display changes as it scrolls and the existing implementation would clear the recycler when (a) setSelection was called (b) a motion scroll occurred</li> </ul> </blockquote> <p>With these modifications my counter in my <code>newView</code> method in my adapter reached... 7.</p> <p><a href="http://pastebin.com/FWyYTt4D">Here is the code</a> (Placed in the public domain 2013/08/07 under <a href="http://en.wikipedia.org/wiki/WTFPL">http://en.wikipedia.org/wiki/WTFPL</a>)</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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