gdx 源码分析摘录
来源:互联网 发布:支持大数据的技术 编辑:程序博客网 时间:2024/05/21 06:30
一, HandlerCaller的使用
封装handler;
1,实现类
HandlerCaller mCaller = new HandlerCaller(context, context.getMainLooper(), this, true);
2,实现回调;
class XX implements HandlerCaller.Callback
public void executeMessage(Message message) { }
3,创建发送message
Message msg = mCaller.obtainMessageI(MSG_VISIBILITY_CHANGED,
visible ? 1 : 0);
mCaller.sendMessage(msg);
二, Engine
The actual implementation of a wallpaper. You must implement {@link WallpaperService#onCreateEngine()}
to return your concrete Engine implementation.
1,监听屏幕
final BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_SCREEN_ON.equals(intent.getAction())) { mScreenOn = true; reportVisibility(); } else if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) { mScreenOn = false; reportVisibility(); } } };
三, class WallpaperService extends Service
实现了IWallpaperService
四,IWallpaperService.stub
attach(); 在attach中创建engine
五,IWallpaperEngine
oneway interface IWallpaperEngine { void setDesiredSize(int width, int height); void setVisibility(boolean visible); void dispatchPointer(in MotionEvent event); void dispatchWallpaperCommand(String action, int x, int y, int z, in Bundle extras); void destroy();}控制wallpaper的生命周期,ibinder对象
六: 创建AndroidWallpaperEngine(libgdx封装)
public class AndroidWallpaperEngine extends Engine
七: Application
It sets up a window and rendering surface and manages the * different aspects of your application
- gdx 源码分析摘录
- Opencv2.4.9源码分析要点摘录
- gdx 打包可执行 jar 不会包含源码 src 目录下的资源
- MSN协议分析摘录
- 智能指针(OSG源码摘录)
- prototype.js部分源码摘录
- .net源码摘录,已展开
- gdx无法更新
- 【gdx ashley】入门
- gdx 游戏线程
- gdx camera详解
- gdx 播放 sound 失败
- 源码与tarball套件管理程序笔记摘录
- 勘误《STL源码剖析》——摘录
- Java HashMap 核心源码解读<摘录>
- C#源码匹配常用正则表达式(摘录)
- 摘录
- 摘录
- 安装、卸载和删除windows服务
- 雪崩处理
- Android ListView addScrapView ArrayIndexOutOfBoundsException
- php5.3/php5.4与之前的版本差异以及(php5.2x/php5.4x性能对比)
- 等你,等到菊花盛开
- gdx 源码分析摘录
- springMVC js等文件找不到错误
- Win8系统怎么调整字体大小
- pray例子----------------------获取时间,碰触背景键盘消失
- DLL注入技术之劫持进程创建注入
- 分组密码
- 整体代码缩进
- latch: cache buffers chains等待导致CPU100%
- SpannableStringBuilder 和 SpannableString(转)