当前位置: 首页>>代码示例>>Java>>正文


Java ViewGroupCompat.setMotionEventSplittingEnabled方法代码示例

本文整理汇总了Java中android.support.v4.view.ViewGroupCompat.setMotionEventSplittingEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ViewGroupCompat.setMotionEventSplittingEnabled方法的具体用法?Java ViewGroupCompat.setMotionEventSplittingEnabled怎么用?Java ViewGroupCompat.setMotionEventSplittingEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.view.ViewGroupCompat的用法示例。


在下文中一共展示了ViewGroupCompat.setMotionEventSplittingEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public DrawerLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    final float density = getResources().getDisplayMetrics().density;
    mMinDrawerMargin = (int) (MIN_DRAWER_MARGIN * density + 0.5f);
    final float minVel = MIN_FLING_VELOCITY * density;

    mLeftCallback = new ViewDragCallback(Gravity.LEFT);
    mRightCallback = new ViewDragCallback(Gravity.RIGHT);

    mLeftDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mLeftCallback);
    mLeftDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_LEFT);
    mLeftDragger.setMinVelocity(minVel);
    mLeftCallback.setDragger(mLeftDragger);

    mRightDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mRightCallback);
    mRightDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_RIGHT);
    mRightDragger.setMinVelocity(minVel);
    mRightCallback.setDragger(mRightDragger);

    // So that we can catch the back button
    setFocusableInTouchMode(true);

    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
}
 
开发者ID:bestarandyan,项目名称:ShoppingMall,代码行数:27,代码来源:DrawerLayout.java

示例2: DragPaneLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public DragPaneLayout(Context context, AttributeSet attrs, int defStyleAttr) {
	super(context, attrs, defStyleAttr);

	mDensity = context.getResources().getDisplayMetrics().density;
	
	mViewDragCallback = new ViewDragCallback();
	mDragHelper = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mViewDragCallback);
	mDragHelper.setMinVelocity(MIN_FLING_VELOCITY * mDensity);
	
	ViewCompat.setImportantForAccessibility(this,
               ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO);
	
	// So that we can catch the back button ?
       setFocusableInTouchMode(true);
       setClickable(true);
       ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
       
       mGestureDetector = new GestureDetectorCompat(context, mGestureListener);
}
 
开发者ID:lwz0316,项目名称:DragPaneLayout,代码行数:20,代码来源:DragPaneLayout.java

示例3: DrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public DrawerLayout(Context context, AttributeSet attributeset, int i1)
{
    super(context, attributeset, i1);
    k = 0x99000000;
    m = new Paint();
    t = true;
    float f1 = getResources().getDisplayMetrics().density;
    j = (int)(0.5F + 64F * f1);
    float f2 = f1 * 400F;
    p = new h(this, 3);
    q = new h(this, 5);
    n = ViewDragHelper.create(this, 1.0F, p);
    n.setEdgeTrackingEnabled(1);
    n.setMinVelocity(f2);
    p.a(n);
    o = ViewDragHelper.create(this, 1.0F, q);
    o.setEdgeTrackingEnabled(2);
    o.setMinVelocity(f2);
    q.a(o);
    setFocusableInTouchMode(true);
    ViewCompat.setAccessibilityDelegate(this, new f(this));
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:24,代码来源:DrawerLayout.java

示例4: DrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public DrawerLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    final float density = getResources().getDisplayMetrics().density;
    mMinDrawerMargin = (int) (MIN_DRAWER_MARGIN * density + 0.5f);
    final float minVel = MIN_FLING_VELOCITY * density;

    mLeftCallback = new ViewDragCallback(Gravity.LEFT);
    mRightCallback = new ViewDragCallback(Gravity.RIGHT);

    mLeftDragger = ViewDragHelper.create(this, 0.5f, mLeftCallback);
    mLeftDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_LEFT);
    mLeftDragger.setMinVelocity(minVel);
    mLeftCallback.setDragger(mLeftDragger);

    mRightDragger = ViewDragHelper.create(this, 0.5f, mRightCallback);
    mRightDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_RIGHT);
    mRightDragger.setMinVelocity(minVel);
    mRightCallback.setDragger(mRightDragger);

    // So that we can catch the back button
    setFocusableInTouchMode(true);

    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:27,代码来源:DrawerLayout.java

示例5: MarginDrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public MarginDrawerLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    final float density = getResources().getDisplayMetrics().density;
    mMinDrawerMargin = (int) (MIN_DRAWER_MARGIN * density + 0.5f);
    final float minVel = MIN_FLING_VELOCITY * density;

    mLeftCallback = new ViewDragCallback(Gravity.LEFT);
    mRightCallback = new ViewDragCallback(Gravity.RIGHT);

    mLeftDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mLeftCallback);
    mLeftDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_LEFT);
    mLeftDragger.setMinVelocity(minVel);
    mLeftCallback.setDragger(mLeftDragger);

    mRightDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mRightCallback);
    mRightDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_RIGHT);
    mRightDragger.setMinVelocity(minVel);
    mRightCallback.setDragger(mRightDragger);

    // So that we can catch the back button
    setFocusableInTouchMode(true);

    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
}
 
