Skip to content

Commit

Permalink
Merge branch 'develop' into sam/update-bsk-to-release-branch
Browse files Browse the repository at this point in the history
* develop:
  Fix dax dialog presentation  (#1035)
  Widget Education (#1040)
  Set version to 7.65.8
  Set the HomeCollectionView backgroundColor according to theme (#1047)
  • Loading branch information
samsymons committed Feb 8, 2022
2 parents 2ebf032 + 37f3330 commit 78c7312
Show file tree
Hide file tree
Showing 104 changed files with 2,059 additions and 926 deletions.
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MARKETING_VERSION = 7.65.7
MARKETING_VERSION = 7.65.8

7 changes: 4 additions & 3 deletions Core/Pixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ public enum PixelName: String {
case widgetNewSearch = "m_w_ns"

case defaultBrowserButtonPressedSettings = "m_db_s"
case defaultBrowserButtonPressedHome = "m_db_h"
case defaultBrowserHomeMessageShown = "m_db_h_s"
case defaultBrowserHomeMessageDismissed = "m_db_h_d"

case widgetsOnboardingCTAPressed = "m_o_w_a"
case widgetsOnboardingDeclineOptionPressed = "m_o_w_d"
Expand Down Expand Up @@ -171,6 +168,10 @@ public enum PixelName: String {
case textSizeSettingsShown = "m_text_size_settings_shown"
case textSizeSettingsChanged = "m_text_size_settings_changed"

case widgetEducationOpenedFromHomeScreen = "m_widget_education_opened_from_home"
case widgetEducationOpenedFromSettings = "m_widget_education_opened_from_settings"
case widgetEducationDismissed = "m_widget_education_dismissed"

case jsAlertShown = "m_js_alert_shown"
case jsAlertBlocked = "m_js_alert_blocked"

Expand Down
2 changes: 1 addition & 1 deletion Core/UserDefaultsPropertyWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public struct UserDefaultsWrapper<T> {

case legacyCovidInfo = "com.duckduckgo.ios.home.covidInfo"

case homeDefaultBrowserMessageDateDismissed = "com.duckduckgo.ios.homeMessage.defaultBrowser.dateDismissed"
case homeWidgetEducationMessageDismissed = "com.duckduckgo.ios.homeMessage.widgetEducation.dismissed"

case lastConfigurationRefreshDate = "com.duckduckgo.ios.lastConfigurationRefreshDate"

Expand Down
22 changes: 16 additions & 6 deletions Core/VariantManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public enum FeatureName: String {
// Used for unit tests
case dummy
case voiceSearch
case widgetEducation
case parameterStripping
}

Expand All @@ -44,16 +45,22 @@ public struct Variant {
static let iOS15 = { () -> Bool in
if #available(iOS 15, *) {
return true
} else {
return false
}
return false
}

static let supportsOnDeviceRecognizer = { SFSpeechRecognizer()?.supportsOnDeviceRecognition ?? false }

static let isIOS15EnglishWithOnDeviceSpeech = {
return inEnglish() && iOS15() && supportsOnDeviceRecognizer()
}

static let supportsWidgets = { () -> Bool in
if #available(iOS 14, *) {
return true
}
return false
}
}

static let doNotAllocate = 0
Expand All @@ -66,11 +73,14 @@ public struct Variant {
Variant(name: "sd", weight: doNotAllocate, isIncluded: When.always, features: []),
Variant(name: "se", weight: doNotAllocate, isIncluded: When.always, features: []),

Variant(name: "ma", weight: 1, isIncluded: When.isIOS15EnglishWithOnDeviceSpeech, features: [.voiceSearch]),
Variant(name: "mb", weight: 1, isIncluded: When.isIOS15EnglishWithOnDeviceSpeech, features: []),
Variant(name: "ma", weight: doNotAllocate, isIncluded: When.isIOS15EnglishWithOnDeviceSpeech, features: [.voiceSearch]),
Variant(name: "mb", weight: doNotAllocate, isIncluded: When.isIOS15EnglishWithOnDeviceSpeech, features: []),

Variant(name: "mc", weight: 1, isIncluded: When.always, features: [.parameterStripping]),
Variant(name: "md", weight: 1, isIncluded: When.always, features: [])
Variant(name: "md", weight: 1, isIncluded: When.always, features: []),

Variant(name: "me", weight: 1, isIncluded: When.supportsWidgets, features: [.widgetEducation]),
Variant(name: "mf", weight: 1, isIncluded: When.supportsWidgets, features: [])
]

public let name: String
Expand Down
68 changes: 52 additions & 16 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

// swiftlint:disable function_body_length
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

#if targetEnvironment(simulator)
if ProcessInfo.processInfo.environment["UITESTING"] == "true" {
// Disable hardware keyboards.
Expand Down Expand Up @@ -123,6 +124,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
UNUserNotificationCenter.current().delegate = self

window?.windowScene?.screenshotService?.delegate = self
ThemeManager.shared.updateUserInterfaceStyle(window: window)

appIsLaunching = true
return true
Expand Down Expand Up @@ -273,12 +275,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
mainViewController?.newTab(reuseExisting: true)
if url.getParam(name: "w") != nil {
Pixel.fire(pixel: .widgetNewSearch)
HomePageConfiguration().dismissHomeMessage(.widgetEducation)
mainViewController?.enterSearch()
}
} else if AppDeepLinks.isLaunchFavorite(url: url) {
let query = AppDeepLinks.query(fromLaunchFavorite: url)
mainViewController?.loadQueryInNewTab(query, reuseExisting: true)
Pixel.fire(pixel: .widgetFavoriteLaunch)
HomePageConfiguration().dismissHomeMessage(.widgetEducation)
} else if AppDeepLinks.isQuickLink(url: url) {
let query = AppDeepLinks.query(fromQuickLink: url)
mainViewController?.loadQueryInNewTab(query, reuseExisting: true)
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/AppDependencyProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AppDependencyProvider: DependencyProvider {

let appSettings: AppSettings = AppUserDefaults()
let variantManager: VariantManager = DefaultVariantManager()
let homePageConfiguration: HomePageConfiguration = HomePageConfiguration()
lazy var homePageConfiguration: HomePageConfiguration = HomePageConfiguration(variantManager: variantManager)
let storageCache = StorageCacheProvider()
lazy var voiceSearchHelper: VoiceSearchHelperProtocol = VoiceSearchHelper(variantManager)
}
14 changes: 9 additions & 5 deletions DuckDuckGo/Base.lproj/Home.storyboard
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_5" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
Expand Down Expand Up @@ -65,7 +66,7 @@
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="TextDuckDuckGo" translatesAutoresizingMaskIntoConstraints="NO" id="0q0-nN-Ola">
<rect key="frame" x="0.0" y="108" width="162" height="21"/>
<color key="tintColor" systemColor="systemBlueColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="tintColor" systemColor="systemBlueColor"/>
</imageView>
</subviews>
<variation key="heightClass=compact" axis="horizontal"/>
Expand Down Expand Up @@ -118,6 +119,7 @@
</view>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="3i0-li-iSv"/>
<gestureRecognizers/>
<constraints>
<constraint firstItem="7Jf-KE-oXj" firstAttribute="leading" secondItem="3i0-li-iSv" secondAttribute="leading" id="2Ia-p2-6HX"/>
Expand All @@ -126,7 +128,6 @@
<constraint firstItem="3i0-li-iSv" firstAttribute="trailing" secondItem="7Jf-KE-oXj" secondAttribute="trailing" id="niW-Cm-waP"/>
<constraint firstItem="7Jf-KE-oXj" firstAttribute="top" secondItem="eQ8-iA-i1e" secondAttribute="bottom" constant="32" id="pw7-Bg-mC2"/>
</constraints>
<viewLayoutGuide key="safeArea" id="3i0-li-iSv"/>
<size key="customSize" width="342" height="287"/>
<connections>
<outlet property="imageView" destination="39W-ag-iVs" id="ob1-89-hb0"/>
Expand Down Expand Up @@ -181,6 +182,7 @@
</connections>
</containerView>
</subviews>
<viewLayoutGuide key="safeArea" id="ijV-Vn-w9w"/>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="3ms-eB-DjL" firstAttribute="width" secondItem="klK-ZJ-wmA" secondAttribute="width" priority="750" id="12Q-iD-RrD"/>
Expand All @@ -198,7 +200,6 @@
<constraint firstItem="ijV-Vn-w9w" firstAttribute="bottom" secondItem="5Rf-oV-2W5" secondAttribute="bottom" id="iP8-nF-jOV"/>
<constraint firstItem="H74-G9-0WZ" firstAttribute="centerY" secondItem="ijV-Vn-w9w" secondAttribute="centerY" id="vdx-nG-nrB"/>
</constraints>
<viewLayoutGuide key="safeArea" id="ijV-Vn-w9w"/>
<variation key="heightClass=compact">
<mask key="constraints">
<include reference="BjB-Gh-zsj"/>
Expand Down Expand Up @@ -239,5 +240,8 @@
<image name="Settings" width="24" height="24"/>
<image name="SuggestLoupe" width="24" height="24"/>
<image name="TextDuckDuckGo" width="162" height="21"/>
<systemColor name="systemBlueColor">
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
Loading

0 comments on commit 78c7312

Please sign in to comment.