Feature/kyocera softkey support - #819
Conversation
|
Thank you for this! I am going to hand this off to @wiggleforlife as they have the right hardware to test this. But you will need to rebase on to the latest changes first. |
Inhishonor
left a comment
There was a problem hiding this comment.
Thanks for this! I didn't test the changes, this is just code style and maintainability review.
| /** | ||
| * Code From: | ||
| * https://habr.com/ru/companies/timeweb/articles/844936/ | ||
| * https://github.com/vladkorotnev/TraditionalT9/blob/c6fe6efab402afc6c2a74bcc17dbfa75cf469428/src/org/nyanya/android/traditionalt9/quirks/kyocera/KYY31SoftkeyGuide.java | ||
| * | ||
| * Renamed from KYY31SoftkeyGuide to KyoceraSoftkeyGuide | ||
| */ |
There was a problem hiding this comment.
Please verify that the license is correct, and we can in fact use it here. If we can use it, we need to provide the license in this file.
There was a problem hiding this comment.
The blog (near the end) I found it from mentions he just used Gemini to make it so I don't think there's a license.
| } catch (Exception e) { | ||
| throw new RuntimeException(e); | ||
| } |
There was a problem hiding this comment.
I would prefer this show a user facing error, instead of crashing if it can find the right class.
| throw new RuntimeException(e); | ||
| } | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Please don't comment out code, it clutters out the codebase. We should make a decision on if to include it or not, and leave it at that.
| val options = arrayOf( | ||
| "Attach a contact", | ||
| "Schedule message", | ||
| "Attach any file", | ||
| "Record an audio message", | ||
| "Take a photo" |
There was a problem hiding this comment.
Do these need to be translatable strings?
There was a problem hiding this comment.
updated to translatable strings
| softkeyMode = if (selectedIds.isEmpty()) | ||
| SoftkeyMode.CONVERSATIONS | ||
| else | ||
| SoftkeyMode.CONVERSATIONS_SELECTED |
There was a problem hiding this comment.
Please use braces here.
| } | ||
| KeyEvent.KEYCODE_F3 -> { | ||
| // Show info | ||
| makeToast("Copied", Toast.LENGTH_SHORT) |
| val s = currentState ?: return false | ||
| val lm = binding.messageList.layoutManager as LinearLayoutManager |
There was a problem hiding this comment.
These need to be more descriptive variable names.
| } | ||
|
|
||
|
|
||
| private fun updateSoftkeys() { |
There was a problem hiding this comment.
This code is duplicated, we should probably create a Kyocera helper, and store all of these functions there.
There was a problem hiding this comment.
I would prefer not to include java files, this should be rewritten to Kotlin.
|
thank you I'll be able to make changes later tomorrow! I'm also newish/inexperienced to using git so bear with me |
f0b8397 to
d91f160
Compare
- Created an interface to allow other devices to implement their softkeys - Fixed crashing if non-kyocera device
- Created an interface to allow other devices to implement their own softkeys - Fixed crashing if non-kyocera device - made strings into translatable strings - changed scrolling onKeyDown actions to have focus after a scroll
- Created an interface to allow other devices to implement their own softkeys - Fixed crashing if non-kyocera device - made strings into translatable strings - changed scrolling onKeyDown actions to have focus after a scroll
|
I've done some more messing around and one of the things I think would be good is an interface for other devices to implement their own softkeys so I added an interface under util/softKey. right now the interface is a mirror of the kyocera's functions but I may just buy a Sharp flip phone to see if I can add more devices. I've also added some translatable strings that fit the kyocera softkey convention. also the onKeyDown and render for each activity feels like it could get messy especially if I added keys for each drawer in the Main Activity. If you have any input on how it could be cleaner I'd appreciate it. I've learned a lot more of the inner working but still feel pretty clueless. Also changing this to a draft did not see that button when I made the PR Last thing I have a friend who has the ky-42c also so I'll use them as a tester too :) |
Hey I've been using quik for over a year now on my KY-42C Kyocera flip phone and it has been working really great.
This is also my first pull request on a public repo. I also just finished college so no real world experience.
I've wanted a more native feel so I did some digging with adb and jadex to try and figure out how built in apps use the soft keys at the bottom of the screen. while researching I came across this blog post of someone that has already figured it out! and the code for it. @wiggleforlife you may be interested in this as another KY-42C user
I don't know too much on java or kotlin or programming for android. But I've managed to make a working demo of quik working with soft keys
Here's some photos on how it looks
MainActivity

ComposeActivity
When long press a message

Sending a text
https://github.com/user-attachments/assets/8a83911b-c892-4c88-8e2a-5763c3f1c503
Again this is just an idea at this point and I'd like feedback on how this could be properly implemented.
Note