/** * Set scale, center and orientation from saved state. */ private void restoreState(ImageViewState state) { if (state != null && VALID_ORIENTATIONS.contains(state.getOrientation())) { this.orientation = state.getOrientation(); this.pendingScale = state.getScale(); this.sPendingCenter = state.getCenter(); invalidate(); } }
/** * Set scale, center and orientation from saved state. */ private void restoreState(ImageViewState state) { if (state != null && state.getCenter() != null && VALID_ORIENTATIONS.contains(state.getOrientation())) { this.orientation = state.getOrientation(); this.pendingScale = state.getScale(); this.sPendingCenter = state.getCenter(); invalidate(); } }
public State getCropImageViewState() { ImageViewState state = getState(); if (state != null) { return new State(state.getScale(), state.getCenter(), state.getOrientation(), cropRect, aspectRatio); } return null; }