I need to implement a list of images and buttons. I have 6 images serving as separators and a total 14 buttons with custom background. The list has a full screen (800×600) background, the separator images are 800×30 pixels and the buttons have similar size as well (all buttons have the same background image). On top of this, I need a custom scroll indicator: two blinking arrows on top and bottom. The arrows should be shown or hidden according to the scroll position.
I have some other GUI elements including a GLSurfaceView hidden using View.GONE as the list is shown on top of those.
The problem is, that this setup runs too slow on relatively powerful handsets such as the Galaxy Nexus or the Desire HD.
I tried two different approaches:
- Using a ListView based on this tutorial: http://android.amberfog.com/?p=296
- Put all buttons and images into one LinearLayout and use that as a child of a ScrollView. To hide and show the the blinking arrows I determine scroll position by overriding onScrollChanged (Synchronise ScrollView scroll positions - android)
Both implementation runs slow depending on the actual handset. The ScrollView implementation is usually faster but it has noticable lags on a Desire or the Galaxy Nexus while the ListView implementation is slow on the Desire HD.
Which is the best way to implement such list? Could you suggest me some guidelines how to make the implementation fast and device independent? I believe having about 20 images and buttons in a list shouldn't be a problem for these handsets.