Beispiel #1
0
        public override void SetSelection(int position)
        {
            bool same = false;

            if (position == SelectedItemPosition)
            {
                same = true;
            }
            base.SetSelection(position);
            //the same value selected will not raised the event in the built-in control
            //to handle the other option we need to raise it even if already selected
            if (same &&
                OnItemSelectedListener != null)
            {
                OnItemSelectedListener.OnItemSelected(this, SelectedView, position, SelectedItemId);
            }
        }
 public void AddOnItemSelectedListener(OnItemSelectedListener listener)
 => this.listener = listener;
 public MySimpleOnGestureListener(RecyclerView rv, OnItemSelectedListener listener)
 {
     Rv       = rv;
     Listener = listener;
 }