scribe-org / Scribe-Android

Android app with keyboards for language learners
GNU General Public License v3.0
41 stars 42 forks source link

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

Open andrewtavis opened 1 month ago

andrewtavis commented 1 month ago

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 😊

KekmaTime commented 1 month ago

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

andrewtavis commented 1 month ago

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

andrewtavis commented 1 month ago

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

Linfye commented 2 weeks ago

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

cc @andrewtavis

KekmaTime commented 2 weeks ago

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

andrewtavis commented 2 weeks ago

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

Linfye commented 6 days ago

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

andrewtavis commented 6 days ago

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?

Linfye commented 5 days ago

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)
}
andrewtavis commented 5 days ago

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 commented 5 days ago

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