Private Story -> Custom Story

This commit is contained in:
Nora Trapp 2022-10-18 15:34:34 -07:00 committed by Nora Trapp
parent 70780cfc7c
commit 8c633c718e
23 changed files with 125 additions and 210 deletions

View File

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "private-story-dark-36.pdf",
"filename" : "custom-story-dark-36.pdf",
"idiom" : "universal"
}
],

View File

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "private-story-light-36.pdf",
"filename" : "custom-story-light-36.pdf",
"idiom" : "universal"
}
],

View File

@ -1,103 +0,0 @@
%PDF-1.7
1 0 obj
<< /ExtGState << /E1 << /ca 0.800000 >> >> >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
/E1 gs
1.000000 0.000000 -0.000000 1.000000 3.451996 1.947266 cm
1.000000 1.000000 1.000000 scn
7.977000 7.198875 m
7.788000 7.198875 l
7.788000 8.476875 l
7.831105 9.431831 7.509348 10.367428 6.888000 11.093875 c
6.594810 11.421329 6.233249 11.680359 5.828892 11.852643 c
5.424535 12.024926 4.987261 12.106255 4.548000 12.090876 c
4.108861 12.106545 3.671681 12.025036 3.267693 11.852170 c
2.863705 11.679303 2.502881 11.419348 2.211000 11.090876 c
1.594219 10.362336 1.275911 9.427419 1.320000 8.473875 c
1.320000 7.198875 l
1.120000 7.198875 l
0.972967 7.199007 0.827349 7.170160 0.691470 7.113984 c
0.555592 7.057808 0.432116 6.975404 0.328101 6.871482 c
0.224086 6.767560 0.141572 6.644158 0.085274 6.508329 c
0.028977 6.372501 -0.000000 6.226909 0.000000 6.079875 c
0.000000 1.132875 l
0.000000 0.836098 0.117894 0.551476 0.327748 0.341623 c
0.537601 0.131770 0.822223 0.013876 1.119000 0.013876 c
7.977000 0.013876 l
8.273777 0.013876 8.558399 0.131770 8.768252 0.341623 c
8.978106 0.551476 9.096001 0.836098 9.096001 1.132875 c
9.096001 6.079875 l
9.096001 6.376653 8.978106 6.661275 8.768252 6.871128 c
8.558399 7.080981 8.273777 7.198875 7.977000 7.198875 c
7.977000 7.198875 l
h
2.753000 8.588875 m
2.725315 9.143169 2.901381 9.688442 3.248000 10.121876 c
3.407440 10.309250 3.607204 10.458126 3.832334 10.557357 c
4.057464 10.656587 4.302126 10.703600 4.548000 10.694876 c
4.795379 10.705052 5.041826 10.658742 5.268636 10.559459 c
5.495445 10.460176 5.696657 10.310528 5.857000 10.121876 c
6.200709 9.687088 6.375152 9.142444 6.348001 8.588875 c
6.348001 7.205875 l
2.753000 7.205875 l
2.753000 8.588875 l
h
f
n
Q
endstream
endobj
3 0 obj
1657
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 16.000000 16.000000 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000074 00000 n
0000001787 00000 n
0000001810 00000 n
0000001983 00000 n
0000002057 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
2116
%%EOF

View File

@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "private-story-outline-24.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "private-story-outline-40.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "private-story-solid-24.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "private-story-solid-40.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "lock-16.pdf",
"filename" : "stories-16.pdf",
"idiom" : "universal"
}
],

View File

@ -0,0 +1,89 @@
%PDF-1.7
1 0 obj
<< >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 2.500000 2.500000 cm
0.000000 0.000000 0.000000 scn
4.577820 11.000000 m
3.749393 11.000000 3.077820 10.328427 3.077820 9.500000 c
3.077820 1.500000 l
3.077820 0.671573 3.749393 0.000000 4.577820 0.000000 c
9.077820 0.000000 l
9.906247 0.000000 10.577820 0.671573 10.577820 1.500000 c
10.577820 9.500000 l
10.577820 10.328427 9.906247 11.000000 9.077820 11.000000 c
4.577820 11.000000 l
h
f
n
Q
q
1.000000 0.000000 -0.000000 1.000000 2.500000 5.889893 cm
0.000000 0.000000 0.000000 scn
2.000000 5.610089 m
2.000000 5.937339 2.078597 6.246233 2.217944 6.518921 c
0.987378 6.071032 l
0.208911 5.787693 -0.192469 4.926929 0.090869 4.148463 c
1.971980 -1.019848 l
1.980771 -1.043999 1.990117 -1.067788 2.000000 -1.091206 c
2.000000 5.610089 l
h
f
n
Q
endstream
endobj
3 0 obj
814
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 16.000000 16.000000 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000034 00000 n
0000000904 00000 n
0000000926 00000 n
0000001099 00000 n
0000001173 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
1232
%%EOF

