summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoey Rizzoli <joey@lineageos.org>2017-12-15 21:54:27 +0100
committerArne Coucheron <arco68@gmail.com>2018-01-27 00:41:45 +0100
commiteedcecc62459dbebee63d39ed0a07e1bd7733688 (patch)
tree18adceaa652c1c851b225335c7d262eb5a29461e /src
parent36da09e8ad11fe88ea15af2fabca8718624900b9 (diff)
downloadandroid_packages_apps_Snap-eedcecc62459dbebee63d39ed0a07e1bd7733688.tar.gz
android_packages_apps_Snap-eedcecc62459dbebee63d39ed0a07e1bd7733688.tar.bz2
android_packages_apps_Snap-eedcecc62459dbebee63d39ed0a07e1bd7733688.zip
Snap: add QReader to module switch
Change-Id: I7cc33c7ebc6de35d19979a9a70f198029e46d88f Signed-off-by: Joey Rizzoli <joey@lineageos.org>
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/CameraActivity.java8
-rw-r--r--src/com/android/camera/ui/ModuleSwitcher.java13
2 files changed, 17 insertions, 4 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index c28cc95ce..b48a232b4 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -120,6 +120,8 @@ import com.android.camera.util.PhotoSphereHelper.PanoramaViewHelper;
import com.android.camera.util.UsageStatistics;
import org.codeaurora.snapcam.R;
+import org.lineageos.quickreader.ScannerActivity;
+
import java.io.File;
import java.io.IOException;
@@ -2141,6 +2143,12 @@ public class CameraActivity extends Activity
@Override
public void onModuleSelected(int moduleIndex) {
+ if (moduleIndex == ModuleSwitcher.QR_MODULE_INDEX) {
+ startActivity(new Intent(this, ScannerActivity.class));
+ finish();
+ return;
+ }
+
mForceReleaseCamera = moduleIndex == ModuleSwitcher.CAPTURE_MODULE_INDEX ||
(mCamera2enabled && moduleIndex == ModuleSwitcher.PHOTO_MODULE_INDEX);
if (mForceReleaseCamera) {
diff --git a/src/com/android/camera/ui/ModuleSwitcher.java b/src/com/android/camera/ui/ModuleSwitcher.java
index e9a9a5419..8b4797f60 100644
--- a/src/com/android/camera/ui/ModuleSwitcher.java
+++ b/src/com/android/camera/ui/ModuleSwitcher.java
@@ -51,10 +51,11 @@ public class ModuleSwitcher extends RotateImageView
public static final int PHOTO_MODULE_INDEX = 0;
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;
- public static final int CAPTURE_MODULE_INDEX = 5;
- public static final int PANOCAPTURE_MODULE_INDEX = 6;
+ public static final int QR_MODULE_INDEX = 3;
+ public static final int LIGHTCYCLE_MODULE_INDEX = 4;
+ public static final int GCAM_MODULE_INDEX = 5;
+ public static final int CAPTURE_MODULE_INDEX = 6;
+ public static final int PANOCAPTURE_MODULE_INDEX = 7;
private boolean mTouchEnabled = true;
private boolean mIsVisible = true;
@@ -63,6 +64,7 @@ public class ModuleSwitcher extends RotateImageView
R.drawable.ic_switch_camera,
R.drawable.ic_switch_video,
R.drawable.ic_switch_pan,
+ R.drawable.ic_cam_switcher_qr,
R.drawable.ic_switch_photosphere,
R.drawable.ic_switch_gcam,
};
@@ -231,6 +233,9 @@ public class ModuleSwitcher extends RotateImageView
item.setContentDescription(getContext().getResources().getString(
R.string.accessibility_switch_to_panorama));
break;
+ case R.drawable.ic_cam_switcher_qr:
+ item.setContentDescription(getContext().getResources().getString(
+ R.string.accessibility_switch_to_qr));
case R.drawable.ic_switch_photosphere:
item.setContentDescription(getContext().getResources().getString(
R.string.accessibility_switch_to_photo_sphere));