Scribe-Android icon indicating copy to clipboard operation
Scribe-Android copied to clipboard

Switch enter button icon to play button when in a command mode

Open andrewtavis opened this issue 1 year ago • 2 comments

Terms

Description

One of the usability features of Scribe is that the enter key switches color and its icon when the user is in a command mode to enter a command. As of now when a user presses the Scribe key and then a command button they're shown the command bar and they'll then type in the command bar as well. The enter key is then Scribe blue, but we also want that its icon switches to a play button. The play button icon should be filled in - i.e. not the just the boarder. An example of the interface in Scribe-iOS can be seen in the Figma designs here (the interface over translation) and below:

iPhone 14 White Minimal

Contribution

This is a great good first issue! Happy to review or support someone wanting to get into Scribe-Android development as needed 😊

andrewtavis avatar Sep 30 '24 16:09 andrewtavis

@andrewtavis hey i would love to work on this issue as part of hacktoberfest

zacharyftw avatar Oct 02 '24 14:10 zacharyftw

Sure thing, @KekmaTime! Let us know if there's anything we can do to support 😊

andrewtavis avatar Oct 02 '24 14:10 andrewtavis

Hey @KekmaTime 👋 Please let us know if you need any support here :)

andrewtavis avatar Oct 25 '24 20:10 andrewtavis

@KekmaTime Do you still want to work on this issue? Can I participate or collaborate? 😊

cc @andrewtavis

Linfye avatar Nov 12 '24 07:11 Linfye

@Linfye im unable to work on this. you can take the issue

zacharyftw avatar Nov 12 '24 11:11 zacharyftw

Thanks for passing it off, @KekmaTime, and thanks for picking it up, @Linfye! 🚀

andrewtavis avatar Nov 12 '24 14:11 andrewtavis

@andrewtavis I've tried many ways, but none of them seem to work. Can you give me some hints for this?

Linfye avatar Nov 20 '24 12:11 Linfye

Wouldn't it be setting the key icon and then reloading the keyboard whenever the keyboard is in a command mode? What have you tried so far, @Linfye?

andrewtavis avatar Nov 20 '24 14:11 andrewtavis

I tried to add a judgment in the keyboard build helper, and then dynamically update the value of isCommandMode in the SimpleKeyboardIME, but the keyboard did not update the icon after this value was updated.

if (key.code == KEYCODE_ENTER) {
    val enterResourceId = if (isCommandMode) {
        R.drawable.play_button
    } else {
        when (mEnterKeyType) {
            EditorInfo.IME_ACTION_SEARCH -> R.drawable.ic_search_vector
            EditorInfo.IME_ACTION_NEXT, EditorInfo.IME_ACTION_GO -> R.drawable.ic_arrow_right_vector
            EditorInfo.IME_ACTION_SEND -> R.drawable.ic_send_vector
            else -> R.drawable.ic_enter_vector
        }
    }
    key.icon = context.resources.getDrawable(enterResourceId, context.theme)
}

Linfye avatar Nov 21 '24 02:11 Linfye

And did you recreate the keyboard UI after the variable was set? In iOS we need to change the value of the key icon and then recreate the entire keyboard UI.

andrewtavis avatar Nov 21 '24 07:11 andrewtavis

Also feel free to open a PR and we can look at it, @Linfye! 😊

andrewtavis avatar Nov 21 '24 07:11 andrewtavis

Closed by #251 😊 Thanks for the amazing work here and for being such a great collaborator on Scribe-Android, @Linfye!

andrewtavis avatar Nov 28 '24 19:11 andrewtavis