use of org.fairphone.launcher.edgeswipe.ui.EditFavoritesGridView.OnEditFavouritesIconDraggedListener in project Fairphone by Kwamecorp.
the class EditFavoritesActivity method setupAllAppsList.
/**
* Setup the list with all the apps installed on the device.
*/
private void setupAllAppsList() {
mAllAppsGridView = (EditFavoritesGridView) findViewById(R.id.allAppsGridView);
mAllAppsListAdapter = new AllAppsListAdapter(this);
mAllAppsListAdapter.setAllApps(mAllApps);
mAllAppsGridView.setLongClickable(true);
mAllAppsGridView.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View v, int position, long id) {
startDraggingIcon(v, position);
return true;
}
});
mAllAppsGridView.setOnEditFavouritesIconDraggedListener(new OnEditFavouritesIconDraggedListener() {
@Override
public void OnEditFavouritesIconDragged(AdapterView<?> parent, View view, int position, long id) {
startDraggingIcon(view, position);
}
});
mAllAppsGridView.setAdapter(mAllAppsListAdapter);
// set the drag listener to enable favorite icon removal
View allAppsGroupView = findViewById(R.id.allAppsGroup);
allAppsGroupView.setOnDragListener(new DropDragEventListener(this, mFavIcons, mSelectedApps, mAllApps, true));
}
Aggregations