mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-13 23:07:37 +10:00
update FeedCellLayout for URLLayout
This commit is contained in:
@@ -2968,7 +2968,7 @@ struct DiscoveredFeed: Hashable {
|
||||
let description: String
|
||||
let thumbnailImageURLString: String
|
||||
|
||||
static func URLInfo(json: JSONDictionary) -> URLInfo? {
|
||||
static func fromJSONDictionary(json: JSONDictionary) -> URLInfo? {
|
||||
guard let
|
||||
URLString = json["url"] as? String,
|
||||
URL = NSURL(string: URLString),
|
||||
|
||||
@@ -1076,6 +1076,10 @@ extension FeedsViewController: UITableViewDataSource, UITableViewDelegate {
|
||||
|
||||
cell.configureWithFeed(feed, layoutCache: layoutCache, needShowSkill: needShowSkill)
|
||||
|
||||
case .URL:
|
||||
|
||||
cell.configureWithFeed(feed, layoutCache: layoutCache, needShowSkill: needShowSkill)
|
||||
|
||||
case .Image:
|
||||
|
||||
let tapMediaAction: FeedTapMediaAction = { [weak self] transitionView, image, attachments, index in
|
||||
|
||||
@@ -111,6 +111,11 @@ struct FeedCellLayout {
|
||||
}
|
||||
var locationLayout: LocationLayout?
|
||||
|
||||
struct URLLayout {
|
||||
let URLContainerViewFrame: CGRect
|
||||
}
|
||||
var _URLLayout: URLLayout?
|
||||
|
||||
// MARK: - Init
|
||||
|
||||
init(height: CGFloat, basicLayout: BasicLayout) {
|
||||
@@ -217,6 +222,15 @@ struct FeedCellLayout {
|
||||
|
||||
case .Text:
|
||||
break
|
||||
|
||||
case .URL:
|
||||
|
||||
let height: CGFloat = leftBottomLabelFrame.origin.y - beginY - 15
|
||||
let URLContainerViewFrame = CGRect(x: 65, y: beginY, width: screenWidth - 65 - 60, height: height)
|
||||
|
||||
let _URLLayout = FeedCellLayout.URLLayout(URLContainerViewFrame: URLContainerViewFrame)
|
||||
|
||||
self._URLLayout = _URLLayout
|
||||
|
||||
case .Image:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user