Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit edc8acc

Browse files
authored
Merge pull request #487 from wordpress-mobile/feature/401-prologue_button_blur
ULS: Add visual blur to Prologue button view
2 parents b441021 + 4cd74ac commit edc8acc

File tree

3 files changed

+44
-13
lines changed

3 files changed

+44
-13
lines changed

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPressAuthenticator"
3-
s.version = "1.26.0-beta.12"
3+
s.version = "1.26.0-beta.13"
44
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."
55

66
s.description = <<-DESC

WordPressAuthenticator/Signin/Login.storyboard

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Ck1-vY-O11">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17503.1" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Ck1-vY-O11">
33
<device id="retina4_7" orientation="portrait" appearance="light"/>
44
<dependencies>
5-
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17502"/>
76
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
87
</dependencies>
98
<scenes>
@@ -30,7 +29,7 @@
3029
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
3130
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
3231
<subviews>
33-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gpM-nW-lFQ">
32+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gpM-nW-lFQ">
3433
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
3534
<connections>
3635
<action selector="dismissTapped" destination="IwV-3R-6dB" eventType="touchDown" id="E6x-JG-Ve8"/>
@@ -86,6 +85,14 @@
8685
<segue destination="TP5-re-Ncg" kind="embed" id="mLC-uB-YYS"/>
8786
</connections>
8887
</containerView>
88+
<visualEffectView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="s7U-M4-ZVd">
89+
<rect key="frame" x="0.0" y="501" width="375" height="166"/>
90+
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="ZDd-Ar-1RT">
91+
<rect key="frame" x="0.0" y="0.0" width="375" height="166"/>
92+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
93+
</view>
94+
<blurEffect style="regular"/>
95+
</visualEffectView>
8996
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="G3G-Ap-6ix">
9097
<rect key="frame" x="0.0" y="501" width="375" height="166"/>
9198
<constraints>
@@ -99,15 +106,20 @@
99106
<constraints>
100107
<constraint firstItem="6cw-FO-hjb" firstAttribute="leading" secondItem="EnO-7f-1yO" secondAttribute="leading" id="7Z8-mD-FWN"/>
101108
<constraint firstAttribute="trailing" secondItem="G3G-Ap-6ix" secondAttribute="trailing" id="96a-eB-JlD"/>
109+
<constraint firstItem="s7U-M4-ZVd" firstAttribute="leading" secondItem="G3G-Ap-6ix" secondAttribute="leading" id="CCE-RK-7oE"/>
102110
<constraint firstItem="G3G-Ap-6ix" firstAttribute="top" secondItem="6cw-FO-hjb" secondAttribute="bottom" id="Cuw-sd-C5k"/>
103111
<constraint firstAttribute="trailing" secondItem="6cw-FO-hjb" secondAttribute="trailing" id="Hgo-qC-AqF"/>
112+
<constraint firstItem="s7U-M4-ZVd" firstAttribute="top" secondItem="G3G-Ap-6ix" secondAttribute="top" id="ISb-cY-EO1"/>
113+
<constraint firstItem="s7U-M4-ZVd" firstAttribute="trailing" secondItem="G3G-Ap-6ix" secondAttribute="trailing" id="WyG-Lz-bxP"/>
104114
<constraint firstItem="6cw-FO-hjb" firstAttribute="top" secondItem="EnO-7f-1yO" secondAttribute="top" id="dXg-NZ-hRY"/>
105115
<constraint firstAttribute="bottom" secondItem="G3G-Ap-6ix" secondAttribute="bottom" id="lOP-Up-00c"/>
116+
<constraint firstItem="s7U-M4-ZVd" firstAttribute="bottom" secondItem="G3G-Ap-6ix" secondAttribute="bottom" id="qfx-iK-Dth"/>
106117
<constraint firstItem="G3G-Ap-6ix" firstAttribute="leading" secondItem="EnO-7f-1yO" secondAttribute="leading" id="uzT-mw-eJq"/>
107118
</constraints>
108119
</view>
109120
<navigationItem key="navigationItem" id="42E-2e-kOq"/>
110121
<connections>
122+
<outlet property="buttonBlurEffectView" destination="s7U-M4-ZVd" id="Td4-9h-aeb"/>
111123
<outlet property="buttonViewLeadingConstraint" destination="uzT-mw-eJq" id="ASz-qQ-ii9"/>
112124
<outlet property="buttonViewTrailingConstraint" destination="96a-eB-JlD" id="qI1-75-31G"/>
113125
<outlet property="topContainerView" destination="6cw-FO-hjb" id="rCh-90-6d1"/>
@@ -472,7 +484,7 @@
472484
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="zbk-h0-lpE">
473485
<rect key="frame" x="20" y="603" width="343" height="44"/>
474486
<subviews>
475-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Gzk-TE-YfP" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
487+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Gzk-TE-YfP" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
476488
<rect key="frame" x="0.0" y="7" width="141" height="30"/>
477489
<fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/>
478490
<state key="normal" title="Lost your password?">
@@ -646,7 +658,7 @@
646658
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="ilv-iW-HgP">
647659
<rect key="frame" x="20" y="603" width="343" height="44"/>
648660
<subviews>
649-
<button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0P1-6g-BI3" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
661+
<button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0P1-6g-BI3" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
650662
<rect key="frame" x="0.0" y="7" width="141" height="30"/>
651663
<fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/>
652664
<state key="normal" title="Lost your password?">
@@ -806,7 +818,7 @@
806818
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="x1G-Lf-mra">
807819
<rect key="frame" x="20" y="595" width="343" height="44"/>
808820
<subviews>
809-
<button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="309-z3-fPx" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
821+
<button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="309-z3-fPx" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
810822
<rect key="frame" x="0.0" y="0.0" width="131" height="44"/>
811823
<constraints>
812824
<constraint firstAttribute="height" constant="44" id="fzI-rH-0f8"/>
@@ -950,7 +962,7 @@
950962
</mask>
951963
</variation>
952964
</stackView>
953-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="B6x-b7-hU9" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
965+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="B6x-b7-hU9" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
954966
<rect key="frame" x="0.0" y="617" width="375" height="30"/>
955967
<fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/>
956968
<state key="normal" title="Enter your password instead"/>
@@ -1053,7 +1065,7 @@
10531065
<stackView contentMode="scaleToFill" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" distribution="equalSpacing" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="mlx-XY-MGX">
10541066
<rect key="frame" x="20" y="600" width="351" height="44"/>
10551067
<subviews>
1056-
<button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="roL-ID-k8n" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
1068+
<button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="roL-ID-k8n" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
10571069
<rect key="frame" x="0.0" y="7" width="250" height="30"/>
10581070
<accessibility key="accessibilityConfiguration" identifier="addSelfHostedButton"/>
10591071
<fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/>
@@ -1155,7 +1167,7 @@
11551167
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="hzZ-dr-nAB">
11561168
<rect key="frame" x="20" y="603" width="343" height="44"/>
11571169
<subviews>
1158-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XI0-rr-yUh" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
1170+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XI0-rr-yUh" customClass="SubheadlineButton" customModule="WordPressAuthenticator">
11591171
<rect key="frame" x="0.0" y="7" width="141" height="30"/>
11601172
<fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/>
11611173
<state key="normal" title="Lost your password?">
@@ -1380,7 +1392,7 @@
13801392
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
13811393
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
13821394
<subviews>
1383-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ueg-Bw-KU6">
1395+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ueg-Bw-KU6">
13841396
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
13851397
<connections>
13861398
<action selector="dismissTapped" destination="hed-vB-osh" eventType="touchDown" id="JQ6-xt-z9a"/>
@@ -1416,6 +1428,11 @@
14161428
<point key="canvasLocation" x="-460" y="1248"/>
14171429
</scene>
14181430
</scenes>
1431+
<designables>
1432+
<designable name="usY-bV-fpM">
1433+
<size key="intrinsicContentSize" width="32" height="34"/>
1434+
</designable>
1435+
</designables>
14191436
<inferredMetricsTieBreakers>
14201437
<segue reference="swV-lc-6gI"/>
14211438
</inferredMetricsTieBreakers>

