File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
app/src/main/java/com/owncloud/android/ui/adapter Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ interface CommonOCFileListAdapterInterface {
3333 fun removeCheckedFile (file : OCFile )
3434 fun notifyItemChanged (file : OCFile )
3535 fun getFilesCount (): Int
36- fun setMultiSelect (boolean : Boolean )
36+ fun setMultiSelect (isMultiSelect : Boolean )
3737 fun clearCheckedItems ()
3838 fun selectAll (value : Boolean )
3939}
Original file line number Diff line number Diff line change @@ -314,9 +314,28 @@ class GalleryAdapter(
314314 }
315315 }
316316
317+ /* *
318+ * Enables or disables multi-select mode in the gallery.
319+ *
320+ * When multi-select mode is enabled:
321+ * - Checkboxes are shown for all items.
322+ * - Users can select multiple files.
323+ *
324+ * When multi-select mode is disabled:
325+ * - Checkboxes are hidden.
326+ * - Selected files remain visually unselected.
327+ *
328+ * Note:
329+ * - This function is only called when the user explicitly enters or exits multi-select mode.
330+ * It is **not** called for individual file selection or deselection.
331+ * - The entire adapter is refreshed using [notifyDataSetChanged] to properly show or hide
332+ * checkboxes across all rows, as individual item updates are not sufficient in this case.
333+ *
334+ * @param isMultiSelect true to enable multi-select mode, false to disable it.
335+ */
317336 @SuppressLint(" NotifyDataSetChanged" )
318- override fun setMultiSelect (boolean : Boolean ) {
319- ocFileListDelegate.isMultiSelect = boolean
337+ override fun setMultiSelect (isMultiSelect : Boolean ) {
338+ ocFileListDelegate.isMultiSelect = isMultiSelect
320339 notifyDataSetChanged()
321340 }
322341
You can’t perform that action at this time.
0 commit comments