List of usage examples for android.gesture GestureOverlayView setEventsInterceptionEnabled
public void setEventsInterceptionEnabled(boolean enabled)
From source file:com.android.mms.ui.ComposeMessageActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { mIsSmsEnabled = MmsConfig.isSmsEnabled(this); super.onCreate(savedInstanceState); resetConfiguration(getResources().getConfiguration()); SharedPreferences prefs = PreferenceManager .getDefaultSharedPreferences((Context) ComposeMessageActivity.this); mGestureSensitivity = prefs.getInt(MessagingPreferenceActivity.GESTURE_SENSITIVITY_VALUE, 3); mEnableEmoticons = prefs.getBoolean(MessagingPreferenceActivity.ENABLE_EMOTICONS, true); boolean showGesture = prefs.getBoolean(MessagingPreferenceActivity.SHOW_GESTURE, false); int unicodeStripping = prefs.getInt(MessagingPreferenceActivity.UNICODE_STRIPPING_VALUE, MessagingPreferenceActivity.UNICODE_STRIPPING_LEAVE_INTACT); mInputMethod = Integer.parseInt(prefs.getString(MessagingPreferenceActivity.INPUT_TYPE, Integer.toString(InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE))); mLibrary = TemplateGesturesLibrary.getStore(this); int layout = R.layout.compose_message_activity; GestureOverlayView gestureOverlayView = new GestureOverlayView(this); View inflate = getLayoutInflater().inflate(layout, null); gestureOverlayView.addView(inflate); gestureOverlayView.setEventsInterceptionEnabled(true); gestureOverlayView.setGestureVisible(showGesture); gestureOverlayView.addOnGesturePerformedListener(this); setContentView(gestureOverlayView);//from w w w . j a va 2s .c o m setProgressBarVisibility(false); getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); // Initialize members for UI elements. initResourceRefs(); LengthFilter lengthFilter = new LengthFilter(MmsConfig.getMaxTextLimit()); mTextEditor.setFilters(new InputFilter[] { lengthFilter }); if (unicodeStripping != MessagingPreferenceActivity.UNICODE_STRIPPING_LEAVE_INTACT) { boolean stripNonDecodableOnly = unicodeStripping == MessagingPreferenceActivity.UNICODE_STRIPPING_NON_DECODABLE; mUnicodeFilter = new UnicodeFilter(stripNonDecodableOnly); } mContentResolver = getContentResolver(); mBackgroundQueryHandler = new BackgroundQueryHandler(mContentResolver); initialize(savedInstanceState, 0); mMultiSensorManager = new MultiSensorManager((Context) ComposeMessageActivity.this, this); if (TRACE) { android.os.Debug.startMethodTracing("compose"); } }