Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mayundoyouknow
Android悬浮框
提交
88a40ae5
A
Android悬浮框
项目概览
mayundoyouknow
/
Android悬浮框
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
Android悬浮框
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
88a40ae5
编写于
11月 10, 2021
作者:
D
dongdawei1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
自定义shape,layer-list,selector
上级
8727ef21
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
212 addition
and
1 deletion
+212
-1
FloatWindowL/app/src/main/res/drawable/rect_dashed_border.xml
...tWindowL/app/src/main/res/drawable/rect_dashed_border.xml
+11
-0
FloatWindowL/app/src/main/res/drawable/rect_gradient_sweep.xml
...WindowL/app/src/main/res/drawable/rect_gradient_sweep.xml
+26
-0
FloatWindowL/app/src/main/res/drawable/rect_rounded_border_and_fill.xml
...pp/src/main/res/drawable/rect_rounded_border_and_fill.xml
+12
-0
FloatWindowL/app/src/main/res/drawable/rect_rounded_top_bottom_arc.xml
...app/src/main/res/drawable/rect_rounded_top_bottom_arc.xml
+9
-0
FloatWindowL/app/src/main/res/drawable/rect_solid_border.xml
FloatWindowL/app/src/main/res/drawable/rect_solid_border.xml
+8
-0
FloatWindowL/app/src/main/res/drawable/ring_border.xml
FloatWindowL/app/src/main/res/drawable/ring_border.xml
+16
-0
FloatWindowL/app/src/main/res/drawable/selector_practice.xml
FloatWindowL/app/src/main/res/drawable/selector_practice.xml
+72
-0
FloatWindowL/app/src/main/res/drawable/shape_model.xml
FloatWindowL/app/src/main/res/drawable/shape_model.xml
+10
-0
FloatWindowL/app/src/main/res/layout/recyclerview_activity.xml
...WindowL/app/src/main/res/layout/recyclerview_activity.xml
+2
-0
FloatWindowL/app/src/main/res/layout/shape_activity.xml
FloatWindowL/app/src/main/res/layout/shape_activity.xml
+45
-0
FloatWindowL/app/src/main/res/values/themes.xml
FloatWindowL/app/src/main/res/values/themes.xml
+1
-1
未找到文件。
FloatWindowL/app/src/main/res/drawable/rect_dashed_border.xml
0 → 100644
浏览文件 @
88a40ae5
<?xml version="1.0" encoding="utf-8"?>
<!--矩形虚线边框-内填充-->
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<stroke
android:color=
"@android:color/holo_red_light"
android:width=
"2dp"
android:dashGap=
"5dp"
android:dashWidth=
"10dp"
/>
<solid
android:color=
"@android:color/holo_green_light"
/>
</shape>
\ No newline at end of file
FloatWindowL/app/src/main/res/drawable/rect_gradient_sweep.xml
0 → 100644
浏览文件 @
88a40ae5
<?xml version="1.0" encoding="utf-8"?>
<!-- 矩形内部填充-扫描渐变 -->
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
android:useLevel=
"true"
>
<!--如果布局中没有设置View的大小,会size设置的大小为默认值-->
<size
android:width=
"20dp"
android:height=
"20dp"
/>
<stroke
android:width=
"1px"
android:color=
"#ffff00ff"
/>
<!--调整angle不能实现角度变化
centerX,centerY是中心点的位置,这里用的是百分比值(0-1)
在rect中gradientRadius无效-->
<gradient
android:angle=
"0"
android:centerX=
"0.5"
android:centerY=
"0.5"
android:startColor=
"#ff00ff00"
android:gradientRadius=
"20dp"
android:type=
"sweep"
/>
</shape>
\ No newline at end of file
FloatWindowL/app/src/main/res/drawable/rect_rounded_border_and_fill.xml
0 → 100644
浏览文件 @
88a40ae5
<?xml version="1.0" encoding="utf-8"?>
<!--圆角矩形-有边框有填充-->
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<stroke
android:width=
"2dp"
android:color=
"@android:color/holo_red_light"
/>
<solid
android:color=
"@color/purple_200"
/>
<corners
android:topLeftRadius=
"15dp"
android:topRightRadius=
"15dp"
android:bottomLeftRadius=
"15dp"
android:bottomRightRadius=
"15dp"
/>
</shape>
\ No newline at end of file
FloatWindowL/app/src/main/res/drawable/rect_rounded_top_bottom_arc.xml
0 → 100644
浏览文件 @
88a40ae5
<?xml version="1.0" encoding="utf-8"?>
<!-- 矩形圆角+左右两边为一个圆弧 -->
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<size
android:width=
"20dp"
android:height=
"60dp"
/>
<solid
android:color=
"#8000ff00"
/>
<!-- 圆角半径是高度的一般就是一个圆弧了 -->
<corners
android:radius=
"20dp"
/>
</shape>
\ No newline at end of file
FloatWindowL/app/src/main/res/drawable/rect_solid_border.xml
0 → 100644
浏览文件 @
88a40ae5
<?xml version="1.0" encoding="utf-8"?>
<!--矩形实线边框-内填充-->
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<stroke
android:color=
"@android:color/holo_red_dark"
android:width=
"2dp"
/>
<solid
android:color=
"@android:color/holo_blue_light"
/>
</shape>
\ No newline at end of file
FloatWindowL/app/src/main/res/drawable/ring_border.xml
0 → 100644
浏览文件 @
88a40ae5
<?xml version="1.0" encoding="utf-8"?>
<!-- 圆环-仅有边框 -->
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"ring"
android:innerRadius=
"20dp"
android:thickness=
"16dp"
android:useLevel=
"false"
>
<!--android:useLevel="false"必须是false-->
<size
android:width=
"80dp"
android:height=
"80dp"
/>
<stroke
android:width=
"3dp"
android:color=
"#ffff00ff"
/>
</shape>
\ No newline at end of file
FloatWindowL/app/src/main/res/drawable/selector_practice.xml
0 → 100644
浏览文件 @
88a40ae5
<?xml version="1.0" encoding="utf-8"?>
<!--选择器-->
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<!--按下状态显示样式-->
<item
android:state_pressed=
"true"
>
<!--分层-->
<layer-list>
<!--分层 第一层-->
<item
android:bottom=
"8dp"
>
<shape>
<solid
android:color=
"#ffaaaaaa"
/>
</shape>
</item>
<!--分层 第二层-->
<item>
<shape>
<corners
android:bottomLeftRadius=
"4dp"
android:bottomRightRadius=
"4dp"
android:topLeftRadius=
"1dp"
android:topRightRadius=
"1dp"
/>
<solid
android:color=
"#ffaaaaaa"
/>
<padding
android:bottom=
"1dp"
android:left=
"1dp"
android:right=
"1dp"
android:top=
"0dp"
/>
</shape>
</item>
<!--分层 第三层-->
<item>
<shape>
<corners
android:bottomLeftRadius=
"3dp"
android:bottomRightRadius=
"3dp"
android:topLeftRadius=
"1dp"
android:topRightRadius=
"1dp"
/>
<solid
android:color=
"@android:color/holo_green_light"
/>
</shape>
</item>
</layer-list>
</item>
<!--正常状态显示样式-->
<item>
<layer-list>
<item
android:bottom=
"8dp"
>
<shape>
<solid
android:color=
"#ffaaaaaa"
/>
</shape>
</item>
<item>
<shape>
<corners
android:bottomLeftRadius=
"4dp"
android:bottomRightRadius=
"4dp"
android:topLeftRadius=
"1dp"
android:topRightRadius=
"1dp"
/>
<solid
android:color=
"#ffaaaaaa"
/>
<padding
android:bottom=
"1dp"
android:left=
"1dp"
android:right=
"1dp"
android:top=
"0dp"
/>
</shape>
</item>
<item>
<shape>
<corners
android:bottomLeftRadius=
"3dp"
android:bottomRightRadius=
"3dp"
android:topLeftRadius=
"1dp"
android:topRightRadius=
"1dp"
/>
<solid
android:color=
"@android:color/holo_blue_light"
/>
</shape>
</item>
</layer-list>
</item>
</selector>
\ No newline at end of file
FloatWindowL/app/src/main/res/drawable/shape_model.xml
0 → 100644
浏览文件 @
88a40ae5
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<!-- android:shape="">-->
<!-- <corners />-->
<!-- <gradient />-->
<!-- <padding />-->
<!-- <size />-->
<!-- <solid />-->
<!-- <stroke />-->
</shape>
\ No newline at end of file
FloatWindowL/app/src/main/res/layout/recyclerview_activity.xml
浏览文件 @
88a40ae5
...
...
@@ -27,6 +27,8 @@
app:layout_constraintTop_toTopOf=
"parent"
android:layout_marginTop=
"3dp"
android:text=
"添加数据"
android:backgroundTint=
"@null"
android:background=
"@drawable/selector_practice"
android:id=
"@+id/add_btn_data"
/>
<Button
android:layout_width=
"match_parent"
...
...
FloatWindowL/app/src/main/res/layout/shape_activity.xml
0 → 100644
浏览文件 @
88a40ae5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_margin=
"10dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:padding=
"10dp"
android:text=
"矩形实线边框-内填充"
android:background=
"@drawable/rect_solid_border"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:padding=
"10dp"
android:text=
"矩形虚线边框-内填充"
android:background=
"@drawable/rect_dashed_border"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:padding=
"10dp"
android:text=
"圆角矩形-有边框有填充"
android:background=
"@drawable/rect_rounded_border_and_fill"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/rect_rounded_top_bottom_arc"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/rect_gradient_sweep"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/ring_border"
/>
</LinearLayout>
\ No newline at end of file
FloatWindowL/app/src/main/res/values/themes.xml
浏览文件 @
88a40ae5
<resources
xmlns:tools=
"http://schemas.android.com/tools"
>
<!-- Base application theme. -->
<style
name=
"Theme.FloatWindowL"
parent=
"Theme.
MaterialComponents
.DayNight.DarkActionBar"
>
<style
name=
"Theme.FloatWindowL"
parent=
"Theme.
AppCompat
.DayNight.DarkActionBar"
>
<!-- Primary brand color. -->
<item
name=
"colorPrimary"
>
@color/purple_500
</item>
<item
name=
"colorPrimaryVariant"
>
@color/purple_700
</item>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录