From ac6814d06186cdbb850a5f3c0d45896ea9d88867 Mon Sep 17 00:00:00 2001 From: Dylan McIntyre Date: Wed, 15 Feb 2017 15:25:06 -0500 Subject: [PATCH] Toast feedback --- .../com/flurgle/camerakit/demo/MainActivity.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/demo/src/main/java/com/flurgle/camerakit/demo/MainActivity.java b/demo/src/main/java/com/flurgle/camerakit/demo/MainActivity.java index 149fccd1..19b3af35 100644 --- a/demo/src/main/java/com/flurgle/camerakit/demo/MainActivity.java +++ b/demo/src/main/java/com/flurgle/camerakit/demo/MainActivity.java @@ -95,8 +95,6 @@ public class MainActivity extends AppCompatActivity { width.setText(String.valueOf(mCameraWidth)); height.setText(String.valueOf(mCameraHeight)); - - camera.removeOnLayoutChangeListener(this); } }); @@ -195,6 +193,8 @@ public class MainActivity extends AppCompatActivity { CameraKit.Constants.PICTURE_MODE_QUALITY : CameraKit.Constants.PICTURE_MODE_SPEED ); + + Toast.makeText(MainActivity.this, "Picture capture set to" + (checkedId == R.id.modeCaptureQuality ? " quality!" : " speed!"), Toast.LENGTH_SHORT).show(); } }; @@ -204,6 +204,8 @@ public class MainActivity extends AppCompatActivity { camera.setCropOutput( checkedId == R.id.modeCropVisible ); + + Toast.makeText(MainActivity.this, "Picture cropping is" + (checkedId == R.id.modeCropVisible ? " on!" : " off!"), Toast.LENGTH_SHORT).show(); } }; @@ -217,6 +219,8 @@ public class MainActivity extends AppCompatActivity { CameraKit.Constants.TAP_TO_FOCUS_INVISIBLE : CameraKit.Constants.TAP_TO_FOCUS_OFF ); + + Toast.makeText(MainActivity.this, "Tap to focus is" + (checkedId == R.id.modeTapToFocusOff ? " off!" : (checkedId == R.id.modeTapToFocusVisible) ? " on and visible!" : " on and invisible!"), Toast.LENGTH_SHORT).show(); } }; @@ -240,6 +244,8 @@ public class MainActivity extends AppCompatActivity { width.clearFocus(); width.setEnabled(checkedId == R.id.widthCustom); width.setAlpha(checkedId == R.id.widthCustom ? 1f : 0.5f); + + updateCamera(true, false); } }; @@ -263,6 +269,8 @@ public class MainActivity extends AppCompatActivity { height.clearFocus(); height.setEnabled(checkedId == R.id.heightCustom); height.setAlpha(checkedId == R.id.heightCustom ? 1f : 0.5f); + + updateCamera(false, true); } }; @@ -332,6 +340,8 @@ public class MainActivity extends AppCompatActivity { } }); camera.setLayoutParams(cameraLayoutParams); + + Toast.makeText(this, (updateWidth && updateHeight ? "Width and height" : updateWidth ? "Width" : "Height") + " updated!", Toast.LENGTH_SHORT).show(); } }