-
Notifications
You must be signed in to change notification settings - Fork 4
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
JPro stage width cange listener is not working fine in a case of screen orientation change on Android! #145
Comments
This also depends on the index.html file, and how the Stage/Scene/Root is set up. |
Hi @FlorianKirmaier ! I want to design different front-end GUI depending upon the orientation of devices, e.g. landscape or portrait. Also w.r.t different width like CSS media queries. I am not sure, how can I achieve them in JPro? The main thing is somehow I can add listener to main viewport area's size of web! But how to achieve this in JPro Web? |
The Node of your Page, should, by default be layout to the size (width/height) of the WebSite. If this is not the case - for some reason, then I need a minimal sample to take a look into it. Then, you can either have you Page handle the layout-logic, to decide based on it's width/height how it's layouting. |
@FlorianKirmaier Hi! there is a technical problem with Initial app when load first time in portrait view! When switch to Landscape view (by rotating Android device), all is working well: But when again switch to portrait view, something wrong happens, like zoom out of app: In the same why when again switch to landscape view, vertical scroll happens: As see in screen shots something unexpected happens. Sample code to demonstrate the issue:
defaultpage if it matter somehow:
|
A small tip before looking into the topic in detail: |
Hello @ctoabidmaqbool, The following website shpresa.shop is also running with JPro server. Can you please open it and see if you experience the same issue for some reason? You feedback will help us better understand the issue. Thank You. |
@besidev I have tried your provided website. It looks like it's working fine on Desktop Chrome and Android Chrome. e.g. Screen Orientation is working fine. In both cases Landscape and Portrait responsive forms are fine. More over this website opensources project or some closed one. It's looks like are forms are made up of using simple html,css,js running on jpro.one server? |
I think,
stage.getWidth() or stage.getHeight() not return correct page height / width (visible viewport size). |
The shpresa.shop website is not open source, but everything is done in JavaFX code, running via JPro server. |
|
Okey! Still we can't get height of root element by using this method e.g. |
Hi! After a couple of try, researching and tying provided fixes, I have got expected behavior! ResponsiveApp.java
defaultpage
@FlorianKirmaier @besidev ! Please see my above code, it's almost working fine. How to fix it, in a case all other codding should works too? |
Can you explain more about what you mean? |
@FlorianKirmaier I am talking about simple. Let open https://google.com website in chrome, and resize the page (the scaling of the page will not be changed, or zoom in/out remains same): Now open jpro app (above code), and resize the page: On resizing the page the scaling of page will be changed, or zoom in/out will be changed on resizing, e.g.: Let me know, if still you not get-up the error or issue? |
Hi! I have an JPro App running on my local pc. I am trying to connect my App on Android device using local network, e.g. through IP address.
When orientation of device changes sometime codding not works correctly!
Basically we are using listener on stage which compare width and height to calculate orientation of device e.g. Portrait or Landscape.
We are using latest release of JPro plugin (except routing).
We have implemented something like this method for detection of screen orientation.
The text was updated successfully, but these errors were encountered: