summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjrizzoli <joey@cyanogenmoditalia.it>2016-01-07 21:07:51 +0100
committerArne Coucheron <arco68@gmail.com>2018-01-26 01:08:31 +0100
commita0df98edb234a6f4702e1f01df3b67a243103fd1 (patch)
tree240fbe0144590ffc7bd62dbf201803155dd2ad54 /src
parent026807dfd5e0b97eef54b24975937b0d038bdbb5 (diff)
downloadandroid_packages_apps_Snap-a0df98edb234a6f4702e1f01df3b67a243103fd1.tar.gz
android_packages_apps_Snap-a0df98edb234a6f4702e1f01df3b67a243103fd1.tar.bz2
android_packages_apps_Snap-a0df98edb234a6f4702e1f01df3b67a243103fd1.zip
Snap: initial materialization
Just for initial ship Change-Id: I8d6c0d71d1b94e6eb2f43ab962fb92de0e6c7093 Signed-off-by: jrizzoli <joey@cyanogenmoditalia.it>
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/PhotoModule.java2
-rw-r--r--src/com/android/camera/PhotoUI.java20
-rw-r--r--src/com/android/camera/ShutterButton.java49
-rwxr-xr-xsrc/com/android/camera/ui/CameraControls.java2
-rw-r--r--src/com/android/camera/ui/ModuleSwitcher.java2
-rw-r--r--src/com/android/camera/ui/OneUICameraControls.java2
-rw-r--r--src/com/android/camera/ui/Switch.java2
7 files changed, 6 insertions, 73 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 57fcc40ad..21d742bb9 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1111,8 +1111,6 @@ public class PhotoModule
return;
}
- mUI.doShutterAnimation();
-
Location loc = getLocationAccordPictureFormat(mParameters.get(KEY_PICTURE_FORMAT));
mLongShotCaptureCount++;
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index c1ccd9b41..42d691e27 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -677,29 +677,11 @@ public class PhotoUI implements PieListener,
// called from onResume but only the first time
public void initializeFirstTime() {
// Initialize shutter button.
- mShutterButton.setImageResource(R.drawable.shutter_button_anim);
- mShutterButton.setOnClickListener(new OnClickListener()
- {
- @Override
- public void onClick(View v) {
- if (!CameraControls.isAnimating())
- doShutterAnimation();
- if (mController.isImageCaptureIntent()) {
- mCameraControls.setTitleBarVisibility(View.VISIBLE);
- }
- }
- });
-
+ mShutterButton.setImageResource(R.drawable.btn_new_shutter);
mShutterButton.setOnShutterButtonListener(mController);
mShutterButton.setVisibility(View.VISIBLE);
}
- public void doShutterAnimation() {
- AnimationDrawable frameAnimation = (AnimationDrawable) mShutterButton.getDrawable();
- frameAnimation.stop();
- frameAnimation.start();
- }
-
// called from onResume every other time
public void initializeSecondTime(Camera.Parameters params) {
initializeZoom(params);
diff --git a/src/com/android/camera/ShutterButton.java b/src/com/android/camera/ShutterButton.java
index b35658070..22223510c 100644
--- a/src/com/android/camera/ShutterButton.java
+++ b/src/com/android/camera/ShutterButton.java
@@ -22,14 +22,12 @@ import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
-import com.android.camera.ui.RotateImageView;
-
/**
* A button designed to be used for the on-screen shutter button.
* It's currently an {@code ImageView} that can call a delegate when the
* pressed state changes.
*/
-public class ShutterButton extends RotateImageView {
+public class ShutterButton extends ImageView {
private class LongClickListener implements View.OnLongClickListener {
public boolean onLongClick(View v) {
@@ -84,51 +82,6 @@ public class ShutterButton extends RotateImageView {
setLongClickable(enable);
}
- /**
- * Hook into the drawable state changing to get changes to isPressed -- the
- * onPressed listener doesn't always get called when the pressed state
- * changes.
- */
- @Override
- protected void drawableStateChanged() {
- super.drawableStateChanged();
- final boolean pressed = isPressed();
- if (pressed != mOldPressed) {
- if (!pressed) {
- // When pressing the physical camera button the sequence of
- // events is:
- // focus pressed, optional camera pressed, focus released.
- // We want to emulate this sequence of events with the shutter
- // button. When clicking using a trackball button, the view
- // system changes the drawable state before posting click
- // notification, so the sequence of events is:
- // pressed(true), optional click, pressed(false)
- // When clicking using touch events, the view system changes the
- // drawable state after posting click notification, so the
- // sequence of events is:
- // pressed(true), pressed(false), optional click
- // Since we're emulating the physical camera button, we want to
- // have the same order of events. So we want the optional click
- // callback to be delivered before the pressed(false) callback.
- //
- // To do this, we delay the posting of the pressed(false) event
- // slightly by pushing it on the event queue. This moves it
- // after the optional click notification, so our client always
- // sees events in this sequence:
- // pressed(true), optional click, pressed(false)
- post(new Runnable() {
- @Override
- public void run() {
- callShutterButtonFocus(pressed);
- }
- });
- } else {
- callShutterButtonFocus(pressed);
- }
- mOldPressed = pressed;
- }
- }
-
private void callShutterButtonFocus(boolean pressed) {
if (mListener != null) {
mListener.onShutterButtonFocus(pressed);
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index eb69aa384..30136bde5 100755
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -1100,7 +1100,7 @@ public class CameraControls extends RotatableLayout {
View[] views = {
mSceneModeSwitcher, mFilterModeSwitcher, mFrontBackSwitcher,
TsMakeupManager.HAS_TS_MAKEUP ? mTsMakeupSwitcher : mHdrSwitcher,mBokehSwitcher,
- mMenu, mShutter, mPreview, mSwitcher, mMute, mReviewRetakeButton,
+ mMenu, mPreview, mSwitcher, mMute, mReviewRetakeButton,
mReviewCancelButton, mReviewDoneButton, mExitPanorama
};
for (View v : views) {
diff --git a/src/com/android/camera/ui/ModuleSwitcher.java b/src/com/android/camera/ui/ModuleSwitcher.java
index d96775d14..e9a9a5419 100644
--- a/src/com/android/camera/ui/ModuleSwitcher.java
+++ b/src/com/android/camera/ui/ModuleSwitcher.java
@@ -102,7 +102,7 @@ public class ModuleSwitcher extends RotateImageView
private void init(Context context) {
mItemSize = context.getResources().getDimensionPixelSize(R.dimen.switcher_size);
- mIndicator = context.getResources().getDrawable(R.drawable.ic_switcher_menu_indicator);
+ mIndicator = context.getResources().getDrawable(R.color.transparent);
initializeDrawables(context);
}
diff --git a/src/com/android/camera/ui/OneUICameraControls.java b/src/com/android/camera/ui/OneUICameraControls.java
index 236a49243..1a0b7cebb 100644
--- a/src/com/android/camera/ui/OneUICameraControls.java
+++ b/src/com/android/camera/ui/OneUICameraControls.java
@@ -229,7 +229,7 @@ public class OneUICameraControls extends RotatableLayout {
mViews = new View[]{
mSceneModeSwitcher, mFilterModeSwitcher, mFrontBackSwitcher,
- mTsMakeupSwitcher, mFlashButton, mShutter, mPreview, mVideoShutter,
+ mTsMakeupSwitcher, mFlashButton, mPreview, mVideoShutter,
mPauseButton, mCancelButton
};
mBottomLargeSize = getResources().getDimensionPixelSize(
diff --git a/src/com/android/camera/ui/Switch.java b/src/com/android/camera/ui/Switch.java
index 3e7b9bfb9..68fb36542 100644
--- a/src/com/android/camera/ui/Switch.java
+++ b/src/com/android/camera/ui/Switch.java
@@ -123,7 +123,7 @@ public class Switch extends CompoundButton {
mSwitchMinWidth = res.getDimensionPixelSize(R.dimen.switch_min_width);
mSwitchTextMaxWidth = res.getDimensionPixelSize(R.dimen.switch_text_max_width);
mSwitchPadding = res.getDimensionPixelSize(R.dimen.switch_padding);
- setSwitchTextAppearance(context, android.R.style.TextAppearance_Holo_Small);
+ setSwitchTextAppearance(context, android.R.style.TextAppearance_Material_Small);
ViewConfiguration config = ViewConfiguration.get(context);
mTouchSlop = config.getScaledTouchSlop();