Java Code Examples for androidx.recyclerview.widget.RecyclerView#OnItemTouchListener

The following examples show how to use androidx.recyclerview.widget.RecyclerView#OnItemTouchListener . 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: DownloadsInProgress.java    From Beedio with GNU General Public License v2.0 5 votes vote down vote up
@SuppressLint("ClickableViewAccessibility")
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    if (Utils.isServiceRunning(DownloadManager.class, getActivity().getApplicationContext())) {
        downloadsStartPauseButton.setText(R.string.pause);
        getAdapter().unpause();
        tracking.startTracking();
    } else {
        downloadsStartPauseButton.setText(R.string.start);
        getAdapter().pause();
        tracking.stopTracking();
    }

    downloadRearranger = new DownloadRearranger(getActivity(), this);
    downloadsListItemTouchDisabler = new RecyclerView.OnItemTouchListener() {
        @Override
        public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
            return true;
        }

        @Override
        public void onTouchEvent(RecyclerView rv, MotionEvent e) {

        }

        @Override
        public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {

        }
    };
}
 
Example 2
Source File: OptimumRecyclerView.java    From RvHelper with Apache License 2.0 4 votes vote down vote up
/**
 * Add the onItemTouchListener for the recycler
 */

public void addOnItemTouchListener(RecyclerView.OnItemTouchListener listener) {
    mRecyclerView.addOnItemTouchListener(listener);
}
 
Example 3
Source File: OptimumRecyclerView.java    From RvHelper with Apache License 2.0 4 votes vote down vote up
/**
 * Remove the onItemTouchListener for the recycler
 */
public void removeOnItemTouchListener(RecyclerView.OnItemTouchListener listener) {
    mRecyclerView.removeOnItemTouchListener(listener);
}
 
Example 4
Source File: UltimateRecyclerView.java    From UltimateRecyclerView with Apache License 2.0 4 votes vote down vote up
public void addOnItemTouchListener(RecyclerView.OnItemTouchListener listener) {
    mRecyclerView.addOnItemTouchListener(listener);
}
 
Example 5
Source File: UltimateRecyclerView.java    From UltimateRecyclerView with Apache License 2.0 4 votes vote down vote up
public void removeOnItemTouchListener(RecyclerView.OnItemTouchListener listener) {
    mRecyclerView.removeOnItemTouchListener(listener);
}
 
Example 6
Source File: DragDropTouchDragListener.java    From RecyclerViewExtensions with MIT License 4 votes vote down vote up
public DragDropTouchDragListener(RecyclerView.OnItemTouchListener onItemTouchListener) {
    this.onItemTouchListener = onItemTouchListener;
}