Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>if you need to disable touch listener on particular row . than this is simple .</p> <p>set a tag on desired list row . in getview list adapter class.</p> <p>e.g : </p> <pre><code>ABCList extends ArrayAdapter&lt;String&gt; { public MyCustomAdapter(Context context, int textViewResourceId, String[] objects) { super(context, textViewResourceId, objects); } @Override public View getView(int position, View convertView, ViewGroup parent) { View row = inflater.inflate(R.layout.history_list_item, parent, false); if(position == YOUR_DESIRED_ROW) row.setTag("disableThisRow") return row; } } </code></pre> <p>then edit touch listener like this.</p> <pre><code> final OnTouchListener flingSwipeListener = new OnTouchListener() { float touchX; float touchY; @Override public boolean onTouch(final View view, final MotionEvent event) { String isRow=view.getTag(); if(isRow.equals("disableThisRow"))return false; if (event.getAction() == MotionEvent.ACTION_DOWN) { touchX = event.getX(); touchY = event.getY(); } else if (event.getAction() == MotionEvent.ACTION_UP) { if (Math.abs(touchY - event.getY()) &gt; SWIPE_MAX_OFF_PATH) return false; // right to left swipe else if (touchX - event.getX() &gt; SWIPE_MIN_DISTANCE){ Log.i("flingSwipe","right to left swipe"); } // left to right swipe else if (event.getX() - touchX &gt; SWIPE_MIN_DISTANCE){ Log.i("flingSwipe","left to right swipe"); } } return true; } }; </code></pre> <p>this will disable touch for disired list item.. hope this helps. or if you more gesture listeners than that will be also similar to this. hope it helps</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload