Can't enable screen rotation after disabling it

R Ruben Ruben 3 years 7 months ago
4 2 0

Hi,

I'm writing a javascript-based app, and while making use of the screenRotation API, I encounter the following problem:

- According to the Documentation, I set screen auto rotation off: Rho.ScreenOrientation.autoRotate = false;

- This works as expected, and the user no longer can rotate the screen. Eventually the user leaves the view, and I enable the autoRotate again by doing: Rho.ScreenOrientation.autoRotate = true;

- I can see in the log that the code to enable autorotation is beeing executed:
     ScreenOrientationSingleton|  setAutorotate -- START
     ScreenOrientationSingleton|  setAutorotate -- autoRotate: true
     ScreenOrientationSingleton|  setAutorotate -- END

- If I try to rotate the view again, I get:
     BaseActivity| Screen rotation is disabled. Force old orientation: 1

And of course, no rotation happens.

Can't I set the device to autorotate again?

Thanks,

Rubén Torrero

Please Register or Login to post a reply

2 Replies

K Kutir Mobility

Hi Ruben,
Have you tried "Rho.ScreenOrientation.autoRotate = true" to enable auto rotation ?

Visnupriya R
Kutir Mobility

R Ruben Ruben

Hi,
I made a error in the original post, thanks for noticing, but unfortunately that was correct in the original sources. The original code:

$scope.signCap = function (){

  function saveCap(params){
  /** Prepare base64 string to be compatible with what the handler expects
   * (Remove the new line chars and cut out the format tag)
  **/
  $scope.selectedJourneyStop.signature = (params.imageUri.substring(params.imageUri.indexOf(",") + 1, params.imageUri.length)).replace(/\r?\n|\r/g, "");
  $scope.selectedJourneyStop.signatureFormat = params.imageUri.substring(0, params.imageUri.indexOf(","));

  /** Refresh signature in the screen */
  loadSignature();
  console.log("setting autorotation ON again");
  Rho.ScreenOrientation.autoRotate = true;
  };

  var captureSettings = {
  outputFormat: "dataUri"
  };
  if (!Rho.System.isRhoSimulator){
  console.log("disable autorotation");
  Rho.ScreenOrientation.autoRotate = false;
  Rho.Signature.takeFullScreen(captureSettings, saveCap);
  }

};

CONTACT
Can’t find what you’re looking for?