I hacked one up quickly but need help in testing it. Please if you also need such an implementation try it out in your own app and give feedback on potential improvements. Some basic methods are missing such as removing, sorting items etc but the main part is there.
Note that the purpose of it is for games and it shall not have every feature a high level spinner has, just the basics to be used for ex. settings, in game options etc.
Usage:
in View onCreate() (note Image passed has internally hardcoded size set to 16x16px.)
Using java Syntax Highlighting
- lldd = new LowLevelDropDown( 20, 20, 150, 18, <Your_16x16_Bitmap> );
- lldd.addItem( "Jompe71" );
- lldd.addItem( "LowLevel" );
- lldd.addItem( "DropDown" );
- lldd.addItem( "Can be used" );
- lldd.addItem( "In games !" );
- lldd.addItem( "Please feel" );
- lldd.addItem( "Free to try" );
- lldd.addItem( "It out..." );
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
More View code
Using java Syntax Highlighting
- @Override
- public boolean onTouchEvent( MotionEvent event ) {
- lldd.update( ( int )event.getX(), ( int )event.getY(), event.getAction() );
- return true;
- }
- @Override
- public boolean onKeyUp( int code, KeyEvent event ) {
- switch( code ) {
- case KeyEvent.KEYCODE_DPAD_DOWN:
- lldd.scrollDown();
- return true;
- case KeyEvent.KEYCODE_DPAD_UP:
- lldd.scrollUp();
- return true;
- }
- return false;
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
And in whatever method you chose to render:
Using java Syntax Highlighting
- lldd.render( canvas );
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
Any input highly appreciated !

