Search in sources :

Example 1 with OnEditFavouritesIconDraggedListener

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));
}
Also used : OnEditFavouritesIconDraggedListener(org.fairphone.launcher.edgeswipe.ui.EditFavoritesGridView.OnEditFavouritesIconDraggedListener) EditFavoritesGridView(org.fairphone.launcher.edgeswipe.ui.EditFavoritesGridView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) OnItemLongClickListener(android.widget.AdapterView.OnItemLongClickListener) Point(android.graphics.Point)

Aggregations

Point (android.graphics.Point)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 OnItemLongClickListener (android.widget.AdapterView.OnItemLongClickListener)1 TextView (android.widget.TextView)1 EditFavoritesGridView (org.fairphone.launcher.edgeswipe.ui.EditFavoritesGridView)1 OnEditFavouritesIconDraggedListener (org.fairphone.launcher.edgeswipe.ui.EditFavoritesGridView.OnEditFavouritesIconDraggedListener)1