Here is my code:
Using java Syntax Highlighting
- public class MapDisplaySpinner extends Spinner {
- public MapDisplaySpinner(Context context) {
- super(context);
- }
- public MapDisplaySpinner(Context context, AttributeSet attrs, Map params) {
- super(context, attrs, params);
- }
- @Override
- public boolean onKeyDown(int KeyCode, KeyEvent event) {
- Message m = new Message();
- m.what = MapDisplay.HALTIDENTIFIER;
- switch (KeyCode) {
- case KeyEvent.KEYCODE_DPAD_LEFT:
- if (this.getSelectedItemPosition() > 0)
- {
- this.setSelection(this.getSelectedItemPosition() - 1);
- }
- break;
- case KeyEvent.KEYCODE_DPAD_RIGHT:
- if (this.getSelectedItemPosition() < this.mItemCount)
- {
- this.setSelection(this.getSelectedItemPosition() + 1);
- }
- break;
- }
- MapDisplay.this.ControlRefreshUpdateHandler.sendMessage(m);
- return true;
- }
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
Here is my xml file:
Using xml Syntax Highlighting
- <com.Mvite.MapDisplay.MapDisplaySpinner
- android:id="@+id/spinner"
- android:layout_alignParentTop="true"
- android:layout_width="20px"
- android:layout_height="5px"
- />
Parsed in 0.001 seconds, using GeSHi 1.0.8.4
Thanks