WordPressAuthenticator/Signin/LoginPrologueViewController.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,20 @@ import WordPressKit
77
class LoginPrologueViewController: LoginViewController {
88

99
@IBOutlet private weak var topContainerView: UIView!
10+
@IBOutlet private weak var buttonBlurEffectView: UIVisualEffectView!
1011
private var buttonViewController: NUXButtonViewController?
1112
var showCancel = false
1213

14+
/// Blur effect on button container view
15+
///
16+
private var blurEffect: UIBlurEffect.Style {
17+
if #available(iOS 13.0, *) {
18+
return .systemChromeMaterial
19+
}
20+
21+
return .regular
22+
}
23+
1324
/// Constraints on the button view container.
1425
/// Used to adjust the button width in unified views.
1526
@IBOutlet private weak var buttonViewLeadingConstraint: NSLayoutConstraint!
@@ -178,6 +189,7 @@ class LoginPrologueViewController: LoginViewController {
178189
}
179190

180191
buttonViewController.backgroundColor = style.buttonViewBackgroundColor
192+
buttonBlurEffectView.isHidden = true
181193
}
182194

183195
/// Displays the Unified prologue buttons.
@@ -212,7 +224,9 @@ class LoginPrologueViewController: LoginViewController {
212224
}
213225
}
214226

215-
buttonViewController.backgroundColor = style.buttonViewBackgroundColor
227+
// Set the button background color to clear so the blur effect blurs the Prologue background color.
228+
buttonViewController.backgroundColor = .clear
229+
buttonBlurEffectView.effect = UIBlurEffect(style: blurEffect)
216230
}
217231

218232
// MARK: - Actions

0 commit comments

Comments
 (0)