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

Commit

Permalink
update player design and size
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0c committed Jan 23, 2015
1 parent c1a9c40 commit b8f6e5d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 35 deletions.
30 changes: 14 additions & 16 deletions Pod/Assets/LMMediaPlayerView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="1hC-He-NDs" customClass="LMMediaPlayerView">
<rect key="frame" x="0.0" y="0.0" width="320" height="200"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="180"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="077-OQ-G8z">
<rect key="frame" x="0.0" y="0.0" width="320" height="200"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="180"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oc7-kf-peg">
<rect key="frame" x="0.0" y="156" width="320" height="44"/>
<rect key="frame" x="0.0" y="136" width="320" height="44"/>
<subviews>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="tJg-rp-csT">
<rect key="frame" x="69" y="10" width="177" height="25"/>
Expand Down Expand Up @@ -148,41 +148,39 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KVB-cs-JcH">
<rect key="frame" x="0.0" y="52" width="40" height="96"/>
<rect key="frame" x="0.0" y="60" width="40" height="60"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qWF-ZD-TKU">
<rect key="frame" x="0.0" y="0.0" width="40" height="96"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<rect key="frame" x="0.0" y="0.0" width="40" height="60"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<state key="normal" title="&lt;"/>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="qWF-ZD-TKU" secondAttribute="trailing" id="9sB-5g-AGt"/>
<constraint firstItem="qWF-ZD-TKU" firstAttribute="leading" secondItem="KVB-cs-JcH" secondAttribute="leading" id="G3s-5e-tXM"/>
<constraint firstAttribute="height" constant="96" id="KFU-0f-sbL"/>
<constraint firstAttribute="height" constant="60" id="KFU-0f-sbL"/>
<constraint firstAttribute="width" constant="40" id="aLT-vd-fDt"/>
<constraint firstAttribute="bottom" secondItem="qWF-ZD-TKU" secondAttribute="bottom" id="ars-b6-UsB"/>
<constraint firstItem="qWF-ZD-TKU" firstAttribute="top" secondItem="KVB-cs-JcH" secondAttribute="top" id="fdN-IR-owH"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EsM-nS-vku">
<rect key="frame" x="280" y="52" width="40" height="96"/>
<rect key="frame" x="280" y="60" width="40" height="60"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zy1-iS-KVp">
<rect key="frame" x="0.0" y="0.0" width="40" height="96"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<rect key="frame" x="0.0" y="0.0" width="40" height="60"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<state key="normal" title="&gt;"/>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="zy1-iS-KVp" secondAttribute="bottom" id="5P2-aL-2Mg"/>
<constraint firstAttribute="height" constant="96" id="Aka-6b-nJP"/>
<constraint firstAttribute="height" constant="60" id="Aka-6b-nJP"/>
<constraint firstAttribute="width" constant="40" id="DPD-LK-uqe"/>
<constraint firstAttribute="trailing" secondItem="zy1-iS-KVp" secondAttribute="trailing" id="Gfm-sb-b3O"/>
<constraint firstItem="zy1-iS-KVp" firstAttribute="leading" secondItem="EsM-nS-vku" secondAttribute="leading" id="HN0-cl-Pjp"/>
Expand All @@ -196,16 +194,16 @@
<constraint firstAttribute="trailing" secondItem="EsM-nS-vku" secondAttribute="trailing" id="5UB-O3-88A"/>
<constraint firstItem="077-OQ-G8z" firstAttribute="top" secondItem="GIL-kJ-GRw" secondAttribute="top" id="Eua-v5-Vjh"/>
<constraint firstAttribute="trailing" secondItem="oc7-kf-peg" secondAttribute="trailing" id="Mbo-TJ-bhY"/>
<constraint firstAttribute="centerY" secondItem="KVB-cs-JcH" secondAttribute="centerY" id="P1k-VH-8Mv"/>
<constraint firstAttribute="trailing" secondItem="077-OQ-G8z" secondAttribute="trailing" id="P81-MF-TC8"/>
<constraint firstItem="KVB-cs-JcH" firstAttribute="leading" secondItem="1hC-He-NDs" secondAttribute="leading" id="RSk-dt-5tT"/>
<constraint firstAttribute="trailing" secondItem="GIL-kJ-GRw" secondAttribute="trailing" id="V5n-Y2-znX"/>
<constraint firstItem="oc7-kf-peg" firstAttribute="leading" secondItem="1hC-He-NDs" secondAttribute="leading" id="Vzb-MO-TOX"/>
<constraint firstAttribute="centerY" secondItem="EsM-nS-vku" secondAttribute="centerY" id="Wle-UN-WZC"/>
<constraint firstItem="077-OQ-G8z" firstAttribute="top" secondItem="1hC-He-NDs" secondAttribute="top" id="hKq-gd-WE6"/>
<constraint firstAttribute="centerY" secondItem="EsM-nS-vku" secondAttribute="centerY" id="lSO-qw-6Pr"/>
<constraint firstItem="GIL-kJ-GRw" firstAttribute="top" secondItem="1hC-He-NDs" secondAttribute="top" id="pYr-FF-FBu"/>
<constraint firstAttribute="bottom" secondItem="077-OQ-G8z" secondAttribute="bottom" id="q7c-z1-0ry"/>
<constraint firstAttribute="centerX" secondItem="077-OQ-G8z" secondAttribute="centerX" id="qXo-wX-bQC"/>
<constraint firstAttribute="centerY" secondItem="KVB-cs-JcH" secondAttribute="centerY" id="tfo-Z7-HDJ"/>
<constraint firstItem="GIL-kJ-GRw" firstAttribute="leading" secondItem="1hC-He-NDs" secondAttribute="leading" id="wKB-kG-MDX"/>
<constraint firstAttribute="bottom" secondItem="oc7-kf-peg" secondAttribute="bottom" id="wMT-nA-3u7"/>
</constraints>
Expand All @@ -229,7 +227,7 @@
<outlet property="shuffleButton_" destination="gdm-wB-X2t" id="hap-jQ-Sd4"/>
<outlet property="titleLabel" destination="9Qi-Gq-8h6" id="LcN-IL-tU1"/>
</connections>
<point key="canvasLocation" x="169" y="1649"/>
<point key="canvasLocation" x="250" y="932"/>
</view>
</objects>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
Expand Down
20 changes: 1 addition & 19 deletions Pod/Classes/MediaPlayerView/LMMediaPlayerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ @interface LMMediaPlayerView ()
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0
UIVisualEffectView *headerBlurView_;
UIVisualEffectView *footerBlurView_;
UIVisualEffectView *nextButtonBlurView_;
UIVisualEffectView *previousButtonBlurView_;
#endif