开发者ID:2fast2fourier,项目名称:something.apk,代码行数:27,代码来源:MarginDrawerLayout.java

示例6: KlyphDrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public KlyphDrawerLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    final float density = getResources().getDisplayMetrics().density;
    mMinDrawerMargin = (int) (MIN_DRAWER_MARGIN * density + 0.5f);
    final float minVel = MIN_FLING_VELOCITY * density;

    mLeftCallback = new ViewDragCallback(Gravity.LEFT);
    mRightCallback = new ViewDragCallback(Gravity.RIGHT);

    mLeftDragger = ViewDragHelper.create(this, 0.5f, mLeftCallback);
    mLeftDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_LEFT);
    mLeftDragger.setMinVelocity(minVel);
    mLeftCallback.setDragger(mLeftDragger);

    mRightDragger = ViewDragHelper.create(this, 0.5f, mRightCallback);
    mRightDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_RIGHT);
    mRightDragger.setMinVelocity(minVel);
    mRightCallback.setDragger(mRightDragger);

    // So that we can catch the back button
    setFocusableInTouchMode(true);

    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
}
 
开发者ID:jonathangerbaud,项目名称:Klyph,代码行数:27,代码来源:KlyphDrawerLayout.java

示例7: TopSwipeLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public TopSwipeLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    final float density = getResources().getDisplayMetrics().density;
    mMinDrawerMargin = (int) (MIN_DRAWER_MARGIN * density + 0.5f);
    final float minVel = MIN_FLING_VELOCITY * density;

    mLeftCallback = new ViewDragCallback(Gravity.LEFT);
    mRightCallback = new ViewDragCallback(Gravity.RIGHT);

    mLeftDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mLeftCallback);
    mLeftDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_LEFT);
    mLeftDragger.setMinVelocity(minVel);
    mLeftCallback.setDragger(mLeftDragger);

    mRightDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mRightCallback);
    mRightDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_RIGHT);
    mRightDragger.setMinVelocity(minVel);
    mRightCallback.setDragger(mRightDragger);

    // So that we can catch the back button
    setFocusableInTouchMode(true);

    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
}
 
开发者ID:kevinmmarlow,项目名称:Dreamer,代码行数:27,代码来源:TopSwipeLayout.java

示例8: init

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
/**
 * Initialize the slider panel
 */
private void init() {
    mScreenWidth = getResources().getDisplayMetrics().widthPixels;

    final float density = getResources().getDisplayMetrics().density;
    final float minVel = MIN_FLING_VELOCITY * density;

    mDragHelper = ViewDragHelper.create(this, 1f, mCallback);
    mDragHelper.setMinVelocity(minVel);

    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);

    // Setup the dimmer view
    mDimView = new View(getContext());
    mDimView.setBackgroundColor(Color.BLACK);
    ViewCompat.setAlpha(mDimView, MAX_DIM_ALPHA);

    // Add the dimmer view to the layout
    addView(mDimView);

}
 
开发者ID:soarcn,项目名称:COCO-Accessory,代码行数:24,代码来源:SliderPanel.java

示例9: DrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public DrawerLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    this.mChildAccessibilityDelegate = new ChildAccessibilityDelegate();
    this.mScrimColor = DEFAULT_SCRIM_COLOR;
    this.mScrimPaint = new Paint();
    this.mFirstLayout = true;
    this.mLockModeLeft = 3;
    this.mLockModeRight = 3;
    this.mLockModeStart = 3;
    this.mLockModeEnd = 3;
    this.mShadowStart = null;
    this.mShadowEnd = null;
    this.mShadowLeft = null;
    this.mShadowRight = null;
    setDescendantFocusability(262144);
    float density = getResources().getDisplayMetrics().density;
    this.mMinDrawerMargin = (int) ((64.0f * density) + 0.5f);
    float minVel = 400.0f * density;
    this.mLeftCallback = new ViewDragCallback(3);
    this.mRightCallback = new ViewDragCallback(5);
    this.mLeftDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, this.mLeftCallback);
    this.mLeftDragger.setEdgeTrackingEnabled(1);
    this.mLeftDragger.setMinVelocity(minVel);
    this.mLeftCallback.setDragger(this.mLeftDragger);
    this.mRightDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, this.mRightCallback);
    this.mRightDragger.setEdgeTrackingEnabled(2);
    this.mRightDragger.setMinVelocity(minVel);
    this.mRightCallback.setDragger(this.mRightDragger);
    setFocusableInTouchMode(true);
    ViewCompat.setImportantForAccessibility(this, 1);
    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
    if (ViewCompat.getFitsSystemWindows(this)) {
        IMPL.configureApplyInsets(this);
        this.mStatusBarBackground = IMPL.getDefaultStatusBarBackground(context);
    }
    this.mDrawerElevation = TitleBar.SHAREBTN_RIGHT_MARGIN * density;
    this.mNonDrawerViews = new ArrayList();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:40,代码来源:DrawerLayout.java

