Comments (3)
This is a non-ideal fix in PLView:
private int getDeviceDefaultOrientation() {
WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
Configuration config = getResources().getConfiguration();
int rotation = windowManager.getDefaultDisplay().getRotation();
if ( ((rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) &&
config.orientation == Configuration.ORIENTATION_LANDSCAPE)
|| ((rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) &&
config.orientation == Configuration.ORIENTATION_PORTRAIT))
return Configuration.ORIENTATION_LANDSCAPE;
else
return Configuration.ORIENTATION_PORTRAIT;
}
onSensorChanged/case Sensor.TYPE_ORIENTATION:
After the orientation is detected, correct it.
if (Configuration.ORIENTATION_LANDSCAPE == getDeviceDefaultOrientation())
switch (newOrientation) {
case UIDeviceOrientationPortrait: {
newOrientation = UIDeviceOrientation.UIDeviceOrientationLandscapeLeft;
break;
}
case UIDeviceOrientationPortraitUpsideDown: {
newOrientation = UIDeviceOrientation.UIDeviceOrientationLandscapeRight;
break;
}
case UIDeviceOrientationLandscapeLeft: {
newOrientation = UIDeviceOrientation.UIDeviceOrientationPortrait;
break;
}
case UIDeviceOrientationLandscapeRight: {
newOrientation = UIDeviceOrientation.UIDeviceOrientationPortraitUpsideDown;
break;
}
}
Original comment by [email protected]
on 13 May 2014 at 11:37
from panoramagl-android.
trying the same solution for a Acer A-810 .. in this case I get the problem
highlighted in the issue both using the original PLView, both trying this
solution.
The "new" issue is that defaultOrientation is ORIENTATION_UNDEFINED and all
positions bring to Portrait.
Example:
printing rotation and config.orientation variables we get:
in portrait positition --> rotation=0 (so 0 degrees) + orient=1 (portrait) =
Configuration.ORIENTATION_PORTRAIT
in "landscape left" positition --> rotation=3 (so 270 degrees) + orient=2
(landscape) = Configuration.ORIENTATION_PORTRAIT
in "upsideDown portrait" positition --> rotation=2 (so 180 degrees) + orient=1
(portrait) = Configuration.ORIENTATION_PORTRAIT
in "landscape right" positition --> rotation=1 (so 90 degrees) + orient=2
(landscape) = Configuration.ORIENTATION_PORTRAIT
Original comment by [email protected]
on 6 Jun 2014 at 7:23
from panoramagl-android.
showing toasts during exectution .. I discovered that in my case in method
onSensorChanged the exectution goes directly to case Sensor.TYPE_GYROSCOPE
without passing through Sensor.TYPE_ORIENTATION ..so maybe this part should be
edited too to solve this mismatch of sceen orientation and movement of
sensorialRotation..
Original comment by [email protected]
on 6 Jun 2014 at 7:59
from panoramagl-android.
Related Issues (20)
- JSON loaded panorama won't rotate Camera HOT 1
- Add a spinner while loading a panorama (or loading image, or progress bar) HOT 1
- add a hotspot in the coordinate that I want HOT 2
- HotSpot touch is not detected, but detects with some vertical offset HOT 1
- issue with image quality HOT 2
- App crashes in android 4.0
- PanoramaGL 0.2 beta on the Imagination PowerVR SGX GPU display problems HOT 10
- I want to start camera and capture images to create panorama HOT 2
- PanaromaGL 0.2 beta hotspot issue HOT 4
- how to add commend for hotspots click?
- panorama didn't appear correct in galaxy tab 2
- When using LSpherical2Panorama It has four slices where the alpha is not set.
- retrieve spherical image from web url HOT 1
- in any case view always start from centre of image HOT 1
- Sensorial rotation not working
- Error hotspot click position
- Compiling error in Android Studio HOT 1
- PanoramaGL support for Android 5.0.x
- How can i add panorama view to a fragment.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panoramagl-android.