Browser window orientation

Forside Forum Developer discussions Browser window orientation

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3900
    Laurynas
    Participant

    Hi, I have a question about browser implementation. By your design, to be able to communicate with device, we have to open your implemented browser window:

    Code:
    cpp_state.launchBrowser();

    When we rotate mobile device, this causes reload browser content completely. If user have initiated reading measurements from device, this probably will fail the action. I'm not sure, is it in your scope, but maybe you could identify, what may be done, to prevent this?I have already tried to lock device orientation in AndroidManifest.xml:

    Code:
    android:screenOrientation="landscape"

    or main.qml

    Code:
    Window {    id: window1    // ommited code    contentOrientation: "LandscapeOrientation"}

    This locks views, parsed from *.qml files, but browser window acts independently, and ignores theses settings. Do I have extend PlatformWebBrowser functionality, or it may be done in other place?P.S.It would be ideal, if we could rotate device and not cause page reload  8)

    #3915
    Jacob Andersen
    Moderator

    I have noticed the same thing – quite annoying 😉Mike implemented this, but he's on Easter vacation until Tuesday. I hope it is ok for you to wait for his response - it'll definitely be better than mine 🙂/Jacob

    #3916
    mikek
    Participant

    Hi, I'm assuming we are talking about the Android platform here, as the AndroidManifest.xml is mentioned in the question.Yes, the browser reloads when the orientation is changed, that is standard behavior for the browser.  And you are right that this could interfere with the reading of measurements, I have opened a Jira on this: https://issuetracker4s.atlassian.net/browse/SDC-26You should be able to lock the rotation in the demo app by adding an android:screenOrientation="landscape", but you need to ensure it's done in the webkit activity, like this:

    Code:
                               

    (This works on a Samsung S4, I haven't tested on other platforms)Changing it in the QML or in the qt part of the code will not affect the webkit browser (which is a native Android component in the demo application).^__^Mike

    #3917
    Laurynas
    Participant

    Thanks for reply, Mike, I certainly will try this.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.