Android: move getRotation() directly under handleOrientationChange()
This call is done only from handleOrientationChange(). Task-number: QTBUG-132716 Change-Id: Ib483a8d37c61514bc1a3cf1ca107518ffaaeb572 Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
This commit is contained in:
parent
0abdca8790
commit
95c21244cc
@ -84,17 +84,13 @@ class QtDisplayManager {
|
|||||||
|
|
||||||
static void handleOrientationChange(Activity activity)
|
static void handleOrientationChange(Activity activity)
|
||||||
{
|
{
|
||||||
int currentRotation = getDisplayRotation(activity);
|
|
||||||
if (m_previousRotation == currentRotation)
|
|
||||||
return;
|
|
||||||
int nativeOrientation = getNativeOrientation(activity, currentRotation);
|
|
||||||
QtDisplayManager.handleOrientationChanged(currentRotation, nativeOrientation);
|
|
||||||
m_previousRotation = currentRotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int getDisplayRotation(Activity activity) {
|
|
||||||
Display display = QtDisplayManager.getDisplay(activity);
|
Display display = QtDisplayManager.getDisplay(activity);
|
||||||
return display != null ? display.getRotation() : 0;
|
int rotation = display != null ? display.getRotation() : 0;
|
||||||
|
if (m_previousRotation == rotation)
|
||||||
|
return;
|
||||||
|
int nativeOrientation = getNativeOrientation(activity, rotation);
|
||||||
|
QtDisplayManager.handleOrientationChanged(rotation, nativeOrientation);
|
||||||
|
m_previousRotation = rotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getNativeOrientation(Activity activity, int rotation)
|
private static int getNativeOrientation(Activity activity, int rotation)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user