mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-26 09:17:20 +00:00

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
34 lines
810 B
Java
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;
|
|
}
|
|
}
|