View File

@ -296,7 +296,7 @@ class StoryItemMediaView: UIView {
// For private stories, other than "My Story", render the name of the story
let contextIcon = UIImageView()
contextIcon.setTemplateImageName("lock-16", tintColor: Theme.darkThemePrimaryColor)
contextIcon.setTemplateImageName("stories-16", tintColor: Theme.darkThemePrimaryColor)
contextIcon.autoSetDimensions(to: .square(16))
let contextNameLabel = UILabel()

View File

@ -74,14 +74,14 @@ class StoryPrivacySettingsViewController: OWSTableViewController2 {
let myStoriesSection = OWSTableSection()
myStoriesSection.customHeaderView = NewStoryHeaderView(
title: NSLocalizedString(
"STORIES_SETTINGS_MY_STORIES_HEADER",
comment: "Header for the 'My Stories' section of the stories settings"
"STORIES_SETTINGS_STORIES_HEADER",
comment: "Header for the 'Stories' section of the stories settings"
),
delegate: self
)
myStoriesSection.footerTitle = NSLocalizedString(
"STORIES_SETTINGS_MY_STORIES_FOOTER",
comment: "Footer for the 'My Stories' section of the stories settings"
"STORIES_SETTINGS_STORIES_FOOTER",
comment: "Footer for the 'Stories' section of the stories settings"
)
contents.addSection(myStoriesSection)

View File

@ -3892,6 +3892,9 @@
/* Title for error alert indicating that a story name is required. */
"NEW_PRIVATE_STORY_MISSING_NAME_ALERT_TITLE" = "Missing Story Name";
/* Section footer for the name text field on the 'new private story' creation view */
"NEW_PRIVATE_STORY_NAME_FOOTER" = "Only you can see the name of this story.";
/* Placeholder text for a new private story name */
"NEW_PRIVATE_STORY_NAME_PLACEHOLDER" = "Story Name (Required)";
@ -3904,18 +3907,18 @@
/* table section header button to add a new story */
"NEW_STORY_HEADER_VIEW_ADD_NEW_STORY_BUTTON" = "New";
/* Subtitle for create custom story row on the 'new story sheet' */
"NEW_STORY_SHEET_CUSTOM_STORY_SUBTITLE" = "Visible only to specific people";
/* Title for create custom story row on the 'new story sheet' */
"NEW_STORY_SHEET_CUSTOM_STORY_TITLE" = "New Custom Story";
/* Subtitle for create group story row on the 'new story sheet' */
"NEW_STORY_SHEET_GROUP_STORY_SUBTITLE" = "Share to an existing group";
/* Title for create group story row on the 'new story sheet' */
"NEW_STORY_SHEET_GROUP_STORY_TITLE" = "New Group Story";
/* Subtitle for create private story row on the 'new story sheet' */
"NEW_STORY_SHEET_PRIVATE_STORY_SUBTITLE" = "Visible only to specific people";
/* Title for create private story row on the 'new story sheet' */
"NEW_STORY_SHEET_PRIVATE_STORY_TITLE" = "New Private Story";
/* Title for the new story sheet */
"NEW_STORY_SHEET_TITLE" = "Choose Story Type";
@ -4739,7 +4742,7 @@
"PRIVATE_STORY_SETTINGS_ADD_VIEWER_BUTTON" = "Add Viewers";
/* Button to delete the story on the 'private story settings' view */
"PRIVATE_STORY_SETTINGS_DELETE_BUTTON" = "Delete Private Story";
"PRIVATE_STORY_SETTINGS_DELETE_BUTTON" = "Delete Custom Story";
/* Action sheet title confirming deletion of a private story on the 'private story settings' view. Embeds {{ $1%@ private story name }} */
"PRIVATE_STORY_SETTINGS_DELETE_CONFIRMATION_FORMAT" = "Are you sure you want to delete “%1$@”? Updates shared to this story will also be deleted.";
@ -6283,11 +6286,11 @@
/* Context menu action to save the selected story */
"STORIES_SAVE_STORY_ACTION" = "Save";
/* Footer for the 'My Stories' section of the stories settings */
"STORIES_SETTINGS_MY_STORIES_FOOTER" = "Stories automatically disappear after 24 hours. Choose who can view your story or create new stories with specific viewers or groups.";
/* Footer for the 'Stories' section of the stories settings */
"STORIES_SETTINGS_STORIES_FOOTER" = "Stories automatically disappear after 24 hours. Choose who can view your story or create new stories with specific viewers or groups.";
/* Header for the 'My Stories' section of the stories settings */
"STORIES_SETTINGS_MY_STORIES_HEADER" = "My Stories";
/* Header for the 'Stories' section of the stories settings */
"STORIES_SETTINGS_STORIES_HEADER" = "Stories";
/* Title for the action sheet confirming you want to turn off and delete all stories */
"STORIES_SETTINGS_TURN_OFF_ACTION_SHEET_MESSAGE" = "You will no longer be able to share or view stories. Story updates you have recently shared will also be deleted.";

View File

@ -376,9 +376,9 @@
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>one</key>
<string>Private Story · 1 Viewer</string>
<string>Custom Story · 1 Viewer</string>
<key>other</key>
<string>Private Story · %d Viewers</string>
<string>Custom Story · %d Viewers</string>
</dict>
</dict>
<key>MY_STORY_VIEWERS_ALL_CONNECTIONS_%d</key>

View File

@ -52,7 +52,6 @@ public enum ThemeIcon: UInt {
case settingsBoost
case settingsReceipts
case settingsGift
case settingsPrivateStory
case stickerButton
case cameraButton
@ -82,8 +81,6 @@ public enum ThemeIcon: UInt {
case contextMenuInfo20
case contextMenuInfo24
case privateStory40
case compose24
case composeNewGroup
case composeFindByPhoneNumber
@ -299,10 +296,6 @@ public extension Theme {
return isDarkThemeEnabled ? "receipts-solid-24" : "receipts-outline-24"
case .settingsGift:
return isDarkThemeEnabled ? "gift-solid-24" : "gift-outline-24"
case .settingsPrivateStory:
return isDarkThemeEnabled ? "private-story-solid-24" : "private-story-outline-24"
case .privateStory40:
return isDarkThemeEnabled ? "private-story-solid-40" : "private-story-outline-40"
// Input Toolbar
case .stickerButton:

View File

@ -461,7 +461,7 @@ extension PrivateStoryConversationItem: ConversationItem {
}
public var image: UIImage? {
UIImage(named: "private-story-\(Theme.isDarkThemeEnabled ? "dark" : "light")-36")
UIImage(named: "custom-story-\(Theme.isDarkThemeEnabled ? "dark" : "light")-36")
}
public func getExistingThread(transaction: SDSAnyReadTransaction) -> TSThread? {

View File

@ -78,48 +78,29 @@ public class NewPrivateStoryConfirmViewController: OWSTableViewController2 {
return textField
}()
private lazy var iconImageView: UIImageView = {
let imageView = UIImageView()
imageView.contentMode = .center
imageView.layer.cornerRadius = 32
imageView.clipsToBounds = true
imageView.autoSetDimensions(to: CGSize(square: 64))
return imageView
}()
public override func applyTheme() {
super.applyTheme()
nameTextField.textColor = Theme.primaryTextColor
iconImageView.setThemeIcon(.privateStory40, tintColor: Theme.primaryIconColor)
iconImageView.backgroundColor = Theme.isDarkThemeEnabled ? .ows_gray65 : .ows_gray02
}
private func updateTableContents() {
let contents = OWSTableContents()
let nameAndAvatarSection = OWSTableSection()
nameAndAvatarSection.footerTitle = OWSLocalizedString(
"NEW_PRIVATE_STORY_NAME_FOOTER",
comment: "Section footer for the name text field on the 'new private story' creation view"
)
nameAndAvatarSection.add(.init(
customCellBlock: { [weak self] in
let cell = OWSTableItem.newCell()
cell.selectionStyle = .none
guard let self = self else { return cell }
self.iconImageView.setContentHuggingVerticalHigh()
self.nameTextField.setContentHuggingHorizontalLow()
let firstSection = UIStackView(arrangedSubviews: [
self.iconImageView,
self.nameTextField
])
firstSection.axis = .horizontal
firstSection.alignment = .center
firstSection.spacing = ContactCellView.avatarTextHSpacing
cell.contentView.addSubview(firstSection)
firstSection.autoPinEdgesToSuperviewMargins()
cell.contentView.addSubview(self.nameTextField)
self.nameTextField.autoPinEdgesToSuperviewMargins()
return cell
},

View File

@ -47,11 +47,11 @@ public class NewStorySheet: OWSTableSheetViewController {
optionsSection.customHeaderHeight = 28
contents.addSection(optionsSection)
optionsSection.add(buildOptionItem(
icon: .settingsPrivateStory,
title: OWSLocalizedString("NEW_STORY_SHEET_PRIVATE_STORY_TITLE",
comment: "Title for create private story row on the 'new story sheet'"),
subtitle: OWSLocalizedString("NEW_STORY_SHEET_PRIVATE_STORY_SUBTITLE",
comment: "Subtitle for create private story row on the 'new story sheet'"),
icon: .settingsStories,
title: OWSLocalizedString("NEW_STORY_SHEET_CUSTOM_STORY_TITLE",
comment: "Title for create custom story row on the 'new story sheet'"),
subtitle: OWSLocalizedString("NEW_STORY_SHEET_CUSTOM_STORY_SUBTITLE",
comment: "Subtitle for create custom story row on the 'new story sheet'"),
action: { [weak self] in
guard let self = self else { return }
let presentingViewController = self.presentingViewController