app in portrait only, but one activity in landscape ?

Hubert Brandel

Active Member
Licensed User
Longtime User
Hi,

I do have a app in portrait only (over the IDE switch) and this is right for all
normal activities. But now I need a signature windows ...
I found the example and it should work easy, but this window I want to recognize that the smartphone is in landscape and where is the TOP.
Otherwise it can be that the signature will be saved staying on the head ...

I found the PhoneOrientation, but don't realy understand what the Azimuth will tell me ... and best if the activity will do it for me (switch the bottom of the activity to bottom) ...

B4X:
Dim Orientation As PhoneOrientation
... 
Orientation.StartListening("Orientation") 
...
Orientation.StopListening
...
Sub Orientation_OrientationChanged (Azimuth As Float, Pitch As Float, Roll As Float)
end sub

I have no problem to understand the Start, Stop and the Event, but I have a problem to interpret the AZIMUTH value. :sign0085:
 

Hubert Brandel

Active Member
Licensed User
Longtime User
But the phone can be in landscape with the controls right or left,
so there is the problem where is TOP and where is BOTTOM ?
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
Maybe an example shows what I mean ...

the service man hold the phone in the left hand and turn it to left landscape to let the customer sign the form. The other man hold it in the right hand and turn it right to let the customer sign.
Noone will give the smartphone out of hand.

So landscape is not landscape and the signature could be turned by 180°
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
If I understand what you are trying to do then it is technically impossible. Even if you do know the exact orientation of the device, it will not help.
You can either make it clear where is the signature field top, or if you know that the signatures will be written from left to right then you can find the signature orientation by comparing the start position to the end position.
 
Upvote 0
Top