|
|
@@ -35,13 +35,13 @@ public class OrientationHelper {
|
|
|
|
|
|
@VisibleForTesting
|
|
|
final OrientationEventListener mDeviceOrientationListener;
|
|
|
- private int mDeviceOrientation = -1;
|
|
|
+ private int mDeviceOrientation = 0;
|
|
|
|
|
|
@VisibleForTesting
|
|
|
final DisplayManager.DisplayListener mDisplayOffsetListener;
|
|
|
- private int mDisplayOffset = -1;
|
|
|
-
|
|
|
- private boolean mEnabled;
|
|
|
+ private int mDisplayOffset = 0;
|
|
|
+
|
|
|
+ private boolean mEnabled = true;
|
|
|
|
|
|
/**
|
|
|
* Creates a new orientation helper.
|
|
|
@@ -70,12 +70,10 @@ public class OrientationHelper {
|
|
|
deviceOrientation = 270;
|
|
|
}
|
|
|
|
|
|
- /*if (deviceOrientation != mDeviceOrientation) {
|
|
|
+ if (deviceOrientation != mDeviceOrientation) {
|
|
|
mDeviceOrientation = deviceOrientation;
|
|
|
mCallback.onDeviceOrientationChanged(mDeviceOrientation);
|
|
|
- }*/
|
|
|
- mDeviceOrientation = 0;
|
|
|
- mCallback.onDeviceOrientationChanged(mDeviceOrientation);
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
if (Build.VERSION.SDK_INT >= 17) {
|
|
|
@@ -114,7 +112,6 @@ public class OrientationHelper {
|
|
|
manager.registerDisplayListener(mDisplayOffsetListener, mHandler);
|
|
|
}
|
|
|
mDeviceOrientationListener.enable();
|
|
|
- //mCallback.onDeviceOrientationChanged(0);
|
|
|
}
|
|
|
|
|
|
/**
|