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

Commit dab01048 authored by Shamali Patwa's avatar Shamali Patwa Committed by Android (Google) Code Review
Browse files

Merge "Add a factory for PreviewPositionHelper" into main

parents 34eaed1a 61ee45f2
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -208,4 +208,19 @@ public class PreviewPositionHelper {
        }
        mMatrix.postTranslate(translateX, translateY);
    }

    /**
     * A factory that returns a new instance of the {@link PreviewPositionHelper}.
     * <p>{@link PreviewPositionHelper} is a stateful helper, and hence when using it in distinct
     * scenarios, prefer fetching an object using this factory</p>
     * <p>Additionally, helpful for injecting mocks in tests</p>
     */
    public static class PreviewPositionHelperFactory {
        /**
         * Returns a new {@link PreviewPositionHelper} for use in a distinct scenario.
         */
        public PreviewPositionHelper create() {
            return new PreviewPositionHelper();
        }
    }
}