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

Commit a234acb5 authored by Mark Renouf's avatar Mark Renouf Committed by Android (Google) Code Review
Browse files

Merge "Adds two UiEvent IDs for actions on long screenshots"

parents c67f7700 bdd861e2
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;