Slab icon indicating copy to clipboard operation
Slab copied to clipboard

Support for mobile devices

Open IsometricShahil opened this issue 5 years ago • 19 comments

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

IsometricShahil avatar Jul 06 '20 13:07 IsometricShahil

Hi @FlamingArr, thanks for the feedback. I am currently wrapping up a release but will look into this for the next release.

coding-jackalope avatar Jul 22 '20 17:07 coding-jackalope

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.

coding-jackalope avatar Nov 16 '20 20:11 coding-jackalope

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.

IsometricShahil avatar Nov 17 '20 14:11 IsometricShahil

This crash is fixed for the upcoming patch release and has been addressed in issue #58. We can revisit this issue after the release.

coding-jackalope avatar Nov 17 '20 21:11 coding-jackalope

There is another minor issue where after clicking on a button, the button belives it is being hovered on until one clicks somewhere else.

IsometricShahil avatar Nov 18 '20 08:11 IsometricShahil

Thanks for the info. I'll look into this for the patch release.

coding-jackalope avatar Nov 19 '20 22:11 coding-jackalope

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.

IsometricShahil avatar Nov 20 '20 11:11 IsometricShahil

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.

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.

flamendless avatar Aug 21 '21 06:08 flamendless

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

IsometricShahil avatar Nov 08 '21 12:11 IsometricShahil

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

IsometricShahil avatar Nov 08 '21 12:11 IsometricShahil

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

flamendless avatar Nov 09 '21 04:11 flamendless

Thinking about it, I think Enter clearing the text is sane behaviour but moving the window around should not clear the text I guess?

IsometricShahil avatar Nov 10 '21 13:11 IsometricShahil

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 avatar Nov 10 '21 17:11 flamendless

@flamendless, Starting to use Slab on iOS Mobile for some projects-- overall, pretty impressed and works pretty well.

Some notes:

  1. 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

  2. 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 avatar Aug 16 '23 20:08 SugarRayLua

@SugarRayLua thanks!

For #2, what are those calls you modify?

flamendless avatar Aug 16 '23 22:08 flamendless

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. IMG_1454 IMG_1455

SugarRayLua avatar Aug 17 '23 00:08 SugarRayLua

@SugarRayLua are you using the latest commit? I pushed a similar fix in #151

flamendless avatar Aug 17 '23 04:08 flamendless

@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 avatar Aug 19 '23 05:08 SugarRayLua

@SugarRayLua we learn each day! Thank you

flamendless avatar Aug 19 '23 07:08 flamendless