我想禁用使用向下滑动手势完成当前活动的选项。我想我们可以在createGestureDetector方法中做到这一点,但是怎么做?
if (gesture == Gesture.SWIPE_DOWN) {
// TODO disable this gesture
}
答案 0 :(得分:0)
import com.google.android.glass.touchpad.Gesture;
import com.google.android.glass.touchpad.GestureDetector;
public class MainActivity extends Activity
implements GestureDetector.BaseListener, GestureDetector.FingerListener{
private GestureDetector mGestureDetector;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mGestureDetector = new GestureDetector(this).setBaseListener(this).setFingerListener(this);
}
@Override
public boolean onGesture(Gesture gesture) {
if(gesture == Gesture.SWIPE_DOWN){
return false;
}
}
return true;
}