diff --git a/app/src/main/java/com/anytypeio/anytype/ui/editor/EditorFragment.kt b/app/src/main/java/com/anytypeio/anytype/ui/editor/EditorFragment.kt index 911cd2fb3a..0c98438afa 100644 --- a/app/src/main/java/com/anytypeio/anytype/ui/editor/EditorFragment.kt +++ b/app/src/main/java/com/anytypeio/anytype/ui/editor/EditorFragment.kt @@ -145,6 +145,8 @@ import com.anytypeio.anytype.ui.relations.RelationTextValueFragment import com.anytypeio.anytype.ui.relations.RelationValueFragment import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.snackbar.Snackbar +import javax.inject.Inject +import kotlin.math.abs import kotlinx.coroutines.Job import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.delay @@ -157,8 +159,6 @@ import kotlinx.coroutines.flow.mapLatest import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch import timber.log.Timber -import javax.inject.Inject -import kotlin.math.abs open class EditorFragment : NavigationFragment(R.layout.fragment_editor), OnFragmentInteractionListener, @@ -1076,9 +1076,9 @@ open class EditorFragment : NavigationFragment(R.layout.f } is Command.OpenObjectSnackbar -> { binding.root.showActionableSnackBar( - getFrom(), - command.text, - command.icon, + from = command.fromText, + to = command.toText, + icon = command.icon, middleString = R.string.snack_move_to ) { if (command.isSet) { diff --git a/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/EditorViewModel.kt b/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/EditorViewModel.kt index 037eccbc8d..8c12fa7d06 100644 --- a/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/EditorViewModel.kt +++ b/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/EditorViewModel.kt @@ -5069,7 +5069,15 @@ class EditorViewModel( blocks = blocks, position = Position.BOTTOM, onSuccess = { - dispatch(Command.OpenObjectSnackbar(id = target, text, icon, isSet)) + dispatch( + Command.OpenObjectSnackbar( + id = target, + fromText = "${blocks.size} block${if (blocks.size > 1) "s" else ""} ", + toText = text, + icon, + isSet + ) + ) } ) ) diff --git a/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/editor/Command.kt b/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/editor/Command.kt index c5bcd0fcd2..b4d3e2d4d4 100644 --- a/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/editor/Command.kt +++ b/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/editor/Command.kt @@ -36,7 +36,8 @@ sealed class Command { data class OpenObjectSnackbar( val id: Id, - val text: String, + val fromText: String, + val toText: String, val icon: ObjectIcon, val isSet: Boolean, ) : Command()