hide the bottom buttons for a second on photo taken
This commit is contained in:
parent
276c47d4f0
commit
18c060eb71
|
@ -31,9 +31,9 @@ import java.util.List;
|
|||
|
||||
public class Preview extends ViewGroup
|
||||
implements SurfaceHolder.Callback, View.OnTouchListener, View.OnClickListener, MediaScannerConnection.OnScanCompletedListener {
|
||||
public static final int PHOTO_PREVIEW_LENGTH = 1000;
|
||||
private static final String TAG = Preview.class.getSimpleName();
|
||||
private static final int FOCUS_AREA_SIZE = 100;
|
||||
private static final int PHOTO_PREVIEW_LENGTH = 1000;
|
||||
private static final float RATIO_TOLERANCE = 0.1f;
|
||||
|
||||
private static SurfaceHolder mSurfaceHolder;
|
||||
|
|
|
@ -290,8 +290,14 @@ public class MainActivity extends SimpleActivity
|
|||
|
||||
private void handleShutter() {
|
||||
if (mIsInPhotoMode) {
|
||||
mShutterBtn.animate().rotationBy(90).start();
|
||||
toggleBottomButtons(true);
|
||||
mPreview.takePicture();
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
toggleBottomButtons(false);
|
||||
}
|
||||
}, Preview.PHOTO_PREVIEW_LENGTH);
|
||||
} else {
|
||||
final Resources res = getResources();
|
||||
final boolean isRecording = mPreview.toggleRecording();
|
||||
|
@ -307,6 +313,12 @@ public class MainActivity extends SimpleActivity
|
|||
}
|
||||
}
|
||||
|
||||
private void toggleBottomButtons(Boolean hide) {
|
||||
mShutterBtn.animate().alpha(hide ? 0 : 1).start();
|
||||
mToggleCameraBtn.animate().alpha(hide ? 0 : 1).start();
|
||||
mToggleFlashBtn.animate().alpha(hide ? 0 : 1).start();
|
||||
}
|
||||
|
||||
@OnClick(R.id.settings)
|
||||
public void launchSettings() {
|
||||
if (mSettingsBtn.getAlpha() == 1.f) {
|
||||
|
|
Loading…
Reference in New Issue