mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-262 Editor | Fix| Simple long click for table cells (#2521)
Co-authored-by: konstantiniiv <ki@anytype.io>
This commit is contained in:
parent
8aa5205ae8
commit
66fda69067
2 changed files with 3 additions and 11 deletions
|
@ -41,11 +41,12 @@ class TableBlockAdapter(
|
|||
onCellClicked(getItem(pos))
|
||||
}
|
||||
}
|
||||
editorTouchProcessor.onLongClick = {
|
||||
textContent.setOnLongClickListener { _ ->
|
||||
val pos = bindingAdapterPosition
|
||||
if (pos != RecyclerView.NO_POSITION) {
|
||||
clickListener(ListenerType.LongClick(tableBlockId))
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,8 +13,6 @@ import com.anytypeio.anytype.core_ui.databinding.ItemBlockTableRowItemBinding
|
|||
import com.anytypeio.anytype.core_ui.databinding.ItemBlockTableSpaceBinding
|
||||
import com.anytypeio.anytype.core_ui.extensions.resolveThemedTextColor
|
||||
import com.anytypeio.anytype.core_ui.extensions.veryLight
|
||||
import com.anytypeio.anytype.core_ui.features.editor.EditorTouchProcessor
|
||||
import com.anytypeio.anytype.core_ui.features.editor.SupportCustomTouchProcessor
|
||||
import com.anytypeio.anytype.core_ui.features.table.TableCellsDiffUtil
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
|
@ -27,7 +25,7 @@ import com.anytypeio.anytype.presentation.editor.editor.model.BlockView
|
|||
sealed class TableCellHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
|
||||
class TableTextCellHolder(context: Context, binding: ItemBlockTableRowItemBinding) :
|
||||
TableCellHolder(binding.root), SupportCustomTouchProcessor {
|
||||
TableCellHolder(binding.root) {
|
||||
|
||||
val root: View = binding.root
|
||||
val textContent: AppCompatTextView = binding.textContent
|
||||
|
@ -45,13 +43,6 @@ sealed class TableCellHolder(view: View) : RecyclerView.ViewHolder(view) {
|
|||
private val mentionInitialsSize =
|
||||
itemView.resources.getDimension(R.dimen.mention_span_initials_size_default)
|
||||
|
||||
override val editorTouchProcessor = EditorTouchProcessor(
|
||||
fallback = { e -> itemView.onTouchEvent(e) })
|
||||
|
||||
init {
|
||||
textContent.setOnTouchListener { v, e -> editorTouchProcessor.process(v, e) }
|
||||
}
|
||||
|
||||
fun bind(
|
||||
cell: BlockView.Table.Cell
|
||||
) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue