Jake McGinty 8fd0ea39aa Simplify excessively convoluted camera logic
1) QuickCamera logic moved into CameraView

2) The strategies for texture vs. surface view were too complex
   with no observed gain. Better to remove and have to re-add
   if necessary than assume it to be necessary.

3) Drop CWAC-Camera dependency - the device profiles weren't being
   used very much and even that is deprecated so we'd be left on
   our own with new hardware. Not worth it.

4) Selfies first.

5) Layout/orientation mathy logic from CWAC moved into CameraUtils,
   with the  hopes that most of it might be further simplified or
   rendered unnecessary in the future.

Closes #4326

// FREEBIE
2015-11-04 17:56:20 -08:00

34 lines
810 B
Java

package org.thoughtcrime.securesms.components.camera;
import android.content.Context;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
public class CameraSurfaceView extends SurfaceView implements SurfaceHolder.Callback {
private boolean ready;
@SuppressWarnings("deprecation")
public CameraSurfaceView(Context context) {
super(context);
getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
getHolder().addCallback(this);
}
public boolean isReady() {
return ready;
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
ready = true;
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
ready = false;
}
}