summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-01-15 08:59:20 +0100
committerDanny Baumann <dannybaumann@web.de>2016-01-20 23:31:18 -0800
commit42f6d5c06c5db74c6971e37dbb78bf41d2783e07 (patch)
treeea7305846f10d3ddfee87d19d6700a3de65d7bab /src/com
parent4faa77d616d3637e628816da0d24bb0ea3432cd2 (diff)
downloadandroid_packages_apps_Snap-42f6d5c06c5db74c6971e37dbb78bf41d2783e07.tar.gz
android_packages_apps_Snap-42f6d5c06c5db74c6971e37dbb78bf41d2783e07.tar.bz2
android_packages_apps_Snap-42f6d5c06c5db74c6971e37dbb78bf41d2783e07.zip
Remove unused menu indicators code.
Change-Id: I0ce48da277a532b46fdde15027f636de4d7585b7
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/OnScreenIndicators.java205
-rw-r--r--src/com/android/camera/PhotoModule.java6
-rw-r--r--src/com/android/camera/PhotoUI.java43
-rw-r--r--src/com/android/camera/VideoModule.java7
-rw-r--r--src/com/android/camera/VideoUI.java26
-rw-r--r--src/com/android/camera/WideAnglePanoramaUI.java3
-rw-r--r--src/com/android/camera/ui/CameraControls.java6
7 files changed, 2 insertions, 294 deletions
diff --git a/src/com/android/camera/OnScreenIndicators.java b/src/com/android/camera/OnScreenIndicators.java
deleted file mode 100644
index 9d07c49e2..000000000
--- a/src/com/android/camera/OnScreenIndicators.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.camera;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.hardware.Camera;
-import android.hardware.Camera.Parameters;
-import android.util.Log;
-import android.view.View;
-import android.widget.ImageView;
-
-import org.codeaurora.snapcam.R;
-
-/**
- * The on-screen indicators of the pie menu button. They show the camera
- * settings in the viewfinder.
- */
-public class OnScreenIndicators {
- public static final String SCENE_MODE_HDR_PLUS = "hdr_plus";
-
- private final int[] mWBArray;
- private final View mOnScreenIndicators;
- private final ImageView mExposureIndicator;
- private final ImageView mFlashIndicator;
- private final ImageView mSceneIndicator;
- private final ImageView mLocationIndicator;
- private final ImageView mTimerIndicator;
- private final ImageView mWBIndicator;
-
- public OnScreenIndicators(Context ctx, View onScreenIndicatorsView) {
- TypedArray iconIds = ctx.getResources().obtainTypedArray(
- R.array.camera_wb_indicators);
- final int n = iconIds.length();
- mWBArray = new int[n];
- for (int i = 0; i < n; i++) {
- mWBArray[i] = iconIds.getResourceId(i, R.drawable.ic_indicator_wb_off);
- }
- mOnScreenIndicators = onScreenIndicatorsView;
- mExposureIndicator = (ImageView) onScreenIndicatorsView.findViewById(
- R.id.menu_exposure_indicator);
- mFlashIndicator = (ImageView) onScreenIndicatorsView.findViewById(
- R.id.menu_flash_indicator);
- mSceneIndicator = (ImageView) onScreenIndicatorsView.findViewById(
- R.id.menu_scenemode_indicator);
- mLocationIndicator = (ImageView) onScreenIndicatorsView.findViewById(
- R.id.menu_location_indicator);
- mTimerIndicator = (ImageView) onScreenIndicatorsView.findViewById(
- R.id.menu_timer_indicator);
- mWBIndicator = (ImageView) onScreenIndicatorsView.findViewById(
- R.id.menu_wb_indicator);
- mExposureIndicator.setVisibility(View.GONE);
- mFlashIndicator.setVisibility(View.GONE);
- mSceneIndicator.setVisibility(View.GONE);
- mLocationIndicator.setVisibility(View.GONE);
- mTimerIndicator.setVisibility(View.GONE);
- mWBIndicator.setVisibility(View.GONE);
- }
-
- /**
- * Resets all indicators to show the default values.
- */
- public void resetToDefault() {
- updateExposureOnScreenIndicator(0);
- updateFlashOnScreenIndicator(Parameters.FLASH_MODE_OFF);
- updateSceneOnScreenIndicator(Parameters.SCENE_MODE_AUTO);
- updateWBIndicator(2);
- updateTimerIndicator(false);
- updateLocationIndicator(false);
- }
-
- /**
- * Sets the exposure indicator using exposure compensations step rounding.
- */
- public void updateExposureOnScreenIndicator(Camera.Parameters params, int value) {
- if (mExposureIndicator == null) {
- return;
- }
- float step = params.getExposureCompensationStep();
- value = Math.round(value * step);
- updateExposureOnScreenIndicator(value);
- }
-
- /**
- * Set the exposure indicator to the given value.
- *
- * @param value Value between -3 and 3. If outside this range, 0 is used by
- * default.
- */
- public void updateExposureOnScreenIndicator(int value) {
- int id = 0;
- switch(value) {
- case -3:
- id = R.drawable.ic_indicator_ev_n3;
- break;
- case -2:
- id = R.drawable.ic_indicator_ev_n2;
- break;
- case -1:
- id = R.drawable.ic_indicator_ev_n1;
- break;
- case 0:
- id = R.drawable.ic_indicator_ev_0;
- break;
- case 1:
- id = R.drawable.ic_indicator_ev_p1;
- break;
- case 2:
- id = R.drawable.ic_indicator_ev_p2;
- break;
- case 3:
- id = R.drawable.ic_indicator_ev_p3;
- break;
- }
- mExposureIndicator.setImageResource(R.drawable.ic_settings);
- }
-
- public void updateWBIndicator(int wbIndex) {
- if (mWBIndicator == null) return;
- mWBIndicator.setImageResource(mWBArray[wbIndex]);
- }
-
- public void updateTimerIndicator(boolean on) {
- if (mTimerIndicator == null) return;
- mTimerIndicator.setImageResource(on ? R.drawable.ic_indicator_timer_on
- : R.drawable.ic_indicator_timer_off);
- }
-
- public void updateLocationIndicator(boolean on) {
- if (mLocationIndicator == null) return;
- mLocationIndicator.setImageResource(on ? R.drawable.ic_indicator_loc_on
- : R.drawable.ic_indicator_loc_off);
- }
-
- /**
- * Set the flash indicator to the given value.
- *
- * @param value One of Parameters.FLASH_MODE_OFF, Parameters.FLASH_MODE_RED_EYE,
- * Parameters.FLASH_MODE_AUTO, Parameters.FLASH_MODE_ON.
- */
- public void updateFlashOnScreenIndicator(String value) {
- if (mFlashIndicator == null) {
- return;
- }
- if (value == null || Parameters.FLASH_MODE_OFF.equals(value)) {
- mFlashIndicator.setImageResource(R.drawable.ic_indicator_flash_off);
- } else {
- if (Parameters.FLASH_MODE_AUTO.equals(value)) {
- mFlashIndicator.setImageResource(R.drawable.ic_indicator_flash_auto);
- } else if (Parameters.FLASH_MODE_ON.equals(value)
- || Parameters.FLASH_MODE_TORCH.equals(value)) {
- mFlashIndicator.setImageResource(R.drawable.ic_indicator_flash_on);
- } else if (Parameters.FLASH_MODE_RED_EYE.equals(value)) {
- mFlashIndicator.setImageResource(R.drawable.ic_indicator_flash_redeye);
- } else {
- mFlashIndicator.setImageResource(R.drawable.ic_indicator_flash_off);
- }
- }
- }
-
- /**
- * Set the scene indicator depending on the given scene mode.
- *
- * @param value the current Parameters.SCENE_MODE_* value or
- * {@link #SCENE_MODE_HDR_PLUS}.
- */
- public void updateSceneOnScreenIndicator(String value) {
- if (mSceneIndicator == null) {
- return;
- }
-
- if (SCENE_MODE_HDR_PLUS.equals(value)) {
- mSceneIndicator.setImageResource(R.drawable.ic_indicator_hdr_plus_on);
- } else if ((value == null) || Parameters.SCENE_MODE_AUTO.equals(value)) {
- mSceneIndicator.setImageResource(R.drawable.ic_indicator_sce_off);
- } else if (Parameters.SCENE_MODE_HDR.equals(value)) {
- mSceneIndicator.setImageResource(R.drawable.ic_indicator_sce_hdr);
- } else {
- mSceneIndicator.setImageResource(R.drawable.ic_indicator_sce_on);
- }
- }
-
- /**
- * Sets the visibility of all indicators.
- *
- * @param visibility View.VISIBLE, View.GONE etc.
- */
- public void setVisibility(int visibility) {
- mOnScreenIndicators.setVisibility(visibility);
- }
-}
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 077436b69..30956c4e2 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -456,8 +456,6 @@ public class PhotoModule
case SET_PHOTO_UI_PARAMS: {
setCameraParametersWhenIdle(UPDATE_PARAM_PREFERENCE);
- mUI.updateOnScreenIndicators(mParameters, mPreferenceGroup,
- mPreferences);
break;
}
@@ -2309,8 +2307,6 @@ public class PhotoModule
}
mUI.initDisplayChangeListener();
keepScreenOnAwhile();
- mUI.updateOnScreenIndicators(mParameters, mPreferenceGroup,
- mPreferences);
UsageStatistics.onContentViewChanged(
UsageStatistics.COMPONENT_CAMERA, "PhotoModule");
@@ -4264,8 +4260,6 @@ public class PhotoModule
* later by posting a message to the handler */
if (mUI.mMenuInitialized) {
setCameraParametersWhenIdle(UPDATE_PARAM_PREFERENCE);
- mUI.updateOnScreenIndicators(mParameters, mPreferenceGroup,
- mPreferences);
mActivity.initPowerShutter(mPreferences);
mActivity.initMaxBrightness(mPreferences);
} else {
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 6529051c8..d5ddaf0c7 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -110,9 +110,6 @@ public class PhotoUI implements PieListener,
private CameraControls mCameraControls;
private AlertDialog mLocationDialog;
- // Small indicators which show the camera settings in the viewfinder.
- private OnScreenIndicators mOnScreenIndicators;
-
private PieRenderer mPieRenderer;
private ZoomRenderer mZoomRenderer;
private RotateTextToast mNotSelectableToast;
@@ -293,7 +290,6 @@ public class PhotoUI implements PieListener,
setSurfaceTextureSizeChangedListener(mFaceView);
}
mFocusRing = (FocusRing) mRootView.findViewById(R.id.focus_ring);
- initIndicators();
mAnimationManager = new AnimationManager();
mOrientationResize = false;
mPrevOrientationResize = false;
@@ -470,11 +466,6 @@ public class PhotoUI implements PieListener,
return mRootView;
}
- private void initIndicators() {
- mOnScreenIndicators = new OnScreenIndicators(mActivity,
- mRootView.findViewById(R.id.on_screen_indicators));
- }
-
public void onCameraOpened(PreferenceGroup prefGroup, ComboPreferences prefs,
Camera.Parameters params, OnPreferenceChangedListener listener) {
if (mPieRenderer == null) {
@@ -507,7 +498,6 @@ public class PhotoUI implements PieListener,
mRenderOverlay.requestLayout();
initializeZoom(params);
- updateOnScreenIndicators(params, prefGroup, prefs);
mActivity.setPreviewGestures(mGestures);
}
@@ -696,30 +686,6 @@ public class PhotoUI implements PieListener,
mMenu.overrideSettings(keyvalues);
}
- public void updateOnScreenIndicators(Camera.Parameters params,
- PreferenceGroup group, ComboPreferences prefs) {
- if (params == null || group == null) return;
- mOnScreenIndicators.updateSceneOnScreenIndicator(params.getSceneMode());
- mOnScreenIndicators.updateExposureOnScreenIndicator(params,
- CameraSettings.readExposure(prefs));
- mOnScreenIndicators.updateFlashOnScreenIndicator(params.getFlashMode());
- int wbIndex = -1;
- String wb = Camera.Parameters.WHITE_BALANCE_AUTO;
- if (Camera.Parameters.SCENE_MODE_AUTO.equals(params.getSceneMode())) {
- wb = params.getWhiteBalance();
- }
- ListPreference pref = group.findPreference(CameraSettings.KEY_WHITE_BALANCE);
- if (pref != null) {
- wbIndex = pref.findIndexOfValue(wb);
- }
- // make sure the correct value was found
- // otherwise use auto index
- mOnScreenIndicators.updateWBIndicator(wbIndex < 0 ? 2 : wbIndex);
- boolean location = RecordLocationPreference.get(
- prefs, mActivity.getContentResolver());
- mOnScreenIndicators.updateLocationIndicator(location);
- }
-
public void setCameraState(int state) {
}
@@ -784,7 +750,6 @@ public class PhotoUI implements PieListener,
if (mPieRenderer != null) {
mPieRenderer.setBlockFocus(!previewFocused);
}
- setShowMenu(previewFocused);
if (!previewFocused && mCountDownView != null) mCountDownView.cancelCountDown();
}
@@ -964,12 +929,6 @@ public class PhotoUI implements PieListener,
}
}
- private void setShowMenu(boolean show) {
- if (mOnScreenIndicators != null) {
- mOnScreenIndicators.setVisibility(show ? View.VISIBLE : View.GONE);
- }
- }
-
public boolean collapseCameraControls() {
// TODO: Mode switcher should behave like a popup and should hide itself when there
// is a touch outside of it.
@@ -992,7 +951,6 @@ public class PhotoUI implements PieListener,
mCameraControls.hideCameraSettings();
mDecodeTaskForReview = new DecodeImageForReview(jpegData, orientation, mirror);
mDecodeTaskForReview.execute();
- mOnScreenIndicators.setVisibility(View.GONE);
mMenuButton.setVisibility(View.GONE);
CameraUtil.fadeIn(mReviewDoneButton);
mShutterButton.setVisibility(View.INVISIBLE);
@@ -1005,7 +963,6 @@ public class PhotoUI implements PieListener,
mDecodeTaskForReview.cancel(true);
}
mReviewImage.setVisibility(View.GONE);
- mOnScreenIndicators.setVisibility(View.VISIBLE);
mMenuButton.setVisibility(View.VISIBLE);
CameraUtil.fadeOut(mReviewDoneButton);
mShutterButton.setVisibility(View.VISIBLE);
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 6b882ae19..fd7bff616 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -321,7 +321,6 @@ public class VideoModule implements CameraModule,
private int mVideoEncoder;
private int mAudioEncoder;
- private boolean mRestartPreview = false;
private int videoWidth;
private int videoHeight;
boolean mUnsupportedResolution = false;
@@ -2625,9 +2624,6 @@ public class VideoModule implements CameraModule,
// Keep preview size up to date.
mParameters = mCameraDevice.getParameters();
- // Update UI based on the new parameters.
- mUI.updateOnScreenIndicators(mParameters, mPreferences);
-
mFocusManager.setPreviewSize(videoWidth, videoHeight);
}
@@ -2685,7 +2681,6 @@ public class VideoModule implements CameraModule,
} else {
setCameraParameters();
}
- mUI.updateOnScreenIndicators(mParameters, mPreferences);
Storage.setSaveSDCard(
mPreferences.getString(CameraSettings.KEY_CAMERA_SAVEPATH, "0").equals("1"));
mActivity.updateStorageSpaceAndHint();
@@ -2739,7 +2734,6 @@ public class VideoModule implements CameraModule,
// Start switch camera animation. Post a message because
// onFrameAvailable from the old camera may already exist.
mHandler.sendEmptyMessage(SWITCH_CAMERA_START_ANIMATION);
- mUI.updateOnScreenIndicators(mParameters, mPreferences);
//Display timelapse msg depending upon selection in front/back camera.
mUI.showTimeLapseUI(mCaptureTimeLapse);
@@ -2820,7 +2814,6 @@ public class VideoModule implements CameraModule,
}
forceFlashOffIfSupported(forceOff);
mCameraDevice.setParameters(mParameters);
- mUI.updateOnScreenIndicators(mParameters, mPreferences);
}
@Override
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index a193fa82a..d5255ccbe 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -90,7 +90,6 @@ public class VideoUI implements PieRenderer.PieListener,
private ZoomRenderer mZoomRenderer;
private PreviewGestures mGestures;
private View mMenuButton;
- private OnScreenIndicators mOnScreenIndicators;
private RotateLayout mRecordingTimeRect;
private boolean mRecordingStarted = false;
private VideoController mController;
@@ -281,9 +280,6 @@ public class VideoUI implements PieRenderer.PieListener,
});
mCameraControls = (CameraControls) mRootView.findViewById(R.id.camera_controls);
- mOnScreenIndicators = new OnScreenIndicators(mActivity,
- mRootView.findViewById(R.id.on_screen_indicators));
- mOnScreenIndicators.resetToDefault();
if (mController.isVideoCaptureIntent()) {
hideSwitcher();
mActivity.getLayoutInflater().inflate(R.layout.review_module_control,
@@ -639,16 +635,6 @@ public class VideoUI implements PieRenderer.PieListener,
mPauseButton.setOnPauseButtonListener(this);
}
- public void updateOnScreenIndicators(Parameters param, ComboPreferences prefs) {
- mOnScreenIndicators.updateExposureOnScreenIndicator(param,
- CameraSettings.readExposure(prefs));
- mOnScreenIndicators.updateFlashOnScreenIndicator(param.getFlashMode());
- boolean location = RecordLocationPreference.get(
- prefs, mActivity.getContentResolver());
- mOnScreenIndicators.updateLocationIndicator(location);
-
- }
-
public void setAspectRatio(double ratio) {
if (mOrientationResize && CameraUtil.isScreenRotated(mActivity)) {
ratio = 1 / ratio;
@@ -896,7 +882,6 @@ public class VideoUI implements PieRenderer.PieListener,
public void showRecordingUI(boolean recording) {
mRecordingStarted = recording;
mMenuButton.setVisibility(recording ? View.GONE : View.VISIBLE);
- mOnScreenIndicators.setVisibility(recording ? View.GONE : View.VISIBLE);
if (recording) {
mShutterButton.setImageResource(R.drawable.shutter_button_video_stop);
hideSwitcher();
@@ -934,27 +919,17 @@ public class VideoUI implements PieRenderer.PieListener,
CameraUtil.fadeIn(mReviewPlayButton);
mReviewImage.setVisibility(View.VISIBLE);
mMenuButton.setVisibility(View.GONE);
- mOnScreenIndicators.setVisibility(View.GONE);
}
public void hideReviewUI() {
mReviewImage.setVisibility(View.GONE);
mShutterButton.setEnabled(true);
mMenuButton.setVisibility(View.VISIBLE);
- mOnScreenIndicators.setVisibility(View.VISIBLE);
CameraUtil.fadeOut(mReviewDoneButton);
CameraUtil.fadeOut(mReviewPlayButton);
CameraUtil.fadeIn(mShutterButton);
}
- private void setShowMenu(boolean show) {
- if (mController.isVideoCaptureIntent())
- return;
- if (mOnScreenIndicators != null) {
- mOnScreenIndicators.setVisibility(show ? View.VISIBLE : View.GONE);
- }
- }
-
public void onPreviewFocusChanged(boolean previewFocused) {
if (previewFocused) {
showUI();
@@ -968,7 +943,6 @@ public class VideoUI implements PieRenderer.PieListener,
// this can not happen in capture mode
mRenderOverlay.setVisibility(previewFocused ? View.VISIBLE : View.GONE);
}
- setShowMenu(previewFocused);
}
public void initializePopup(PreferenceGroup pref) {
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java
index d811b9580..3c55adda7 100644
--- a/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/src/com/android/camera/WideAnglePanoramaUI.java
@@ -451,9 +451,8 @@ public class WideAnglePanoramaUI implements
mShutterButton = (ShutterButton) mRootView.findViewById(R.id.shutter_button);
mShutterButton.setImageResource(R.drawable.btn_new_shutter);
mShutterButton.setOnShutterButtonListener(this);
- // Hide menu and indicators.
+ // Hide menu
mRootView.findViewById(R.id.menu).setVisibility(View.GONE);
- mRootView.findViewById(R.id.on_screen_indicators).setVisibility(View.GONE);
mReview.setBackgroundColor(mReviewBackground);
// TODO: set display change listener properly.
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index c0fbf13b4..f4449182b 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -52,7 +52,6 @@ public class CameraControls extends RotatableLayout {
private View mMenu;
private View mFrontBackSwitcher;
private View mHdrSwitcher;
- private View mIndicators;
private View mPreview;
private View mSceneModeSwitcher;
private View mFilterModeSwitcher;
@@ -190,7 +189,6 @@ public class CameraControls extends RotatableLayout {
mFrontBackSwitcher = findViewById(R.id.front_back_switcher);
mHdrSwitcher = findViewById(R.id.hdr_switcher);
mMenu = findViewById(R.id.menu);
- mIndicators = findViewById(R.id.on_screen_indicators);
mPreview = findViewById(R.id.preview_thumb);
mSceneModeSwitcher = findViewById(R.id.scene_mode_switcher);
mFilterModeSwitcher = findViewById(R.id.filter_mode_switcher);
@@ -202,7 +200,7 @@ public class CameraControls extends RotatableLayout {
mFrontBackSwitcher, mMenu
};
mBottomViews = new View[] {
- mIndicators, mPreview, mShutter, mSwitcher
+ mPreview, mShutter, mSwitcher
};
mAllViews = new View[mTopViews.length + mBottomViews.length];
for (int i = 0; i < mTopViews.length; i++) {
@@ -273,7 +271,6 @@ public class CameraControls extends RotatableLayout {
}
toRight(mSwitcher, expandedShutter, rotation);
- toLeft(mIndicators, expandedShutter, rotation);
toLeft(mPreview, expandedShutter, rotation);
layoutToast(mRefocusToast, w, h, rotation);
@@ -451,7 +448,6 @@ public class CameraControls extends RotatableLayout {
shutterAnim.stop();
mMenu.setVisibility(View.VISIBLE);
- mIndicators.setVisibility(View.VISIBLE);
mPreview.setVisibility(View.VISIBLE);
mFrontBackSwitcher.animate().setListener(inlistener);