1.LauncherApplication的作用意义分析
概括:LauncherApplication属于自定义的Application类,并在AndroidManifest.xml里指定了自定义Application类,如下:
<application
android:name="com.android.launcher2.LauncherApplication"
android:process="@string/process"
android:label="@string/application_name"
android:icon="@drawable/ic_launcher_home">
</application>
作用:
a.创建全局使用的应用程序快捷方式的缓存.
IconCache,即在LauncherApplication中创建.
b.创建全局使用的数据库加载类LauncherModel.
c.为LauncherModel注册package remove,update相关的Boradcast.为LauncherModel 注册favorites 修改的observer.
// Register intent receivers
IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
filter.addDataScheme("package");
registerReceiver(mModel, filter);
filter = new IntentFilter();
filter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
filter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE);
registerReceiver(mModel, filter);
// Register for changes to the favorites
ContentResolver resolver = getContentResolver();
resolver.registerContentObserver(LauncherSettings.Favorites.CONTENT_URI, true,
mFavoritesObserver);
d.提供全局使用的LauncherModel的入口.
LauncherModel getModel() {
return mModel;
}
e.(父类)提供获取PackageManager,Resource,相关资源的方法.
LauncherModel.java
app.getPackageManager().getDefaultActivityIcon();
app.getResources().getInteger();
f.提供Context作用.
2.IconCache
概括:
这个类是提供系统全局使用的应用程序基本信息(title,icon)的缓存信息.这样每次使用的时候都能够从系统里很快得到.
作用:
a.声明内部类对应存储应用程序的基本信息,因为home的作用就是需要展现这些东西。
private static class CacheEntry {
public Bitmap icon;
public String title;
public Bitmap titleBitmap;
}
b.提供应用程序的默认图标.
private Bitmap makeDefaultIcon();
c.提供全局的缓存信息.
private final HashMap<ComponentName, CacheEntry> mCache;
3.LauncherModel
概括:
在程序包,以及程序的快捷方式更改,添加时,更新数据库的表。加载更新workspace,all apps view的程序及快捷方式.
作用:
a.声明接口Callbacks,提供了一系列加载程序及快捷方式的抽象方法.
public interface Callbacks {
public boolean setLoadOnResume();
public int getCurrentWorkspaceScreen();
public void startBinding();
public void bindItems(ArrayList<ItemInfo> shortcuts, int start, int end);
public void bindFolders(HashMap<Long,FolderInfo> folders);
public void finishBindingItems();
public void bindAppWidget(LauncherAppWidgetInfo info);
public void bindAllApplications(ArrayList<ApplicationInfo> apps);
public void bindAppsAdded(ArrayList<ApplicationInfo> apps);
public void bindAppsUpdated(ArrayList<ApplicationInfo> apps);
public void bindAppsRemoved(ArrayList<ApplicationInfo> apps, boolean permanent);
public boolean isAllAppsVisible();
}
分享到:
相关推荐
赠送jar包:junit-platform-launcher-1.8.0-M1.jar; 赠送原API文档:junit-platform-launcher-1.8.0-M1-javadoc.jar; 赠送源代码:junit-platform-launcher-1.8.0-M1-sources.jar; 赠送Maven依赖信息文件:junit-...
junit-platform-launcher-1.7.0.jarjunit-platform-launcher-1.7.0.jar
spark-launcher_2.11-2.1.3-SNAPSHOT.jar
系统桌面-RELEASE-4.26.3.4214-123117.apk
赠送jar包:junit-platform-launcher-1.8.0-M1.jar; 赠送原API文档:junit-platform-launcher-1.8.0-M1-javadoc.jar; 赠送源代码:junit-platform-launcher-1.8.0-M1-sources.jar; 赠送Maven依赖信息文件:junit-...
匹配mirth3.9server
[INFO] hadoop-yarn-applications-unmanaged-am-launcher .... SUCCESS [2.152s] [INFO] hadoop-yarn-site .................................. SUCCESS [0.140s] [INFO] hadoop-yarn-project ........................
ant.jar,ant-junit.jar,ant-launcher.jar,ant-trax.jar
python库,解压后可用。 资源全名:python_embedded_launcher-0.5.1-py2.py3-none-any.whl
赠送jar包:junit-platform-launcher-1.6.1.jar; 赠送原API文档:junit-platform-launcher-1.6.1-javadoc.jar; 赠送源代码:junit-platform-launcher-1.6.1-sources.jar; 赠送Maven依赖信息文件:junit-platform-...
junit-platform-launcher-1.6.2.jarjunit-platform-launcher-1.6.2.jarjunit-platform-launcher-1.6.2.jar
ant-launcher-1.7.1.jar ant-launcher-1.7.1.jar ant-launcher-1.7.1.jar ant-launcher-1.7.1.jar ant-launcher-1.7.1.jar
[INFO] hadoop-yarn-applications-unmanaged-am-launcher .... SUCCESS [2.152s] [INFO] hadoop-yarn-site .................................. SUCCESS [0.140s] [INFO] hadoop-yarn-project ........................
标签:ant-launcher-1.7.0.jar.zip,ant,launcher,1.7.0,jar.zip包下载,依赖包
maven-osgi-plugin-launcher-framework-knopflerfish-1.0.8b.jar
maven-osgi-plugin-launcher-framework-equinox-1.0.8b.jar
资源来自pypi官网。 资源全名:python_embedded_launcher-0.5.1-py2.py3-none-any.whl
launcher-v3-master-源码.rar
标签:ant-launcher-1.8.3.jar,ant,launcher,1.8.3,jar包下载,依赖包
标签:ant-launcher-1.7.1.jar.zip,ant,launcher,1.7.1,jar.zip包下载,依赖包