(4)Launcher客制化之 workspace长按事件弹出Widgets界面
来源:互联网 发布:php ajax返回html标签 编辑:程序博客网 时间:2024/04/28 01:59
转帖请注明:来自http://blog.csdn.net/xufeifandj
同样修改lancher.java里面文件
OnLongclick事件,因为workspace注册了Launcher,OnLongClick事情。Launcher实现了长按的事件。
因此在 注释掉,进入设置界面代码,替换为,跳转到 Widgets里面即可。直接看代码。
public boolean onLongClick(View v) {
if (!isDraggingEnabled()) return false;
if (isWorkspaceLocked()) return false;
if (mState != State.WORKSPACE) return false;
if (v instanceof Workspace) {
//修改长按显示widgets
showAllApps(true, AppsCustomizePagedView.ContentType.Widgets, true);
return true;
// if (!mWorkspace.isInOverviewMode()) {
// if (mWorkspace.enterOverviewMode()) {
// mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
// HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
//
// return true;
// } else {
// return false;
// }
// }
}
if (!(v instanceof CellLayout)) {
v = (View) v.getParent().getParent();
}
resetAddInfo();
CellLayout.CellInfo longClickCellInfo = (CellLayout.CellInfo) v.getTag();
// This happens when long clicking an item with the dpad/trackball
if (longClickCellInfo == null) {
return true;
}
// The hotseat touch handling does not go through Workspace, and we always allow long press
// on hotseat items.
final View itemUnderLongClick = longClickCellInfo.cell;
boolean allowLongPress = isHotseatLayout(v) || mWorkspace.allowLongPress();
if (allowLongPress && !mDragController.isDragging()) {
if (itemUnderLongClick == null) {
// User long pressed on empty space
// mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
// HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
// // Disabling reordering until we sort out some issues.
// if (mWorkspace.isInOverviewMode()) {
// mWorkspace.startReordering(v);
// } else {
// mWorkspace.enterOverviewMode();
// }
//修改长按显示widgets
showAllApps(true, AppsCustomizePagedView.ContentType.Widgets, true);
} else {
if (!(itemUnderLongClick instanceof Folder)) {
// User long pressed on an item
mWorkspace.startDrag(longClickCellInfo);
}
}
}
return true;
}
- (4)Launcher客制化之 workspace长按事件弹出Widgets界面
- launcher之workspace
- 墨香带你学Launcher之(五)- Workspace滑动
- Launcher桌面点击&长按&拖动事件处理流程分析
- Launcher桌面点击&长按&拖动事件处理流程分析 .
- Launcher桌面点击&长按&拖动事件处理流程分析
- launcher workspace
- Android之ListView长按列表项弹出菜单 给菜单项添加事件 获取上下文
- launcher 长按拖动流程
- Android4.4-Launcher源码分析系列之WorkSpace及屏幕滑动
- listview长按弹出菜单并响应菜单事件
- Launcher长按拖拽流程(三)长按松手简述
- Android之Launcher分析和修改1——Launcher默认界面配置(default_workspace)
- android长按home键源码分析以及模拟长按home事件--弹出近期任务
- android长按home键源码分析以及模拟长按home事件--弹出近期任务.
- Android launcher - Workspace
- Launcher workspace 定制分析
- Launcher workspace 定制分析
- 1156. Binary tree
- 面向对象编程的两顶帽子
- Bayan 2015 Contest Warm Up
- Android开发系列(十四):ListView用法、对ListView监听的三种方法以及ListView中Adapter的使用方法
- 婴幼儿食谱
- (4)Launcher客制化之 workspace长按事件弹出Widgets界面
- Node.js的调试
- 获取安卓百度地图两点间的直线距离并画线
- SQL不同服务器数据库之间的数据操作整理(完整版)
- 关于dll和lib(傻乎乎的我 又学到一点)
- rsh 无秘钥登陆配置
- 养成良好的java编程习惯
- Windows下为eclipse添加"Show in Finder"的功能(右键打开文件目录)
- 闺蜜pk男朋友