Skip to content

Commit

Permalink
Merge pull request #15613 from wordpress-mobile/10795-invite_message_…
Browse files Browse the repository at this point in the history
…field

People > Invite: make Message field scrollable
  • Loading branch information
ScoutHarris authored Jan 8, 2021
2 parents 9ca7a00 + c15283c commit 6a77fe7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ private extension InvitePersonViewController {
messageTextView.font = WPStyleGuide.tableviewTextFont()
messageTextView.textColor = .text
messageTextView.backgroundColor = .listForeground
messageTextView.delegate = self
}

func setupPlaceholderLabel() {
Expand Down Expand Up @@ -493,3 +494,15 @@ private extension InvitePersonViewController {
placeholderLabel?.isHidden = !messageTextView.text.isEmpty
}
}

// MARK: - UITextViewDelegate

extension InvitePersonViewController: UITextViewDelegate {
func textViewShouldBeginEditing(_ textView: UITextView) -> Bool {
// This calls the segue in People.storyboard
// that shows the SettingsMultiTextViewController.
performSegue(withIdentifier: "message", sender: nil)
return false
}

}
28 changes: 10 additions & 18 deletions WordPress/Classes/ViewRelated/People/People.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -335,27 +335,19 @@
</tableViewSection>
<tableViewSection id="KTt-dH-XgO">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" selectionStyle="none" indentationWidth="10" rowHeight="88" id="sdj-uY-1LY">
<rect key="frame" x="0.0" y="178" width="375" height="88"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" selectionStyle="none" indentationWidth="10" rowHeight="100" id="sdj-uY-1LY">
<rect key="frame" x="0.0" y="178" width="375" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" tableViewCell="sdj-uY-1LY" id="Y8v-KJ-xnc">
<rect key="frame" x="0.0" y="0.0" width="375" height="88"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="scaleToFill" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" editable="NO" textAlignment="natural" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nh9-39-Mdw">
<rect key="frame" x="16" y="11" width="343" height="66"/>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="nh9-39-Mdw">
<rect key="frame" x="16" y="0.0" width="343" height="100"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="72" id="ARy-hL-nFx"/>
</constraints>
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</string>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
<variation key="default">
<mask key="constraints">
<exclude reference="ARy-hL-nFx"/>
</mask>
</variation>
</textView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Custom message..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jyo-4B-Bt9" userLabel="Placeholder Label">
<rect key="frame" x="16" y="11" width="139" height="19.5"/>
Expand All @@ -367,12 +359,12 @@
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailingMargin" secondItem="nh9-39-Mdw" secondAttribute="trailing" id="06N-1n-lgP"/>
<constraint firstAttribute="bottomMargin" secondItem="nh9-39-Mdw" secondAttribute="bottom" id="Avz-ZP-kHa"/>
<constraint firstItem="nh9-39-Mdw" firstAttribute="top" secondItem="Y8v-KJ-xnc" secondAttribute="topMargin" id="HlP-n4-smH"/>
<constraint firstItem="nh9-39-Mdw" firstAttribute="leading" secondItem="Y8v-KJ-xnc" secondAttribute="leading" constant="16" id="0cN-hB-5DE"/>
<constraint firstAttribute="trailing" secondItem="nh9-39-Mdw" secondAttribute="trailing" constant="16" id="3YE-iy-glN"/>
<constraint firstItem="Jyo-4B-Bt9" firstAttribute="top" secondItem="Y8v-KJ-xnc" secondAttribute="topMargin" id="KCB-49-L7U"/>
<constraint firstItem="nh9-39-Mdw" firstAttribute="leading" secondItem="Y8v-KJ-xnc" secondAttribute="leadingMargin" id="Sq4-Av-m3J"/>
<constraint firstItem="Jyo-4B-Bt9" firstAttribute="leading" secondItem="Y8v-KJ-xnc" secondAttribute="leadingMargin" id="Tt0-eO-4t1"/>
<constraint firstItem="nh9-39-Mdw" firstAttribute="top" secondItem="Y8v-KJ-xnc" secondAttribute="top" id="eJ6-Gv-uEP"/>
<constraint firstAttribute="bottom" secondItem="nh9-39-Mdw" secondAttribute="bottom" id="qeC-n5-gJx"/>
</constraints>
</tableViewCellContentView>
<connections>
Expand All @@ -397,7 +389,7 @@
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="fuT-BL-XQM" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1994" y="1519"/>
<point key="canvasLocation" x="1992.8" y="1518.8905547226389"/>
</scene>
<!--Username TextViewController-->
<scene sceneID="tMT-sn-IIW">
Expand Down

0 comments on commit 6a77fe7

Please sign in to comment.