Skip to content

Commit

Permalink
ArkFilePickerViewModel: pinFile -> pinFolder
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrlzy committed Dec 27, 2024
1 parent beda289 commit c17719b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import com.mikepenz.fastadapter.binding.AbstractBindingItem
import dev.arkbuilders.arklib.utils.DeviceStorageUtils
import dev.arkbuilders.arklib.utils.INTERNAL_STORAGE
import org.orbitmvi.orbit.viewmodel.observe
import dev.arkbuilders.components.filepicker.R
import dev.arkbuilders.components.filepicker.databinding.ArkFilePickerDialogNewFolderBinding
import dev.arkbuilders.components.filepicker.databinding.ArkFilePickerHostFragmentBinding
import dev.arkbuilders.components.filepicker.databinding.ArkFilePickerItemFileBinding
Expand Down Expand Up @@ -211,7 +210,7 @@ open class ArkFilePickerFragment :

if (newFolder.mkdirs()) {
if (isARKMode()) {
viewModel.pinFile(newFolder.toPath())
viewModel.pinFolder(newFolder.toPath())
}
//Reload current files tree
currentFolder?.let { viewModel.onItemClick(it) }
Expand Down Expand Up @@ -486,7 +485,7 @@ internal class FilesPage(
val popupMenu = PopupMenu(fragment.activity, anchor, Gravity.END)
popupMenu.menuInflater.inflate(R.menu.file_select_menu, popupMenu.menu)
popupMenu.setOnMenuItemClickListener {
viewModel.pinFile(file)
viewModel.pinFolder(file)
true
}
popupMenu.show()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import org.orbitmvi.orbit.viewmodel.container
import dev.arkbuilders.arklib.data.folders.FoldersRepo
import dev.arkbuilders.arklib.utils.DeviceStorageUtils
import dev.arkbuilders.arklib.utils.listChildren
import dev.arkbuilders.components.utils.hasNestedOrParentalRoot
import dev.arkbuilders.components.utils.hasNestedRoot
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
Expand Down Expand Up @@ -183,7 +182,7 @@ internal class ArkFilePickerViewModel(
return arkGlobal?.exists() == true
}

fun pinFile(file: Path) = intent {
fun pinFolder(file: Path) = intent {
if (!file.isDirectory()) {
postSideEffect(FilePickerSideEffect.CannotPinFile)
return@intent
Expand Down

0 comments on commit c17719b

Please sign in to comment.