summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-01-14 14:56:10 +0100
committerDanny Baumann <dannybaumann@web.de>2016-01-20 23:31:01 -0800
commit4faa77d616d3637e628816da0d24bb0ea3432cd2 (patch)
tree05524c1a1b3d3ddf4b07a3d6979fd39ec0fe8b1c
parent96b38fddc1aa487755e6c186df9e18ab70165d38 (diff)
downloadandroid_packages_apps_Snap-4faa77d616d3637e628816da0d24bb0ea3432cd2.zip
android_packages_apps_Snap-4faa77d616d3637e628816da0d24bb0ea3432cd2.tar.gz
android_packages_apps_Snap-4faa77d616d3637e628816da0d24bb0ea3432cd2.tar.bz2
Avoid static member variable.
Change-Id: I3758bb219552d22768afa0af83c69c6a5460693b
-rw-r--r--src/com/android/camera/PhotoMenu.java3
-rw-r--r--src/com/android/camera/PhotoUI.java6
-rw-r--r--src/com/android/camera/VideoMenu.java3
-rw-r--r--src/com/android/camera/VideoUI.java6
-rw-r--r--src/com/android/camera/WideAnglePanoramaUI.java2
-rw-r--r--src/com/android/camera/ui/CameraControls.java22
6 files changed, 24 insertions, 18 deletions
diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java
index 7b71959..e38c872 100644
--- a/src/com/android/camera/PhotoMenu.java
+++ b/src/com/android/camera/PhotoMenu.java
@@ -44,7 +44,6 @@ import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
import com.android.camera.CameraPreference.OnPreferenceChangedListener;
-import com.android.camera.ui.CameraControls;
import com.android.camera.ui.CountdownTimerPopup;
import com.android.camera.ui.ListSubMenu;
import com.android.camera.ui.ListMenu;
@@ -1030,7 +1029,7 @@ public class PhotoMenu extends MenuController
}
public void openFirstLevel() {
- if (isMenuBeingShown() || CameraControls.isAnimating())
+ if (isMenuBeingShown() || mUI.isCameraControlsAnimating())
return;
if (mListMenu == null || mPopupStatus != POPUP_FIRST_LEVEL) {
initializePopup();
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 481463f..6529051 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -531,12 +531,16 @@ public class PhotoUI implements PieListener,
}
}
+ public boolean isCameraControlsAnimating() {
+ return mCameraControls.isAnimating();
+ }
+
public void initializeControlByIntent() {
mThumbnail = (ImageView) mRootView.findViewById(R.id.preview_thumb);
mThumbnail.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- if (!CameraControls.isAnimating()
+ if (!isCameraControlsAnimating()
&& mController.getCameraState() != PhotoController.SNAPSHOT_IN_PROGRESS)
mActivity.gotoGallery();
}
diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java
index e8aca48..b2805ac 100644
--- a/src/com/android/camera/VideoMenu.java
+++ b/src/com/android/camera/VideoMenu.java
@@ -38,7 +38,6 @@ import android.widget.LinearLayout;
import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
-import com.android.camera.ui.CameraControls;
import com.android.camera.ui.ListSubMenu;
import com.android.camera.ui.ListMenu;
import com.android.camera.ui.TimeIntervalPopup;
@@ -641,7 +640,7 @@ public class VideoMenu extends MenuController
}
public void openFirstLevel() {
- if (isMenuBeingShown() || CameraControls.isAnimating())
+ if (isMenuBeingShown() || mUI.isCameraControlsAnimating())
return;
if (mListMenu == null || mPopupStatus != POPUP_FIRST_LEVEL) {
initializePopup();
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 3f5a73e..a193fa8 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -599,7 +599,7 @@ public class VideoUI implements PieRenderer.PieListener,
@Override
public void onClick(View v) {
// Do not allow navigation to filmstrip during video recording
- if (!mRecordingStarted && !CameraControls.isAnimating()) {
+ if (!mRecordingStarted && !isCameraControlsAnimating()) {
mActivity.gotoGallery();
}
}
@@ -611,6 +611,10 @@ public class VideoUI implements PieRenderer.PieListener,
mActivity.setPreviewGestures(mGestures);
}
+ public boolean isCameraControlsAnimating() {
+ return mCameraControls.isAnimating();
+ }
+
public void setPrefChangedListener(OnPreferenceChangedListener listener) {
mVideoMenu.setListener(listener);
}
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java
index 862e4d2..d811b95 100644
--- a/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/src/com/android/camera/WideAnglePanoramaUI.java
@@ -124,7 +124,7 @@ public class WideAnglePanoramaUI implements
mThumbnail.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- if (!CameraControls.isAnimating())
+ if (!mCameraControls.isAnimating())
mActivity.gotoGallery();
}
});
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index 892981e..c0fbf13 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -61,7 +61,7 @@ public class CameraControls extends RotatableLayout {
private int mSize;
private static final int WIDTH_GRID = 5;
private static final int HEIGHT_GRID = 7;
- private static boolean isAnimating = false;
+ private boolean mAnimating = false;
private ArrayList<View> mViewList;
private View[] mAllViews, mTopViews, mBottomViews;
private static final int ANIME_DURATION = 300;
@@ -92,7 +92,7 @@ public class CameraControls extends RotatableLayout {
for (View v : mAllViews) {
v.setVisibility(View.INVISIBLE);
}
- isAnimating = false;
+ mAnimating = false;
enableTouch(true);
}
@@ -101,7 +101,7 @@ public class CameraControls extends RotatableLayout {
for (View v : mAllViews) {
v.setVisibility(View.INVISIBLE);
}
- isAnimating = false;
+ mAnimating = false;
enableTouch(true);
}
};
@@ -118,13 +118,13 @@ public class CameraControls extends RotatableLayout {
@Override
public void onAnimationEnd(Animator animation) {
- isAnimating = false;
+ mAnimating = false;
enableTouch(true);
}
@Override
public void onAnimationCancel(Animator animation) {
- isAnimating = false;
+ mAnimating = false;
enableTouch(true);
}
};
@@ -146,8 +146,8 @@ public class CameraControls extends RotatableLayout {
this(context, null);
}
- public static boolean isAnimating() {
- return isAnimating;
+ public boolean isAnimating() {
+ return mAnimating;
}
public void enableTouch(boolean enable) {
@@ -399,9 +399,9 @@ public class CameraControls extends RotatableLayout {
}
public void hideUI() {
- if(!isAnimating)
+ if (!mAnimating)
enableTouch(false);
- isAnimating = true;
+ mAnimating = true;
int rotation = getUnifiedRotation();
for (View v : mAllViews) {
v.animate().cancel();
@@ -434,9 +434,9 @@ public class CameraControls extends RotatableLayout {
}
public void showUI() {
- if(!isAnimating)
+ if (!mAnimating)
enableTouch(false);
- isAnimating = true;
+ mAnimating = true;
int rotation = getUnifiedRotation();
for (View v : mAllViews) {
v.animate().cancel();