Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
92cf271e
Commit
92cf271e
authored
Nov 05, 2019
by
徐健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复资源文件
parent
61ed3e25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
34 deletions
+36
-34
FMSurfaceView.kt
m-fm/src/main/java/com/yidianling/fm/widget/FMSurfaceView.kt
+35
-33
activity_fm.xml
m-fm/src/main/res/layout/activity_fm.xml
+1
-1
No files found.
m-fm/src/main/java/com/yidianling/fm/widget/FMSurfaceView.kt
View file @
92cf271e
...
...
@@ -86,40 +86,42 @@ class FMSurfaceView(context: Context?, attrs: AttributeSet?) : SurfaceView(conte
}
private
fun
drawAnimate
()
{
mHolder
?.
let
{
canvas
=
mHolder
?.
lockCanvas
()
canvas
?.
let
{
//清空画布,进行重绘
canvas
?.
drawColor
(
Color
.
TRANSPARENT
,
PorterDuff
.
Mode
.
CLEAR
)
//重置最小六边形半径
resetPresentRadius
()
paint
?.
style
=
Paint
.
Style
.
FILL
//设置画笔为填充模式
//绘制四个变化的六边形
drawMinHexagon
()
drawMiddleHexagon
()
drawMaxHexagon
()
drawMMaxHexagon
()
//绘制图片外面包围的一层圆
canvas
?.
let
{
paint
?.
strokeWidth
=
ringWidth
+
0.5f
paint
?.
style
=
Paint
.
Style
.
STROKE
//设置画笔为线模式
paint
?.
color
=
Color
.
parseColor
(
"#D0FFFFFF"
)
paint
?.
setShadowLayer
(
ringWidth
,
1F
,
1F
,
Color
.
parseColor
(
"#D0FFFFFF"
))
canvas
!!
.
drawCircle
((
canvas
?.
width
!!
/
2
).
toFloat
(),
(
canvas
?.
height
!!
/
2
).
toFloat
(),
ringRadius
+
0.5f
,
paint
!!
)
paint
?.
setShadowLayer
(
0F
,
0F
,
0F
,
Color
.
WHITE
)
synchronized
(
this
)
{
mHolder
?.
let
{
canvas
=
mHolder
?.
lockCanvas
()
canvas
?.
let
{
//清空画布,进行重绘
canvas
?.
drawColor
(
Color
.
TRANSPARENT
,
PorterDuff
.
Mode
.
CLEAR
)
//重置最小六边形半径
resetPresentRadius
()
paint
?.
style
=
Paint
.
Style
.
FILL
//设置画笔为填充模式
//绘制四个变化的六边形
drawMinHexagon
()
drawMiddleHexagon
()
drawMaxHexagon
()
drawMMaxHexagon
()
//绘制图片外面包围的一层圆
canvas
?.
let
{
paint
?.
strokeWidth
=
ringWidth
+
0.5f
paint
?.
style
=
Paint
.
Style
.
STROKE
//设置画笔为线模式
paint
?.
color
=
Color
.
parseColor
(
"#D0FFFFFF"
)
paint
?.
setShadowLayer
(
ringWidth
,
1F
,
1F
,
Color
.
parseColor
(
"#D0FFFFFF"
))
canvas
!!
.
drawCircle
((
canvas
?.
width
!!
/
2
).
toFloat
(),
(
canvas
?.
height
!!
/
2
).
toFloat
(),
ringRadius
+
0.5f
,
paint
!!
)
paint
?.
setShadowLayer
(
0F
,
0F
,
0F
,
Color
.
WHITE
)
}
presentRadius
+=
presentRadiusChangeNumber
//每次循环presentRadius+presentRadiusChangeNumber
}
//这里有些机型上面会出现异常,暴力try一次,也可以用 mHolder?.surface?.isValid先进行一次判断后进行try
try
{
mHolder
?.
unlockCanvasAndPost
(
canvas
)
// android 4.3 会有IllegalArgumentException
}
catch
(
e
:
Exception
)
{
}
}
presentRadius
+=
presentRadiusChangeNumber
//每次循环presentRadius+presentRadiusChangeNumber
}
//这里有些机型上面会出现异常,暴力try一次,也可以用 mHolder?.surface?.isValid先进行一次判断后进行try
try
{
mHolder
?.
unlockCanvasAndPost
(
canvas
)
// android 4.3 会有IllegalArgumentException
}
catch
(
e
:
Exception
)
{
}
}
}
...
...
m-fm/src/main/res/layout/activity_fm.xml
View file @
92cf271e
...
...
@@ -9,7 +9,7 @@
android:id=
"@+id/tb_title"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/title_bar_height"
app:pa_left_start_icon
=
"@drawable/platform_toolbar_back
"
app:pa_left_start_icon
_color=
"@color/google_green
"
app:pa_title_text=
"心灵电台"
/>
<FrameLayout
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment