View Camera Preview Surface
public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback {
private SurfaceHolder mHolder;
private Camera mCamera;
private List<Camera.Size> mSupportedPreviewSizes;
private Camera.Size mPreviewSize;
private int mCameraId;
public CameraPreview(Context context) {
super(context);
mHolder = getHolder();
View UnauthorizedErrorInterceptor
final Interceptor unauthorizedErrorInterceptor = new Interceptor() {
@Override public Response intercept(Interceptor.Chain chain) throws IOException {
Request request = chain.request();
Response response = chain.proceed(request);
boolean unAuthorized = (response.code() == 401);
if (unAuthorized) {
EventBus.getDefault().post(new EventsHolder.RequestWithInvalidTokenEvent());
}
return response;
View activity
public abstract class EffectiveActivity extends AppCompatActivity {
private ViewGroup mainFrame;
private ScreenContainer screenContainer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
screenContainer = createScreenContainer();
mainFrame = screenContainer.bind(this);
getLayoutInflater().inflate(getLayout(), mainFrame);
View .gitignore
.gradle/
.gradle
gradle/
.idea/
build/
*.iml
*.orig
*.txt