ARK-Builders / ARK-Memo

ARK Memo is one app for all of your notes: it's aiming to combine plain text, voice and hand-written notes
MIT License
2 stars 3 forks source link

Fix undesired disabling of buttons #59

Closed shubertm closed 4 months ago

shubertm commented 4 months ago

We were having null primaryClip from clipboard causing the clipboardTextEmpty value to be wrong

private fun observeClipboardContent() {
        context?.getTextFromClipBoard(view) {
            val clipboardTextEmpty = it.isNullOrEmpty()
            if (clipboardTextEmpty) {
                binding.tvPaste.alpha = 0.4f
                binding.tvPaste.isClickable = false
            } else {
                binding.tvPaste.alpha = 1f
                binding.tvPaste.isClickable = true
            }
            enableSaveText(!clipboardTextEmpty && isContentChanged())
        }
    }

Android 10 Clipboard Changes