Search in sources :

Example 11 with OnItemLongClickListener

use of android.widget.AdapterView.OnItemLongClickListener 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

View (android.view.View)11 AdapterView (android.widget.AdapterView)11 OnItemLongClickListener (android.widget.AdapterView.OnItemLongClickListener)11 ListView (android.widget.ListView)9 TextView (android.widget.TextView)9 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)6 Intent (android.content.Intent)4 OnClickListener (android.view.View.OnClickListener)4 ImageView (android.widget.ImageView)4 DialogInterface (android.content.DialogInterface)2 SharedPreferences (android.content.SharedPreferences)2 ConfirmDialog (org.csploit.android.gui.dialogs.ConfirmDialog)2 ConfirmDialogListener (org.csploit.android.gui.dialogs.ConfirmDialog.ConfirmDialogListener)2 ErrorDialog (org.csploit.android.gui.dialogs.ErrorDialog)2 ActionBar (android.app.ActionBar)1 AlertDialog (android.app.AlertDialog)1 PendingIntent (android.app.PendingIntent)1 ActivityNotFoundException (android.content.ActivityNotFoundException)1 IntentFilter (android.content.IntentFilter)1 DataSetObserver (android.database.DataSetObserver)1