Improve About page layout

This commit is contained in:
Maurice Parker
2019-10-20 14:01:13 -05:00
parent 329d5ccfeb
commit 490e782956
7 changed files with 69 additions and 64 deletions

View File

@@ -50,7 +50,7 @@
5132285B232FF2C40033D4ED /* SettingsRefreshSelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5132285A232FF2C40033D4ED /* SettingsRefreshSelectionView.swift */; };
513228FB233037630033D4ED /* Reachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 513228F2233037620033D4ED /* Reachability.swift */; };
513228FC233037630033D4ED /* Reachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 513228F2233037620033D4ED /* Reachability.swift */; };
513229312330523F0033D4ED /* SettingsAttributedStringView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 513229302330523F0033D4ED /* SettingsAttributedStringView.swift */; };
513229312330523F0033D4ED /* AttributedStringView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 513229302330523F0033D4ED /* AttributedStringView.swift */; };
5132293B23305D4C0033D4ED /* SettingsAboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5132293A23305D4C0033D4ED /* SettingsAboutView.swift */; };
513C5CE9232571C2003D4054 /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 513C5CE8232571C2003D4054 /* ShareViewController.swift */; };
513C5CEC232571C2003D4054 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 513C5CEA232571C2003D4054 /* MainInterface.storyboard */; };
@@ -760,7 +760,7 @@
51322858232FDDB80033D4ED /* VibrantButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VibrantButtonStyle.swift; sourceTree = "<group>"; };
5132285A232FF2C40033D4ED /* SettingsRefreshSelectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsRefreshSelectionView.swift; sourceTree = "<group>"; };
513228F2233037620033D4ED /* Reachability.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Reachability.swift; sourceTree = "<group>"; };
513229302330523F0033D4ED /* SettingsAttributedStringView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsAttributedStringView.swift; sourceTree = "<group>"; };
513229302330523F0033D4ED /* AttributedStringView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttributedStringView.swift; sourceTree = "<group>"; };
5132293A23305D4C0033D4ED /* SettingsAboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsAboutView.swift; sourceTree = "<group>"; };
513C5CE6232571C2003D4054 /* NetNewsWire iOS Share Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "NetNewsWire iOS Share Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
513C5CE8232571C2003D4054 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = "<group>"; };
@@ -1302,7 +1302,6 @@
children = (
51F35D0822AFD4760003CE1B /* SettingsView.swift */,
5132293A23305D4C0033D4ED /* SettingsAboutView.swift */,
513229302330523F0033D4ED /* SettingsAttributedStringView.swift */,
5132285A232FF2C40033D4ED /* SettingsRefreshSelectionView.swift */,
51314717235C89ED00387FDC /* SettingsSubscriptionsExportAccountPickerView.swift */,
5194B5F122B69FCC00144881 /* SettingsSubscriptionsExportDocumentPickerView.swift */,
@@ -1336,6 +1335,7 @@
5194B5E222B693EC00144881 /* SwiftUI Extensions */ = {
isa = PBXGroup;
children = (
513229302330523F0033D4ED /* AttributedStringView.swift */,
DF999FF622B5AEFA0064B687 /* SafariView.swift */,
51322858232FDDB80033D4ED /* VibrantButtonStyle.swift */,
51322854232EED360033D4ED /* VibrantSelectAction.swift */,
@@ -3028,7 +3028,7 @@
519D73FB2323FF35008BB345 /* SettingsView.swift in Sources */,
511D4419231FC02D00FB1562 /* KeyboardManager.swift in Sources */,
51C45293226509C800C03939 /* StarredFeedDelegate.swift in Sources */,
513229312330523F0033D4ED /* SettingsAttributedStringView.swift in Sources */,
513229312330523F0033D4ED /* AttributedStringView.swift in Sources */,
51D6A5BC23199C85001C27D8 /* MasterTimelineDataSource.swift in Sources */,
51934CCB230F599B006127BE /* ThemedNavigationController.swift in Sources */,
51314716235C862200387FDC /* SettingsSubscriptionsImportAccountPickerView.swift in Sources */,

View File

@@ -1,7 +1,7 @@
{\rtf1\ansi\ansicpg1252\cocoartf2507
{\rtf1\ansi\ansicpg1252\cocoartf2509
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 LucidaGrande-Bold;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red10\green96\blue255;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;\cssrgb\c0\c47843\c100000\cname systemBlueColor;}
\margl1440\margr1440\vieww11860\viewh9620\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
@@ -9,4 +9,4 @@
\fs22 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
{\field{\*\fldinst{HYPERLINK "http://inessential.com/"}}{\fldrslt
\fs28 \cf2 inessential.com}}}
\fs28 \cf3 inessential.com}}}

View File

