Example usage for android.view ViewGroup setMotionEventSplittingEnabled

List of usage examples for android.view ViewGroup setMotionEventSplittingEnabled

Introduction

In this page you can find the example usage for android.view ViewGroup setMotionEventSplittingEnabled.

Prototype

public void setMotionEventSplittingEnabled(boolean split) 

Source Link

Document

Enable or disable the splitting of MotionEvents to multiple children during touch event dispatch.

Usage

From source file:com.android.systemui.statusbar.phone.NavigationBarView.java

@Override
public void onFinishInflate() {
    rot0 = (FrameLayout) findViewById(R.id.rot0);
    rot90 = (FrameLayout) findViewById(R.id.rot90);

    mRotatedViews[Surface.ROTATION_0] = mRotatedViews[Surface.ROTATION_180] = findViewById(R.id.rot0);

    mRotatedViews[Surface.ROTATION_90] = findViewById(R.id.rot90);

    mRotatedViews[Surface.ROTATION_270] = NAVBAR_ALWAYS_AT_RIGHT ? findViewById(R.id.rot90)
            : findViewById(R.id.rot270);

    for (View v : mRotatedViews) {
        // this helps avoid drawing artifacts with glowing navigation keys
        ViewGroup group = (ViewGroup) v.findViewById(R.id.nav_buttons);
        group.setMotionEventSplittingEnabled(false);
    }/*  w w  w  . j  av a2 s.  co m*/
    updateColor(true);
    mCurrentView = mRotatedViews[Surface.ROTATION_0];

    // this takes care of making the buttons
    SettingsObserver settingsObserver = new SettingsObserver(new Handler());
    settingsObserver.observe();
}