summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CaptureUI.java
diff options
context:
space:
mode:
authorxianming wang <mingwax@codeaurora.org>2017-12-13 10:24:16 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-02-06 21:47:40 -0800
commitee8e5808ffa75f7ff77b8f8fbeb943bc8d451ce9 (patch)
tree891d9bb3eecf280d8ec72775ab4def6e1f7a606d /src/com/android/camera/CaptureUI.java
parent54b13709b379cb462c0592a8bebd4a9f13f0c586 (diff)
downloadandroid_packages_apps_Snap-ee8e5808ffa75f7ff77b8f8fbeb943bc8d451ce9.tar.gz
android_packages_apps_Snap-ee8e5808ffa75f7ff77b8f8fbeb943bc8d451ce9.tar.bz2
android_packages_apps_Snap-ee8e5808ffa75f7ff77b8f8fbeb943bc8d451ce9.zip
SnapdragonCamera: Complete the function of DeepZoom
Complete the function of DeepZoom, only support the 32 bit library. Does`t support the 64 bit library. CRs-Fixed: 2116533 Change-Id: I9c181ff0de005493d345ecc0b0380dda9910ce63
Diffstat (limited to 'src/com/android/camera/CaptureUI.java')
-rwxr-xr-xsrc/com/android/camera/CaptureUI.java66
1 files changed, 63 insertions, 3 deletions
diff --git a/src/com/android/camera/CaptureUI.java b/src/com/android/camera/CaptureUI.java
index 47ffc1435..450ba62b3 100755
--- a/src/com/android/camera/CaptureUI.java
+++ b/src/com/android/camera/CaptureUI.java
@@ -198,9 +198,13 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
private ImageView mSeekbarToggleButton;
private View mProModeCloseButton;
private RotateLayout mSceneModeLabelRect;
- private LinearLayout mSceneModeLabelView;
private TextView mSceneModeName;
private ImageView mExitBestMode;
+ private RotateLayout mDeepZoomModeRect;
+ private TextView mDeepzoomSetName;
+ private int mDeepZoomIndex = 0;
+ private float mDeepZoomValue = 1.0f;
+
private ImageView mSceneModeLabelCloseIcon;
private AlertDialog mSceneModeInstructionalDialog = null;
@@ -371,6 +375,16 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
RotateImageView muteButton = (RotateImageView) mRootView.findViewById(R.id.mute_button);
muteButton.setVisibility(View.GONE);
+ mDeepZoomModeRect = (RotateLayout)mRootView.findViewById(R.id.deepzoom_set_layout);
+ mDeepzoomSetName = (TextView)mRootView.findViewById(R.id.deepzoom_set);
+ mDeepzoomSetName.setText("Zoom OFF");
+ mDeepzoomSetName.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mDeepZoomIndex = (mDeepZoomIndex + 1) % 3;
+ updateDeepZoomIndex();
+ }
+ });
mSceneModeLabelRect = (RotateLayout)mRootView.findViewById(R.id.scene_mode_label_rect);
mSceneModeName = (TextView)mRootView.findViewById(R.id.scene_mode_label);
mSceneModeLabelCloseIcon = (ImageView)mRootView.findViewById(R.id.scene_mode_label_close);
@@ -509,6 +523,28 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
return mModule.getCurrentIntentMode();
}
+ private void updateDeepZoomIndex() {
+ switch(mDeepZoomIndex) {
+ case 0:
+ mDeepzoomSetName.setText("Zoom OFF");
+ mDeepZoomValue = 1.0f;
+ break;
+ case 1:
+ mDeepzoomSetName.setText("Zoom 2X");
+ mDeepZoomValue = 2.0f;
+ break;
+ case 2:
+ mDeepzoomSetName.setText("Zoom 4X");
+ mDeepZoomValue = 4.0f;
+ break;
+ default:
+ mDeepZoomValue = 1.0f;
+ mDeepzoomSetName.setText("Zoom OFF");
+ break;
+ }
+ mModule.updateDeepZoomIndex(mDeepZoomValue);
+ }
+
private void toggleMakeup() {
String value = mSettingsManager.getValue(SettingsManager.KEY_MAKEUP);
if(value != null && !mIsVideoUI) {
@@ -543,10 +579,18 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
});
}
+ public float getDeepZoomValue() {
+ return mDeepZoomValue;
+ }
+
public void onCameraOpened(List<Integer> cameraIds) {
mGestures.setCaptureUI(this);
- mGestures.setZoomEnabled(mSettingsManager.isZoomSupported(cameraIds));
- initializeZoom(cameraIds);
+ if (mModule.isDeepZoom()) {
+ mGestures.setZoomEnabled(false);
+ } else {
+ mGestures.setZoomEnabled(mSettingsManager.isZoomSupported(cameraIds));
+ initializeZoom(cameraIds);
+ }
}
public void reInitUI() {
@@ -871,9 +915,15 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
mSceneModeName.setText(sceneModeNameArray[index]);
mSceneModeLabelRect.setVisibility(View.VISIBLE);
mExitBestMode.setVisibility(View.VISIBLE);
+ if (mModule.isDeepZoom()) {
+ mDeepZoomModeRect.setVisibility(View.VISIBLE);
+ } else {
+ mDeepZoomModeRect.setVisibility(View.GONE);
+ }
}else{
mSceneModeLabelRect.setVisibility(View.GONE);
mExitBestMode.setVisibility(View.GONE);
+ mDeepZoomModeRect.setVisibility(View.GONE);
}
}
@@ -888,6 +938,7 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
public void hideUIwhileRecording() {
mCameraControls.setVideoMode(true);
mSceneModeLabelRect.setVisibility(View.INVISIBLE);
+ mDeepZoomModeRect.setVisibility(View.INVISIBLE);
mFrontBackSwitcher.setVisibility(View.INVISIBLE);
mFilterModeSwitcher.setVisibility(View.INVISIBLE);
mSceneModeSwitcher.setVisibility(View.INVISIBLE);
@@ -1513,6 +1564,15 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
mSceneModeLabelRect.setOrientation(orientation, false);
}
}
+ if ( mDeepZoomModeRect != null ) {
+ if (orientation == 180) {
+ mDeepzoomSetName.setRotation(180);
+ mDeepZoomModeRect.setOrientation(0, false);
+ } else {
+ mDeepzoomSetName.setRotation(0);
+ mDeepZoomModeRect.setOrientation(orientation, false);
+ }
+ }
if ( mSceneModeInstructionalDialog != null && mSceneModeInstructionalDialog.isShowing()) {
mSceneModeInstructionalDialog.dismiss();