mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-02-18 12:20:36 +01:00
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
|
public class Preview extends ViewGroup
|
||||||
implements SurfaceHolder.Callback, View.OnTouchListener, View.OnClickListener, MediaScannerConnection.OnScanCompletedListener {
|
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 String TAG = Preview.class.getSimpleName();
|
||||||
private static final int FOCUS_AREA_SIZE = 100;
|
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 final float RATIO_TOLERANCE = 0.1f;
|
||||||
|
|
||||||
private static SurfaceHolder mSurfaceHolder;
|
private static SurfaceHolder mSurfaceHolder;
|
||||||
|
@ -290,8 +290,14 @@ public class MainActivity extends SimpleActivity
|
|||||||
|
|
||||||
private void handleShutter() {
|
private void handleShutter() {
|
||||||
if (mIsInPhotoMode) {
|
if (mIsInPhotoMode) {
|
||||||
mShutterBtn.animate().rotationBy(90).start();
|
toggleBottomButtons(true);
|
||||||
mPreview.takePicture();
|
mPreview.takePicture();
|
||||||
|
new Handler().postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
toggleBottomButtons(false);
|
||||||
|
}
|
||||||
|
}, Preview.PHOTO_PREVIEW_LENGTH);
|
||||||
} else {
|
} else {
|
||||||
final Resources res = getResources();
|
final Resources res = getResources();
|
||||||
final boolean isRecording = mPreview.toggleRecording();
|
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)
|
@OnClick(R.id.settings)
|
||||||
public void launchSettings() {
|
public void launchSettings() {
|
||||||
if (mSettingsBtn.getAlpha() == 1.f) {
|
if (mSettingsBtn.getAlpha() == 1.f) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user