Is there a better way?
Since we do not know what you are building, it is impossible to say. I agree with Yoni Samlan's comment that ListView may be enough for your needs.
Why is the Android framework an extension of such a complex widget?
While it is possible that an overridden Gallery might make it easier for you to orient yourself in a different way, the core Android team should weigh such a re-evaluation against other development priorities.
One of the priorities is fidelity to the SDK. They want to make sure that as much as possible the code written for Android 1.5 can run on Android 2.1 without change. This limits them in two ways. Firstly, they cannot simply modify the existing Gallery , for example, to satisfy your desires, if this leads to the fact that they violate the existing API. Secondly, the main Android team will not disclose new methods or classes, even if they can be useful to third-party developers, unless and until the team is ready to support these methods or classes for a long time.
Android was originally written before the SDK was. This is because most embedded applications (for example, a calculator) cannot be built with the SDK only, but must be created as part of the firmware image. Similarly, the core Android team had to make a decision, as part of creating the initial SDK, about how best to use the existing code and create public materials that we can work with, and protected / private things that we cannot, given fidelity SDK As you may have noticed, Android is extensive, and therefore the creation of the SDK should have required a significant amount of staff. Rewriting a large amount of it to increase the likelihood that someone could, for example, create a vertical Gallery , was probably not high on their list.
In an ideal world, yes, we can more easily extend the built-in widgets and significantly change their behavior. Similarly, in an ideal world, I would have hair ... :-)
CommonsWare
source share