diff --git a/CHANGELOG.md b/CHANGELOG.md index e3dbd69..adecb41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,13 @@ +## 1.3.2 + +* Fix: Text input field height, after choosing to mention someone. + +## 1.3.1 + +* Optimize: Improve performance. + ## 1.3.0 + * Fix: Group tips not shows the nickname or remarks when transferring group owner. * Optimize: Remove the confirmation pop-up before opening the file. @@ -11,8 +20,8 @@ ## 1.1.0 And 1.1.0+1 * Add: Supports two new languages, Japanese and Korean. -* Add: Supports adding new other languages, apart from our default ones, including English, Chinese(Simplified and Traditional), Japanese and Korean, or modifying the translations, refers to [this documentation](https://www.tencentcloud.com/document/product/1047/52154). -* Add: Sticker plug-in has been embedded in TUIKit by default. Now we support three types of stickers, Unicode Emoji, small image emoji and big image stickers, the usage has been optimized, refers to [this documentation](https://www.tencentcloud.com/document/product/1047/52227). +* Add: Supports adding new other languages, apart from our default ones, including English, Chinese(Simplified and Traditional), Japanese and Korean, or modifying the translations, refers to [this documentation](https://www.tencentcloud.com/document/product/1047/52154?from=pub). +* Add: Sticker plug-in has been embedded in TUIKit by default. Now we support three types of stickers, Unicode Emoji, small image emoji and big image stickers, the usage has been optimized, refers to [this documentation](https://www.tencentcloud.com/document/product/1047/52227?from=pub). * Optimize: Themes, more customization. * Optimize: The animation of the input area, keyboard, sticker panel and the more panel. * Optimize: Emoji, both Unicode and small images, can be inserted to any position in text messages. @@ -30,7 +39,7 @@ ## 1.0.0 -* Add: Support adding Flutter module to Native APP, for details, please refer to [this documentation](https://www.tencentcloud.com/document/product/1047/51456) to implement. +* Add: Support adding Flutter module to Native APP, for details, please refer to [this documentation](https://www.tencentcloud.com/document/product/1047/51456?from=pub) to implement. * Add: Customize sticker and Emoji for text messages. For details, please refer to [this documentation](https://cloud.tencent.com/document/product/269/80882) to modify. * Optimize: The loading duration for history message list, especially with lots of media and file messages. * Optimize: More panel area supports scroll. diff --git a/LICENSE b/LICENSE index 6d8d58f..3e1a561 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,6 @@ - - Apache License +Apache License Version 2.0, January 2004 - https://www.apache.org/licenses/ + http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -176,16 +175,27 @@ END OF TERMS AND CONDITIONS - Copyright 2013-2018 Docker, Inc. + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [2023] [Tencent] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - https://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. + limitations under the License. \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index fa7cf14..a423f6b 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -970,7 +970,7 @@ packages: path: ".." relative: true source: path - version: "1.3.0" + version: "1.3.2" tencent_extended_text: dependency: transitive description: diff --git a/lib/ui/views/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_chat_group_tips_elem.dart b/lib/ui/views/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_chat_group_tips_elem.dart index c8836ab..3e386d8 100644 --- a/lib/ui/views/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_chat_group_tips_elem.dart +++ b/lib/ui/views/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_chat_group_tips_elem.dart @@ -26,9 +26,9 @@ class _TIMUIKitGroupTipsElemState extends TIMUIKitState { } void getText() async { - setState(() async { - groupTipsAbstractText = - await MessageUtils.groupTipsMessageAbstract(widget.groupTipsElem, widget.groupMemberList); + final newText = await MessageUtils.groupTipsMessageAbstract(widget.groupTipsElem, widget.groupMemberList); + setState(() { + groupTipsAbstractText = newText; }); } diff --git a/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart b/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart index 7837579..431700b 100644 --- a/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart +++ b/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart @@ -874,8 +874,7 @@ class _InputTextFieldState extends TIMUIKitState { showAtBackground: true, )), onChanged: (bool visibility) { - if (showKeyboard != visibility && - visibility == false) { + if (showKeyboard != visibility) { setState(() { showKeyboard = visibility; }); diff --git a/lib/ui/views/TIMUIKitConversation/tim_uikit_conversation_last_msg.dart b/lib/ui/views/TIMUIKitConversation/tim_uikit_conversation_last_msg.dart index ab3217b..0e6e2dd 100644 --- a/lib/ui/views/TIMUIKitConversation/tim_uikit_conversation_last_msg.dart +++ b/lib/ui/views/TIMUIKitConversation/tim_uikit_conversation_last_msg.dart @@ -55,9 +55,9 @@ class _TIMUIKitLastMsgState extends TIMUIKitState { "{{option1}}撤回了一条消息", "$option1撤回了一条消息")(option1: option1); }); } else { - setState(() async { - groupTipsAbstractText = - await _getLastMsgShowText(widget.lastMsg, widget.context); + final newText = await _getLastMsgShowText(widget.lastMsg, widget.context); + setState(() { + groupTipsAbstractText = newText; }); } } diff --git a/lib/ui/views/TIMUIKitSearch/pureUI/tim_uikit_search_input.dart b/lib/ui/views/TIMUIKitSearch/pureUI/tim_uikit_search_input.dart index ea36cba..5a4591d 100644 --- a/lib/ui/views/TIMUIKitSearch/pureUI/tim_uikit_search_input.dart +++ b/lib/ui/views/TIMUIKitSearch/pureUI/tim_uikit_search_input.dart @@ -14,6 +14,7 @@ class TIMUIKitSearchInput extends StatefulWidget { final Widget? prefixIcon; final Widget? prefixText; final bool? isAutoFocus; + final FocusNode focusNode; const TIMUIKitSearchInput({ required this.onChange, @@ -23,6 +24,7 @@ class TIMUIKitSearchInput extends StatefulWidget { this.prefixIcon, this.isAutoFocus = true, this.prefixText, + required this.focusNode, }) : super(key: key); @override @@ -30,7 +32,6 @@ class TIMUIKitSearchInput extends StatefulWidget { } class TIMUIKitSearchInputState extends TIMUIKitState { - late FocusNode focusNode = FocusNode(); late TextEditingController textEditingController = widget.controller ?? TextEditingController(); bool isEmptyInput = true; @@ -43,7 +44,7 @@ class TIMUIKitSearchInputState extends TIMUIKitState { } hideAllPanel() { - focusNode.unfocus(); + widget.focusNode.unfocus(); } @override @@ -79,7 +80,7 @@ class TIMUIKitSearchInputState extends TIMUIKitState { textInputAction: TextInputAction.search, maxLines: 4, minLines: 1, - focusNode: focusNode, + focusNode: widget.focusNode, controller: textEditingController, textAlignVertical: TextAlignVertical.center, decoration: InputDecoration( diff --git a/lib/ui/views/TIMUIKitSearch/tim_uikit_search.dart b/lib/ui/views/TIMUIKitSearch/tim_uikit_search.dart index b022e34..6d3f3b3 100644 --- a/lib/ui/views/TIMUIKitSearch/tim_uikit_search.dart +++ b/lib/ui/views/TIMUIKitSearch/tim_uikit_search.dart @@ -51,6 +51,7 @@ class TIMUIKitSearch extends StatefulWidget { class TIMUIKitSearchState extends TIMUIKitState { late TextEditingController textEditingController = TextEditingController(); final model = serviceLocator(); + final FocusNode focusNode = FocusNode(); GlobalKey inputTextField = GlobalKey(); List searchTypes = [ SearchType.group, @@ -96,6 +97,7 @@ class TIMUIKitSearchState extends TIMUIKitState { mainAxisAlignment: MainAxisAlignment.start, children: [ TIMUIKitSearchInput( + focusNode: focusNode, key: inputTextField, isAutoFocus: widget.isAutoFocus, onChange: (String value) { @@ -127,12 +129,25 @@ class TIMUIKitSearchState extends TIMUIKitState { ), if (searchTypes.contains(SearchType.contact)) TIMUIKitSearchFriend( - onTapConversation: widget.onTapConversation, + onTapConversation: (conversation, message) { + focusNode.unfocus(); + Future.delayed(const Duration(milliseconds: 100), + () { + widget.onTapConversation(conversation, message); + }); + }, friendResultList: friendResultList), if (searchTypes.contains(SearchType.group)) TIMUIKitSearchGroup( - groupList: groupList, - onTapConversation: widget.onTapConversation), + groupList: groupList, + onTapConversation: (conversation, message) { + focusNode.unfocus(); + Future.delayed(const Duration(milliseconds: 100), + () { + widget.onTapConversation(conversation, message); + }); + }, + ), if (searchTypes.contains(SearchType.history)) TIMUIKitSearchMsg( onTapConversation: widget.onTapConversation, diff --git a/lib/ui/views/TIMUIKitSearch/tim_uikit_search_msg_detail.dart b/lib/ui/views/TIMUIKitSearch/tim_uikit_search_msg_detail.dart index 38f0417..3a9b0a8 100644 --- a/lib/ui/views/TIMUIKitSearch/tim_uikit_search_msg_detail.dart +++ b/lib/ui/views/TIMUIKitSearch/tim_uikit_search_msg_detail.dart @@ -41,6 +41,7 @@ class TIMUIKitSearchMsgDetailState final model = serviceLocator(); String keywordState = ""; int currentPage = 0; + final FocusNode focusNode = FocusNode(); @override void initState() { @@ -96,10 +97,17 @@ class TIMUIKitSearchMsgDetailState ), child: TIMUIKitSearchItem( faceUrl: message.faceUrl ?? "", - showName: message.nickName ?? message.userID ?? message.sender ?? "", - lineOne: message.nickName ?? message.userID ?? message.sender ?? "", + showName: TencentUtils.checkString(message.nickName) ?? + TencentUtils.checkString(message.userID) ?? + message.sender ?? + "", + lineOne: TencentUtils.checkString(message.nickName) ?? + TencentUtils.checkString(message.userID) ?? + message.sender ?? + "", lineTwo: _getMsgElem(message), onClick: () { + focusNode.unfocus(); widget.onTapConversation(widget.currentConversation, message); }, ), @@ -165,6 +173,7 @@ class TIMUIKitSearchMsgDetailState body: Column( children: [ TIMUIKitSearchInput( + focusNode: focusNode, isAutoFocus: widget.isAutoFocus, onChange: (String value) { updateMsgResult(value, true); diff --git a/pubspec.yaml b/pubspec.yaml index 5261234..907a134 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: tencent_cloud_chat_uikit description: UI components library and basic chat business logic for Tencent Cloud Chat service, helping you build In-APP Chat module easily. -version: 1.3.0 +version: 1.3.2 homepage: https://www.tencentcloud.com/products/im?from=pub repository: https://github.com/TencentCloud/tc-chat-uikit-flutter documentation: https://comm.qq.com/im/doc/flutter/en/TUIKit/readme.html