Skip to content

Commit

Permalink
Release 3.2.4
Browse files Browse the repository at this point in the history
- Added `resetAppearIntervalWhenPerformingItemAction`, 用于控制点击item时是否重置控制层的显示间隔
- Added `showsPromptView` 设置是否在播放器中显示音量或亮度提示视图
- 完善清晰度切换的处理
- Fix 设置`autoAdjustLayoutWhenDeviceIsiPhoneX`为NO时, 布局错误的问题
  • Loading branch information
changsanjiang committed Apr 10, 2020
1 parent 3b87bb1 commit 8ddf047
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Binary file not shown.
19 changes: 9 additions & 10 deletions SJVideoPlayer/Common/Utils/Adapters/SJEdgeControlLayerAdapters.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ - (BOOL)isFitOnScreen {

- (void)layoutSubviews {
[super layoutSubviews];

[self _updateLayoutIfNeeded];
_centerAdapter.itemFillSizeForFrameLayout = self.bounds.size;
}

- (void)_updateLayoutIfNeeded {
CGRect curr = self.bounds;

if ( _screen.is_iPhoneX && _autoAdjustLayoutWhenDeviceIsiPhoneX ) {
if ( !CGRectEqualToRect(_beforeBounds, curr) ) {
CGFloat viewW = curr.size.width;
Expand All @@ -78,13 +81,9 @@ - (void)layoutSubviews {
}
}
}
else {
if ( !CGRectEqualToRect(_beforeBounds, curr) ) {
[self _updateTopLayout:nil];
}
else if ( !CGRectEqualToRect(_beforeBounds, curr) ) {
[self _updateTopLayout:nil];
}

_centerAdapter.itemFillSizeForFrameLayout = curr.size;
_beforeBounds = curr;
}

Expand Down Expand Up @@ -180,7 +179,7 @@ - (void)_observeOrientationChangeOfStatusBarNotify {

- (void)_updateTopLayout:(nullable NSNotification *)notify {
if ( !_topAdapter ) return;
if ( _screen.is_iPhoneX ) return;
if ( _screen.is_iPhoneX && _autoAdjustLayoutWhenDeviceIsiPhoneX ) return;
[UIView animateWithDuration:0 animations:^{} completion:^(BOOL finished) {
UIInterfaceOrientation orientation = notify?[notify.userInfo[UIApplicationStatusBarOrientationUserInfoKey] integerValue]: UIApplication.sharedApplication.statusBarOrientation;
switch ( orientation ) {
Expand Down Expand Up @@ -431,7 +430,7 @@ - (void)setRightWidth:(CGFloat)rightWidth {
- (void)setTopMargin:(CGFloat)topMargin {
_topMargin = topMargin;

[self _updateTopLayout:nil];
[self _updateLayoutIfNeeded];
}

- (void)setLeftMargin:(CGFloat)leftMargin {
Expand Down

0 comments on commit 8ddf047

Please sign in to comment.