Add copy to clipboard functionality for unit converter

This commit is contained in:
Ensar Sarajčić 2023-09-13 12:18:15 +02:00
parent b6ba9b800c
commit 31fcd94ecf
1 changed files with 8 additions and 0 deletions

View File

@ -51,6 +51,14 @@ class ConverterView @JvmOverloads constructor(
binding.topUnitHolder.setClickListenerForUnitSelector(::topUnit, ::bottomUnit)
binding.bottomUnitHolder.setClickListenerForUnitSelector(::bottomUnit, ::topUnit)
binding.topUnitHolder.setOnLongClickListener {
context.copyToClipboard(binding.topUnitText.text.toString())
true
}
binding.bottomUnitHolder.setOnLongClickListener {
context.copyToClipboard(binding.bottomUnitText.text.toString())
true
}
updateColors()
}