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

This commit is contained in:
Mark Renouf
2021-10-21 20:55:11 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 3 deletions

View File

@@ -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();
}
}

View File

@@ -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;