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

Commit bdd861e2 authored by Mark Renouf's avatar Mark Renouf
Browse files

Adds two UiEvent IDs for actions on long screenshots

After completing a long screenshot, and viewing the result:

SCREENSHOT_LONG_SCREEHSHOT_SAVE

 -  Logged when the "Save" button is tapped

SCREENSHOT_LONG_SCREENSHOT_EXIT

 - Logged then the "Cancel" button is tapped

Bug: 200295026
Test: manually, make statsd_testdrive && statsd_testdrive 90
Change-Id: Iba841287a31853685cfe2596f5a591b31c1166af
parent e59a2d90
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public class LongScreenshotActivity extends Activity {
    private ImageView mTransitionView;
    private ImageView mEnterTransitionView;
    private View mSave;
    private View mCancel;
    private View mEdit;
    private View mShare;
    private CropView mCropView;
@@ -119,15 +120,15 @@ public class LongScreenshotActivity extends Activity {
        mSave = requireViewById(R.id.save);
        mEdit = requireViewById(R.id.edit);
        mShare = requireViewById(R.id.share);
        mCancel = requireViewById(R.id.cancel);
        mCropView = requireViewById(R.id.crop_view);
        mMagnifierView = requireViewById(R.id.magnifier);
        mCropView.setCropInteractionListener(mMagnifierView);
        mTransitionView = requireViewById(R.id.transition);
        mEnterTransitionView = requireViewById(R.id.enter_transition);

        requireViewById(R.id.cancel).setOnClickListener(v -> finishAndRemoveTask());

        mSave.setOnClickListener(this::onClicked);
        mCancel.setOnClickListener(this::onClicked);
        mEdit.setOnClickListener(this::onClicked);
        mShare.setOnClickListener(this::onClicked);

@@ -353,6 +354,7 @@ public class LongScreenshotActivity extends Activity {
        v.setPressed(true);
        setButtonsEnabled(false);
        if (id == R.id.save) {
            mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_SAVED);
            startExport(PendingAction.SAVE);
        } else if (id == R.id.edit) {
            mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_EDIT);
@@ -360,6 +362,9 @@ public class LongScreenshotActivity extends Activity {
        } else if (id == R.id.share) {
            mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_SHARE);
            startExport(PendingAction.SHARE);
        } else if (id == R.id.cancel) {
            mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_EXIT);
            finishAndRemoveTask();
        }
    }

+5 −1
Original line number Diff line number Diff line
@@ -83,7 +83,11 @@ public enum ScreenshotEvent implements UiEventLogger.UiEventEnum {
    @UiEvent(doc = "Long screenshot editor activity loaded a previously saved screenshot")
    SCREENSHOT_LONG_SCREENSHOT_ACTIVITY_CACHED_IMAGE_LOADED(890),
    @UiEvent(doc = "Long screenshot editor activity finished")
    SCREENSHOT_LONG_SCREENSHOT_ACTIVITY_FINISHED(891);
    SCREENSHOT_LONG_SCREENSHOT_ACTIVITY_FINISHED(891),
    @UiEvent(doc = "User has saved a long screenshot to a file")
    SCREENSHOT_LONG_SCREENSHOT_SAVED(910),
    @UiEvent(doc = "User has discarded the result of a long screenshot")
    SCREENSHOT_LONG_SCREENSHOT_EXIT(911);

    private final int mId;