Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93106f9c authored by Mark Harman's avatar Mark Harman
Browse files

Don't clear toast for extension progress.

parent 1fd6023c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
<pre>
Version 1.55 (Work in progress)

FIXED   Ensure the info text for capture progress in x- extension modes remains visible until 100%.
UPDATED Shutter button now changes to a red square when recording video.
UPDATED Smooth zoom transition when using zoom seekbar (for Camera2 API).
UPDATED Removed -/+ controls for zoom and exposure compensation (these "zoom controls" are now
+3 −1
Original line number Diff line number Diff line
@@ -2930,7 +2930,9 @@ public class MyApplicationInterface extends BasicApplicationInterface {
        if( getPhotoMode() == PhotoMode.X_Night ) {
            message = getContext().getResources().getString(R.string.preference_nr_mode_low_light_message) + "\n";
        }
        main_activity.getPreview().showToast(null, message + progress + "%", true);
        // call with dont_clear==true, as on some devices (e.g., Galaxy S24+ in X-Night mode), there can be a pause long enough that
        // the toast would clear, even when not at 100%
        main_activity.getPreview().showToast(null, message + progress + "%", true, true);
    }

    @Override
+25 −9
Original line number Diff line number Diff line
@@ -8153,10 +8153,22 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu
        showToast(clear_toast, message, 32, use_fake_toast);
    }

    public void showToast(final ToastBoxer clear_toast, final String message, final boolean use_fake_toast, boolean dont_clear) {
        showToast(clear_toast, message, 32, use_fake_toast, dont_clear);
    }

    /*public void showToast(final ToastBoxer clear_toast, final String message, final boolean use_fake_toast, int duration) {
        showToast(clear_toast, message, 32, use_fake_toast, duration);
    }*/

    /*public void showToast(final String message, final int offset_y_dp, final boolean use_fake_toast) {
        showToast(null, message, offset_y_dp, use_fake_toast);
    }*/

    public void showToast(final ToastBoxer clear_toast, final String message, final int offset_y_dp, final boolean use_fake_toast) {
        showToast(clear_toast, message, offset_y_dp, use_fake_toast, false);
    }

    /** Displays a "toast", but has several advantages over calling Android's Toast API directly.
     *  We use a custom view, to rotate the toast to account for the device orientation (since
     *  Open Camera always runs in landscape).
@@ -8183,8 +8195,10 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu
     *                       we want the Android toast look such as for an error message).
     *                       Usages where we want to display info on the Preview should always set
     *                       use_fake_toast==true for a consistent look.
     * @param dont_clear     If true, then the toast will remain until explicitly cleared via
     *                       clearActiveFakeToast(). Only supported if use_fake_toast==true.
     */
    public void showToast(final ToastBoxer clear_toast, final String message, final int offset_y_dp, final boolean use_fake_toast) {
    public void showToast(final ToastBoxer clear_toast, final String message, final int offset_y_dp, final boolean use_fake_toast, boolean dont_clear) {
        //final boolean use_fake_toast = true;
        //final boolean use_fake_toast = old_use_fake_toast;
        if( !applicationInterface.getShowToastsPref() ) {
@@ -8255,6 +8269,7 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu
                    // but we remove callbacks always just in case
                    fake_toast_handler.removeCallbacksAndMessages(null);

                    if( !dont_clear ) {
                        fake_toast_handler.postDelayed(new Runnable() {
                            @Override
                            public void run() {
@@ -8263,6 +8278,7 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu
                                clearActiveFakeToast(true);
                            }
                        }, 2000); // supposedly matches Toast.LENGTH_SHORT
                    }

                    return;
                }