Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue-7] Adjust sheet header appearance #8

Merged
merged 1 commit into from Mar 16, 2023
Merged

Conversation

mpospese
Copy link
Contributor

Introduction

There should be no unsightly gap above the header for fixed size sheets (no drag indicator).

Purpose

Refactor sheet layout to have zero gap above the header (if any) for fixed size sheets.
Fix #7

Scope

  • Refactor BottomSheetController layout
  • Refactor DragIndicatorView.Appearance.Layout
  • Update unit tests

Discussion

The layout of the area above the heading was weird. Even with the drag indicator, the offset from the sheet top to drag indicator top was = sheet.cornerRadius - indicator.layout.height, which made little sense. Now there's a simple property topInset that positions the indicator within the sheet and is independent of sheet corner radius. For resizable sheets, the height of the drag area = topInset + indicator.height. For fixed sheets, that view is hidden and has a height of 0.

For resizable sheets the drag indicator by default is closer to the top of the sheet (now: 8, before: 16 - 4 = 12).

馃摫 Screenshots

Before After
Sheet-7-before-none Sheet-7-after-none
Sheet-7-before-title-only Sheet-7-after-title-only
Sheet-7-before-drag-only Sheet-7-after-drag-only
Sheet-7-before-drag-title Sheet-7-after-drag-title

馃搱 Coverage

Code

100%

image

Documentation

100%

image

karkoding

This comment was marked as duplicate.

Copy link

@karthikyml karthikyml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loved the PR details!

@mpospese mpospese merged commit 0d859c1 into main Mar 16, 2023
@mpospese mpospese deleted the issue/7-sheet-header-fix branch March 16, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Collapse extra space above title header when drag indicator is hidden
4 participants