Commit 92cf271e by 徐健

修复资源文件

parent 61ed3e25
......@@ -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) {
}
}
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment