android 11.0 Launcher3长按拖拽时,获取当前是哪一屏,获取当前多少个应用图标

在11.0定制化开发手机项目中,如果专门适配老年机的时候,这时客户提出要求,如果最后一屏未满时,不让拖拽到后面一屏的空屏中
这样就需要获取当前是哪一屏,并且要知道当前有多少个Item,总共一屏最多多少个item
所以就需要从Workspace.java入手
首选来看源码 开始拖拽时会调用startDrag()

public void startDrag(CellLayout.CellInfo cellInfo, DragOptions options) {
   
    
    
View child = cellInfo.cell;
mDragInfo = cellInfo;
child.setVisibility(INVISIBLE);
if (options.isAccessibleDrag) {
   
    
    

猜你喜欢

转载自blog.csdn.net/baidu_41666295/article/details/124828360