Skip to content

Commit

Permalink
Merge remote-tracking branch 'klub-jagielonski/master' into release/1…
Browse files Browse the repository at this point in the history
….8.0
  • Loading branch information
WezSieTato committed Aug 26, 2020
2 parents f92c241 + 95c0ad5 commit a968d93
Show file tree
Hide file tree
Showing 22 changed files with 46 additions and 35 deletions.
11 changes: 2 additions & 9 deletions BuyPolish/Pola/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -19,9 +19,6 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Launch_text_top" translatesAutoresizingMaskIntoConstraints="NO" id="VZS-ti-0tb">
<rect key="frame" x="16" y="0.0" width="343.00000000000011" height="103.00000000000003"/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Launch_logo_center" translatesAutoresizingMaskIntoConstraints="NO" id="Lrl-P5-R6A">
<rect key="frame" x="69" y="205" width="237.5" height="257.5"/>
</imageView>
Expand All @@ -32,9 +29,6 @@
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="gyK-eW-uVb" firstAttribute="top" secondItem="Uvg-KA-EiN" secondAttribute="bottom" constant="15" id="7zf-oO-spm"/>
<constraint firstItem="VZS-ti-0tb" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Ze5-6b-2t3" secondAttribute="leadingMargin" id="8Uf-4Z-iTG"/>
<constraint firstAttribute="trailingMargin" secondItem="VZS-ti-0tb" secondAttribute="trailing" id="JAe-sa-ZNg"/>
<constraint firstItem="VZS-ti-0tb" firstAttribute="top" secondItem="Qa9-zl-eGo" secondAttribute="bottom" id="JPB-Uh-aw5"/>
<constraint firstItem="Lrl-P5-R6A" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="unQ-dq-gfB"/>
<constraint firstItem="Lrl-P5-R6A" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="zMr-PA-fzW"/>
<constraint firstItem="Uvg-KA-EiN" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="zRf-9x-Du2"/>
Expand All @@ -52,6 +46,5 @@
<resources>
<image name="Launch_logo_bottom" width="138" height="26"/>
<image name="Launch_logo_center" width="237.5" height="257.5"/>
<image name="Launch_text_top" width="398.5" height="103"/>
</resources>
</document>

This file was deleted.

Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions BuyPolish/Pola/Manager/Analytics/AnalyticsEventName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ enum AnalyticsEventName: String {
case reportFinished = "report_finished"
case menuItemOpened = "menu_item_opened"
case donateOpened = "donate_opened"
case aboutPola = "about_pola"
case polasFriends = "polas_friends"
}
5 changes: 5 additions & 0 deletions BuyPolish/Pola/Manager/Analytics/AnalyticsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ final class AnalyticsHelper {
parameters: AnalitycsPolasFriendsParameters(device_id: UIDevice.current.deviceId))
}

class func aboutPolaOpened() {
logEvent(name: .aboutPola,
parameters: AnalitycsPolasFriendsParameters(device_id: UIDevice.current.deviceId))
}

private class func reportParameters(barcode: String?) -> AnalyticsReportParameters {
return AnalyticsReportParameters(code: barcode ?? "No Code",
device_id: UIDevice.current.deviceId)
Expand Down
2 changes: 2 additions & 0 deletions BuyPolish/Pola/SupportingFiles/pl.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"created rich salary work places" = "prowadzi badania i rozwój w Polsce";
"producing in PL" = "produkuje w Polsce";
"This is Pola's friend" = "To jest przyjaciel Poli";
"look at Pola's friends" = "ZOBACZ PRZYJACIÓŁ POLI";
"Loading..." = "Pobieranie danych...";
"Sending..." = "Wysyłanie...";
"Report sent" = "Raport wysłany";
Expand Down Expand Up @@ -67,6 +68,7 @@
"Accessibility.Close" = "Zamknij";
"Accessibility.CardHint" = "Otwórz lub zamknij poprzez kliknięcie";
"Accessibility.Report.AddPhoto" = "Dodaj zdjęcie";
"Accessibility.Logo" = "Strona główna";
"CaptureVideo.Timer.Seconds" = "sek.";
"CaptureVideo.Start" = "START";
"CaptureVideo.Sending" = "Wysyłanie zdjęć";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class ScanResultView: UIView {
}
}

