Example usage for android.gesture GestureOverlayView setEventsInterceptionEnabled

List of usage examples for android.gesture GestureOverlayView setEventsInterceptionEnabled

Introduction

In this page you can find the example usage for android.gesture GestureOverlayView setEventsInterceptionEnabled.

Prototype

public void setEventsInterceptionEnabled(boolean enabled) 

Source Link

Usage

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");
    }
}