Skip to content
This repository has been archived by the owner on Apr 28, 2018. It is now read-only.

No issue: map view updates with places #546

Merged
merged 15 commits into from
Feb 25, 2017

Conversation

mcomella
Copy link
Contributor

@mcomella mcomella commented Feb 24, 2017

Still TODO:

Copy link
Contributor

@thebnich thebnich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

get { return layer.shadowRadius }
set { layer.shadowRadius = newValue }
}
public var shadowOffset: CGSize {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason you're exposing these layer properties as properties on the view? If I were using this class, I would expect to do expandingCardView.layer.shadowColor = ... like any other UIView.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No – fixed.


private lazy var scrollView: UIScrollView = {
let view = ObservableScrollView()
view.onContentSizeUpdated = { [unowned self] contentSize in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is typically done use the delegate pattern (ObservableScrollViewDelegate with didUpdateContentSize, for example). That way, the client code isn't responsible for breaking the ref cycle, which is error prone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

import SnapKit

private let cardPadding = 10
private let cardSpacing: CGFloat = 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these go into the Style struct you made?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global constants/strings/etc. create a lot of bloat in files until it's hard to maintain, easy to loose track of unused values, and difficult to identify what is safe to re-use (and what just happens to be in a giant constants file). I prefer to keep the constants locally to the places they're used. A good example is our FFAndroid styles which are so hard to maintain (most of these styles should really be embedded directly in the layout files). fwiw, I'm conflicted about our Colors.swift & Fonts.swift files.

Style.swift was intended to be for shared styles – should I rename it as such?

private let cardSpacing = 18
private let cardProviderSpacing = 12

private let cardCoverPhotoHeight = 72
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here re: Style.


private lazy var reviewCountView: UILabel = {
let view = UILabel()
view.text = "10 reviews"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to Strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-used our "no info" text.

@@ -43,8 +43,8 @@ class MapViewCardFooter: ExpandingCardView {
return view
}()

private lazy var yelpProviderView: UIView = MapViewReviewProvider()
private lazy var tripAdvisorProviderView: UIView = MapViewReviewProvider()
private lazy var yelpProviderView: UIView = MapViewYelpReviewProviderView()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:trollface:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:|

@mcomella mcomella merged commit 6ee4b50 into mozilla-mobile:master Feb 25, 2017
@mcomella mcomella deleted the ni-map-view branch February 25, 2017 01:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants