MiniumApps/launcher3/src/main/java/co/siempo/phone/activities/NoteListActivity.java
/**
     * During multi-choice menu_delete selection mode, callback method if items checked changed
     *
     * @param mode     ActionMode of selection
     * @param position Position checked
     * @param id       ID of item, if exists
     * @param checked  true if checked, false otherwise
     */
During multi-choice menu_delete selection mode, callback method if items checked changed
@param mode     ActionMode of selection
@param position Position checked
@param id       ID of item, if exists
@param checked  true if checked, false otherwise
During multi - choice menu_delete selection mode callback method if items checked changed @param mode ActionMode of selection @param position Position checked @param id ID of item if exists @param checked true if checked false otherwise
@Override
    public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) {
        if (checked)
            checkedArray.add(position);
        else {
            int index = -1;
            for (int i = 0; i < checkedArray.size(); i++) {
                if (position == checkedArray.get(i)) {
                    index = i;
                    break;
                }
            }
            if (index != -1)
                checkedArray.remove(index);
        }
        mode.setTitle(checkedArray.size() + " " + getString(R.string.label_selected));
        adapter.notifyDataSetChanged();
    }
@ Override public void onItemCheckedStateChanged ( ActionMode mode , int position , long id , boolean checked ) { if ( checked ) checkedArray . add ( position ) ; else { int index = - 1 ; for ( int i = 0 ; i < checkedArray . size ( ) ; i ++ ) { if ( position == checkedArray . get ( i ) ) { index = i ; break ; } } if ( index != - 1 ) checkedArray . remove ( index ) ; } mode . setTitle ( checkedArray . size ( ) + " " + getString ( R . string . label_selected ) ) ; adapter . notifyDataSetChanged ( ) ; }
During multi-choice menu_delete selection mode, callback method if items checked changed
 @param mode     ActionMode of selection
 @param position Position checked
 @param id       ID of item, if exists
 @param checked  true if checked, false otherwise
During multi - choice menu_delete selection mode callback method if items checked changed @param mode ActionMode of selection @param position Position checked @param id ID of item if exists @param checked true if checked false otherwise
// If item checked -> add to array // If item unchecked // Loop through array and find currentIndexDashboard of item unchecked // If currentIndexDashboard was found -> remove the item // Set Toolbar title to 'x Selected'