打字指標在聊天應用程序如何實現輸入指示器有人在打字就像什麼應用程序內使用火力地堡在聊天應用程序如何實現使用火力地堡
-3
A
回答
1
爲了實現這一目標或Messenger Android Studio中,您需要在Firebase數據庫中添加一個新字段,名稱爲:typing
,默認值爲false
。然後在EditText
上使用addTextChangedListener()
方法實際查看某人何時輸入消息。當有人鍵入內容時,onTextChanged()
方法被觸發。現在將typing
的值從false更改爲true
。在此之後,addValueEventListener
查看值何時更改。如果該值爲true,則在聊天室中顯示該消息。所以,我建議你使用下面的代碼:
yourEditText.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!TextUtils.isEmpty(s)) {
//Set the value of typing field to true.
} else {
// Set to false
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void afterTextChanged(Editable s) {}
});
+0
我需要還有一個幫助如何在someOne正在輸入數據庫層次結構時更新isTyping,如下所示:https://firebasestorage.googleapis.com/v0/b/websolutionseo-8c349.appspot.com/o/Capture.PNG?alt=media&token = 3f78dfc5-ec33-40d1-AF19-e0853d0f2b5c – Arsalan
相關問題
- 1. 如何實現在火力地堡
- 2. 火力地堡發現如果用戶從火力地堡
- 3. 火力地堡驗證:這個程序是無權使用火力地堡
- 4. 的Android - 火力地堡 - 向用戶發送聊天室
- 5. 在應用程序中實現聊天?
- 6. 火力地堡:使用comodin
- 7. 火力地堡後端使用Java Web應用程序
- 8. 火力地堡查詢實現
- 9. 管理火力地堡用戶在應用程序
- 10. $在火力地堡
- 11. 在火力地堡
- 12. 在火力地堡
- 13. 在火力地堡
- 14. 在火力地堡
- 15. 火力地堡安全規則與多個聊天室
- 16. 聊天火力地堡轉換成片段
- 17. 添加upvotes到reactjs和火力地堡聊天室
- 18. Unity的火力地堡的應用程序在Android
- 19. 火力IOS聊天應用程序無法正常工作
- 20. 火力地堡社交媒體應用程序:用戶節省
- 21. 火力地堡響應400
- 22. 火力地堡用戶registeration
- 23. 如何利用火力地堡
- 24. 如何在Android中實現聊天應用程序
- 25. 如何在android中實現聊天應用程序?
- 26. 如何在codeigniter網站上實現聊天應用程序?
- 27. 如何在Android應用程序中實現聊天功能?
- 28. iOS的火力地堡應用FIRApp.configure()
- 29. 我使用的開發在Android聊天應用火力
- 30. 火力地堡認證+火力地堡貯存在Unity3d
重複:https://stackoverflow.com/questions/33797431/how-to-determine-if-someone-is-typing-on-edittext –