question

Danielle Cox avatar image
Danielle Cox asked Jeffrey Blattman commented

How can I tell if the "platform" has a sensor enabled?

I have an issue where, on an original station, everything works great and my app rotates when the screen rotates. This is not the case on a Station 2018 (as has been documented here) I went ahead and built with the setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR) as shown in other posts and this worked great ... for the Station 2018. The problem is the original station no longer rotates with that setting. I believe the issue is that the original station by default uses the swivel switch to determine when to rotate. (I know there is a setting, but I don't control that out in the wild). I also know that Platform.isStation is deprecated and I should use Platform2 but the problem is that I don't see an ability that corresponds to having a sensor enabled.

Any thoughts on how I should properly detect whether I should setRequestedOrientation or not?
Clover Station
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered Jeffrey Blattman commented
You can compare the model, which will be "C100" for Station 1 if you need to implement device-specific behavior.

It's not clear to me why you need to call setRequestedOrientation(). You'd normally only do that if you wanted to override the "natural" orientation of the device. Our apps let the activity be re-created when the orientation / screen size changes as is the default behavior for Android. Your port resources will be picked up automatically. If you need behavior differences you can inspect the current orientation. This is how we do it in our apps.


2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Danielle Cox avatar image Danielle Cox commented ·

I have an app that is behaving the same as this question. https://community.clover.com/questions/11496/station-2018-orientation.html and when I implemented that solution, it stopped rotating on the Station 1. I would love for everything to just work, but it seems it does not in this case.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ Danielle Cox commented ·

If you can reproduce a problem, please create an MCVE that demonstrates. I created a test app no orientation settings in the code or manifest and it rotates correctly when C100 is swiveled.

0 Likes 0 ·

Welcome to the
Clover Developer Community