Launcher.java
public boolean onLongClick(View v) {
...
CellLayout.CellInfo longClickCellInfo = null;
View itemUnderLongClick = null;
if (v.getTag() instanceof ItemInfo) {
ItemInfo info = (ItemInfo) v.getTag();
longClickCellInfo = new CellLayout.CellInfo(v, info);;
itemUnderLongClick = longClickCellInfo.cell;
resetAddInfo();
}
/*chc add */ 在此处进行判断是否在hotseat进行长按
boolean isHotseatbutten=false;
if(longClickCellInfo!=null){
isHotseatbutten= longClickCellInfo.container==-100? false:true; //每一个Icon都有一个container的属性
//hostSeat:是-101 其他的是-100
}
if(isHotseatbutten){
return false;
}
/*chc end*/
final boolean inHotseat = isHotseatLayout(v); //不知为何原因 此isHotseatLayout(v)并不能判断时候在hotseat区域
...
return true;
}
禁止文件夹的形成
Workspace.java
boolean createUserFolderIfNecessary(View newView, long container, CellLayout target,
int[] targetCell, float distance, boolean external, DragView dragView,
Runnable postAnimationRunnable) {
...
/*chc add*/
if(container==-101){
return false;
}
/*chc end*/
...
}