1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-10 10:00:44 +09:00

DROID-924 Editor | Fix | Change text to block(s) moved to (#2906)

This commit is contained in:
Mikhail 2023-02-08 17:42:04 +03:00 committed by GitHub
parent 790d22fda2
commit 709d081008
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 7 deletions

View file

@ -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<FragmentEditorBinding>(R.layout.fragment_editor),
OnFragmentInteractionListener,
@ -1076,9 +1076,9 @@ open class EditorFragment : NavigationFragment<FragmentEditorBinding>(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) {

View file

@ -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
)
)
}
)
)

View file

@ -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()