@@ -0,0 +1,1795 @@
+/*%0A * Copyright (C) 2016 The Android Open Source Project%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.google.android.cameraview;%0A%0Aimport android.view.Surface;%0Aimport android.view.SurfaceHolder;%0Aimport android.view.View;%0A%0A%0A/**%0A * Encapsulates all the operations related to camera preview in a backward-compatible manner.%0A */%0Aabstract class PreviewImpl %7B%0A%0A    interface Callback %7B%0A        void onSurfaceChanged();%0A    %7D%0A%0A    private Callback mCallback;%0A%0A    private int mWidth;%0A%0A    private int mHeight;%0A%0A    void setCallback(Callback callback) %7B%0A        mCallback = callback;%0A    %7D%0A%0A    abstract Surface getSurface();%0A%0A    abstract View getView();%0A%0A    abstract Class getOutputClass();%0A%0A    abstract void setDisplayOrientation(int displayOrientation);%0A%0A    abstract boolean isReady();%0A%0A    protected void dispatchSurfaceChanged() %7B%0A        mCallback.onSurfaceChanged();%0A    %7D%0A%0A    SurfaceHolder getSurfaceHolder() %7B%0A        return null;%0A    %7D%0A%0A    Object getSurfaceTexture() %7B%0A        return null;%0A    %7D%0A%0A    void setBufferSize(int width, int height) %7B%0A    %7D%0A%0A    void setSize(int width, int height) %7B%0A        mWidth = width;%0A        mHeight = height;%0A    %7D%0A%0A    int getWidth() %7B%0A        return mWidth;%0A    %7D%0A%0A    int getHeight() %7B%0A        return mHeight;%0A    %7D%0A%0A%7D%0A

Create PreviewImpl.java