public void ShowCollapsedPanel(uint length = DEFAULT_SLIDE_ANIMATION_SPEED) { WhenSlidingPanelStateChanging?.Invoke(null, new StateChangingEventArgs() { OldState = _currentSlidePanelState, NewState = SlidingPanelState.Collapsed }); ShowNavigationBar(true); if (_hideTitleView) { _titleRelativeLayout.HeightRequest = _currentTitleHeight; } // set CollapsedPanelHeight Rectangle drawerCollapsedPosition = _slidingPanelAbsoluteLayout.Bounds; double drawerCollapsedPositionY = drawerCollapsedPosition.Y; drawerCollapsedPositionY = _slidingPanelAbsoluteLayout.Height; drawerCollapsedPositionY -= _currentTitleHeight; // iOS only: No need the below code after XF 2.4.0.xxx if (_hideNavBarFeature == true && _showingNavBar == true && Device.RuntimePlatform != Device.iOS) { drawerCollapsedPositionY -= NavigationBarHeight; _showingNavBar = false; if (PanelRatio >= MAX_PANEL_RATIO) { drawerCollapsedPositionY -= StatusBarHeight; } } Device.BeginInvokeOnMainThread(() => { length = (length == DEFAULT_SLIDE_ANIMATION_SPEED) ? (uint)_slideAnimationSpeed : length; _slidingPanelAbsoluteLayout.TranslateTo(0, drawerCollapsedPositionY, length, Easing.CubicOut); }); _currentSlidePanelState = SlidingPanelState.Collapsed; if (_pictureImage != null) { Rectangle pictureBounds = _pictureAbsoluteLayout.Bounds; pictureBounds.Y = drawerCollapsedPositionY + _pictureAbsoluteLayout.Height; pictureBounds.Y += _currentTitleHeight; Device.BeginInvokeOnMainThread(() => { length = (length == DEFAULT_SLIDE_ANIMATION_SPEED) ? (uint)_slideAnimationSpeed : length; _pictureAbsoluteLayout.TranslateTo(pictureBounds.X, pictureBounds.Y, length, Easing.CubicOut); }); } WhenSlidingPanelStateChanged?.Invoke(null, new StateChangedEventArgs() { State = _currentSlidePanelState }); }
public void ShowExpandedPanel(uint length = DEFAULT_SLIDE_ANIMATION_SPEED) { if (_isExpandable == true) { WhenSlidingPanelStateChanging?.Invoke(null, new StateChangingEventArgs() { OldState = _currentSlidePanelState, NewState = SlidingPanelState.Expanded }); ApplyPanelRatio(_panelRatio); ShowNavigationBar(false); // iOS only: No need the below code after XF 2.4.0.xxx if (Device.RuntimePlatform != Device.iOS) { _showingNavBar = true; } if (_hideTitleView) { _titleRelativeLayout.HeightRequest = _primaryFloatingActionButtonHeight / 2; } Rectangle drawerExpandedPosition = _slidingPanelAbsoluteLayout.Bounds; drawerExpandedPosition.Y = 0; // handling hide primary fab button _slidingPanelAbsoluteLayout.Padding = new Thickness(0, 0, 0, _primaryFloatingActionButtonHeight / 2 * -1); drawerExpandedPosition.Y -= (_primaryFloatingActionButtonHeight / 2); Device.BeginInvokeOnMainThread(() => { length = (length == DEFAULT_SLIDE_ANIMATION_SPEED) ? (uint)_slideAnimationSpeed : length; _slidingPanelAbsoluteLayout.TranslateTo(drawerExpandedPosition.X, drawerExpandedPosition.Y, length, Easing.CubicOut); }); _currentSlidePanelState = SlidingPanelState.Expanded; if (_pictureImage != null) { Rectangle pictureExpandedPosition = _pictureAbsoluteLayout.Bounds; pictureExpandedPosition.Y = 0; Device.BeginInvokeOnMainThread(() => { length = (length == DEFAULT_SLIDE_ANIMATION_SPEED) ? (uint)_slideAnimationSpeed : length; _pictureAbsoluteLayout.TranslateTo(pictureExpandedPosition.X, pictureExpandedPosition.Y, length, Easing.CubicOut); }); } WhenSlidingPanelStateChanged?.Invoke(null, new Interface.StateChangedEventArgs() { State = _currentSlidePanelState }); } }
public void ShowCollapsedPanel(uint length = DEFAULT_SLIDE_ANIMATION_SPEED) { WhenSlidingPanelStateChanging?.Invoke(null, new StateChangingEventArgs() { OldState = _currentSlidePanelState, NewState = SlidingPanelState.Collapsed }); ShowNavigationBar(true); if (_hideTitleView) { _titleRelativeLayout.HeightRequest = _currentTitleHeight; } Rectangle drawerCollapsedPosition = _slidingPanelAbsoluteLayout.Bounds; drawerCollapsedPosition.Y = _slidingPanelAbsoluteLayout.Height + (this._primaryFloatingActionButtonHeight / 2); drawerCollapsedPosition.Y -= _currentTitleHeight; if (_hideNavBarFeature == true && _showingNavBar == true) { drawerCollapsedPosition.Y -= NavigationBarHeight; _showingNavBar = false; if (PanelRatio >= MAX_PANEL_RATIO) { drawerCollapsedPosition.Y -= StatusBarHeight; } } Device.BeginInvokeOnMainThread(() => { length = (length == DEFAULT_SLIDE_ANIMATION_SPEED) ? (uint)_slideAnimationSpeed : length; _slidingPanelAbsoluteLayout.TranslateTo(drawerCollapsedPosition.X, drawerCollapsedPosition.Y, length, Easing.CubicOut); }); _currentSlidePanelState = SlidingPanelState.Collapsed; if (_pictureImage != null) { Rectangle pictureBounds = _pictureAbsoluteLayout.Bounds; pictureBounds.Y = drawerCollapsedPosition.Y + _pictureAbsoluteLayout.Height; pictureBounds.Y += _currentTitleHeight; Device.BeginInvokeOnMainThread(() => { length = (length == DEFAULT_SLIDE_ANIMATION_SPEED) ? (uint)_slideAnimationSpeed : length; _pictureAbsoluteLayout.TranslateTo(pictureBounds.X, pictureBounds.Y, length, Easing.CubicOut); }); } WhenSlidingPanelStateChanged?.Invoke(null, new StateChangedEventArgs() { State = _currentSlidePanelState }); }
public void ShowExpandedPanel(uint length = DEFAULT_SLIDE_ANIMATION_SPEED) { if (_isExpandable == true) { WhenSlidingPanelStateChanging?.Invoke(null, new StateChangingEventArgs() { OldState = _currentSlidePanelState, NewState = SlidingPanelState.Expanded }); ApplyPanelRatio(_panelRatio); ShowNavigationBar(false); _showingNavBar = true; if (_hideTitleView) { _titleRelativeLayout.HeightRequest = 0; } Rectangle drawerExpandedPosition = _slidingPanelAbsoluteLayout.Bounds; drawerExpandedPosition.Y = 0; Device.BeginInvokeOnMainThread(() => { length = (length == DEFAULT_SLIDE_ANIMATION_SPEED) ? (uint)_slideAnimationSpeed : length; _slidingPanelAbsoluteLayout.TranslateTo(drawerExpandedPosition.X, drawerExpandedPosition.Y, length, Easing.CubicOut); }); _currentSlidePanelState = SlidingPanelState.Expanded; if (_pictureImage != null) { Rectangle pictureExpandedPosition = _pictureAbsoluteLayout.Bounds; pictureExpandedPosition.Y = 0; Device.BeginInvokeOnMainThread(() => { length = (length == DEFAULT_SLIDE_ANIMATION_SPEED) ? (uint)_slideAnimationSpeed : length; _pictureAbsoluteLayout.TranslateTo(pictureExpandedPosition.X, pictureExpandedPosition.Y, length, Easing.CubicOut); }); } WhenSlidingPanelStateChanged?.Invoke(null, new Interface.StateChangedEventArgs() { State = _currentSlidePanelState }); } }
public void HidePanel(uint length = 700) { Rectangle drawerCollapsedPosition = _slidingPanelAbsoluteLayout.Bounds; drawerCollapsedPosition.Y = _slidingPanelAbsoluteLayout.Height + (this._primaryFloatingActionButtonHeight / 2); if (_hideNavBarFeature == true && _showingNavBar == true) { drawerCollapsedPosition.Y -= NavigationBarHeight; _showingNavBar = false; } _slidingPanelAbsoluteLayout.TranslateTo(drawerCollapsedPosition.X, drawerCollapsedPosition.Y, length, Easing.CubicOut); _currentSlidePanelState = SlidingPanelState.Hidden; Rectangle pictureBounds = _pictureAbsoluteLayout.Bounds; pictureBounds.Y = drawerCollapsedPosition.Y + _pictureAbsoluteLayout.Height; _pictureAbsoluteLayout.TranslateTo(pictureBounds.X, pictureBounds.Y, length, Easing.CubicOut); }
public void ShowExpandedPanel(uint length = 700) { ShowNavigationBar(false); _showingNavBar = true; var actualHeight = _titleRelativeLayout.Height; Rectangle drawerExpandedPosition = _slidingPanelAbsoluteLayout.Bounds; drawerExpandedPosition.Y = 0; _slidingPanelAbsoluteLayout.TranslateTo(drawerExpandedPosition.X, drawerExpandedPosition.Y, length, Easing.CubicOut); _currentSlidePanelState = SlidingPanelState.Expanded; if (IsPictureImageNull == false) { Rectangle pictureExpandedPosition = _pictureAbsoluteLayout.Bounds; pictureExpandedPosition.Y = 0; _pictureAbsoluteLayout.TranslateTo(pictureExpandedPosition.X, pictureExpandedPosition.Y, length, Easing.CubicOut); } }
public void HidePanel(uint length = DEFAULT_SLIDE_ANIMATION_SPEED) { WhenSlidingPanelStateChanging?.Invoke(null, new StateChangingEventArgs() { OldState = _currentSlidePanelState, NewState = SlidingPanelState.Hidden }); // set HidePanelHeight Rectangle drawerCollapsedPosition = _slidingPanelAbsoluteLayout.Bounds; double drawerCollapsedPositionY = drawerCollapsedPosition.Y; drawerCollapsedPositionY = _slidingPanelAbsoluteLayout.Height + (this._primaryFloatingActionButtonHeight / 2); // iOS only: No need the below code after XF 2.4.0.xxx if (_hideNavBarFeature == true && _showingNavBar == true && Device.RuntimePlatform != Device.iOS) { drawerCollapsedPositionY -= NavigationBarHeight; _showingNavBar = false; } Device.BeginInvokeOnMainThread(() => { length = (length == DEFAULT_SLIDE_ANIMATION_SPEED) ? (uint)_slideAnimationSpeed : length; _slidingPanelAbsoluteLayout.TranslateTo(0, drawerCollapsedPositionY, length, Easing.CubicOut); }); _currentSlidePanelState = SlidingPanelState.Hidden; Rectangle pictureBounds = _pictureAbsoluteLayout.Bounds; pictureBounds.Y = drawerCollapsedPositionY + _pictureAbsoluteLayout.Height; Device.BeginInvokeOnMainThread(() => { length = (length == DEFAULT_SLIDE_ANIMATION_SPEED) ? (uint)_slideAnimationSpeed : length; _pictureAbsoluteLayout.TranslateTo(pictureBounds.X, pictureBounds.Y, length, Easing.CubicOut); }); WhenSlidingPanelStateChanged?.Invoke(null, new StateChangedEventArgs() { State = _currentSlidePanelState }); }
public void ShowCollapsedPanel(uint length = 700) { ShowNavigationBar(true); var actualHeight = _titleRelativeLayout.Height; Rectangle drawerCollapsedPosition = _slidingPanelAbsoluteLayout.Bounds; drawerCollapsedPosition.Y = _slidingPanelAbsoluteLayout.Height - actualHeight; if (_hideNavBarFeature == true && _showingNavBar == true && _isCollapsing == false) { drawerCollapsedPosition.Y -= NavigationBarHeight; _showingNavBar = false; } _slidingPanelAbsoluteLayout.TranslateTo(drawerCollapsedPosition.X, drawerCollapsedPosition.Y, length, Easing.CubicOut); _currentSlidePanelState = SlidingPanelState.Collapsed; if (IsPictureImageNull == false) { Rectangle pictureBounds = _pictureAbsoluteLayout.Bounds; pictureBounds.Y = drawerCollapsedPosition.Y + _pictureAbsoluteLayout.Height + (this._primaryFloatingActionButtonHeight / 2); _pictureAbsoluteLayout.TranslateTo(pictureBounds.X, pictureBounds.Y, length, Easing.CubicOut); } }