forked from mirrors/linphone-iphone
Chat: dismiss keyboard when scrolling in conversation
This commit is contained in:
parent
87c3512475
commit
d8c47b06e1
5 changed files with 28 additions and 16 deletions
|
|
@ -459,7 +459,7 @@
|
|||
<accessibility key="accessibilityConfiguration" label="Password"/>
|
||||
<color key="textColor" red="0.2666666667" green="0.2666666667" blue="0.2666666667" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits" autocorrectionType="no" secureTextEntry="YES"/>
|
||||
<textInputTraits key="textInputTraits" autocorrectionType="no"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-1" id="QcZ-wS-LhT"/>
|
||||
<outlet property="errorLabel" destination="YzC-qL-tc0" id="SbI-Cd-cxw"/>
|
||||
|
|
@ -650,7 +650,7 @@
|
|||
<accessibility key="accessibilityConfiguration" label="Password"/>
|
||||
<color key="textColor" red="0.2666666667" green="0.2666666667" blue="0.2666666667" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits" autocorrectionType="no" secureTextEntry="YES"/>
|
||||
<textInputTraits key="textInputTraits" autocorrectionType="no"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-1" id="e0Y-gb-t9q"/>
|
||||
<outlet property="errorLabel" destination="3nU-NE-Lke" id="AlW-17-Y8Q"/>
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@
|
|||
<animations/>
|
||||
</imageView>
|
||||
<button opaque="NO" tag="19" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="73" userLabel="pictureButton">
|
||||
<rect key="frame" x="0.0" y="2" width="63" height="63"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="66" height="66"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
<accessibility key="accessibilityConfiguration" label="Send picture"/>
|
||||
|
|
@ -230,15 +230,8 @@
|
|||
<action selector="onPictureClick:" destination="-1" eventType="touchUpInside" id="87"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view tag="20" contentMode="scaleToFill" id="pqa-tg-5ml" userLabel="messageField" customClass="HPGrowingTextView">
|
||||
<rect key="frame" x="71" y="14" width="233" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Message field"/>
|
||||
</view>
|
||||
<button opaque="NO" tag="21" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="15" userLabel="sendButton">
|
||||
<rect key="frame" x="312" y="2" width="63" height="63"/>
|
||||
<rect key="frame" x="310" y="0.0" width="66" height="66"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
<accessibility key="accessibilityConfiguration" label="Send"/>
|
||||
|
|
@ -252,6 +245,13 @@
|
|||
<action selector="onSendClick:" destination="-1" eventType="touchUpInside" id="25"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view tag="20" contentMode="scaleToFill" id="pqa-tg-5ml" userLabel="messageField" customClass="HPGrowingTextView">
|
||||
<rect key="frame" x="66" y="13" width="243" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Message field"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<animations/>
|
||||
</view>
|
||||
|
|
@ -457,7 +457,7 @@
|
|||
<animations/>
|
||||
</imageView>
|
||||
<button opaque="NO" tag="19" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="gSL-jE-GYO" userLabel="pictureButton">
|
||||
<rect key="frame" x="0.0" y="2" width="63" height="63"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="66" height="66"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
<accessibility key="accessibilityConfiguration" label="Send picture"/>
|
||||
|
|
@ -471,14 +471,14 @@
|
|||
</connections>
|
||||
</button>
|
||||
<view tag="20" contentMode="scaleToFill" id="C02-2r-vXK" userLabel="messageField" customClass="HPGrowingTextView">
|
||||
<rect key="frame" x="122" y="14" width="402" height="40"/>
|
||||
<rect key="frame" x="66" y="13" width="513" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Message field"/>
|
||||
</view>
|
||||
<button opaque="NO" tag="21" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="nV9-xZ-oSM" userLabel="sendButton">
|
||||
<rect key="frame" x="583" y="2" width="63" height="63"/>
|
||||
<rect key="frame" x="580" y="0.0" width="66" height="66"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
<accessibility key="accessibilityConfiguration" label="Send"/>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
- (BOOL)startImageUpload:(UIImage *)image url:(NSURL *)url;
|
||||
- (void)resendChat:(NSString *)message withExternalUrl:(NSString *)url;
|
||||
- (void)tableViewIsScrolling;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
|||
|
|
@ -190,6 +190,10 @@
|
|||
|
||||
#pragma mark - UITableViewDelegate Functions
|
||||
|
||||
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
|
||||
[_chatRoomDelegate tableViewIsScrolling];
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
LinphoneChatMessage *chat = ms_list_nth_data(messageList, (int)[indexPath row]);
|
||||
return [UIChatBubbleTextCell ViewHeightForMessage:chat withWidth:self.view.frame.size.width].height;
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
_messageField.maxNumberOfLines = ([LinphoneManager runningOnIpad]) ? 10 : 3;
|
||||
_messageField.delegate = self;
|
||||
_messageField.font = [UIFont systemFontOfSize:18.0f];
|
||||
_messageField.contentInset = UIEdgeInsetsMake(0, -5, -2, -5);
|
||||
_messageField.internalTextView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 0, 10);
|
||||
_messageField.contentInset = UIEdgeInsetsMake(-15, 0, 0, 0);
|
||||
// _messageField.internalTextView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 0, 10);
|
||||
[_tableController setChatRoomDelegate:self];
|
||||
}
|
||||
|
||||
|
|
@ -554,6 +554,13 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[self chooseImageQuality:image url:url];
|
||||
}
|
||||
|
||||
- (void)tableViewIsScrolling {
|
||||
// if user is scrolling in table view, we should hide the keyboard
|
||||
if ([_messageField isFirstResponder]) {
|
||||
[_messageField resignFirstResponder];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Keyboard Event Functions
|
||||
|
||||
- (void)keyboardWillHide:(NSNotification *)notif {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue