void InitCustomViewAbove() { TouchMode = TouchMode.Margin; SetWillNotDraw(false); DescendantFocusability = DescendantFocusability.AfterDescendants; Focusable = true; _scroller = new Scroller(Context, _interpolator); var configuration = ViewConfiguration.Get(Context); _touchSlop = ViewConfigurationCompat.GetScaledPagingTouchSlop(configuration); _minimumVelocity = configuration.ScaledMinimumFlingVelocity; MaximumVelocity = configuration.ScaledMaximumFlingVelocity; var density = Context.Resources.DisplayMetrics.Density; _flingDistance = (int) (MinDistanceForFling*density); PageSelected += (sender, args) => { if (_viewBehind == null) return; switch (args.Position) { case 0: case 2: _viewBehind.ChildrenEnabled = true; break; case 1: _viewBehind.ChildrenEnabled = false; break; } }; }
void InitCustomViewAbove() { if (Android.OS.Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb) _interpolator = new CVAInterpolator(); TouchMode = TouchMode.Margin; SetWillNotDraw(false); DescendantFocusability = DescendantFocusability.AfterDescendants; Focusable = true; _scroller = new Scroller(Context, _interpolator); var configuration = ViewConfiguration.Get(Context); _touchSlop = ViewConfigurationCompat.GetScaledPagingTouchSlop(configuration); _minimumVelocity = configuration.ScaledMinimumFlingVelocity; MaximumVelocity = configuration.ScaledMaximumFlingVelocity; var density = Context.Resources.DisplayMetrics.Density; _flingDistance = (int) (MinDistanceForFling*density); PageSelected += (sender, args) => { if (_viewBehind == null) return; switch (args.Position) { case 0: case 2: _viewBehind.ChildrenEnabled = true; break; case 1: _viewBehind.ChildrenEnabled = false; break; } }; }