daiyz / react-native-easy-chat-ui Goto Github PK
View Code? Open in Web Editor NEWchat UI for React Native
License: MIT License
chat UI for React Native
License: MIT License
跑demo的时候在到react-native-gesture-handler编译的时候出错,报错如下:
> Task :react-native-gesture-handler:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
具体如下:
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerEnabledRootView.java:10: 错误: 找不到符号
import androidx.annotation.Nullable;
^
符号: 类 Nullable
位置: 程序包 androidx.annotation
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\lib\src\main\java\com\swmansion\gesturehandler\GestureHandlerOrchestrator.java:14: 错误: 找不到符号
import androidx.annotation.Nullable;
^
符号: 类 Nullable
位置: 程序包 androidx.annotation
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerEvent.java:3: 错误: 程序包androidx.core.util不存在
import androidx.core.util.Pools;
^
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerEvent.java:11: 错误: 找不到符号
import androidx.annotation.Nullable;
^
符号: 类 Nullable
位置: 程序包 androidx.annotation
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerEvent.java:19: 错误: 程序包Pools不存在
private static final Pools.SynchronizedPool EVENTS_POOL =
^
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:36: 错误: 找不到符号
import androidx.annotation.Nullable;
^
符号: 类 Nullable
位置: 程序包 androidx.annotation
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerRegistry.java:11: 错误: 找不到符号
import androidx.annotation.Nullable;
^
符号: 类 Nullable
位置: 程序包 androidx.annotation
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerPackage.java:16: 错误: 找不到符号
import androidx.annotation.Nullable;
^
符号: 类 Nullable
位置: 程序包 androidx.annotation
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerRootInterface.java:3: 错误: 找不到符号
import androidx.annotation.Nullable;
^
符号: 类 Nullable
位置: 程序包 androidx.annotation
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerRootView.java:10: 错误: 找不到符号
import androidx.annotation.Nullable;
^
符号: 类 Nullable
位置: 程序包 androidx.annotation
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerRootViewManager.java:10: 错误: 找不到符号
import androidx.annotation.Nullable;
^
符号: 类 Nullable
位置: 程序包 androidx.annotation
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerStateChangeEvent.java:3: 错误: 程序包androidx.core.util不存在
import androidx.core.util.Pools;
^
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerStateChangeEvent.java:11: 错误: 找不到符号
import androidx.annotation.Nullable;
^
符号: 类 Nullable
位置: 程序包 androidx.annotation
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerStateChangeEvent.java:19: 错误: 程序包Pools不存在
private static final Pools.SynchronizedPool EVENTS_POOL =
^
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerEnabledRootView.java:14: 错误: 找不到符号
private @nullable ReactInstanceManager mReactInstanceManager;
^
符号: 类 Nullable
位置: 类 RNGestureHandlerEnabledRootView
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerEnabledRootView.java:15: 错误: 找不到符号
private @nullable RNGestureHandlerRootHelper mGestureRootHelper;
^
符号: 类 Nullable
位置: 类 RNGestureHandlerEnabledRootView
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerEnabledRootView.java:63: 错误: 找不到符号
@nullable Bundle initialProperties) {
^
符号: 类 Nullable
位置: 类 RNGestureHandlerEnabledRootView
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\lib\src\main\java\com\swmansion\gesturehandler\GestureHandlerOrchestrator.java:321: 错误: 找不到符号
private boolean isViewAttachedUnderWrapper(@nullable View view) {
^
符号: 类 Nullable
位置: 类 GestureHandlerOrchestrator
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerEvent.java:24: 错误: 找不到符号
@nullable RNGestureHandlerEventDataExtractor dataExtractor) {
^
符号: 类 Nullable
位置: 类 RNGestureHandlerEvent
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerEvent.java:40: 错误: 找不到符号
@nullable RNGestureHandlerEventDataExtractor dataExtractor) {
^
符号: 类 Nullable
位置: 类 RNGestureHandlerEvent
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:529: 错误: 找不到符号
public @nullable Map getConstants() {
^
符号: 类 Nullable
位置: 类 RNGestureHandlerModule
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:632: 错误: 找不到符号
private @nullable RNGestureHandlerRootHelper findRootHelperForViewAncestor(int viewTag) {
^
符号: 类 Nullable
位置: 类 RNGestureHandlerModule
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:649: 错误: 找不到符号
private @nullable HandlerFactory findFactoryForHandler(GestureHandler handler) {
^
符号: 类 Nullable
位置: 类 RNGestureHandlerModule
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerRegistry.java:23: 错误: 找不到符号
public synchronized @nullable GestureHandler getHandler(int handlerTag) {
^
符号: 类 Nullable
位置: 类 RNGestureHandlerRegistry
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerRootInterface.java:6: 错误: 找不到符号
@nullable RNGestureHandlerRootHelper getRootHelper();
^
符号: 类 Nullable
位置: 接口 RNGestureHandlerRootInterface
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerRootView.java:14: 错误: 找不到符号
private @nullable RNGestureHandlerRootHelper mRootHelper;
^
符号: 类 Nullable
位置: 类 RNGestureHandlerRootView
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerRootViewManager.java:42: 错误: 找不到符号
public @nullable Map getExportedCustomDirectEventTypeConstants() {
^
符号: 类 Nullable
位置: 类 RNGestureHandlerRootViewManager
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerStateChangeEvent.java:26: 错误: 找不到符号
@nullable RNGestureHandlerEventDataExtractor dataExtractor) {
^
符号: 类 Nullable
位置: 类 RNGestureHandlerStateChangeEvent
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerStateChangeEvent.java:44: 错误: 找不到符号
@nullable RNGestureHandlerEventDataExtractor dataExtractor) {
^
符号: 类 Nullable
位置: 类 RNGestureHandlerStateChangeEvent
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\lib\src\main\java\com\swmansion\gesturehandler\GestureHandlerOrchestrator.java:328: 错误: 找不到符号
@nullable ViewParent parent = view.getParent();
^
符号: 类 Nullable
位置: 类 GestureHandlerOrchestrator
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerEvent.java:20: 错误: 程序包Pools不存在
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerStateChangeEvent.java:20: 错误: 程序包Pools不存在
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
注: C:\Users\34662\Desktop\react-native-easy-chat-ui-master\Demo\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerButtonViewManager.java使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
32 个错误
案例中安卓中语音不能使用?
My application was developed using EXPO,
but the render icon and my renderPanelRow when using ios it is on the top, is there any way to do it ... I don't want to develop with ios or androi. I use expo .. thank you hope to receive your soonest reply!
您好,请问一下,在发送语音时,上滑取消,不太灵敏,总是在取消和发送之间跳,有时候还取消不了,能给出点建议吗
在chatview的 render中 会导致有时滑动失效 至少在安卓上是这样的
改成View 会修复
其实我想表达的不是上面写的 我想表达的是 这个项目真的很牛逼
当发送语音时先将sendStatus设置为0此时有loading,当消息真正发出去后,动态改变该消息的sendStatus为1时,还是有loading,我用setState来改变的,render也执行了,loading一直在,同样的代码,我发送纯文本时先有loading,发送成功后loading消失,这个有遇到过吗,还是我的思路不对,请求指点一下哈哈
您好,请问一下,当长按多选删除时,删除消息后删除按钮没有消失,这个我得调用哪个事件来处理,然后还有左侧的选中状态按钮,刚开始多选时默认选中一个,那么我将其不选中,就是一个选中的都没有,此时删除按钮还是可以点击,这个我得需要怎么处理一下呢,谢谢了,我这是个新手。
// 将0-index部分返回文本
data.push(textContent.substring(0, minIndex));
push undefound
react native 6.1版本, 报了这个错误.
Invariant Violation: ViewPagerAndroid has been removed from React Native. It can now be installed and imported from 'react-native-viewpager' instead of 'react-native'. See https://github.com/react-native-community/react-native-viewpager
This error is located at:
in EmojiPanel (at ChatView.js:1124)
in RCTView (at createAnimatedComponent.js:151)
in AnimatedComponent (at ChatView.js:956)
in RCTView (at ChatView.js:954)
你好
我尝试运用这chat UI 但是在安卓上完全无法运行
There are many props in your module...
<ChatScreen
ref={e => (this.chat = e)}
CustomImageComponent={FastImage}
messageList={this.state.messages}
sendMessage={this.sendMessage}
// chatBackgroundImage={this.state.chatBg}
inverted={this.state.inverted}
panelSource={this.state.panelSource}
renderPanelRow={this.renderPanelRow}
onMessagePress={this.onPress}
voiceLoading={this.state.voiceLoading}
voicePlaying={this.state.voicePlaying}
audioPath={this.state.audioPath}
audioHasPermission={this.state.hasPermission}
requestAndroidPermission={this._requestAndroidPermission}
audioOnProgress={this.audioProgress}
audioOnFinish={this.audioFinish}
audioInitPath={this.initPath}
audioRecord={this._record}
audioStopRecord={this._stop}
audioCurrentTime={15}
audioHandle={this.state.audioHandle}
setAudioHandle={this.setAudioHandle}
voiceVolume={this.state.voiceVolume}
/>
I built my project with your package, then I can observe as followings...
executed order audioOnProgress -> audioOnFinish -> audioRecord -> audioStopRecord...
I think 'audioOnFinish ' have to execute at the end...
Please tell me about your opinion....
我这边有个需求,A用户能发送消息。 B用户只能看不能发消息。
妥协的方法就是B不发消息,最好的就是隐藏组件。
该组件无法自动与手动安装
实现了loadHistory方法,但是下拉并任何反应?也没有触发loadHistory?
<ChatScreen
ref={(e) => this.chat = e}
messageList={this.state.messages}
sendMessage={this.sendMessage}
reSendMessage={this.reSendMessage}
userProfile={this.state.userProfile}
chatId={this.state.chatInfo.id}
loadHistory={this.loadHistory}
/>
When using expo, i am unable to start my app because it throws
ENOENT: no such file or directory, scandir '/Users/abisola/Downloads/bereno-app/source'
Failed building JavaScript bundle.
After searching my app source i discovered it is because react-native-easy-chat-ui uses relative paths in it's code base e.g ../../source.
If i remove this package, all works well. I use expo to start my react app.
Please help, here is my package.json
pressAvatar没有返回对应用户的基本信息id等等
回调了3次
In my project, i am having View Pager version 3.3.0 while in your library, the view pager version is 2.0.1. Hence causing error Tried to register two views with the same name RNCViewPager. Any idea how to resolve this issue?
null is not an object(evaluating 'AudioRecorderManager.checkAuthorizationStatus')。我猜想是调用react-native-audio的授权时候有问题。但是不知道该怎么解决呀
多选后,会有一个选中,并且左侧图标是勾选状态,点击左上角取消可以关闭多选,但是再执行一次多选后,也会有一个选中,但是左侧图标不是勾选状态,我看了一下源码
componentWillReceiveProps (nextProps) {
if (!nextProps.isOpen) {
this.setState({ isSelect: false })
} else {
if (nextProps.currentIndex === parseInt(nextProps.rowId) && this.props.currentIndex !== parseInt(nextProps.rowId)) {
this.setState({ isSelect: true })
}
}
}
再次执行多选时this.props.currentIndex !== parseInt(nextProps.rowId) 是false,导致无法执行this.setState({ isSelect: true }),所以没勾选上,这个希望您能够给点建议,或者修改一下,谢谢啦
RT
用于群聊场景,希望能给每条消息加上发送者的昵称,自己可以不加
setPopItems的items为空数组时是否可以不显示pop
1、那例如:
A用户给B用户发送消息,A通过发送方法可以判断是否倒置,但是B用户他只是接收消息啊,这个怎么判断是否倒置
2、删除的时候的isInverted这个参数有很大误差啊
3、如果我自定义了setPopItems,那么this.props.delMessage({ index, message }, this.isInverted)中的this.isInverted我只能通过this.chat.isInverted去拿对吧
show = (view, type, index, text, message) => {
if (!this.props.usePopView) {
this.props.onMessageLongPress(type, index, text, message)
} else {
view.measure((x, y, width, height, pageX, pageY) => {
let items = null
if (this.props.setPopItems) {
items = this.props.setPopItems(type, index, text, message)
} else {
items = [
{
title: '删除',
onPress: () => {
this.props.delMessage({ index, message }, this.isInverted)
"react": "16.9.0",
"react-native": "0.61.5"
error message is as following...
WARN Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.
npx react-codemod rename-unsafe-lifecycles
in your project source folder.Please update the following components: ChatItem, EmojiPanel, PlusPanel, VoiceMessage
Please help me quickly....
您好,我该如何获取消息是否超过一屏,我看源码
onLayout={(e) => {
this._scrollToBottom()
this.listHeight = e.nativeEvent.layout.height
}}
onContentSizeChange={(contentWidth, contentHeight) => { this._scrollToBottom({ contentWidth, contentHeight }) }}
只有这两个地方操作了高度
_scrollToBottom (listHeightAndWidth) {
const { inverted } = this.props
if (listHeightAndWidth !== undefined) {
const { contentHeight } = listHeightAndWidth
this.isInverted = contentHeight > this.listHeight
}
if (!inverted) {
setTimeout(() => {
this.chatList && this.chatList.scrollToEnd({
animated: this._userHasBeenInputed
})
}, this._userHasBeenInputed ? 0 : 130)
}
}
contentHeight 是内容高度是吧,那我外部得怎么获取呢
this.state = {
. . .
contentHeight: 0,
. . .
}
我是利用
<ChatScreen
ref={(e) => this.chat = e}
this.chat外部获取这个高度,但是始终是0,因为没有任何地方改变这个state,是不是我的想法有问题,希望给点建议,谢谢了
您好,消息已读会不会存在一个问题,我先发送一条消息,假如失败了,那么此时肯定还是未读,那么我又发送一条消息,假如本次成功了,会显示已读,咱们这个显示已读是根据最后读取时间来判断的,那就回导致我上一个失败的也会显示已读,然后还有发送语音时,正常是对方听过后显示已读,假如我发送一个语音,紧接着又发送一个文本消息,文本一进页面就会显示已读,最后读取时间定位到文本,那语音此时也会显示已读,如果能将消息已读,未读,定位到每一个消息就好了,比如消息对象中本身就存在一个状态。
在聊天页面任何操作都会导致 ChatItem 重新渲染 比如切换文字和键盘
在聊天记录多的时候会导致卡顿严重
import { observer } from 'mobx-react/native';
@observer
export default class ChatItem extends Component
加入mobx 可以解决这个问题
因为项目已经被我改的面目全非 所以暂时没有办法PR
当在string.xml 设置了true时,键盘会遮挡输入框,请问有方法解决吗
消息气泡不能修改文字颜色,望修改!
用您的这个ui,我发现双方同时发送语音消息,多次发送之后,会出现iOS端在松开手指发送消息时,语音录入动画延迟了取消,语音录入还在继续,过几秒之后才能正常,这个能解决吗
您好,请问一下,在哪可以限制录制语音的长短
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.