Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
add animated arg.
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0c committed Jul 17, 2016
1 parent b906d8d commit 1b02042
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Example/Tests/Tests-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand Down
1 change: 1 addition & 0 deletions Pod/Classes/MediaPlayerView/LMMediaPlayerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ extern NSString *const LMMediaPlayerViewActionButtonImageKey;

+ (instancetype)sharedPlayerView;
+ (instancetype)create;
- (void)setUserInterfaceHidden:(BOOL)userInterfaceHidden animated:(BOOL)animated;
- (void)setHeaderViewHidden:(BOOL)hidden;
- (void)setFooterViewHidden:(BOOL)hidden;
- (void)setFullscreen:(BOOL)fullscreen animated:(BOOL)animated;
Expand Down
25 changes: 18 additions & 7 deletions Pod/Classes/MediaPlayerView/LMMediaPlayerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,22 @@ - (void)setBluredUserInterface:(BOOL)bluredUserInterface visualEffect:(UIVisualE
}
#endif
}
- (void)setProgressBarBorderColor:(UIColor *)borderColor backgroundColor:(UIColor *)backgroundColor fillColor:(UIColor *)fillColor minTrackColor:(UIColor *)minTrackColor thumbTintColor:(UIColor *)thumbTintColor {

- (void)setProgressBarBorderColor:(UIColor *)borderColor backgroundColor:(UIColor *)backgroundColor fillColor:(UIColor *)fillColor minTrackColor:(UIColor *)minTrackColor thumbTintColor:(UIColor *)thumbTintColor
{
self.currentProgressView.barBorderColor = borderColor;
self.currentProgressView.barBackgroundColor = backgroundColor;
self.currentProgressView.barFillColor = fillColor;
self.currentProgressView.barMinimumTrackFillColor = minTrackColor;

self.currentTimeSlider.thumbTintColor = thumbTintColor;
}
- (void)setProgressBarThumbImage:(UIImage *)image {

- (void)setProgressBarThumbImage:(UIImage *)image
{
[self.currentTimeSlider setThumbImage:image forState:UIControlStateNormal];
}

#pragma mark -

- (void)setup
Expand Down Expand Up @@ -656,11 +661,17 @@ - (void)setFooterViewHidden:(BOOL)hidden
footerView_.hidden = hidden;
}

- (void)setUserInterfaceHidden:(BOOL)hidden
- (void)setUserInterfaceHidden:(BOOL)userInterfaceHidden
{
[self setUserInterfaceHidden:userInterfaceHidden animated:NO];
}

- (void)setUserInterfaceHidden:(BOOL)userInterfaceHidden animated:(BOOL)animated
{
_userInterfaceHidden = hidden;
if (hidden) {
[UIView animateWithDuration:0.3 animations:^{
NSTimeInterval duration = 0.3 * animated ? 1 : 0;
_userInterfaceHidden = userInterfaceHidden;
if (userInterfaceHidden) {
[UIView animateWithDuration:duration animations:^{
headerView_.alpha = 0;
footerView_.alpha = 0;
_currentTimeSlider.alpha = 0;
Expand All @@ -670,7 +681,7 @@ - (void)setUserInterfaceHidden:(BOOL)hidden
}];
}
else {
[UIView animateWithDuration:0.3 animations:^{
[UIView animateWithDuration:duration animations:^{
headerView_.alpha = 1;
footerView_.alpha = 1;
_currentTimeSlider.alpha = 1;
Expand Down

0 comments on commit 1b02042

Please sign in to comment.