diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2013-09-06 11:56:32 -0700 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2013-09-18 23:57:14 -0700 |
commit | a9d66bdab247626b31dc182c4d62520b3abffdbd (patch) | |
tree | 96b6f0de3ecdf229c984e51b4d18f73859868a16 /src/com/android/camera/ui/ModuleSwitcher.java | |
parent | b2d70d5bfcebbd2deb3e8e81371204eb0fc0421b (diff) | |
download | android_packages_apps_Snap-a9d66bdab247626b31dc182c4d62520b3abffdbd.tar.gz android_packages_apps_Snap-a9d66bdab247626b31dc182c4d62520b3abffdbd.tar.bz2 android_packages_apps_Snap-a9d66bdab247626b31dc182c4d62520b3abffdbd.zip |
Adding gcam module to Camera2 app.
Bug: 10430748
Change-Id: I0c53085553cd8505ba376b1518507d36065894f5
Diffstat (limited to 'src/com/android/camera/ui/ModuleSwitcher.java')
-rw-r--r-- | src/com/android/camera/ui/ModuleSwitcher.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/camera/ui/ModuleSwitcher.java b/src/com/android/camera/ui/ModuleSwitcher.java index 69ae3b57e..882f6c931 100644 --- a/src/com/android/camera/ui/ModuleSwitcher.java +++ b/src/com/android/camera/ui/ModuleSwitcher.java @@ -35,6 +35,7 @@ import android.widget.FrameLayout.LayoutParams; import android.widget.LinearLayout; import com.android.camera.util.CameraUtil; +import com.android.camera.util.GcamHelper; import com.android.camera.util.PhotoSphereHelper; import com.android.camera.util.UsageStatistics; import com.android.camera2.R; @@ -50,11 +51,14 @@ public class ModuleSwitcher extends RotateImageView public static final int VIDEO_MODULE_INDEX = 1; public static final int WIDE_ANGLE_PANO_MODULE_INDEX = 2; public static final int LIGHTCYCLE_MODULE_INDEX = 3; + public static final int GCAM_MODULE_INDEX = 4; + private static final int[] DRAW_IDS = { R.drawable.ic_switch_camera, R.drawable.ic_switch_video, R.drawable.ic_switch_pan, R.drawable.ic_switch_photosphere, + R.drawable.ic_switch_gcam, }; public interface ModuleSwitchListener { @@ -104,6 +108,10 @@ public class ModuleSwitcher extends RotateImageView --numDrawIds; } + if (!GcamHelper.hasGcamCapture(context)) { + --numDrawIds; + } + int[] drawids = new int[numDrawIds]; int[] moduleids = new int[numDrawIds]; int ix = 0; @@ -111,6 +119,9 @@ public class ModuleSwitcher extends RotateImageView if (i == LIGHTCYCLE_MODULE_INDEX && !PhotoSphereHelper.hasLightCycleCapture(context)) { continue; // not enabled, so don't add to UI } + if (i == GCAM_MODULE_INDEX && !GcamHelper.hasGcamCapture(context)) { + continue; // not enabled, so don't add to UI + } moduleids[ix] = i; drawids[ix++] = DRAW_IDS[i]; } @@ -200,6 +211,10 @@ public class ModuleSwitcher extends RotateImageView item.setContentDescription(getContext().getResources().getString( R.string.accessibility_switch_to_photo_sphere)); break; + case R.drawable.ic_switch_gcam: + item.setContentDescription(getContext().getResources().getString( + R.string.accessibility_switch_to_gcam)); + break; default: break; } |