【发布时间】:2017-08-07 11:21:37
【问题描述】:
我正在开发一个时钟启动器小部件(添加到启动器中的那个)。
我是手动在位图上画时间,然后做
ComponentName thisWidget = new ComponentName(context, MyWidgetProvider.class);
AppWidgetManager manager = AppWidgetManager.getInstance(context);
RemoteViews remoteViews = new RemoteViews(context.getPackageName(),
R.layout.widget_layout);
// Set the text
SimpleDateFormat timeFormat = new SimpleDateFormat("hh:mm a", Locale.US);
remoteViews.setImageViewBitmap(R.id.imageView, buildUpdate(context, timeFormat.format(new Date()))); //update imageView with a new bitmap with drawn time
manager.updateAppWidget(thisWidget, remoteViews);
我想要的是另外模糊小部件的背景(小部件下的壁纸)。
我知道如何模糊位图,但这种情况下我没有要模糊的位图,因为我认为我无法获取小部件下的背景部分。
那么有没有办法模糊小部件的背景?
请注意!我知道如何模糊位图。但我不需要这样做。
【问题讨论】: