Skip to content

Commit

Permalink
Merge branch 'main' into feature/update-vue-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
open-hippy authored Jan 12, 2024
2 parents 6bc34be + 8ad0c88 commit 5368154
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ @interface HippyScrollView () {
CGFloat _lastNonZeroTranslationAlongAxis;
NSMutableDictionary *_contentOffsetCache;
BOOL _didSetContentOffset;
BOOL _showScrollIndicator[2];
int _recordedScrollIndicatorSwitchValue[2]; // default -1
}

@end
Expand All @@ -201,6 +201,8 @@ - (instancetype)initWithFrame:(CGRect)frame {

_scrollEventThrottle = 0.0;
_lastScrollDispatchTime = 0;
_recordedScrollIndicatorSwitchValue[0] = -1;
_recordedScrollIndicatorSwitchValue[1] = -1;

_scrollListeners = [NSHashTable weakObjectsHashTable];
_contentOffsetCache = [NSMutableDictionary dictionaryWithCapacity:32];
Expand Down Expand Up @@ -679,16 +681,19 @@ - (void)didSetProps:(NSArray<NSString *> *)changedProps {
- (void)applyLayoutDirectionIfNeeded {
if ([self isLayoutSubviewsRTL]) {
_scrollView.transform = CGAffineTransformRotate(CGAffineTransformIdentity, M_PI);
_showScrollIndicator[0] = _scrollView.showsHorizontalScrollIndicator;
_showScrollIndicator[1] = _scrollView.showsVerticalScrollIndicator;
_recordedScrollIndicatorSwitchValue[0] = _scrollView.showsHorizontalScrollIndicator ? 1 : 0;
_recordedScrollIndicatorSwitchValue[1] = _scrollView.showsVerticalScrollIndicator ? 1 : 0;
_scrollView.showsVerticalScrollIndicator = NO;
_scrollView.showsHorizontalScrollIndicator = NO;
_contentView.transform = CGAffineTransformRotate(CGAffineTransformIdentity, M_PI);
}
else {
} else {
_scrollView.transform = CGAffineTransformIdentity;
_scrollView.showsHorizontalScrollIndicator = _showScrollIndicator[0];
_scrollView.showsVerticalScrollIndicator = _showScrollIndicator[1];
if (_recordedScrollIndicatorSwitchValue[0] > -1) {
_scrollView.showsHorizontalScrollIndicator = _recordedScrollIndicatorSwitchValue[0];
}
if (_recordedScrollIndicatorSwitchValue[1] > -1) {
_scrollView.showsVerticalScrollIndicator = _recordedScrollIndicatorSwitchValue[1];
}
_contentView.transform = CGAffineTransformIdentity;
}
[self applyContentViewFrame];
Expand Down

0 comments on commit 5368154

Please sign in to comment.