summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/util
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-10-15 19:55:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-15 19:55:18 +0000
commitd3e75bd748ce2be8fdcb30575bbde9bd07536bd3 (patch)
tree706e47f2377bc808eab20d48bd7ae20a7acbd27c /src/com/android/camera/util
parent177c4b05ed8e9f71afc526e5cad339f245563450 (diff)
parent160b036386b1b60ff3fce9742ce66bfcd54d6430 (diff)
downloadandroid_packages_apps_Snap-d3e75bd748ce2be8fdcb30575bbde9bd07536bd3.tar.gz
android_packages_apps_Snap-d3e75bd748ce2be8fdcb30575bbde9bd07536bd3.tar.bz2
android_packages_apps_Snap-d3e75bd748ce2be8fdcb30575bbde9bd07536bd3.zip
Merge "CameraUtil: add float clamp function" into gb-ub-photos-carlsbad
Diffstat (limited to 'src/com/android/camera/util')
-rw-r--r--src/com/android/camera/util/CameraUtil.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index 9f4ea91f5..458ae04f2 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -393,6 +393,12 @@ public class CameraUtil {
return x;
}
+ public static float clamp(float x, float min, float max) {
+ if (x > max) return max;
+ if (x < min) return min;
+ return x;
+ }
+
public static int getDisplayRotation(Activity activity) {
int rotation = activity.getWindowManager().getDefaultDisplay()
.getRotation();
@@ -826,7 +832,7 @@ public class CameraUtil {
}
private static class ImageFileNamer {
- private SimpleDateFormat mFormat;
+ private final SimpleDateFormat mFormat;
// The date (in milliseconds) used to generate the last name.
private long mLastDate;