Skip to content

Commit

Permalink
ui: change post view background to be all black
Browse files Browse the repository at this point in the history
Changelog-Changed: made post view background all black and adjust spacing between image and camera buttons
  • Loading branch information
ericholguin committed Oct 29, 2023
1 parent 7710839 commit e5c6e74
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 1 deletion.
24 changes: 24 additions & 0 deletions DamusShareExtension/Base.lproj/MainInterface.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="j1y-V4-xli">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Share View Controller-->
<scene sceneID="ceB-am-kn3">
<objects>
<viewController id="j1y-V4-xli" customClass="ShareViewController" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" opaque="NO" contentMode="scaleToFill" id="wbc-yd-nQP">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="1Xd-am-t49"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="CEy-Cv-SGf" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
10 changes: 10 additions & 0 deletions DamusShareExtension/DamusShareExtension.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>
18 changes: 18 additions & 0 deletions DamusShareExtension/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>TRUEPREDICATE</string>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
</dict>
</plist>
30 changes: 30 additions & 0 deletions DamusShareExtension/ShareViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// ShareViewController.swift
// DamusShareExtension
//
// Created by eric on 10/28/23.
//

import UIKit
import Social

class ShareViewController: SLComposeServiceViewController {

override func isContentValid() -> Bool {
// Do validation of contentText and/or NSExtensionContext attachments here
return true
}

override func didSelectPost() {
// This is called after the user selects Post. Do the upload of contentText and/or NSExtensionContext attachments.

// Inform the host that we're done, so it un-blocks its UI. Note: Alternatively you could call super's -didSelectPost, which will similarly complete the extension context.
self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil)
}

override func configurationItems() -> [Any]! {
// To add configuration options via table cells at the bottom of the sheet, return an array of SLComposeSheetConfigurationItem here.
return []
}

}
3 changes: 2 additions & 1 deletion damus/Views/PostView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct PostView: View {
}

var AttachmentBar: some View {
HStack(alignment: .center) {
HStack(alignment: .center, spacing: 15) {
ImageButton
CameraButton
}
Expand Down Expand Up @@ -428,6 +428,7 @@ struct PostView: View {
}
}
}
.background(DamusColors.adaptableWhite.edgesIgnoringSafeArea(.all))
.sheet(isPresented: $attach_media) {
ImagePicker(uploader: damus_state.settings.default_media_uploader, sourceType: .photoLibrary, pubkey: damus_state.pubkey, image_upload_confirm: $image_upload_confirm) { img in
self.mediaToUpload = .image(img)
Expand Down
1 change: 1 addition & 0 deletions damus/Views/TextViewWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct TextViewWrapper: UIViewRepresentable {

func makeUIView(context: Context) -> UITextView {
let textView = UITextView()
textView.backgroundColor = UIColor(DamusColors.adaptableWhite)
textView.delegate = context.coordinator

// Disable scrolling (this view will expand vertically as needed to fit text)
Expand Down

0 comments on commit e5c6e74

Please sign in to comment.