本文整理汇总了Java中android.support.v4.view.ViewGroupCompat类的典型用法代码示例。如果您正苦于以下问题:Java ViewGroupCompat类的具体用法?Java ViewGroupCompat怎么用?Java ViewGroupCompat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ViewGroupCompat类属于android.support.v4.view包,在下文中一共展示了ViewGroupCompat类的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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
}
示例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();
}
示例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>();
}
示例13: DrawerLayout
import android.support.v4.view.ViewGroupCompat; //导入依赖的package包/类
public DrawerLayout(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
super(paramContext, paramAttributeSet, paramInt);
setDescendantFocusability(262144);
float f1 = getResources().getDisplayMetrics().density;
this.mMinDrawerMargin = ((int)(0.5F + 64.0F * f1));
float f2 = 400.0F * f1;
this.mLeftCallback = new ViewDragCallback(3);
this.mRightCallback = new ViewDragCallback(5);
this.mLeftDragger = ViewDragHelper.create(this, 1.0F, this.mLeftCallback);
this.mLeftDragger.mTrackingEdges = 1;
this.mLeftDragger.mMinVelocity = f2;
this.mLeftCallback.mDragger = this.mLeftDragger;
this.mRightDragger = ViewDragHelper.create(this, 1.0F, this.mRightCallback);
this.mRightDragger.mTrackingEdges = 2;
this.mRightDragger.mMinVelocity = f2;
this.mRightCallback.mDragger = this.mRightDragger;
setFocusableInTouchMode(true);
ViewCompat.setImportantForAccessibility(this, 1);
ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegate());
ViewGroupCompat.setMotionEventSplittingEnabled$4d3af60(this);
if (ViewCompat.getFitsSystemWindows(this))
{
IMPL.configureApplyInsets(this);
this.mStatusBarBackground = IMPL.getDefaultStatusBarBackground(paramContext);
}
this.mDrawerElevation = (10.0F * f1);
this.mNonDrawerViews = new ArrayList();
}
示例14: 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();
}
示例15: 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);
}
}