private OnItemSelectedListener mSelectedListener;
private boolean mActivated = false;
+ private boolean mSelectionChanged = false;
+
private class Background extends GLView {
@Override
protected void render(GLRootView root, GL11 gl) {
private void setSelectedItem(GLView view, int index) {
if (index == mSelectedIndex) return;
+ mSelectionChanged = true;
mSelectedIndex = index;
if (mSelectedListener != null) {
if (index == INDEX_NONE) {
int y = (int) event.getY();
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
+ mSelectionChanged = false;
setActivated(true);
case MotionEvent.ACTION_MOVE:
for (int i = 1, n = getComponentCount(); i < n; ++i) {
}
}
setSelectedItem(null, INDEX_NONE);
+ break;
+ case MotionEvent.ACTION_UP:
+ if (mSelectionChanged == false) {
+ setSelectedItem(null, INDEX_NONE);
+ }
}
return true;
}