@@ -1,13 +1,12 @@
{\rtf1\ansi\ansicpg1252\cocoartf2507
{\rtf1\ansi\ansicpg1252\cocoartf2509
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0\cname textColor;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\margl1440\margr1440\vieww8960\viewh8160\viewkind0
\deftab720
\pard\pardeftab720\li360\fi-360\sa60\partightenfactor0
\pard\tx0\pardeftab720\sa60\partightenfactor0
{\field{\*\fldinst{HYPERLINK "https://github.com/ccgus/fmdb"}}{\fldrslt
\f0\fs22 \cf2 FMDB}}
\f0\fs22 \cf2 (greatest SQLite wrapper ever in\
history) is by {\field{\*\fldinst{HYPERLINK "http://flyingmeat.com/"}}{\fldrslt Flying Meat Software}}.\
\pard\pardeftab720\li360\fi-360\sa60\partightenfactor0
\f0\fs22 \cf2 (greatest SQLite wrapper ever in history) is by {\field{\*\fldinst{HYPERLINK "http://flyingmeat.com/"}}{\fldrslt Flying Meat Software}}.\
\pard\pardeftab720\sa60\partightenfactor0
{\field{\*\fldinst{HYPERLINK "https://sparkle-project.org/"}}{\fldrslt \cf2 Sparkle}} is by Sparkle Project.}

View File

@@ -1,4 +1,4 @@
{\rtf1\ansi\ansicpg1252\cocoartf2507
{\rtf1\ansi\ansicpg1252\cocoartf2509
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0\cname textColor;}
@@ -6,4 +6,5 @@
\deftab720
\pard\pardeftab720\sa60\partightenfactor0
\f0\fs22 \cf2 Thanks to Sheila and my family; thanks to my friends in Seattle and around the globe; thanks to my co-workers and friends at {\field{\*\fldinst{HYPERLINK "https://www.omnigroup.com/"}}{\fldrslt The Omni Group}}; thanks to the ever-patient and ever-awesome NetNewsWire beta testers. Thanks to {\field{\*\fldinst{HYPERLINK "https://github.com/"}}{\fldrslt GitHub}}, {\field{\*\fldinst{HYPERLINK "https://slack.com/"}}{\fldrslt Slack}}, and {\field{\*\fldinst{HYPERLINK "https://circleci.com/"}}{\fldrslt CircleCI}} for making open source collaboration easy and fun.}
\f0\fs22 \cf2 Thanks to Sheila and my family; thanks to my friends in Seattle and around the globe; thanks to my co-workers and friends at {\field{\*\fldinst{HYPERLINK "https://www.omnigroup.com"}}{\fldrslt The Omni Group}}; thanks to the ever-patient and ever-awesome NetNewsWire beta testers. \
Thanks to {\field{\*\fldinst{HYPERLINK "https://github.com"}}{\fldrslt GitHub}} and {\field{\*\fldinst{HYPERLINK "https://slack.com"}}{\fldrslt Slack}} for making open source collaboration easy and fun.}

View File

@@ -14,20 +14,22 @@ struct SettingsAboutView: View {
@ObservedObject var viewModel: ViewModel
var body: some View {
Form {
Text("NetNewsWire").font(.largeTitle)
SettingsAttributedStringView(string: viewModel.about).frame(height: 54)
Section(header: Text("CREDITS")) {
SettingsAttributedStringView(string: viewModel.credits).frame(height: 135)
}
Section(header: Text("ACKNOWLEDGEMENTS")) {
SettingsAttributedStringView(string: viewModel.acknowledgements).frame(height: 81)
}
Section(header: Text("THANKS")) {
SettingsAttributedStringView(string: viewModel.thanks).frame(height: 189)
}
Section(header: Text("DEDICATION"), footer: Text("Copyright © 2002-2019 Ranchero Software").font(.footnote)) {
SettingsAttributedStringView(string: viewModel.dedication).frame(height: 108)
GeometryReader { geometry in
List {
Text("NetNewsWire").font(.largeTitle)
AttributedStringView(string: self.viewModel.about, preferredMaxLayoutWidth: geometry.size.width - 40)
Section(header: Text("CREDITS")) {
AttributedStringView(string: self.viewModel.credits, preferredMaxLayoutWidth: geometry.size.width - 40)
}
Section(header: Text("ACKNOWLEDGEMENTS")) {
AttributedStringView(string: self.viewModel.acknowledgements, preferredMaxLayoutWidth: geometry.size.width - 40)
}
Section(header: Text("THANKS")) {
AttributedStringView(string: self.viewModel.thanks, preferredMaxLayoutWidth: geometry.size.width - 40)
}
Section(header: Text("DEDICATION"), footer: Text("Copyright © 2002-2019 Ranchero Software").font(.footnote)) {
AttributedStringView(string: self.viewModel.dedication, preferredMaxLayoutWidth: geometry.size.width - 40)
}
}
}
}

View File

@@ -1,34 +0,0 @@
//
// SettingsAttributedStringView.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 9/16/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import SwiftUI
struct SettingsAttributedStringView: UIViewRepresentable {
let string: NSAttributedString
func makeUIView(context: Context) -> UITextView {
let textView = UITextView()
textView.attributedText = string
textView.translatesAutoresizingMaskIntoConstraints = false
textView.isEditable = false
textView.adjustsFontForContentSizeCategory = true
textView.font = .preferredFont(forTextStyle: .body)
textView.textColor = UIColor.label
textView.tintColor = AppAssets.secondaryAccentColor
textView.backgroundColor = UIColor.secondarySystemGroupedBackground
return textView
}
func updateUIView(_ textView: UITextView, context: Context) {
}
}

View File

@@ -0,0 +1,37 @@
//
// AttributedStringView.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 9/16/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import SwiftUI
struct AttributedStringView: UIViewRepresentable {
let string: NSAttributedString
let preferredMaxLayoutWidth: CGFloat
func makeUIView(context: Context) -> UILabel {
return UILabel()
}
func updateUIView(_ view: UILabel, context: Context) {
view.attributedText = string
view.numberOfLines = 0
view.lineBreakMode = .byWordWrapping
view.preferredMaxLayoutWidth = preferredMaxLayoutWidth
view.adjustsFontForContentSizeCategory = true
view.font = .preferredFont(forTextStyle: .body)
view.textColor = UIColor.label
view.tintColor = AppAssets.secondaryAccentColor
view.backgroundColor = UIColor.secondarySystemGroupedBackground
view.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
view.setContentCompressionResistancePriority(.required, for: .vertical)
}
}