Drawable是一种可绘制资源的载体,如图形、图像等。在实际开发中可以作为view的背景。
今天就来实现用Drawable实现动态时钟的功能
效果图如下:
实现思路:
1.自定义动态Drawable
2.绘制动态时钟
1 自定义Drawable
package com.pne.view;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphi