Note that there are some explanatory texts on larger screens.

plurals
  1. POWeird animation on Gallery when a invalidate is requested from it's children
    text
    copied!<p>This is the adapter of my Gallery on which I display ImageViews (thumb of a page)</p> <p>I want to load the images ASync (some times this can come from Network), so I did that code:</p> <pre><code> public View getView(int position, View convertView, ViewGroup parent) { final ImageView image = convertView != null ? convertView : new ImageView(getContext()); final PageInfo page = getItem(position); image.setBackgroundColor(Color.WHITE); image.setLayoutParams(new Gallery.LayoutParams(96, 170)); new AsyncTask&lt;Void, Void, Bitmap&gt;() { @Override protected Bitmap doInBackground(Void... arg0) { try { File thumbnail = page.thumbnail();//Thumbnail download the image if not available return BitmapFactory.decodeStream(new FileInputStream(thumbnail)); } catch (ApplicationException e) { return null; } catch (NetworkException e) { return null; } } protected void onPostExecute(Bitmap result) { if (result == null) return; image.setImageBitmap(result); }; }.executeOnExecutor(executor); return image; } </code></pre> <p>This works, but if I'm dragging the Gallery the views (when switching to the real Bitmap) do a "jump" to another position inside the galley, making it weird.</p> <p>How can I avoid that? Or can I change the image of a ImageView without requesting layout of the ViewGroup?</p> <p>EDIT: A similar question on Google dev groups <a href="http://code.google.com/p/android/issues/detail?id=15526" rel="nofollow">http://code.google.com/p/android/issues/detail?id=15526</a></p>
 

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