Example #1
0
 /// <summary>
 /// Layout the botton sheet to it's pending state, with animation.
 /// </summary>
 /// <returns>The task.</returns>
 private async Task SetBottomSheetPending()
 {
     Rectangle bottomSheetRect = new Rectangle
     {
         Left = 0,
         Top  = Height * (1 - bottomSheetExtensionFraction / 2),
         Size = new Size(Width, Height * bottomSheetExtensionFraction / 2)
     };
     Rectangle buttonRect = new Rectangle
     {
         Top  = bottomSheetRect.Top - Button.Height / 2,
         Size = new Size(Button.Width, Button.Height),
         X    = Button.X
     };
     await Task.WhenAll(BottomSheetContentView.LayoutTo(bottomSheetRect), Button.LayoutTo(buttonRect));
 }
Example #2
0
        /// <summary>
        /// Layout the bottom sheet to its collapsed state, with animation.
        /// </summary>
        /// <returns>The task.</returns>
        private async Task CollapseBottomSheet()
        {
            var bottomSheetRect = new Rectangle
            {
                Left = 0,
                Top  = Height - bottomSheetSize,
                Size = new Size(Width, bottomSheetSize)
            };
            var buttonRect = new Rectangle
            {
                Top  = bottomSheetRect.Top - Button.Height / 2,
                Size = new Size(Button.Width, Button.Height),
                X    = Button.X
            };
            await Task.WhenAll(BottomSheetContentView.LayoutTo(bottomSheetRect), Button.LayoutTo(buttonRect), Button.RotateXTo(0));

            bottomSheetState = BottomSheetState.Collapsed;
        }
Example #3
0
        /// <summary>
        /// Layout the bottom sheet to its extended state, with animation.
        /// </summary>
        /// <returns>The task.</returns>
        private async Task ExtendBottomSheet()
        {
            var bottomSheetRect = new Rectangle
            {
                Left = 0,
                Top  = Height * (1 - bottomSheetExtensionFraction),
                Size = new Size(Width, Height * bottomSheetExtensionFraction)
            };
            var buttonRect = new Rectangle
            {
                Top  = bottomSheetRect.Top - Button.Height / 2,
                Size = new Size(Button.Width, Button.Height),
                X    = Button.X
            };
            await Task.WhenAll(BottomSheetContentView.LayoutTo(bottomSheetRect), Button.LayoutTo(buttonRect), Button.RotateXTo(180));

            bottomSheetState = BottomSheetState.Extended;
        }