Support for mobile devices
This ui library looks very good! It would be awesome if you consider providing a mobile device backend to it, It seems to mess up the coordinates when I try to use it on my Android
Hi @FlamingArr, thanks for the feedback. I am currently wrapping up a release but will look into this for the next release.
I was able to get around to investigating some issues with mobile support. The one that stands out is the Android status bar that is rendered on top of Love. Love currently has a function called 'love.window.getSafeArea', but unfortunately does not seem to return the correct results. This may be fixed in a future version as discussed in this thread here.
There are some other minor issues that I have found that will be addressed in future releases. I wanted to reach out and see if you have noticed any other issues with running Slab on mobile devices.
Hi, I just tried out the current master branch and this error is thrown when running the bundled program and switching to 'Window' from 'Overview'
Error
/Internal/Core/DrawCommands.lua:526: Cannot set scissor with negative width.
Traceback
[C]: in function 'assert'
/Internal/Core/DrawCommands.lua:526: in function 'Scissor'
/Internal/UI/Region.lua:468: in function 'ApplyScissor'
/Internal/UI/Region.lua:345: in function 'Begin'
/Internal/UI/Window.lua:651: in function 'BeginWindow'
SlabTest.lua:1872: in function <SlabTest.lua:1678>
SlabTest.lua:2375: in function 'Begin'
main.lua:42: in function 'update'
[C]: in function 'xpcall'
The last coordinate mess up issue seems to be perfectly fixed, thanks. I don't see any other issue yet.
This crash is fixed for the upcoming patch release and has been addressed in issue #58. We can revisit this issue after the release.
There is another minor issue where after clicking on a button, the button belives it is being hovered on until one clicks somewhere else.
Thanks for the info. I'll look into this for the patch release.
Re: Input
On mobile devices the keyboard is disabled by default and to enable it love.keyboard.setTextInput(true) must be called, disabling it is pretty same except false should be passed to the function.
Slab should enable the keyboard when the edittext field is clicked on and should disable it when somewhere else is clicked.
Re: Input On mobile devices the keyboard is disabled by default and to enable it
love.keyboard.setTextInput(true)must be called, disabling it is pretty same exceptfalseshould be passed to the function.Slab should enable the keyboard when the edittext field is clicked on and should disable it when somewhere else is clicked.
Hi @FlamingArr , I was about to fix this but it seems that it was already fixed. Please test again using the v0.8.0 and let me know if this issue is solved already.
Yeah this issue seems to be solved now though the Input still doesn't work 🤔, the contents of a Input is wiped if the enter key is pressed on gboard or the window is moved
In the meantime, docks are not working either, they worked before. I can programatically dock/undock windows but doing it through the UI doesn't work
Thanks for the updates @FlamingArr , will test it as soon as possible.
For the Input i think it's the sane behavior? Pressing enter should trigger like a next or proceed event so the text gets cleared :thinking: I'll think about what's the best way for it. Let me know if you have any suggestion.
For the docks, i think it has something to do with touch events in Android acting differently. This is tricky to test since compiling a love project for android takes longer time
Thinking about it, I think Enter clearing the text is sane behaviour but moving the window around should not clear the text I guess?
This behavior doesn't happen on desktop right? 🤔 If so, then i think it's due to the input losing focus when the window is touched and that clears it as well. That is indeed not a sane behavior
@flamendless, Starting to use Slab on iOS Mobile for some projects-- overall, pretty impressed and works pretty well.
Some notes:
-
It appears you all have raised an issue with the "input" control. I do have an issue with the "input" control arbitrarily not letting me type in it if I' have gone in and off focus from it. However, that only happens when I use input with the option stating I want to wait for the "return" key to store text. If I don't use that option, the input box works fine
-
Please consider checking for mobile OS and disabling custom mouse cursors if mobile OS. At least for iOS, Love doesn't support mouse cursors so if I want to use the latest Slab, I need to manually go and modify/remove those calls.
Thanks!
@SugarRayLua thanks!
For #2, what are those calls you modify?
Thanks, @flamendless, I included an iOS screenshot of the initial error I get when trying to run Slab and then a second screenshot of a partial list of all references to that call in "Mouse.lua" in the Input folder of slap.
@SugarRayLua are you using the latest commit? I pushed a similar fix in #151
@flamendless : sorry, you are correct-- the fix in the latest commit corrects the problem. I'm still rather a novice at github and wasn't understanding exactly how to determine whether a commit fixed a problem after the last release and then download the master with that commit in it. I now understand that better, thank you.
@SugarRayLua we learn each day! Thank you