From 0d6a05a7c565e70e435c1b0f56239a8134eb05c6 Mon Sep 17 00:00:00 2001 From: Dwayne Harris Date: Wed, 7 Nov 2018 00:20:09 -0800 Subject: [PATCH] Development --- elpha-ios.xcodeproj/project.pbxproj | 10 +- elpha-ios/AccountTableViewController.swift | 4 +- .../Icons/Close.imageset/Contents.json | 12 +++ .../Icons/Close.imageset/x-square.pdf | Bin 0 -> 3927 bytes .../Icons/Share.imageset/Contents.json | 12 +++ .../Icons/Share.imageset/share.pdf | Bin 0 -> 3912 bytes .../Assets.xcassets/New Folder/Contents.json | 6 -- elpha-ios/AttachmentViewController.swift | 40 ++++---- elpha-ios/Base.lproj/Main.storyboard | 97 +++++++++++++----- elpha-ios/StatusTableViewController.swift | 15 +-- elpha-ios/StatusView.swift | 15 +-- elpha-ios/StatusView.xib | 22 ++-- elpha-ios/String+HtmlAttributed.swift | 6 +- elpha-ios/UITextViewFixed.swift | 18 ++++ 14 files changed, 163 insertions(+), 94 deletions(-) create mode 100644 elpha-ios/Assets.xcassets/Icons/Close.imageset/Contents.json create mode 100644 elpha-ios/Assets.xcassets/Icons/Close.imageset/x-square.pdf create mode 100644 elpha-ios/Assets.xcassets/Icons/Share.imageset/Contents.json create mode 100644 elpha-ios/Assets.xcassets/Icons/Share.imageset/share.pdf delete mode 100644 elpha-ios/Assets.xcassets/New Folder/Contents.json create mode 100644 elpha-ios/UITextViewFixed.swift diff --git a/elpha-ios.xcodeproj/project.pbxproj b/elpha-ios.xcodeproj/project.pbxproj index ec60048..5f624f9 100644 --- a/elpha-ios.xcodeproj/project.pbxproj +++ b/elpha-ios.xcodeproj/project.pbxproj @@ -51,6 +51,7 @@ 15BB72AB2171A8D4002F1FA4 /* TimelinesTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15BB72AA2171A8D4002F1FA4 /* TimelinesTableViewCell.swift */; }; 15C91A02216AB2D600D97DC3 /* AlertView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 15C91A01216AB2D600D97DC3 /* AlertView.xib */; }; 15C91A04216AB32500D97DC3 /* AlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15C91A03216AB32500D97DC3 /* AlertView.swift */; }; + 15CF7244219282AF00E6BF19 /* UITextViewFixed.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15CF7243219282AF00E6BF19 /* UITextViewFixed.swift */; }; 15F9981721629965009E58DA /* TimelineTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15F9981621629965009E58DA /* TimelineTableViewController.swift */; }; 15F998352162C0E8009E58DA /* MastodonDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15F998342162C0E8009E58DA /* MastodonDataManager.swift */; }; /* End PBXBuildFile section */ @@ -237,6 +238,7 @@ 15BB72AA2171A8D4002F1FA4 /* TimelinesTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelinesTableViewCell.swift; sourceTree = ""; }; 15C91A01216AB2D600D97DC3 /* AlertView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AlertView.xib; sourceTree = ""; }; 15C91A03216AB32500D97DC3 /* AlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertView.swift; sourceTree = ""; }; + 15CF7243219282AF00E6BF19 /* UITextViewFixed.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITextViewFixed.swift; sourceTree = ""; }; 15F9981621629965009E58DA /* TimelineTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineTableViewController.swift; sourceTree = ""; }; 15F998342162C0E8009E58DA /* MastodonDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MastodonDataManager.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -378,11 +380,12 @@ 15960E59213145E100C38CE9 /* elpha-ios */ = { isa = PBXGroup; children = ( - 15960E5A213145E100C38CE9 /* AppDelegate.swift */, 15960E63213145E200C38CE9 /* Assets.xcassets */, - 15960E7621322C6F00C38CE9 /* Configuration.swift */, - 15960E6E21321FA500C38CE9 /* Elpha.xcdatamodeld */, 15960E68213145E200C38CE9 /* Info.plist */, + 15960E6E21321FA500C38CE9 /* Elpha.xcdatamodeld */, + 15960E5A213145E100C38CE9 /* AppDelegate.swift */, + 15960E7621322C6F00C38CE9 /* Configuration.swift */, + 15CF7243219282AF00E6BF19 /* UITextViewFixed.swift */, 156FF05621779C140074D9CA /* API */, 151AD4AF2166DDA000F07403 /* Extensions */, 15960E7121322B9F00C38CE9 /* Keychain Helper */, @@ -634,6 +637,7 @@ 15960E7C213272CD00C38CE9 /* AuthenticationManager.swift in Sources */, 15B127922192467F00F4EF1D /* String+HtmlAttributed.swift in Sources */, 15960E7E21329FED00C38CE9 /* AuthenticateViewController.swift in Sources */, + 15CF7244219282AF00E6BF19 /* UITextViewFixed.swift in Sources */, 15960E5B213145E100C38CE9 /* AppDelegate.swift in Sources */, 15131EF2216D8D570092B252 /* StatusView.swift in Sources */, 152734D22186DC74003DB3C8 /* TimelinesViewController.swift in Sources */, diff --git a/elpha-ios/AccountTableViewController.swift b/elpha-ios/AccountTableViewController.swift index 2a298ff..b63adcb 100644 --- a/elpha-ios/AccountTableViewController.swift +++ b/elpha-ios/AccountTableViewController.swift @@ -74,7 +74,7 @@ class AccountTableViewController: UITableViewController { } displayNameLabel.text = account.displayName - usernameLabel.text = account.acct + usernameLabel.text = "@\(account.acct!)" if let note = account.note { contentLabel.attributedText = note.htmlAttributed(size: 15, centered: true) @@ -370,7 +370,7 @@ extension AccountTableViewController: StatusViewDelegate { controller.status = status controller.attachmentIndex = index - self.navigationController?.pushViewController(controller, animated: false) + present(controller, animated: false) } } } diff --git a/elpha-ios/Assets.xcassets/Icons/Close.imageset/Contents.json b/elpha-ios/Assets.xcassets/Icons/Close.imageset/Contents.json new file mode 100644 index 0000000..58a1f2d --- /dev/null +++ b/elpha-ios/Assets.xcassets/Icons/Close.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "x-square.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/elpha-ios/Assets.xcassets/Icons/Close.imageset/x-square.pdf b/elpha-ios/Assets.xcassets/Icons/Close.imageset/x-square.pdf new file mode 100644 index 0000000000000000000000000000000000000000..35aead3400b571854e59283884cabb2c75ac7992 GIT binary patch literal 3927 zcmai%cT`jB(uXNgARwYr1W~sf0-{I~l2Al?i6~05&>;y4gcc24?<$AjAqErR&aD`>tx2h$p%Q*Ota<-A=L;T zO>8&R=geE_8nAh*Z@bFv_Z2a)U75k+>6|JKvqeEF_6)mpj(!X?d?H+9jxD#&k zy^mvXZib!=1>@c9f5gdrV;zrmCe{;k3VNOy5LA;@5jSQz0H_Y$lZeBcptb&Yp;B*q zT`(OG4x`f)X|MN60FXs7UmoC%%4s2xakzef5l3jSl&8)PJ;6OPm+UXRWJiZd;B*Cf zZw6uec)ki4HPssH=rRVQoO$L7Q42#Uo6Y9K0~6(a0}gY3eU)rR8$qBtiWz$VGTlt@ z^K`A%-hFKi%N+X!*!j)aUycw6AoPk3NB0IzH90x=bW`clXSo3Ts&}$AMpEv*TmEqp zirSJp*}%Fz3a4&Ji7+@4O-ma^<+nhsi%Bx_p>TQObe@NgBt{#GU6yjjk5{$ap-PRV ziZb*k5i~4*$x*#+}%p{DRCMxvK1VpUpelVJrd^u8+;$(|3o+n0!T8n=dt8#lnv#)}I^s z)7yZ)SjKk?CK6Cgx~@x|Da zArECmGlqj*YB~1Ca#0?Dk%4kB4q3Zh;sJ;&oI?OxaKLE+&fA=Fr#XlkpeLGY{cK=O zct5-6O{Xht-GRQZLFa=MuI#h|U4FUi3NK#(S_2$fdltq%6iDO_`XV6oP%}SPICFQh zR^IBbL|1wYXG@(lie?P z&mE2~%&va6X8{8xD&pMey0#BG-a_}dL|(odIa495#$R41GIHPxn{0?}T>`hpD{jtC zJu~hD^Ez6wW|HiCjyT6jWOC%`ro{4R9(W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MYCFf$x$!2g z=UT=iv=bec{4R|yLN2p|gwjH%cT@?R&TrVZj}adYA@Ad-ht2&iuMV~^1<%s5ma^8p zK6r9_y&s&aTrf+`4*pG|$+{I0KN*ww#_J({zTOYM-L_zVA6%SO(Hny!tQ_al$$>C+EC zRn|E8+xqLwo}Q1RqeIYH&2=#zJu2OOin)r33U$%(O^-*fHj_3#eAB+RuVBguk@0*5 zq;y1i{$umX;ko;Krv`i?{PL%yH`A7$y|#$3Nbh~$8~!X)fq2c}+VE6BSL(rzgD2GQ zZe3rDT1rkSZFM+HkLwV+cUL*h>&92DrjYr_aFMW+mnmwMWn*tri%N=y+5)M?HuKNP zdGBcJ8yBes4n@k=Dt@VcwAs+j=-xwB_ix+I+#pUpopYs4T`AqXJz99HdWYY{n)Nz# zXsObVace8}0B7XRwa;?Z*S2ilt4{e1ZFX|y?Y2>G_f^_-+{Dd{K9mL<9=o5fUbxw_ z(nrXnEzUgXv!j>(=@1iIp$*+iS}iuL-$Bo#AJ;3>`-Cn;)1y|S27MndHhyV~qIQjj z)X4n(Y&og3Ank_NI?Vyw((uK(b2?f5%usH%@>=hb>xBK}SeF-ZE;}b;sGwSXDR47= z9kQbByYeH#+1mj?rli+V3Ic+fSx7VyEEaL zh3HIgzX39wCI6>KZ43qDLUQE>L zfMNfC0SYJ-0tFC&A2tM%`L(?Yxc#)jI1 zK>bUHfd3aAl3C3E*o%N8{^buLufXi7fBpvo0sk*H<=^&F$QYsvp1eJ+ni74P`D0E+ zCL|KGX;_WHOr*XWfyC^f@9#Ry9y*1EDIsu5idcIj0jYqMhZB?(aR_-N2B!$KS5i`j dtAYQwT@VBc4g*6Vx`uk-{{s)Uqd5Qo literal 0 HcmV?d00001 diff --git a/elpha-ios/Assets.xcassets/Icons/Share.imageset/Contents.json b/elpha-ios/Assets.xcassets/Icons/Share.imageset/Contents.json new file mode 100644 index 0000000..840cdbf --- /dev/null +++ b/elpha-ios/Assets.xcassets/Icons/Share.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "share.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/elpha-ios/Assets.xcassets/Icons/Share.imageset/share.pdf b/elpha-ios/Assets.xcassets/Icons/Share.imageset/share.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d9a5758057211b188ab4138d6e572da6b776029f GIT binary patch literal 3912 zcmai%c{r5)_s1<$7?R2osqQ?6l+13Z?8~H-t;Nm^gRxDGv7}_l5=OE$D9MsFOHql& zz9fB3vZX>3LqZadHTm7s@_l-q-*a8x`?{~WKlA>a&$-U$ob$))z)bZG42`-b8=faIk9IqUlUs*HsihOpz&P$_Ky_{Vi zh7-I8<_`Z43y{W4eK4#6HE_%tDg!kDBmXHS~SUctEp5DH-nPAoqq-f zuDJK%UV{5YVo=;o?h^IeRZpHjO9J4g1lRAsRFXFhK>xV5Imw6OOLZdo0IEL(J&HFC z-1h;vsWRuL;HN+C{;$-TQYlUrBpP4?I@LD>>;SkP#gjs{I7@IM0o>f``5*z@PY1vG zQ2Wit&-AN*w}PJl1A^;tOW+OWAAswV{K!rubG+{Vu1v;t|C1I2l2I%sj`?D%8~~e_ z2^0ce9y%fcF^e_|G3AR4SMbx{U?{#t>9q67dR}~#oRfjL@Z~UKzt9&k)7AzveFM%Q z-9u=m1UomBzSd?nJTU&Kf53GnsK1)W^lKQTk!Hyog2}QJ|1{ZPyLDSf^CI7NFr+3k1KU&)4&nsgageaHO?j;gd>;bIlv&I#UIozV+Y)Ih>ySMjog^uj=7T3Q`=t zWQ&RxY1BI8*?fu;DiVp3%o57JD>u?y=DCnRw!fx5m7y@2C1ceo{RDH1USm3x4rAxg zAz8Mmuy?LG7X?VnlSb)0oW;G}-Agx(c@W}h4$sFGvOJ?v2IA76qQCI*2qrhHKcR}o zE~~rU;t9xe9gTrR8xixi^rwx3h!1HATPvy|fxm}T-_KD5!MHGc&r=~o8cr!gz_J6>wW`cTE5Ja}iMn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mNg60h%Dy02JywB>RHojRfGw$j&|>JaZ8p^!6JdBe~{( z_ozpp5j-ibKk(h>C%6BFX%f|kOz{Sg2o)qo1qs;h)%7KNI)gFj z;;^<#fSE6WN(%%)Z2wOB0W_swmqGrT820KPL?MuBNF)M>z@kwYj5PwG2)=(={uU%S z3OM^Zfs@nsK)^vt4;+|iU|b(x?QoCyDxfJhdPPg82idB6A7_Y#MH3fQdBncA UIView? { + return attachmentImageView } } diff --git a/elpha-ios/Base.lproj/Main.storyboard b/elpha-ios/Base.lproj/Main.storyboard index b11de00..11522f3 100644 --- a/elpha-ios/Base.lproj/Main.storyboard +++ b/elpha-ios/Base.lproj/Main.storyboard @@ -1232,35 +1232,73 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + + + + - - - - - - - + + + + + + + + + + + @@ -1277,20 +1315,21 @@ - + + - + - + - - + + - + - + @@ -1350,10 +1389,12 @@ + - + + @@ -1363,7 +1404,7 @@ - + diff --git a/elpha-ios/StatusTableViewController.swift b/elpha-ios/StatusTableViewController.swift index b86c035..a3f1757 100644 --- a/elpha-ios/StatusTableViewController.swift +++ b/elpha-ios/StatusTableViewController.swift @@ -253,7 +253,7 @@ extension StatusTableViewController { if let account = status.account { cell.avatarImageView.af_setImage(withURL: account.avatarURL!, filter: avatarFilter) cell.displayNameLabel.text = account.displayName - cell.usernameLabel.text = account.acct + cell.usernameLabel.text = "@\(account.acct!)" } } @@ -264,18 +264,7 @@ extension StatusTableViewController { } if let content = status.content { - do { - let styledContent = " \(content)" - let attributedText = try NSAttributedString( - data: styledContent.data(using: String.Encoding.unicode, allowLossyConversion: true)!, - options: [.documentType: NSAttributedString.DocumentType.html], - documentAttributes: nil - ) - - cell.contentLabel.attributedText = attributedText - } catch { - print("\(error)") - } + cell.contentLabel.attributedText = content.htmlAttributed(size: 16) } cell.attachmentsView.backgroundColor = UIColor.white diff --git a/elpha-ios/StatusView.swift b/elpha-ios/StatusView.swift index d1f92fa..111828c 100644 --- a/elpha-ios/StatusView.swift +++ b/elpha-ios/StatusView.swift @@ -231,7 +231,7 @@ class StatusView: UIView { if let account = status.account { avatarImageView.af_setImage(withURL: account.avatarURL!, filter: avatarFilter) displayNameLabel.text = account.displayName - usernameLabel.text = account.acct + usernameLabel.text = "@\(account.acct!)" } if let attachments = status.attachments, attachments.count > 0 { @@ -240,14 +240,7 @@ class StatusView: UIView { } if let content = status.content { -// let linkAttributes: [NSAttributedString.Key : Any] = [ -// NSAttributedString.Key.foregroundColor: UIColor(named: "Primary")!, -// NSAttributedString.Key.underlineColor: UIColor(named: "Primary")!, -// NSAttributedString.Key.underlineStyle: NSUnderlineStyle.single, -// ] - contentTextView.attributedText = content.htmlAttributed(size: 15.0) - //contentTextView.linkTextAttributes = linkAttributes if status.hidden && spoilerView == nil { let spoilerText = UILabel(frame: contentTextView.frame) @@ -321,7 +314,7 @@ class StatusView: UIView { if let account = status.account { boostAvatarImageView.af_setImage(withURL: account.avatarURL!, filter: avatarFilter) boostDisplayNameLabel.text = account.displayName - boostUsernameLabel.text = account.acct + boostUsernameLabel.text = "@\(account.acct!)" } updateStatusContent(reblog) @@ -329,7 +322,7 @@ class StatusView: UIView { if let account = status.account { avatarImageView.af_setImage(withURL: account.avatarURL!, filter: avatarFilter) displayNameLabel.text = account.displayName - usernameLabel.text = account.acct + usernameLabel.text = "@\(account.acct!)" } updateStatusContent(status) @@ -340,7 +333,7 @@ class StatusView: UIView { replyView.isHidden = false replyAvatarImageView.af_setImage(withURL: replyAccount.avatarURL!, filter: avatarFilter) replyDisplayNameLabel.text = replyAccount.displayName - replyUsernameLabel.text = replyAccount.acct + replyUsernameLabel.text = "@\(replyAccount.acct!)" } } } diff --git a/elpha-ios/StatusView.xib b/elpha-ios/StatusView.xib index c05c51f..b9d5ec8 100644 --- a/elpha-ios/StatusView.xib +++ b/elpha-ios/StatusView.xib @@ -44,11 +44,11 @@ - + - + @@ -224,7 +224,7 @@ - + @@ -266,8 +266,8 @@ - - + + @@ -292,14 +292,14 @@ - + - + @@ -454,7 +454,7 @@ - + @@ -484,7 +484,7 @@ - + @@ -508,7 +508,7 @@ - + @@ -569,7 +569,7 @@ - + diff --git a/elpha-ios/String+HtmlAttributed.swift b/elpha-ios/String+HtmlAttributed.swift index 9dc2e70..0eff2a1 100644 --- a/elpha-ios/String+HtmlAttributed.swift +++ b/elpha-ios/String+HtmlAttributed.swift @@ -9,14 +9,16 @@ import UIKit extension String { - func htmlAttributed(size: CGFloat, centered: Bool = false) -> NSAttributedString? { + func htmlAttributed(size: CGFloat, centered: Bool = false, color: UIColor? = nil) -> NSAttributedString? { + let color = color ?? UIColor(named: "Text")! + do { let htmlString = """ diff --git a/elpha-ios/UITextViewFixed.swift b/elpha-ios/UITextViewFixed.swift new file mode 100644 index 0000000..283a068 --- /dev/null +++ b/elpha-ios/UITextViewFixed.swift @@ -0,0 +1,18 @@ +// +// UITextViewFixed.swift +// elpha-ios +// +// Created by Dwayne Harris on 11/6/18. +// Copyright © 2018 Elpha. All rights reserved. +// + +import UIKit + +@IBDesignable class UITextViewFixed: UITextView { + override func layoutSubviews() { + super.layoutSubviews() + + textContainerInset = UIEdgeInsets.zero + textContainer.lineFragmentPadding = 0 + } +}