Java Code Examples for android.widget.AbsListView#setOnItemLongClickListener()

The following examples show how to use android.widget.AbsListView#setOnItemLongClickListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MultiSelectionUtil.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
private Controller(AbsListView listView, AppCompatActivity activity,
        MultiChoiceModeListener listener) {
    mListView = listView;
    mActivity = activity;
    mListener = listener;
    mCallbacks = new Callbacks();
    // We set ourselves as the OnItemLongClickListener so we know when to start
    // an Action Mode
    listView.setOnItemLongClickListener(mCallbacks);
}
 
Example 2
Source File: MultiSelectionUtil.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
private Controller(AbsListView listView, AppCompatActivity activity,
        MultiChoiceModeListener listener) {
    mListView = listView;
    mActivity = activity;
    mListener = listener;
    mCallbacks = new Callbacks();
    // We set ourselves as the OnItemLongClickListener so we know when to start
    // an Action Mode
    listView.setOnItemLongClickListener(mCallbacks);
}
 
Example 3
Source File: MultiSelectionUtil.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
private Controller(AbsListView listView, AppCompatActivity activity,
        MultiChoiceModeListener listener) {
    mListView = listView;
    mActivity = activity;
    mListener = listener;
    mCallbacks = new Callbacks();
    // We set ourselves as the OnItemLongClickListener so we know when to start
    // an Action Mode
    listView.setOnItemLongClickListener(mCallbacks);
}
 
Example 4
Source File: ArcaSimpleAdapterFragment.java    From arca-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
    final View view = inflater.inflate(FragmentUtils.getFragmentLayout(this.getClass()), container, false);
    final AbsListView listView = (AbsListView) view.findViewById(getAdapterViewId());
    listView.setOnItemLongClickListener(this);
    listView.setOnItemClickListener(this);
    return view;
}
 
Example 5
Source File: ArcaSimpleAdapterSupportFragment.java    From arca-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
    final View view = inflater.inflate(FragmentUtils.getFragmentLayout(this.getClass()), container, false);
    final AbsListView listView = (AbsListView) view.findViewById(getAdapterViewId());
    listView.setOnItemLongClickListener(this);
    listView.setOnItemClickListener(this);
    return view;
}
 
Example 6
Source File: AbsListViewExampleActivity.java    From Paginate with Apache License 2.0 4 votes vote down vote up
@Override
protected void setupPagination() {
    if (paginate != null) {
        paginate.unbind();
    }
    handler.removeCallbacks(fakeCallback);
    adapter = new PersonAdapter(this, DataProvider.getRandomData(20));
    loading = false;
    page = 0;

    int layoutId;
    switch (absListViewType) {
        case LIST_VIEW:
            layoutId = R.layout.listview_layout;
            break;
        case GRID_VIEW:
            layoutId = R.layout.gridview_layout;
            break;
        default:
            layoutId = R.layout.listview_layout;
            break;
    }

    getContainer().removeAllViews();
    LayoutInflater.from(this).inflate(layoutId, getContainer(), true);

    AbsListView absListView = (AbsListView) findViewById(R.id.abs_list_view);
    if ((absListView instanceof ListView) && useHeaderAndFooter) {
        ListView listView = (ListView) absListView;
        listView.addHeaderView(LayoutInflater.from(this).inflate(R.layout.list_view_header, absListView, false));
        listView.addFooterView(LayoutInflater.from(this).inflate(R.layout.list_view_footer, absListView, false));
    }

    absListView.setAdapter(adapter);
    absListView.setOnItemClickListener(this);
    absListView.setOnItemLongClickListener(this);

    paginate = Paginate.with(absListView, this)
            .setOnScrollListener(this)
            .setLoadingTriggerThreshold(threshold)
            .addLoadingListItem(addLoadingRow)
            .setLoadingListItemCreator(customLoadingListItem ? new CustomLoadingListItemCreator() : null)
            .build();
}
 
Example 7
Source File: AbsListViewQuickReturnAttacher.java    From QuickReturn with MIT License 4 votes vote down vote up
public AbsListViewQuickReturnAttacher(AbsListView listView) {
  this.absListView = listView;
  listView.setOnScrollListener(onScrollListener);
  listView.setOnItemClickListener(this);
  listView.setOnItemLongClickListener(this);
}