List of usage examples for android.support.v4.view GestureDetectorCompat GestureDetectorCompat
public GestureDetectorCompat(Context context, OnGestureListener onGestureListener)
From source file:zemin.notification.NotificationView.java
void setContentView(View view) { if (mContentView == view || view == null) return;/*from w w w . j a v a 2 s . com*/ if (mContentView != null) { mContentViewSwitcher.start(view); } else { mContentBackground = new GradientDrawable(); addState(CONTENT_BACKGROUND_CHANGED); mDimension[0] = LayoutParams.MATCH_PARENT; mDimension[1] = LayoutParams.WRAP_CONTENT; mHideAnimationListener = mDismissAnimationListener; mDefaultShowAnimation = AnimationFactory.pushDownIn(); mDefaultHideAnimation = AnimationFactory.pushUpOut(); mContentViewSwitcher = new ContentViewSwitcher(); mGestureDetector = new GestureDetectorCompat(mContext, this); setContentViewInner(view); } }
From source file:com.adherence.adherence.SwipeRevealLayout.java
private void init(Context context, AttributeSet attrs) { if (attrs != null && context != null) { TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.SwipeRevealLayout, 0, 0); mDragEdge = a.getInteger(R.styleable.SwipeRevealLayout_dragEdge, DRAG_EDGE_LEFT); mMinFlingVelocity = a.getInteger(R.styleable.SwipeRevealLayout_flingVelocity, DEFAULT_MIN_FLING_VELOCITY); mMode = a.getInteger(R.styleable.SwipeRevealLayout_mode, MODE_NORMAL); mMinDistRequestDisallowParent = a.getDimensionPixelSize( R.styleable.SwipeRevealLayout_minDistRequestDisallowParent, dpToPx(DEFAULT_MIN_DIST_REQUEST_DISALLOW_PARENT)); }/*from w w w . j a v a2 s . c o m*/ mDragHelper = ViewDragHelper.create(this, 1.0f, mDragHelperCallback); mDragHelper.setEdgeTrackingEnabled(ViewDragHelper.EDGE_ALL); mGestureDetector = new GestureDetectorCompat(context, mGestureListener); }
From source file:gdswww.com.momo.view.SwipeRevealLayout.java
private void init(Context context, AttributeSet attrs) { if (attrs != null && context != null) { TypedArray a;// w ww.j ava 2 s .c om a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.SwipeRevealLayout, 0, 0); mDragEdge = a.getInteger(R.styleable.SwipeRevealLayout_dragEdge, DRAG_EDGE_LEFT); mMinFlingVelocity = a.getInteger(R.styleable.SwipeRevealLayout_flingVelocity, DEFAULT_MIN_FLING_VELOCITY); // mMode = a.getInteger(R.styleable.SwipeRevealLayout_mode, MODE_NORMAL); mMinDistRequestDisallowParent = a.getDimensionPixelSize( R.styleable.SwipeRevealLayout_minDistRequestDisallowParent, dpToPx(DEFAULT_MIN_DIST_REQUEST_DISALLOW_PARENT)); } mDragHelper = ViewDragHelper.create(this, 1.0f, mDragHelperCallback); mDragHelper.setEdgeTrackingEnabled(ViewDragHelper.EDGE_ALL); mGestureDetector = new GestureDetectorCompat(context, mGestureListener); }
From source file:org.androfarsh.widget.DragGridLayout.java
private void init() { mHierarchyChangeListener = new HierarchyChangeListenerImpl(); mGestureListener = new GestureListenerImpl(); mGestureDetector = new GestureDetectorCompat(getContext(), mGestureListener); mGestureDetector.setIsLongpressEnabled(true); setLongClickable(true);/*ww w.j a va 2s. c om*/ super.setOnHierarchyChangeListener(mHierarchyChangeListener); setChildrenDrawingOrderEnabled(true); setClipToPadding(false); }
From source file:com.xnxs.mediaplayer.widget.media.VRVideoView.java
/** * By Lin Date:2016/8/12 15:42// w w w .ja v a2 s .c o m * * @? */ public void enableBrightnessAudioVolume(@NonNull Window window) { this.mBrightnessAudioVolumeEnable = true; this.mWindow = window; if (mDetector == null) { mDetector = new GestureDetectorCompat(mAppContext, onGestureListener); mDetector.setOnDoubleTapListener(onGestureListener); } }
From source file:zemin.notification.NotificationBoard.java
private void initialize() { mContext = getContext();//from w w w . ja va2 s.c o m mInflater = LayoutInflater.from(mContext); mCenter = NotificationDelegater.getInstance().center(); mCenter.addListener(this); mGestureDetector = new GestureDetectorCompat(mContext, this); mH = new H(this); mContentView = new ContentView(mContext); addView(mContentView, new FrameLayout.LayoutParams(mContentView.mWidth, mContentView.mHeight, Gravity.CENTER | Gravity.TOP)); }