linphone-去掉ChatListFragment聊天界面
来源:互联网 发布:c语言编程书籍推荐 编辑:程序博客网 时间:2024/05/15 01:05
说明
linphone有一个聊天界面。
1. 显示所有的聊天界面。
2. 向固定的帐号发送聊天信息。
3. 向固定的帐号发送附件信息。这个需要跳转到其他的应用。
4. 怎样显示聊天列表,有没有优化这个。
5. 当编辑的时候,对端显示remote is writing.
图片
显示对话列表
新增加对话框列表
对话聊天界面
具体逻辑分析
调用系统的应用
#ChatFragment.java//File transferprivate void pickImage() { List<Intent> cameraIntents = new ArrayList<Intent>(); Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File file = new File(Environment.getExternalStorageDirectory(), getString(R.string.temp_photo_name_with_date).replace("%s", String.valueOf(System.currentTimeMillis()))); imageToUploadUri = Uri.fromFile(file); captureIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageToUploadUri); cameraIntents.add(captureIntent); Intent galleryIntent = new Intent(); galleryIntent.setType("image/*"); galleryIntent.setAction(Intent.ACTION_PICK); Intent chooserIntent = Intent.createChooser(galleryIntent, getString(R.string.image_picker_title)); chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, cameraIntents.toArray(new Parcelable[]{})); startActivityForResult(chooserIntent, ADD_PHOTO);}
@Overridepublic void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == ADD_PHOTO && resultCode == Activity.RESULT_OK) { String fileToUploadPath = null; if (data != null && data.getData() != null) { fileToUploadPath = getRealPathFromURI(data.getData()); } else if (imageToUploadUri != null) { fileToUploadPath = imageToUploadUri.getPath(); } if (fileToUploadPath != null) { //showPopupMenuAskingImageSize(fileToUploadPath); sendImageMessage(fileToUploadPath, 0); } } else { super.onActivityResult(requestCode, resultCode, data); }}
private void sendImageMessage(String path, int imageSize) { LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull(); boolean isNetworkReachable = lc == null ? false : lc.isNetworkReachable(); if (newChatConversation && chatRoom == null) { String address = searchContactField.getText().toString(); if (address != null && !address.equals("")) { initChatRoom(address); } } if (chatRoom != null && path != null && path.length() > 0 && isNetworkReachable) { try { Bitmap bm = BitmapFactory.decodeFile(path); if (bm != null) { FileUploadPrepareTask task = new FileUploadPrepareTask(getActivity(), path, imageSize); task.execute(bm); } else { Log.e("Error, bitmap factory can't read " + path); } } catch (RuntimeException e) { Log.e("Error, not enough memory to create the bitmap"); } } else if (!isNetworkReachable && LinphoneActivity.isInstanciated()) { LinphoneActivity.instance().displayCustomToast(getString(R.string.error_network_unreachable), Toast.LENGTH_LONG); } }
0 0
- linphone-去掉ChatListFragment聊天界面
- linphone-去掉HistoryListFragment界面
- linphone-去掉linphone的ContactsListFragment联系人界面
- linphone-去掉About界面(一)
- linphone-去掉About界面(二)
- linphone-去掉蓝牙功能
- 聊天界面
- 聊天界面
- 聊天界面
- 聊天界面
- 聊天界面
- 聊天界面
- 聊天界面
- 聊天界面
- 聊天界面
- 聊天界面
- 聊天界面
- Java聊天--聊天界面
- 直方图之calcHist使用
- Android MediaProvider,MediaScanner媒体文件扫描源码解析
- Java 集合系列03之 ArrayList详细介绍(源码解析)和使用示例
- TensorBoard-可视化简单例子
- floyd 算法详解
- linphone-去掉ChatListFragment聊天界面
- spark submit脚本
- JAVA本地方法
- 机器学习调参经验:学习速率、正则项系数、minibatch size
- PHP和JAVA在WEB方面的比较
- [算法] -- 微信红包算法
- WAMPServer多站点配置
- 快速搭建自己的物联网平台,zigbee协议(不会控制你的物联网系统)
- Cannot open volume for direct access +++ Can unspecified error occurred