java.lang.Object

↳android.app.WallpaperManager

Class Overview(类概述)

Provides access to the system wallpaper. With WallpaperManager, you can get the current wallpaper, get the desired dimensions for the wallpaper, set the wallpaper, and more. Get an instance of WallpaperManager with getInstance().

提供系统壁纸访问。使用该类,你可以获得当前壁纸,获得壁纸所需尺寸,设置壁纸等等。用getInstance函数来获得该类的一个实例。

Summary(摘要)

Constants(常量)

String     ACTION_LIVE_WALLPAPER_CHOOSER

Launch an activity for the user to pick the current global live wallpaper.

启动一个选择当前全局动态壁纸的Activity

String     COMMAND_DROP

Command for sendWallpaperCommand(IBinder, String, int, int, int, Bundle): reported by the wallpaper host when the user drops an object into an area of the host.

当用户拖动一个object到host区域时,

String     COMMAND_SECONDARY_TAP

Command for sendWallpaperCommand(IBinder, String, int, int, int, Bundle): reported by the wallpaper host when the user releases a secondary pointer on an empty area (not performing an action in the host).

当用户释放一个xxx在空白区域时,(不在host显示动画效果)

String     COMMAND_TAP

Command for sendWallpaperCommand(IBinder, String, int, int, int, Bundle): reported by the wallpaper host when the user taps on an empty area (not performing an action in the host).

当用户点击空白区域时,

String     WALLPAPER_PREVIEW_META_DATA

Manifest entry for activities that respond to ACTION_SET_WALLPAPER which allows them to provide a custom large icon associated with this action.

Public Methods(公开函数)

void     clear()

Remove any currently set wallpaper, reverting to the system's default wallpaper.

清除当前设置的壁纸,还原成系统默认的壁纸

void     clearWallpaperOffsets(IBinder windowToken)

Clear the offsets previously associated with this window through setWallpaperOffsets(IBinder, float, float).

清除setWallpaperOffsets设置的内容

int     getDesiredMinimumHeight()

Returns the desired minimum height for the wallpaper.

返回要求的最小壁纸高度

int     getDesiredMinimumWidth()

Returns the desired minimum width for the wallpaper.

返回要求的最小壁纸宽度

Drawable     getDrawable()

Retrieve the current system wallpaper; if no wallpaper is set, the system default wallpaper is returned.

重新获得当前系统壁纸,如果没有设置过壁纸,则返回默认系统壁纸。

Drawable     getFastDrawable()

Like getDrawable(), but the returned Drawable has a number of limitations to reduce its overhead as much as possible.

跟GetDrawable函数一样,不过返回的Drawable有一定的限制,尽量减少它的总开销。

static WallpaperManager     getInstance(Context context)

Retrieve a WallpaperManager associated with the given Context.

根据给定的Context获得WallpaperManager实例

WallpaperInfo     getWallpaperInfo()

If the current wallpaper is a live wallpaper component, return the information about that wallpaper.

如果当前壁纸是动态壁纸,则返回动态壁纸信息。

这里还少写了一句,如果不是动态壁纸的话则返回null,可依此来判断当前壁纸是动态还是静态的。

Drawable     peekDrawable()

Retrieve the current system wallpaper; if there is no wallpaper set, a null pointer is returned.

获得当前系统壁纸,如果壁纸未设置则返回null

Drawable     peekFastDrawable()

Like getFastDrawable(), but if there is no wallpaper set, a null pointer is returned.

跟getFastDrawable函数一样,但是该函数如果没有设置壁纸则返回null。

void     sendWallpaperCommand(IBinder windowToken, String action, int x, int y, int z, Bundle extras)

Send an arbitrary command to the current active wallpaper.

发送任意指令到当前活动的壁纸程序

void     setBitmap(Bitmap bitmap)

Change the current system wallpaper to a bitmap.

设置当前壁纸

void     setResource(int resid)

Change the current system wallpaper to the bitmap in the given resource.

设置当前壁纸

void     setStream(InputStream data)

Change the current system wallpaper to a specific byte stream.

设置当前壁纸

void     setWallpaperOffsetSteps(float xStep, float yStep)

For applications that use multiple virtual screens showing a wallpaper, specify the step size between virtual screens.

如果程序使用多个虚拟屏幕来显示壁纸,指定虚拟屏幕之间的步长,其实就是设置壁纸需要几屏来显示。

yStep为1.0f,xStep为1.0f/(屏数-1)。所以如果你只有一屏,在设置这里的时候要注意了。

void     setWallpaperOffsets(IBinder windowToken, float xOffset, float yOffset)

Set the position of the current wallpaper within any larger space, when that wallpaper is visible behind the given window.

