本文实例为大家分享了android桌面悬浮窗,实现录屏时间控制显示效果的具体代码,供大家参考,具体内容如下
悬浮窗效果如上图所示:
很简单的一个布局直接上代码
悬浮窗布局如下record_screen_time_float.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/corners_bg" android:paddingBottom="3dp" android:paddingTop="3dp" android:paddingLeft="15dp" android:paddingRight="8dp" android:layout_gravity="center" android:gravity="center" android:orientation="horizontal"> <TextView android:id="@+id/record_time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="00:00" android:textColor="#ffffff" android:textSize="10dp" /> <View android:layout_width="2dp" android:layout_height="match_parent" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:textColor="#ffffff" /> <LinearLayout android:id="@+id/stop_record" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center" android:orientation="horizontal"> <ImageView android:id="@+id/record_hint_button" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginRight="5dp" android:background="#FF4040" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="结束" android:textColor="#ffffff" android:textSize="10dp" /> </LinearLayout> </LinearLayout> </LinearLayout>
本文标题:android桌面悬浮窗显示录屏时间控制效果-创新互联
浏览路径:https://www.cdcxhl.com/article20/dspsjo.html
成都网站建设公司_创新互联,为您提供虚拟主机、用户体验、品牌网站制作、做网站、企业网站制作、动态网站
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联