let polasFriendsButton = UIButton(type: .custom)
let reportProblemButton = UIButton(type: .custom)
let reportInfoLabel = UILabel()
let separatorView = UIView()
Expand Down Expand Up @@ -52,6 +53,17 @@ final class ScanResultView: UIView {
mainProgressView.sizeToFit()
addSubview(mainProgressView)

polasFriendsButton.setTitle(R.string.localizable.lookAtPolaSFriends(), for: .normal)
polasFriendsButton.titleLabel?.font = Theme.buttonFont
polasFriendsButton.layer.borderColor = Theme.actionColor.cgColor
polasFriendsButton.layer.borderWidth = 1
polasFriendsButton.setTitleColor(Theme.actionColor, for: .normal)
polasFriendsButton.setTitleColor(Theme.clearColor, for: .highlighted)
polasFriendsButton.setBackgroundImage(UIImage.image(color: UIColor.clear), for: .normal)
polasFriendsButton.setBackgroundImage(UIImage.image(color: Theme.actionColor), for: .highlighted)
polasFriendsButton.sizeToFit()
addSubview(polasFriendsButton)

reportProblemButton.titleLabel?.font = Theme.buttonFont
reportProblemButton.sizeToFit()
addSubview(reportProblemButton)
Expand Down Expand Up @@ -125,11 +137,20 @@ final class ScanResultView: UIView {
rect.origin.y = reportProblemButton.frame.minY - verticalPadding - rect.height
reportInfoLabel.frame = rect

if !polasFriendsButton.isHidden {
rect = polasFriendsButton.frame
rect.size = CGSize(width: widthWithPadding, height: buttonHeight)
rect.origin.x = horizontalPadding
rect.origin.y = reportInfoLabel.frame.minY - verticalPadding - rect.height
polasFriendsButton.frame = rect
}

rect = separatorView.frame
rect.size.width = bounds.width
rect.size.height = 1
rect.origin.x = 0
rect.origin.y = reportInfoLabel.frame.minY - 15 - rect.height
let viewUnderSeparator = polasFriendsButton.isHidden ? reportInfoLabel : polasFriendsButton
rect.origin.y = viewUnderSeparator.frame.minY - 15 - rect.height
separatorView.frame = rect

rect = scrollViewForContentView.frame
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ final class ScanResultViewController: UIViewController {
super.viewDidLoad()

castedView.reportProblemButton.addTarget(self, action: #selector(reportProblemTapped), for: .touchUpInside)
castedView.polasFriendsButton.addTarget(self, action: #selector(polasFriendsButtonTapped), for: .touchUpInside)

downloadScanResult()
}
Expand Down Expand Up @@ -115,6 +116,16 @@ final class ScanResultViewController: UIViewController {
argument: ReportProblemReason.product(productId, barcode))!
present(vc, animated: true, completion: nil)
}

@objc
func polasFriendsButtonTapped() {
AnalyticsHelper.polasFriendsOpened()
let vc = AboutWebViewController(url: "https://www.pola-app.pl/m/friends",
title: R.string.localizable.polaSFriends())
vc.addCloseButton()
let nvc = UINavigationController(rootViewController: vc)
present(nvc, animated: true, completion: nil)
}
}

extension ScanResultViewController: CardStackViewControllerCard {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class ScanCodeView: UIView {

addSubview(dimView)

logoButton.accessibilityLabel = R.string.localizable.accessibilityPolaFriends()
logoButton.accessibilityLabel = R.string.localizable.accessibilityLogo()
logoButton.setImage(R.image.logoIcon(), for: .normal)
logoButton.sizeToFit()
addSubview(logoButton)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ final class ScanCodeViewController: UIViewController {

@objc
func tapLogoButton() {
AnalyticsHelper.polasFriendsOpened()
let vc = AboutWebViewController(url: "https://www.pola-app.pl/m/friends",
AnalyticsHelper.aboutPolaOpened()
let vc = AboutWebViewController(url: "https://www.pola-app.pl/m/about",
title: R.string.localizable.polaSFriends())
vc.addCloseButton()
let nvc = UINavigationController(rootViewController: vc)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...aUITests.CompanyPageUITests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...Tests.CompanyPageUITests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...ests.CompanyPageUITests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ....CompanyPageUITests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a968d93

Please sign in to comment.