webpage repeatedly page when start web is horizontal(Landscape) layout

  1. ‹ Older
  2. 6 months ago

    Michel B

    3 Jun 2019 Pre-Release Testers, Xojo Pro
    Edited 6 months ago

    OK. Here is the workaround I used . I post it here to help the poor souls who stumble on the same issue in the future.

    I had already added the PreviousAngle as Integer to the session, which is set in the OrientationChanged Event.

    I added a multiple 1000 ms WebTimer to each page (WebPageAndroidPortrait and WebPageAndroidLandscape) with this in the Action event (on WebPageAndroidPortrait) :

    Sub Action() Handles Action
      Dim ref As WeakRef
      ref = New WeakRef(session)
      If ref.Value <> Nil Then
        if Session(ref.Value).PreviousAngle = 90 or Session(ref.Value).PreviousAngle = 90 then
          WebPageAndroidLandscape.show
          self.close
        End If
      end if
    End Sub

    Of course, the code needs to be modified to PreviousAngle 0 and 180, as well as show WebPageAndroidPortrait for the WebTimer on WebPageAndroidLandscape

    I don't know if this could be implemented, but it would make more sense to have OrientationChanged on webPages, instead of session. Or if "by design", the OrientationChanged event fired only once, and did not create undue new sessions.

or Sign Up to reply!