示例10: DebugDrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public DebugDrawerLayout(Context context, AttributeSet attrs, int defStyle) {
  super(context, attrs, defStyle);
  setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
  final float density = getResources().getDisplayMetrics().density;
  mMinDrawerMargin = (int) (MIN_DRAWER_MARGIN * density + 0.5f);
  final float minVel = MIN_FLING_VELOCITY * density;

  mLeftCallback = new ViewDragCallback(Gravity.LEFT);
  mRightCallback = new ViewDragCallback(Gravity.RIGHT);

  mLeftDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mLeftCallback);
  mLeftDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_LEFT);
  mLeftDragger.setMinVelocity(minVel);
  mLeftCallback.setDragger(mLeftDragger);

  mRightDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mRightCallback);
  mRightDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_RIGHT);
  mRightDragger.setMinVelocity(minVel);
  mRightCallback.setDragger(mRightDragger);

  // So that we can catch the back button
  setFocusableInTouchMode(true);

  ViewCompat.setImportantForAccessibility(this,
      ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);

  ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
  ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
  if (ViewCompat.getFitsSystemWindows(this)) {
    IMPL.configureApplyInsets(this);
    mStatusBarBackground = IMPL.getDefaultStatusBarBackground(context);
  }
}
 
开发者ID:rogues-dev,项目名称:superglue,代码行数:34,代码来源:DebugDrawerLayout.java

示例11: DrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public DrawerLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    this.mChildAccessibilityDelegate = new ChildAccessibilityDelegate();
    this.mScrimColor = DEFAULT_SCRIM_COLOR;
    this.mScrimPaint = new Paint();
    this.mFirstLayout = true;
    this.mLockModeLeft = 3;
    this.mLockModeRight = 3;
    this.mLockModeStart = 3;
    this.mLockModeEnd = 3;
    this.mShadowStart = null;
    this.mShadowEnd = null;
    this.mShadowLeft = null;
    this.mShadowRight = null;
    setDescendantFocusability(262144);
    float density = getResources().getDisplayMetrics().density;
    this.mMinDrawerMargin = (int) ((64.0f * density) + 0.5f);
    float minVel = 400.0f * density;
    this.mLeftCallback = new ViewDragCallback(3);
    this.mRightCallback = new ViewDragCallback(5);
    this.mLeftDragger = ViewDragHelper.create(this, 1.0f, this.mLeftCallback);
    this.mLeftDragger.setEdgeTrackingEnabled(1);
    this.mLeftDragger.setMinVelocity(minVel);
    this.mLeftCallback.setDragger(this.mLeftDragger);
    this.mRightDragger = ViewDragHelper.create(this, 1.0f, this.mRightCallback);
    this.mRightDragger.setEdgeTrackingEnabled(2);
    this.mRightDragger.setMinVelocity(minVel);
    this.mRightCallback.setDragger(this.mRightDragger);
    setFocusableInTouchMode(true);
    ViewCompat.setImportantForAccessibility(this, 1);
    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
    if (ViewCompat.getFitsSystemWindows(this)) {
        IMPL.configureApplyInsets(this);
        this.mStatusBarBackground = IMPL.getDefaultStatusBarBackground(context);
    }
    this.mDrawerElevation = 10.0f * density;
    this.mNonDrawerViews = new ArrayList();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:40,代码来源:DrawerLayout.java

示例12: TranslucentDrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public TranslucentDrawerLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
    final float density = getResources().getDisplayMetrics().density;
    mMinDrawerMargin = (int) (MIN_DRAWER_MARGIN * density + 0.5f);
    final float minVel = MIN_FLING_VELOCITY * density;

    mLeftCallback = new ViewDragCallback(Gravity.LEFT);
    mRightCallback = new ViewDragCallback(Gravity.RIGHT);

    mLeftDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mLeftCallback);
    mLeftDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_LEFT);
    mLeftDragger.setMinVelocity(minVel);
    mLeftCallback.setDragger(mLeftDragger);

    mRightDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mRightCallback);
    mRightDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_RIGHT);
    mRightDragger.setMinVelocity(minVel);
    mRightCallback.setDragger(mRightDragger);

    // So that we can catch the back button
    setFocusableInTouchMode(true);

    ViewCompat.setImportantForAccessibility(this,
            ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);

    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
    if (ViewCompat.getFitsSystemWindows(this)) {
        IMPL.configureApplyInsets(this);
        mStatusBarBackground = IMPL.getDefaultStatusBarBackground(context);
    }

    mDrawerElevation = DRAWER_ELEVATION * density;

    mNonDrawerViews = new ArrayList<View>();
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:38,代码来源:TranslucentDrawerLayout.java

