Kotlin高仿微信-第26篇-朋友圈-选择图片、小视频对话框
Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册、登录、主页、单聊(文本、表情、语音、图片、小视频、视频通话、语音通话、红包、转账)、群聊、个人信息、朋友圈、支付服务、扫一扫、搜索好友、添加好友、开通VIP等众多功能。
Kotlin高仿微信-项目实践58篇,点击查看详情
效果图:
实现代码:
<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="wrap_content"xmlns:app="http://schemas.android.com/apk/res-auto"><LinearLayoutandroid:id="@+id/moments_pop_video"android:layout_width="match_parent"android:layout_height="64dp"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toTopOf="parent"android:gravity="center"android:background="@drawable/wc_base_white_normal"android:orientation="vertical"><androidx.appcompat.widget.AppCompatTextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="18sp"android:textColor="@color/black"android:textStyle="bold"android:text="拍摄"/><androidx.appcompat.widget.AppCompatTextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="12sp"android:text="照片或视频"/></LinearLayout><TextViewandroid:id="@+id/moments_pop_splitline"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toBottomOf="@+id/moments_pop_video"android:layout_width="match_parent"android:layout_height="1dp"android:background="@color/gray"android:text="-"/><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:background="@color/gray_item"app:layout_constraintTop_toBottomOf="@+id/moments_pop_splitline"android:orientation="vertical"><androidx.appcompat.widget.AppCompatTextViewandroid:id="@+id/moments_pop_album"android:layout_width="match_parent"android:layout_height="64dp"android:gravity="center"android:background="@color/white"android:text="从相册选择"android:textSize="18sp"android:textStyle="bold"android:textColor="@color/black"/><androidx.appcompat.widget.AppCompatTextViewandroid:id="@+id/moments_pop_svideo"android:layout_width="match_parent"android:layout_height="64dp"android:gravity="center"android:background="@color/white"android:text="选择小视频"android:textSize="18sp"android:textStyle="bold"android:textColor="@color/black"/><androidx.appcompat.widget.AppCompatTextViewandroid:id="@+id/moments_pop_cancel"android:layout_width="match_parent"android:layout_height="64dp"android:layout_marginTop="14dp"android:background="@color/white"android:gravity="center"android:text="取消"android:textSize="18sp"android:textStyle="bold"android:textColor="@color/black"/></LinearLayout></androidx.constraintlayout.widget.ConstraintLayout>
private fun showPopupWindow(){var popupView = layoutInflater.inflate(R.layout.wc_moments_pop_view , moment_root, false)var popupWindow = PopupWindow(popupView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, true)popupWindow.showAtLocation(moment_root, Gravity.BOTTOM, 0, 0)var window = requireActivity().window//popupWindow在弹窗的时候背景半透明val params = window.attributesparams.alpha = 0.5fwindow.attributes = paramspopupWindow.setOnDismissListener {params.alpha = 1.0fwindow.attributes = params}//拍照小视频popupView.findViewById<LinearLayout>(R.id.moments_pop_video).setOnClickListener {popupWindow.dismiss()var bundle = bundleOf(CameraFragment.TYPE_ENTER to CameraFragment.TYPE_MOMENT)navController?.navigate(R.id.action_svideo_camera, bundle)}//选择相册popupView.findViewById<AppCompatTextView>(R.id.moments_pop_album).setOnClickListener {popupWindow.dismiss()openAblum()}//选择小视频popupView.findViewById<AppCompatTextView>(R.id.moments_pop_svideo).setOnClickListener {popupWindow.dismiss()openVideo()}//取消popupView.findViewById<AppCompatTextView>(R.id.moments_pop_cancel).setOnClickListener {popupWindow.dismiss()}}
Kotlin高仿微信-第26篇-朋友圈-选择图片、小视频对话框相关推荐
- Flutter高仿微信-第16篇-朋友圈-发布作品(图片)
Flutter高仿微信系列共59篇,从Flutter客户端.Kotlin客户端.Web服务器.数据库表结构.Xmpp即时通讯服务器.视频通话服务器.腾讯云服务器全面讲解. 详情请查看 效果图: 实现 ...
- Kotlin高仿微信-第11篇-单聊-语音
Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜 ...
- Kotlin高仿微信-第14篇-单聊-视频通话
Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜索 ...
- Kotlin高仿微信-第34篇-支付-向商家付款(二维码)
Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜 ...
- Kotlin高仿微信-第20篇-个人信息
Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜 ...
- Kotlin高仿微信-第6篇-主页-我的
Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜 ...
- Kotlin高仿微信-第58篇-开通VIP
Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫. ...
- Kotlin高仿微信-第35篇-支付-二维码收款(二维码)
Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫. ...
- Kotlin高仿微信-第8篇-单聊
Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜索 ...
最新文章
- 2020.3.10.遗留问题
- 服务器配置文档查服务器名称,服务器配置答案资料.doc
- C/C++中调用api设置mysql连接的编码方式
- 关于Unity中的本地存储
- WeihanLi.Npoi 1.7.0 更新介绍
- .NET Core / C# 开发 IOT 嵌入式设备的个人见解
- 如何确定你的伴侣真的爱你?复杂数学公式告诉你
- 深度学习工作笔记002---曼哈顿距离_欧氏距离
- Webpack基础学习
- Python_study_day_1_while_if
- ubuntu之录屏软件kazam的安装
- 如何打造领英朋友圈_领英点赞,请摆好姿势!
- LC-779 语法中的第k个字符
- win64 安装Oracle 11g
- WinForm程序设计-ToolTip控件
- 使用ssh公钥密钥自动登陆linux服务器
- 联想 Y7000 安装 扩展 内存条
- 虚拟机修改ip地址的操作步骤
- leetcode:1000. 合并石头的最低成本(区间dp,困难)
- 线程状态的区别 blocked waitting ,join 详解
热门文章
- 卫星影像领域的深度学习数据和模型项目
- 脑电波技术的前途光明吗?
- Dell 笔记本电脑BIOS详细解读
- 两用物项许可证办理流程_办理两用物项和技术进口许可证流程
- 7-1 验证哥德巴赫猜想
- Canvas drawImage在高清屏幕下变模糊,解决方案
- 系统安全之利用操作系统自带命令杀毒
- 【前端】报错TypeError: Cannot create property ‘xxx‘ on string ‘xxx‘
- 作为项目经理你应该掌握的关键链法
- uniapp实现video视频禁止拖拽快进功能,禁止拖动进度条快进