UIWindow *mainWindow_;
Expand Down Expand Up @@ -186,41 +184,27 @@ - (void)setBluredUserInterface:(BOOL)bluredUserInterface visualEffect:(UIVisualE
if (headerBlurView_ == nil) {
headerBlurView_ = [[UIVisualEffectView alloc] initWithEffect:effect];
footerBlurView_ = [[UIVisualEffectView alloc] initWithEffect:effect];
nextButtonBlurView_ = [[UIVisualEffectView alloc] initWithEffect:effect];
previousButtonBlurView_ = [[UIVisualEffectView alloc] initWithEffect:effect];

headerBlurView_.frame = headerView_.bounds;
headerBlurView_.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

footerBlurView_.frame = footerView_.bounds;
footerBlurView_.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

nextButtonBlurView_.frame = _nextButton.bounds;
nextButtonBlurView_.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

previousButtonBlurView_.frame = _previousButton.bounds;
previousButtonBlurView_.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

[headerView_ insertSubview:headerBlurView_ atIndex:0];
[footerView_ insertSubview:footerBlurView_ atIndex:0];
[_nextButton.superview insertSubview:nextButtonBlurView_ atIndex:0];
[_previousButton.superview insertSubview:previousButtonBlurView_ atIndex:0];
}

headerView_.backgroundColor = [UIColor clearColor];
footerView_.backgroundColor = [UIColor clearColor];
_nextButton.backgroundColor = [UIColor clearColor];
_previousButton.backgroundColor = [UIColor clearColor];
}
else {
UIColor *backgroundColor = [UIColor colorWithWhite:0.000 alpha:0.400];
headerView_.backgroundColor = backgroundColor;
footerView_.backgroundColor = backgroundColor;
_nextButton.backgroundColor = backgroundColor;
_previousButton.backgroundColor = backgroundColor;
}

headerBlurView_.hidden = footerBlurView_.hidden = nextButtonBlurView_.hidden = previousButtonBlurView_.hidden = !_bluredUserInterface;
headerBlurView_.hidden = footerBlurView_.hidden = !_bluredUserInterface;
}
#endif
}
Expand Down Expand Up @@ -266,8 +250,6 @@ - (void)setupUserInterface

UIColor *backgroundColor = [UIColor colorWithWhite:0.000 alpha:0.400];
footerView_.backgroundColor = headerView_.backgroundColor = backgroundColor;
_nextButton.backgroundColor = _previousButton.backgroundColor = backgroundColor;
_nextButton.superview.backgroundColor = _previousButton.superview.backgroundColor = [UIColor clearColor];
[_mediaPlayer setShuffleEnabled:NO];
[_mediaPlayer setRepeatMode:LMMediaRepeatModeNone];

Expand Down

0 comments on commit b8f6e5d

Please sign in to comment.