本文整理汇总了Java中com.android.camera.util.CameraUtil.roundOrientation方法的典型用法代码示例。如果您正苦于以下问题:Java CameraUtil.roundOrientation方法的具体用法?Java CameraUtil.roundOrientation怎么用?Java CameraUtil.roundOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.camera.util.CameraUtil
的用法示例。
在下文中一共展示了CameraUtil.roundOrientation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onOrientationChanged
import com.android.camera.util.CameraUtil; //导入方法依赖的package包/类
@Override
public void onOrientationChanged(int orientation) {
// We keep the last known orientation. So if the user first orient
// the camera then point the camera to floor or sky, we still have
// the correct orientation.
if (orientation == OrientationEventListener.ORIENTATION_UNKNOWN) {
return;
}
int newOrientation = CameraUtil.roundOrientation(orientation, mOrientation);
if (mOrientation != newOrientation) {
mOrientation = newOrientation;
}
mUI.onOrientationChanged(orientation);
}
示例2: onOrientationChanged
import com.android.camera.util.CameraUtil; //导入方法依赖的package包/类
@Override
public void onOrientationChanged(int orientation) {
// We keep the last known orientation. So if the user first orient
// the camera then point the camera to floor or sky, we still have
// the correct orientation.
if (orientation == OrientationEventListener.ORIENTATION_UNKNOWN) return;
int newOrientation = CameraUtil.roundOrientation(orientation, mOrientation);
if (mOrientation != newOrientation) {
mOrientation = newOrientation;
}
// Show the toast after getting the first orientation changed.
if (mHandler.hasMessages(SHOW_TAP_TO_SNAPSHOT_TOAST)) {
mHandler.removeMessages(SHOW_TAP_TO_SNAPSHOT_TOAST);
showTapToSnapshotToast();
}
}
示例3: onOrientationChanged
import com.android.camera.util.CameraUtil; //导入方法依赖的package包/类
@Override
public void onOrientationChanged(int orientation) {
// We keep the last known orientation. So if the user first orient
// the camera then point the camera to floor or sky, we still have
// the correct orientation.
if (orientation == OrientationEventListener.ORIENTATION_UNKNOWN) return;
mOrientation = CameraUtil.roundOrientation(orientation, mOrientation);
// Show the toast after getting the first orientation changed.
if (mHandler.hasMessages(SHOW_TAP_TO_FOCUS_TOAST)) {
mHandler.removeMessages(SHOW_TAP_TO_FOCUS_TOAST);
showTapToFocusToast();
}
}
示例4: onOrientationChanged
import com.android.camera.util.CameraUtil; //导入方法依赖的package包/类
@Override
public void onOrientationChanged(int orientation) {
// We keep the last known orientation. So if the user first orient
// the camera then point the camera to floor or sky, we still have
// the correct orientation.
if (orientation == ORIENTATION_UNKNOWN) return;
mDeviceOrientation = CameraUtil.roundOrientation(orientation, mDeviceOrientation);
// When the screen is unlocked, display rotation may change. Always
// calculate the up-to-date orientationCompensation.
int orientationCompensation = mDeviceOrientation
+ CameraUtil.getDisplayRotation(mActivity) % 360;
if (mOrientationCompensation != orientationCompensation) {
mOrientationCompensation = orientationCompensation;
}
}