示例13: DrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public DrawerLayout(Context context, AttributeSet attributeset, int i)
{
    super(context, attributeset, i);
    mChildAccessibilityDelegate = new ChildAccessibilityDelegate();
    mScrimColor = 0x99000000;
    mScrimPaint = new Paint();
    mFirstLayout = true;
    mShadowStart = null;
    mShadowEnd = null;
    mShadowLeft = null;
    mShadowRight = null;
    setDescendantFocusability(0x40000);
    float f = getResources().getDisplayMetrics().density;
    mMinDrawerMargin = (int)(64F * f + 0.5F);
    float f1 = 400F * f;
    mLeftCallback = new ViewDragCallback(3);
    mRightCallback = new ViewDragCallback(5);
    mLeftDragger = ViewDragHelper.create(this, 1.0F, mLeftCallback);
    mLeftDragger.setEdgeTrackingEnabled(1);
    mLeftDragger.setMinVelocity(f1);
    mLeftCallback.setDragger(mLeftDragger);
    mRightDragger = ViewDragHelper.create(this, 1.0F, mRightCallback);
    mRightDragger.setEdgeTrackingEnabled(2);
    mRightDragger.setMinVelocity(f1);
    mRightCallback.setDragger(mRightDragger);
    setFocusableInTouchMode(true);
    ViewCompat.setImportantForAccessibility(this, 1);
    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
    if (ViewCompat.getFitsSystemWindows(this))
    {
        IMPL.configureApplyInsets(this);
        mStatusBarBackground = IMPL.getDefaultStatusBarBackground(context);
    }
    mDrawerElevation = 10F * f;
    mNonDrawerViews = new ArrayList();
}
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:38,代码来源:DrawerLayout.java

示例14: DrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public DrawerLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
    final float density = getResources().getDisplayMetrics().density;
    mMinDrawerMargin = (int) (MIN_DRAWER_MARGIN * density + 0.5f);
    final float minVel = MIN_FLING_VELOCITY * density;

    mLeftCallback = new ViewDragCallback(Gravity.LEFT);
    mRightCallback = new ViewDragCallback(Gravity.RIGHT);

    mLeftDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mLeftCallback);
    mLeftDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_LEFT);
    mLeftDragger.setMinVelocity(minVel);
    mLeftCallback.setDragger(mLeftDragger);

    mRightDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mRightCallback);
    mRightDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_RIGHT);
    mRightDragger.setMinVelocity(minVel);
    mRightCallback.setDragger(mRightDragger);

    // So that we can catch the back button
    setFocusableInTouchMode(true);

    ViewCompat.setImportantForAccessibility(this,
            ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);

    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
    if (ViewCompat.getFitsSystemWindows(this)) {
        IMPL.configureApplyInsets(this);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:33,代码来源:DrawerLayout.java

示例15: ReverseDrawerLayout

import android.support.v4.view.ViewGroupCompat; //导入方法依赖的package包/类
public ReverseDrawerLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    final float density = getResources().getDisplayMetrics().density;

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ReverseDrawerLayout, 0, 0);
    try {
        mDrawerOverhang = (int) a.getDimension(R.styleable.ReverseDrawerLayout_drawerOverhang,
                (int) (DRAWER_OVERHANG * density + 0.5f));
    } finally {
        a.recycle();
    }

    final float minVel = MIN_FLING_VELOCITY * density;

    mLeftCallback = new ViewDragCallback(Gravity.LEFT);
    mRightCallback = new ViewDragCallback(Gravity.RIGHT);

    mLeftDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mLeftCallback);
    mLeftDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_LEFT);
    mLeftDragger.setMinVelocity(minVel);
    mLeftCallback.setDragger(mLeftDragger);

    mRightDragger = ViewDragHelper.create(this, TOUCH_SLOP_SENSITIVITY, mRightCallback);
    mRightDragger.setEdgeTrackingEnabled(ViewDragHelper.EDGE_RIGHT);
    mRightDragger.setMinVelocity(minVel);
    mRightCallback.setDragger(mRightDragger);

    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
    ViewGroupCompat.setMotionEventSplittingEnabled(this, false);
}
 
开发者ID:mattlogan,项目名称:ReverseDrawerLayout,代码行数:32,代码来源:ReverseDrawerLayout.java


注:本文中的android.support.v4.view.ViewGroupCompat.setMotionEventSplittingEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。