Android 9.0 10.0 Launcher3 时钟动态图标的定制化(时钟动态图标)

1.概述

在定制化10.0的项目开发中,在Launcher3的app列表页,有时钟app的图标,由于图标是静态的
开发的需要要求调成动态图标,时刻显示时间,所以要把时钟图标替换成动态图标

如图:

Android 9.0 10.0 Launcher3 时钟动态图标的定制化(时钟动态图标)_第1张图片

 

2. 9.0 10.0时钟动态图标的定制化主要核心代码

   packages/apps/Launcher3/src/com/android/launcher3/BubbleTextView.java
   packages/apps/Launcher3/src/com/android/launcher3/Launcher.java

3 9.0 10.0时钟动态图标的定制化主要核心代码和功能实现

在Launcher3 workspace 第二屏app列表页中 默认的时钟app图标是静态图标 就是时间不会变化的
但这也显然不符合要求,时间是时刻都在变化的 下面就来定制化时钟动态图标

3.1 定义绘制时间图标类IconUtil.java

package com.android.launcher3;
import android.content.Context;
import android.graphics.*;
import com.android.launcher3.R;
public class IconUtil {
private static final String TAG = "IconUtil";
private static Bitmap getBitmap(Context context, int res) {
BitmapFactory.Options options &#

你可能感兴趣的:(android,Launcher3动态时钟,动态时钟图标,时钟动态图标,增加时钟动态功能)