01.
private
void
setupViews() {
02.
mDragLayer = (DragLayer) findViewById(R.id.drag_layer);
03.
final
DragLayer dragLayer = mDragLayer;
04.
05.
mWorkspace = (Workspace) dragLayer.findViewById(R.id.workspace);
06.
final
Workspace workspace = mWorkspace;
07.
08.
/*mDrawer = (SlidingDrawer) dragLayer.findViewById(R.id.drawer);
09.
final SlidingDrawer drawer = mDrawer;*/
10.
11.
mAllAppsGrid = (AllAppsGridView) dragLayer.findViewById(R.id.content);
12.
dock_view=(DockView)dragLayer.findViewById(R.id.dock_view);
13.
14.
dock_view.setLauncher(
this
);
15.
dock_view.setDragger(mDragLayer);
16.
dock_view.init();
17.
18.
//mAllAppsGrid.setVisibility(View.GONE);
19.
final
AllAppsGridView grid = mAllAppsGrid;
20.
21.
final
DeleteZone deleteZone = (DeleteZone) dragLayer.findViewById(R.id.delete_zone);
22.
23.
mHandleView = (HandleView) dragLayer.findViewById(R.id.all_apps);
24.
mHandleView.setLauncher(
this
);
25.
//mHandleIcon = (TransitionDrawable) mHandleView.getDrawable();
26.
//mHandleIcon.setCrossFadeEnabled(true);
27.
28.
//author:jezz
29.
main_apps=(RelativeLayout)dragLayer.findViewById(R.id.main_apps);
30.
home=(ImageView)dragLayer.findViewById(R.id.all_home);
31.
32.
main_apps.setVisibility(View.GONE);
33.
mHandleView.setOnClickListener(
new
OnClickListener() {
34.
public
void
onClick(View v) {
35.
onMainOpened(
true
);
36.
37.
}
38.
});
39.
home.setOnClickListener(
new
OnClickListener() {
40.
public
void
onClick(View v) {
41.
onMainClosed(
true
);
42.
}
43.
});
44.
45.
/*drawer.lock();
46.
final DrawerManager drawerManager = new DrawerManager();
47.
drawer.setOnDrawerOpenListener(drawerManager);
48.
drawer.setOnDrawerCloseListener(drawerManager);
49.
drawer.setOnDrawerScrollListener(drawerManager);*/
50.
51.
grid.setTextFilterEnabled(
false
);
52.
grid.setDragger(dragLayer);
53.
grid.setLauncher(
this
);
54.
55.
workspace.setOnLongClickListener(
this
);
56.
workspace.setDragger(dragLayer);
57.
workspace.setLauncher(
this
);
58.
59.
deleteZone.setLauncher(
this
);
60.
deleteZone.setDragController(dragLayer);
61.
deleteZone.setHandle(mHandleView);
62.
63.
dragLayer.setIgnoredDropTarget(grid);
64.
dragLayer.setDragScoller(workspace);
65.
dragLayer.setDragListener(deleteZone);
66.
67.
dragLayer.setDockDragListener(dock_view);
68.
69.
dock_view.setWorkspace(workspace);
70.
}
1.
if
(mListener !=
null
) {
2.
mListener.onDragStart(v, source, dragInfo, dragAction);
3.
}
4.
if
(mDockListener!=
null
){
5.
mDockListener.onDragStart(v, source, dragInfo, dragAction);
6.
}