Skip to content
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

Support for mobile devices #35

Open
IsometricShahil opened this issue Jul 6, 2020 · 19 comments
Open

Support for mobile devices #35

IsometricShahil opened this issue Jul 6, 2020 · 19 comments
Labels
Android for Android

Comments

@IsometricShahil
Copy link

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

@coding-jackalope
Copy link
Collaborator

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

@coding-jackalope
Copy link
Collaborator

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.

@IsometricShahil
Copy link
Author

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.

@coding-jackalope
Copy link
Collaborator

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

@IsometricShahil
Copy link
Author

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

@coding-jackalope
Copy link
Collaborator

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

@IsometricShahil
Copy link
Author

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.

@flamendless
Copy link
Owner

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 flamendless added the Android for Android label Aug 21, 2021
@IsometricShahil
Copy link
Author

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
Copy link
Author

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

@flamendless
Copy link
Owner

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 🤔 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

@IsometricShahil
Copy link
Author

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

@flamendless
Copy link
Owner

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

@SugarRayLua
Copy link

@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!

@flamendless
Copy link
Owner

@SugarRayLua thanks!

For #2, what are those calls you modify?

@SugarRayLua
Copy link

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

@flamendless
Copy link
Owner

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

@SugarRayLua
Copy link

SugarRayLua commented Aug 19, 2023

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

@flamendless
Copy link
Owner

@SugarRayLua we learn each day! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android for Android
Projects
None yet
Development

No branches or pull requests

4 participants