-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Play Icon When in a Command Mode #251
Conversation
Thank you for the pull request!The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Android rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you! Maintainer checklist |
The creation process of the keyboard is implemented by a helper, and I haven't found a suitable way to pass the |
CC also @angrezichatterbox as I'm at work atm :) I'll take a look tonight or over the weekend, @Linfye! Thank you! |
I am not sure we have any easy ways of passing the command boolean. However, I have another way in which we could do it. One method is to set a custom state within the keyboard. So for eg if we use the EditorInfo.IME_ACTION_UNSPECIFIED is the condition for setting the icon of the enter key to the Play Icon. Now there is the setEnterKeyColor function use it to set the mEnterKeyType as that specific type. Now create a function to set the enter key icon using this logic in MyKeyboard.kt and call this function after setting the mEnterKey type. You can use any custom type to do it. I am happy to explain in more detail :) |
I had considered this method initially, but I thought that modifying the built-in state might not be a common practice in Android development (I'm not quite sure about this). Since you suggested it, I can give it a try. Thank you! :) |
You could also set a companion object as a new type and set the key type as that from the setEnterKeyColor function. |
@angrezichatterbox Sorry for the delay, I've been busy with college matters lately. And thank you very much for your help! Could you review the current code? 😊 |
Functionality wise it looks good to me, @Linfye :) Might be nice if we could have the play icon moved a bit to the right - say 10% of the button's width, as with these sorts of icons if we actually center it it doesn't "look centered" :) This could be another task if you'd like it to be though! |
Yes, I noticed this issue before but forgot to mention it here. I can update this icon by adding a transparent margin on the left side to resolve it. What do you think? :) |
That'd be perfect, @Linfye! Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Linfye Everything looks nice. We could make the visual changes as suggested. We also have an edge case to deal with which comes which the approach. This could be an issue which could be created and worked on later on.
So currently when the user closes the keyboard when in any of the modes where the play icon is shown. If the user switches to an app and gets back to keyboard the play icon disappears and it would become again the icon as per the Editor Info.
A thing we could do is to switch the mode to idle when the user exits off the keyboard. Would love to hear about this specific issue.
Other than this amazing work @Linfye
Switching to idle when the user navigates away makes sense to me, @angrezichatterbox 😊 |
Yes it makes sense. Should we create an issue for correcting this edge case after this PR is merged ? |
Either or. @Linfye, if you want to include it in here, then by all means, or if not let's make the issue 😊 |
@Linfye Would u like to bring it in or should I add it to this PR :) Happy to add it to the PR :) |
Yes, I'd like to solve this. |
@angrezichatterbox I've tried to change the keyboard state using |
I would look into it and would get back to you. |
So the function that was being run when the input view is closed was onFinishInputView(). I have implemented the changes. I just checked the codebase a bit more now. Thanks for replacing the deprecated setBackgroundDrawable(). It is ready for review @andrewtavis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is working really well now 😊 Beautiful work, @Linfye, and thanks for following through with the fix for setting the keyboard to idle! Thanks also for the review and final touches, @angrezichatterbox!
Contributor checklist
./gradlew lintKotlin detekt test
command as directed in the testing section of the contributing guideDescription
This PR changes enter icon to play button when in a command mode.
Related issue