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

Simultaneous interaction #40

Closed
Aisthetic opened this issue May 13, 2020 · 7 comments
Closed

Simultaneous interaction #40

Aisthetic opened this issue May 13, 2020 · 7 comments

Comments

@Aisthetic
Copy link

Hi, I want to be able to interact with my application while the keyboard is open. For example I want to be able to click on a button while the keyboard is open, the current state of the plugin (and unity TouchKeyBoard) makes the app lose focus when It is visible, thus you need to click twice on the screen before being able to click on a button, any solutions ?
Thanks

@mopsicus
Copy link
Owner

Hi,
hmm, strange.. current plugin should works as you described: keyboard shouldn't hides

@Aisthetic
Copy link
Author

Ok, it must be me doing something wrong, i'm using unity 2019.1 though, hope it's not a problem. Besides, will It be a problem if I swap the canvas type from overlay to camera ?

@mopsicus
Copy link
Owner

Everything should work correct with both camera types.

@Aisthetic
Copy link
Author

Well I have just build your demo project and It worked as It should, I will try to import it correctly into my project again to see if it works, thanks for the fast answers !

@Aisthetic
Copy link
Author

Aisthetic commented May 13, 2020

Finally It worked ! Yet I'm still experience some unexpected behaviour where I'm getting this
image instead of this
image
Edit: I will try making the native input invisible and rebuild the plugin to seen if works

@mopsicus
Copy link
Owner

mopsicus commented May 13, 2020

To remove white background, set alpha to 0 for input field image "normal color".
But, you can't set custom font for native input, at least in current realization

@Aisthetic
Copy link
Author

Well thanks a lot, it's all fixed now, I added my font in the android project and changed setRec
// Set new position and size private void SetRect(JSONObject data) { try { boolean visible = data.getBoolean("visible"); double x = data.getDouble("x") * (double) layout.getWidth(); double y = data.getDouble("y") * (double) layout.getHeight(); double width = data.getDouble("width") * (double) layout.getWidth(); double height = data.getDouble("height") * (double) layout.getHeight(); Rect rect = new Rect((int) x, (int) y, (int) (x + width), (int) (y + height)); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(rect.width(), rect.height()); params.setMargins(rect.left, rect.top, 0, 0); if(!visible){ edit.setBackgroundColor(Color.TRANSPARENT); //edit.setTextColor(Color.TRANSPARENT); Typeface face=Typeface.createFromAsset(Plugin.activity.getAssets(),"fonts/dum1.ttf"); edit.setTypeface(face); } edit.setLayoutParams(params); } catch (JSONException e) {} }

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

No branches or pull requests

2 participants