当壁纸显示在给定窗口下方时,设置当前壁纸的位置,这个就不是很明白,理论上说不是应该从左上角开始嘛?

void     suggestDesiredDimensions(int minimumWidth, int minimumHeight)

For use only by the current home application, to specify the size of wallpaper it would like to use.

仅仅为了给主应用使用,用来指定壁纸的尺寸

[Expand]

Inherited Methods(继承函数)

From class java.lang.Object

android.app.WallpaperManager壁纸管理类相关推荐

  1. android9壁纸存放路径,Android基础入门教程——10.9 WallpaperManager(壁纸管理器)

    Android基础入门教程--10.9 WallpaperManager(壁纸管理器) 标签(空格分隔): Android基础入门教程 本节引言: 本节给大家带来的是WallpaperManager( ...

  2. Android基础入门教程——10.9 WallpaperManager(壁纸管理器)

    Android基础入门教程--10.9 WallpaperManager(壁纸管理器) 标签(空格分隔): Android基础入门教程 本节引言: 本节给大家带来的是WallpaperManager( ...

  3. 10.9 安卓WallpaperManager(壁纸管理器)

    10.9 WallpaperManager(壁纸管理器) 分类 Android 基础入门教程 本节引言: 本节给大家带来的是WallpaperManager(壁纸管理器),如其名,就是手机壁纸相关的一 ...

  4. Android APP常见的5类内存泄露及解决方法

    Android APP常见的5类内存泄露及解决方法 参考文章: (1)Android APP常见的5类内存泄露及解决方法 (2)https://www.cnblogs.com/genggeng/p/7 ...

  5. android 应用程序Activity管理类

    import android.annotation.SuppressLint; import android.app.Activity; import android.app.ActivityMana ...

  6. Android APP更新下载工具类——简单封装DownloadManager

    几乎所有APP都包含了检查更新功能,更新下载功能的实现方式常用的有两种:1.使用App网络框架的文件下载请求:2.使用自带的DownloadManager类:本文介绍第二种,简单封装一下Downloa ...

  7. Android开发线程池管理类之ThreadPoolExecutor工具类

    平常开发中网络请求自从Android4.0后强制要求放到子线程中避免主线程进行网络请求,一般很多人习惯直接通过new Thread的方法.不建议这样使用.我们用ThreadPoolExecutor线程 ...

  8. android 设置系统壁纸,Android HttpURLConnection下载网络图片设置系统壁纸

    需求: 壁纸是url链接,get就能请求到,所以就用get请求到图片,把图片转化为bitmap,然后设置壁纸. 代码: 这里我封装了工具类 package xxxxx.utils; import an ...

  9. Android Launcher 设置壁纸

    版本:1.0  日期:2014.11.25 2014.11.26 版权:©kince 特别推荐:泡在网上的日子 一.概述 一般Launcher都带有壁纸设置的功能,Android提供了设置壁纸的API ...

最新文章

  1. python逐行写入csv_python之模块csv之CSV文件的写入(按行写入)
  2. pytorch 随机打乱
  3. JS破解专题|光汇云油登录算法
  4. Git - 版本控制工具十分钟入门手册
  5. 安卓内边距padding与外边距magrin
  6. 使用bash编写Linux shell脚本--复合命令
  7. 想要写好的程序应该远离计算机
  8. Page Object设计模式实践
  9. TeamCity+Rancher+Docker实现.Net Core项目DevOps(目前成本最小的DevOps实践)
  10. CCS下载MSP430编译遇到的几个小问题
  11. linux下blast设计引物,手把手教你设计引物(图文并茂)
  12. 响应式布局——媒体查询
  13. (1)CC3200学习之blinky导入后报编译器版本错误
  14. 2021年企业商务网站建设必须安装的24个WordPress插件
  15. 谁发明了验证码?你出来 保证不打死你
  16. 论职务犯罪案件侦查 z
  17. Mysql查询时间段内数据,并处理相同日期或同类型的数据
  18. TensorFlow实现自定义Op
  19. JVM监控:JMX组件与底层原理
  20. 新的 ES2022 规范终于发布了,我总结了8个实用的新功能

热门文章

  1. ant Design vue中a-row 内容不会垂直居中
  2. Redis:(error) MOVED 原因和解决方案
  3. SCU(System Control Units)
  4. curl https -k
  5. python【第七篇】网络编程
  6. 计算机网络实验之Cisco Packet Tracer 实验
  7. SpringCloud - Spring Cloud Netflix 之 Hystrix熔断器(七)
  8. 基于Java图书馆管理系统、JAVA图书借阅系统设计与实现 毕业设计开题报告
  9. 死锁的定义和产生条件以及如何避免死锁
  10. 推荐算法_02_协同过滤算法(ItemCF和UserCF)