add: comments for better reference during maintaining

zhengkunpeng_branch
zkx 2 years ago
parent 28b397fd5d
commit d652be7665

@ -34,6 +34,7 @@ import java.util.Iterator;
public class NotesListAdapter extends CursorAdapter { public class NotesListAdapter extends CursorAdapter {
private static final String TAG = "NotesListAdapter"; private static final String TAG = "NotesListAdapter";
private Context mContext; private Context mContext;
/** 键-值对值为true时表示被选中 @zhoukexing 2024/1/2 20:50 */
private HashMap<Integer, Boolean> mSelectedIndex; private HashMap<Integer, Boolean> mSelectedIndex;
private int mNotesCount; private int mNotesCount;
private boolean mChoiceMode; private boolean mChoiceMode;
@ -78,6 +79,17 @@ public class NotesListAdapter extends CursorAdapter {
mChoiceMode = mode; mChoiceMode = mode;
} }
/**
* @method: selectAll
* @description: boolean
* setCheckedItemmSelectedIndex
*
* or
* @date: 2024/1/3 22:36
* @author: zhoukexing
* @param: [checked]
* @return: void
*/
public void selectAll(boolean checked) { public void selectAll(boolean checked) {
Cursor cursor = getCursor(); Cursor cursor = getCursor();
for (int i = 0; i < getCount(); i++) { for (int i = 0; i < getCount(); i++) {
@ -143,6 +155,18 @@ public class NotesListAdapter extends CursorAdapter {
return count; return count;
} }
public int getMNotesCount() {
return mNotesCount;
}
/**
* @method: isAllSelected
* @description: truefalse
* @date: 2024/1/2 20:47
* @author: zhoukexing
* @param: []
* @return: boolean
*/
public boolean isAllSelected() { public boolean isAllSelected() {
int checkedCount = getSelectedCount(); int checkedCount = getSelectedCount();
return (checkedCount != 0 && checkedCount == mNotesCount); return (checkedCount != 0 && checkedCount == mNotesCount);

Loading…
Cancel
Save