Skip to content

Commit

Permalink
fixed safeAreaPadding, added some nonSystemSheet properties
Browse files Browse the repository at this point in the history
  • Loading branch information
mbender74 committed Oct 16, 2021
2 parents 56c430c + f481010 commit e2f947f
Show file tree
Hide file tree
Showing 8 changed files with 789 additions and 753 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [mbender74]
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ manually hide the controller, per exaple if to did any action in the content vie
### `selectedDetentIdentifier`
return STRING - selectedDetentIdentifier (medium,large or none)
### `changeCurrentDetent(STRING)`
change the selectedDetentIdentifier animated ('large' or 'medium') **on 'nonSystemSheet:true' only**
change the selectedDetentIdentifier animated ('large' or 'medium') **on 'nonSystemSheet:false' only** (iOS15+)


## Events
Expand Down Expand Up @@ -76,6 +76,27 @@ when your contentView is not a scrollable view, then this activates scrolling if
**ATTENTION**: when you put a tableView, scrollView or listView inside your contentView this property disables scrolling in the contentView in favour of the bottomSheetScrollView


### `nonSystemSheetAutomaticStartPositionFromContentViewHeight:bool`
when this property is "**true**" the nonSystemSheet opens in the height of the contentView, **all detents are disabled**,

only the real height is active,

"**startDetent**" property **will be ignored**, also the "detents" property are ignored --

if you want an undimmed background, then you need to set property "**largestUndimmedDetentIdentifier**" to "large"

if NOT set defaults to false

### `nonSystemSheetSmallHeight:integer`
(optional) when set, the small detent is set to this height

### `nonSystemSheetMediumHeight:integer`
(optional) when set, the medium detent is set to this height

### `nonSystemSheetLargeHeight:integer`
(optional) when set, the large detent is set to this height


## Example

```js
Expand Down
15 changes: 11 additions & 4 deletions ios/Classes/BottomSheetViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@ static CGFloat maxPosition = 0;
static State minState = partial;
static CGFloat minPosition = 0;
static UIEdgeInsets insets;
static UIEdgeInsets scrollBarinsets;
static bool panEnabled = YES;
static bool panInit = NO;
static bool panFromScrollView = NO;

static CGFloat width = 0;
static CGFloat height = 0;
static CGRect customViewRect;
static bool fullPositon = YES;
static bool mediumPosition = YES;
static bool smallPosition = YES;
static CGFloat lastScrollViewOffsetY = 0;
static CGFloat newSrollViewOffsetY = 0;
static CGFloat lastTranslation = 0;


static CGFloat yPosition = 0;
static NSDictionary *userDetents;
static CGFloat fullViewYPosition = 0;
static CGFloat partialViewYPosition = 0;
Expand All @@ -49,9 +51,13 @@ static UIColor *dimmedViewBackgroundColor = nil;
static NSString *largestUndimmedDetent = nil;
static NSString *startDetent = nil;
static NSString *detentString = nil;
static Director director = up;
@interface BottomSheetViewController : UIViewController
@property (assign, nonatomic) State lastStatus;
@property (assign, nonatomic) NSString *selectedDetentIdentifier;
@property (assign, nonatomic) CGFloat fullViewYPosition;
@property (assign, nonatomic) CGFloat partialViewYPosition;
@property (assign, nonatomic) CGFloat expandedViewYPosition;

- (id)proxyOfBottomSheetController;
- (void)setProxyOfBottomSheetController:(id)args;
Expand All @@ -64,9 +70,10 @@ static NSString *detentString = nil;
- (UIPanGestureRecognizer *)panRecognizer;
- (void)panRecognizerInit:(bool)enabled;
- (void)panFromScrollView:(bool)enabled;

- (void)changeInsets:(UIView *)view;
- (void)scrollView:(UIScrollView*)scrollview;
- (void)lastContentOffsetY:(CGFloat)contentOffsetY;
- (void)setupData;
@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit e2f947f

Please sign in to comment.