-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Add Speaker View #604
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7889ae4
Add SpeakerViewController
yanamura 8f2f910
Fix Navigation settings
yanamura c7fa676
Add tag, bio
yanamura dddfbe9
Use Nuke
yanamura 8126a86
Fix NavigationBar color
yanamura 36a8255
Add Speaker Directory
yanamura 4397a5f
Add UINavigationBar.appearance().isTranslucent = false
yanamura File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | |
} else { | ||
let window = UIWindow(frame: UIScreen.main.bounds) | ||
UINavigationBar.appearance().isTranslucent = false | ||
|
||
let backButtonBackgroundImage = #imageLiteral(resourceName: "ic_back") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
UINavigationBar.appearance().backIndicatorImage = backButtonBackgroundImage | ||
UINavigationBar.appearance().backIndicatorTransitionMaskImage = backButtonBackgroundImage | ||
|
||
let vc = FilterViewController() | ||
let nvc = NavigationController(rootViewController: vc) | ||
let root = NavigationDrawerController(rootViewController: nvc, leftViewController: SidebarViewController.instantiate(rootViewController: nvc)) | ||
|
12 changes: 12 additions & 0 deletions
12
ios-base/DroidKaigi 2020/Assets.xcassets/ic_back.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "ic_back.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+978 Bytes
ios-base/DroidKaigi 2020/Assets.xcassets/ic_back.imageset/ic_back.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
ios-base/DroidKaigi 2020/Speaker/Views/SpeakerViewController.storyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="uOd-Md-Mqj"> | ||
<device id="retina6_1" orientation="portrait" appearance="light"/> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--Speaker View Controller--> | ||
<scene sceneID="bmM-5m-QN8"> | ||
<objects> | ||
<viewController id="uOd-Md-Mqj" customClass="SpeakerViewController" customModule="DroidKaigi_2020" customModuleProvider="target" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" id="Aci-wR-Oop"> | ||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="amj-hh-azz"> | ||
<rect key="frame" x="24" y="44" width="366" height="818"/> | ||
<subviews> | ||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zxq-Au-f6x"> | ||
<rect key="frame" x="0.0" y="0.0" width="366" height="688"/> | ||
<subviews> | ||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="XWk-lo-a4J"> | ||
<rect key="frame" x="133" y="8" width="100" height="100"/> | ||
<constraints> | ||
<constraint firstAttribute="width" constant="100" id="hzT-1Y-3ma"/> | ||
<constraint firstAttribute="height" constant="100" id="uUr-Fx-2bY"/> | ||
</constraints> | ||
</imageView> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" text="Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0C4-aA-7aL"> | ||
<rect key="frame" x="91" y="132" width="184" height="29"/> | ||
<constraints> | ||
<constraint firstAttribute="width" constant="184" id="Bhi-Ji-EU4"/> | ||
</constraints> | ||
<fontDescription key="fontDescription" type="system" pointSize="24"/> | ||
<nil key="textColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="O53-5d-nTd"> | ||
<rect key="frame" x="91" y="177" width="184" height="487"/> | ||
<constraints> | ||
<constraint firstAttribute="width" constant="184" id="daI-hr-dtb"/> | ||
</constraints> | ||
<fontDescription key="fontDescription" type="system" pointSize="12"/> | ||
<color key="textColor" white="0.0" alpha="0.37538512323943662" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> | ||
<constraints> | ||
<constraint firstItem="O53-5d-nTd" firstAttribute="centerX" secondItem="zxq-Au-f6x" secondAttribute="centerX" id="474-V0-znd"/> | ||
<constraint firstItem="XWk-lo-a4J" firstAttribute="centerX" secondItem="zxq-Au-f6x" secondAttribute="centerX" id="6w5-c7-Vlu"/> | ||
<constraint firstItem="0C4-aA-7aL" firstAttribute="top" secondItem="XWk-lo-a4J" secondAttribute="bottom" constant="24" id="Bw9-xE-tog"/> | ||
<constraint firstItem="O53-5d-nTd" firstAttribute="top" secondItem="0C4-aA-7aL" secondAttribute="bottom" constant="16" id="XWb-CF-C88"/> | ||
<constraint firstItem="0C4-aA-7aL" firstAttribute="centerX" secondItem="zxq-Au-f6x" secondAttribute="centerX" id="gHl-S0-JIo"/> | ||
<constraint firstAttribute="bottom" secondItem="O53-5d-nTd" secondAttribute="bottom" constant="24" id="qRj-Mn-1PG"/> | ||
<constraint firstItem="XWk-lo-a4J" firstAttribute="top" secondItem="zxq-Au-f6x" secondAttribute="top" constant="8" id="spC-xq-Ghh"/> | ||
</constraints> | ||
</view> | ||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Yuv-dy-Of5"> | ||
<rect key="frame" x="0.0" y="688" width="366" height="1"/> | ||
<color key="backgroundColor" white="0.0" alpha="0.3753851232" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
<constraints> | ||
<constraint firstAttribute="height" constant="1" id="jWz-AI-sAM"/> | ||
</constraints> | ||
</view> | ||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Xnd-YB-s88"> | ||
<rect key="frame" x="0.0" y="689" width="366" height="128"/> | ||
<subviews> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2FB-qi-ed3"> | ||
<rect key="frame" x="0.0" y="24" width="366" height="80"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
<nil key="textColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> | ||
<constraints> | ||
<constraint firstAttribute="bottom" secondItem="2FB-qi-ed3" secondAttribute="bottom" constant="24" id="LXo-Xj-zu5"/> | ||
<constraint firstAttribute="trailing" secondItem="2FB-qi-ed3" secondAttribute="trailing" id="x1V-1u-gaM"/> | ||
<constraint firstItem="2FB-qi-ed3" firstAttribute="top" secondItem="Xnd-YB-s88" secondAttribute="top" constant="24" id="xZ6-UI-CjJ"/> | ||
<constraint firstItem="2FB-qi-ed3" firstAttribute="leading" secondItem="Xnd-YB-s88" secondAttribute="leading" id="xyE-m1-zqc"/> | ||
</constraints> | ||
</view> | ||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hzH-WS-AjJ"> | ||
<rect key="frame" x="0.0" y="817" width="366" height="1"/> | ||
<color key="backgroundColor" white="0.0" alpha="0.3753851232" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
<constraints> | ||
<constraint firstAttribute="height" constant="1" id="ZOE-DA-v6a"/> | ||
</constraints> | ||
</view> | ||
<view contentMode="scaleToFill" id="esp-sf-8kz"> | ||
<rect key="frame" x="0.0" y="818" width="366" height="0.0"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> | ||
<viewLayoutGuide key="safeArea" id="smL-fu-Mf4"/> | ||
</view> | ||
</subviews> | ||
</stackView> | ||
</subviews> | ||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> | ||
<constraints> | ||
<constraint firstItem="amj-hh-azz" firstAttribute="bottom" secondItem="61B-TN-rWe" secondAttribute="bottom" id="PQD-BF-Gdw"/> | ||
<constraint firstItem="61B-TN-rWe" firstAttribute="trailing" secondItem="amj-hh-azz" secondAttribute="trailing" constant="24" id="QPF-tW-E5C"/> | ||
<constraint firstItem="amj-hh-azz" firstAttribute="top" secondItem="61B-TN-rWe" secondAttribute="top" id="kEc-Fl-7I2"/> | ||
<constraint firstItem="amj-hh-azz" firstAttribute="leading" secondItem="61B-TN-rWe" secondAttribute="leading" constant="24" id="tIp-y8-oS1"/> | ||
</constraints> | ||
<viewLayoutGuide key="safeArea" id="61B-TN-rWe"/> | ||
</view> | ||
<connections> | ||
<outlet property="biographyLabel" destination="2FB-qi-ed3" id="pW2-wM-rlB"/> | ||
<outlet property="tagLabel" destination="O53-5d-nTd" id="bsn-OI-a0q"/> | ||
<outlet property="userImageView" destination="XWk-lo-a4J" id="35q-bk-mlm"/> | ||
<outlet property="userNameLabel" destination="0C4-aA-7aL" id="9Ct-6a-uEe"/> | ||
</connections> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="anN-R6-2hD" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="166.66666666666669" y="135.9375"/> | ||
</scene> | ||
</scenes> | ||
</document> |
49 changes: 49 additions & 0 deletions
49
ios-base/DroidKaigi 2020/Speaker/Views/SpeakerViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Foundation | ||
import ios_combined | ||
import Nuke | ||
import UIKit | ||
|
||
final class SpeakerViewController: UIViewController { | ||
@IBOutlet weak var userImageView: UIImageView! { | ||
didSet { | ||
userImageView.clipsToBounds = true | ||
userImageView.layer.cornerRadius = userImageView.bounds.width / 2 | ||
} | ||
} | ||
|
||
@IBOutlet weak var userNameLabel: UILabel! | ||
@IBOutlet weak var tagLabel: UILabel! | ||
@IBOutlet weak var biographyLabel: UILabel! | ||
|
||
private var speaker: Speaker! | ||
|
||
static func instantiate(speaker: Speaker) -> SpeakerViewController { | ||
guard let viewController = UIStoryboard(name: "SpeakerViewController", bundle: .main).instantiateInitialViewController() as? SpeakerViewController else { fatalError() } | ||
viewController.speaker = speaker | ||
return viewController | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
setupUI() | ||
} | ||
|
||
override func viewWillAppear(_ animated: Bool) { | ||
super.viewWillAppear(animated) | ||
|
||
navigationController?.navigationBar.barTintColor = .white | ||
navigationController?.navigationBar.tintColor = .black | ||
} | ||
|
||
private func setupUI() { | ||
if | ||
let imageUrl = speaker.imageUrl, | ||
let url = URL(string: imageUrl) { | ||
Nuke.loadImage(with: url, into: userImageView) | ||
} | ||
userNameLabel.text = speaker.name | ||
tagLabel.text = speaker.tagLine | ||
biographyLabel.text = speaker.bio | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