From 175a2421dd01b2b740dc5e2699994632bf82c334 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 13 Dec 2024 09:06:39 +0100 Subject: [PATCH] spotless Signed-off-by: tobiasKaminsky --- .../ui/trashbinFileActions/TrashbinFileAction.kt | 2 +- .../TrashbinFileActionsBottomSheet.kt | 7 ++----- .../TrashbinFileActionsViewModel.kt | 12 +++--------- .../owncloud/android/ui/trashbin/TrashbinActivity.kt | 9 ++++++--- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileAction.kt b/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileAction.kt index e86c8260e4..9054e8f443 100644 --- a/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileAction.kt +++ b/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileAction.kt @@ -26,7 +26,7 @@ enum class TrashbinFileAction(@IdRes val id: Int, @StringRes val title: Int, @Dr DELETE_PERMANENTLY, RESTORE, SELECT_ALL, - SELECT_NONE, + SELECT_NONE ) } } diff --git a/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileActionsBottomSheet.kt b/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileActionsBottomSheet.kt index 7a5d07d978..d90abb75b1 100644 --- a/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileActionsBottomSheet.kt +++ b/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileActionsBottomSheet.kt @@ -220,14 +220,11 @@ class TrashbinFileActionsBottomSheet : BottomSheetDialogFragment(), Injectable { private const val RESULT_KEY_ACTION_ID = "RESULT_KEY_ACTION_ID" @JvmStatic - fun newInstance( - numberOfAllFiles: Int, - files: Collection, - ): TrashbinFileActionsBottomSheet { + fun newInstance(numberOfAllFiles: Int, files: Collection): TrashbinFileActionsBottomSheet { return TrashbinFileActionsBottomSheet().apply { val argsBundle = bundleOf( TrashbinFileActionsViewModel.ARG_ALL_FILES_COUNT to numberOfAllFiles, - TrashbinFileActionsViewModel.ARG_FILES to ArrayList(files), + TrashbinFileActionsViewModel.ARG_FILES to ArrayList(files) ) arguments = argsBundle } diff --git a/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileActionsViewModel.kt b/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileActionsViewModel.kt index d7cbc9bd17..fe4f6d6a76 100644 --- a/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileActionsViewModel.kt +++ b/app/src/main/java/com/nextcloud/ui/trashbinFileActions/TrashbinFileActionsViewModel.kt @@ -29,7 +29,7 @@ class TrashbinFileActionsViewModel @Inject constructor( data object Error : UiState data class LoadedForSingleFile( val actions: List, - val titleFile: TrashbinFile?, + val titleFile: TrashbinFile? ) : UiState data class LoadedForMultipleFiles(val actions: List, val fileCount: Int) : UiState @@ -56,10 +56,7 @@ class TrashbinFileActionsViewModel @Inject constructor( } } - private fun load( - files: Collection, - numberOfAllFiles: Int?, - ) { + private fun load(files: Collection, numberOfAllFiles: Int?) { viewModelScope.launch(Dispatchers.IO) { val toHide = getHiddenActions(numberOfAllFiles, files) val availableActions = getActionsToShow(toHide) @@ -67,10 +64,7 @@ class TrashbinFileActionsViewModel @Inject constructor( } } - private fun getHiddenActions( - numberOfAllFiles: Int?, - files: Collection, - ): List { + private fun getHiddenActions(numberOfAllFiles: Int?, files: Collection): List { numberOfAllFiles?.let { if (files.size >= it) { return listOf(R.id.action_select_all_action_menu) diff --git a/app/src/main/java/com/owncloud/android/ui/trashbin/TrashbinActivity.kt b/app/src/main/java/com/owncloud/android/ui/trashbin/TrashbinActivity.kt index 98e51cb7dd..aa16d47b88 100644 --- a/app/src/main/java/com/owncloud/android/ui/trashbin/TrashbinActivity.kt +++ b/app/src/main/java/com/owncloud/android/ui/trashbin/TrashbinActivity.kt @@ -178,7 +178,9 @@ class TrashbinActivity : handleOnBackPressed() mMultiChoiceModeListener = MultiChoiceModeListener( - this, trashbinListAdapter, viewThemeUtils, + this, + trashbinListAdapter, + viewThemeUtils ) { filesCount, checkedFiles -> openActionsMenu(filesCount, checkedFiles) } addDrawerListener(mMultiChoiceModeListener) } @@ -373,7 +375,8 @@ class TrashbinActivity : TrashbinFileActionsBottomSheet.newInstance(filesCount, checkedFiles) .setResultListener( - supportFragmentManager, this + supportFragmentManager, + this ) { id: Int -> onFileActionChosen( id, @@ -533,7 +536,7 @@ class TrashbinActivity : val inflater: MenuInflater = activity.menuInflater inflater.inflate(R.menu.custom_menu_placeholder, menu) val item = menu.findItem(R.id.custom_menu_placeholder_item) - item.icon?.let{ + item.icon?.let { item.setIcon( viewThemeUtils.platform.colorDrawable( it,