【问题标题】:Blurring the launcher widget background模糊启动器小部件背景
【发布时间】: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);

我想要的是另外模糊小部件的背景(小部件下的壁纸)。

我知道如何模糊位图,但这种情况下我没有要模糊的位图,因为我认为我无法获取小部件下的背景部分。

那么有没有办法模糊小部件的背景?

请注意!我知道如何模糊位图。但我不需要这样做。

【问题讨论】:

    标签: android android-widget


    【解决方案1】:

    这是不可能的,因为没有办法让小部件底层位图应用模糊。您只能创建部分透明的背景。

    【讨论】:

    • 这是一种选择。但如果有人可以提供任何类型的 hack,我会稍等片刻
    猜你喜欢
    • 1970-01-01
    • 2015-12-20
    • 2011-12-10
    • 2018-04-24
    • 2020-10-06
    • 2021-01-15
    • 2017-07-17
    • 1970-01-01
    • 2013-10-19
    相关资源
    最近更新 更多