【android launcher2开发之有抽屉改成无抽屉】天下之事常成于困约,而败于奢靡。这篇文章主要讲述android launcher2开发之有抽屉改成无抽屉相关的知识,希望能为你提供帮助。
在launcher.java中在createShortcut方法中
屏蔽全部应用button
修改之前
View createShortcut(int layoutResId, ViewGroup parent, ShortcutInfo info) {
BubbleTextView favorite = (BubbleTextView) mInflater.inflate(
layoutResId, parent, false);
favorite.applyFromShortcutInfo(info, mIconCache);
favorite.setOnClickListener(this);
if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS
&
&
info.getIcon(mIconCache) == null) {
// All apps icon
// Drawable d =
// getResources().getDrawable(R.drawable.all_apps_button_icon);
Drawable d = mHotseat.getAppsButtonBitmap();
// qijinling
Utilities.resizeIconDrawable(d);
favorite.setCompoundDrawables(null, d, null, null);
favorite.setOnTouchListener(getHapticFeedbackTouchListener());
}
Utilities.applyTypeface(favorite);
return favorite;
}
修改之后
*/
View createShortcut(int layoutResId, ViewGroup parent, ShortcutInfo info) {
BubbleTextView favorite = (BubbleTextView) mInflater.inflate(
layoutResId, parent, false);
favorite.applyFromShortcutInfo(info, mIconCache);
favorite.setOnClickListener(this);
if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS
&
&
info.getIcon(mIconCache) == null) {
// All apps icon
Drawable d = getResources().getDrawable(
R.drawable.all_apps_button_icon);
// 隐藏菜单
favorite.setWidth(0);
favorite.setHeight(0);
favorite.setVisibility(View.GONE);
Utilities.resizeIconDrawable(d);
favorite.setCompoundDrawables(null, d, null, null);
favorite.setOnTouchListener(getHapticFeedbackTouchListener());
}
Utilities.applyTypeface(favorite);
return favorite;
}
然后在AppsCustomizePagedView类中 找到DISABLE_ALL_APPS 属性
//无抽屉true
同理反之
public static boolean DISABLE_ALL_APPS = true;
属性设置 TRUE 或者FAULE
推荐阅读
- Android system ( Led class 节点添加)
- Android实现夜间模式小结
- Hadoop-2.4.1学习之怎样确定Mapper数量
- Android开发之JNI--HelloWorld及遇到的错误解析
- android应用多线程守护让你非常难杀死它
- android之Activity的生命周期
- 掌上快递 APP 项目之概述篇
- Android新浪微博client——主框架搭建
- android IntentService生命周期问题