Closed downloadpizza closed 4 years ago
Took a look at the code behind. Each layout is a separate XML file. So with the current system each option we add to the layout exponentially increases the number of necessary layout files... which is not something maintainable...
There is a generator included, that makes things a bit better, but it's still a bit messy.
@peterekepeter Maybe we need to modify the code and unify the layout files.
Yes I wanted to work on this, that's why I investigated but I noticed it would take a significant rewrite. However it is possible to do, instead of inflating the XML resource files, the view can be built programmatically using plain old Java.
But going forward with this project this should be done, it will allow much more configurability and it would also simplify the current code which takes into consideration all the different layout xml files, and it also removes dependency on the sed linux tool, which is not something you have when you develop on windows.
This rewrite will also enable solving other issues and feature requests much more easily.
@peterekepeter I hope you can manage some time to start working on this. Because a customizable keyboard is a long-awaited dream for programmers :blush:
I would love to have contributors working on a rewrite! Yes, the current keyboard generation is hacky, but it requires a lot of time to rewrite (and I'm busy with college most of the time). I'll set up a project and see what I can do
I've made a basic proof of concept to see if it's doable, basically it's generating one button for the whole layout and Android OS didn't complain about it. (didn't write much Java code or android so I needed to confirm that there is a way)
I'll be taking leaving my current job soon, so I might have some time between to look at this again while searching for a new job.
In the spirit of Hacktoberfest I'll give this one a proper attempt, I've been putting it off for too long.
WIP:
This is generated from Java, It also has unit tests. But I still have a few more things to figure out, right now the keyboard size is static, as did not figure out how to get the avaialbe width and height from Android. Maybe subclassing ViewGroup will help.
Here is a link inside my new branch to the new Java classes that will be responsible for layout generation https://github.com/peterekepeter/codeboard/tree/feature/layout-builder/app/src/main/java/com/gazlaws/codeboard/layout
Nice work! TBH, I haven't taken a look at this project in a while, I'm glad that you've brought it up. I'll take a look at your fork soon (feel free to email me if it seems I've forgotten)
Aye, well I still have some work to do on it, I'll get a pull request up when the layout generator is ready. After that, the rest of the issues should be easy peasy!
Alright, keyboard size is now proportional to screen size, it's possible to set any number from 0% to 100% screen usage.
Next steps are to
And we can call the base feature done! -> we can move on to more interesting stuff, further customization and layouts.
Alright I have added all supported layout definitions to the code. There are some validation check that make sure that the layout does not throw and that each key has either a code or an output text set.
I still have some adjustments to make as it's not really compatible right now.
Fighting some bugs currently:
I've opened the Pull Request: https://github.com/gazlaws-dev/codeboard/pull/61
There are still a few things different, but functinally it's the same.
Great job!
I am also doing this, and I am already completing the customization.
I am working hard to make its shortcuts custom.
ohh, this is so that you can make in app customizations, nice
We already have it in sym so an option to remove it from letter kb would be nice ==> more space