Example #1
0
 public ImageSaver(Activity activity, Context context, Camera2Fragment owner, Image image)
 {
     this.owner      = owner;
     this.context    = context;
     this.activity   = activity;
     imageRecognizer = new ImageRecognizer(context, activity);
     mImage          = image ?? throw new System.ArgumentNullException("image");
 }
Example #2
0
 public StateListener(Camera2Fragment owner)
 {
     if (owner == null)
     {
         throw new System.ArgumentNullException("owner");
     }
     this.owner = owner;
 }
Example #3
0
        public ImageAvailableListener(Activity activity, Context context, Camera2Fragment fragment)
        {
            this.activity = activity;
            this.context  = context;
            if (fragment == null)
            {
                throw new System.ArgumentNullException("fragment");
            }

            owner = fragment;
        }
 public CameraCaptureSessionCallback(Camera2Fragment owner)
 {
     Owner = owner;
 }
Example #5
0
 public CaptureStillPictureSessionCallback(Camera2Fragment owner)
 {
     this.owner = owner ?? throw new System.ArgumentNullException("owner");
 }
 public ImageAvailableListener(Camera2Fragment frag, File file)
 {
     this.Fragment = frag;
     this.File     = file;
 }
Example #7
0
 public CaptureListener(Camera2Fragment owner)
 {
     this.owner = owner ?? throw new System.ArgumentNullException("owner");
 }
 public SurfaceTextureListener(Camera2Fragment owner)
 {
     Owner = owner;
 }
Example #9
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.CameraActivity);

            string jsonData = Intent.GetStringExtra("JSON") ?? "";

            learningTask = JsonConvert.DeserializeObject <AppTask>(jsonData, new JsonSerializerSettings {
                TypeNameHandling = TypeNameHandling.Auto
            });
            activityId = Intent.GetIntExtra("ACTID", -1);

            if (bundle == null)
            {
                if (learningTask.TaskType.IdName == "TAKE_VIDEO")
                {
                    RequestedOrientation = ScreenOrientation.Landscape;
                    if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
                    {
                        FragmentManager.BeginTransaction().Replace(Resource.Id.container, Camera2VideoFragment.NewInstance()).Commit();
                    }
                    else
                    {
                        FragmentManager.BeginTransaction().Replace(Resource.Id.container, Camera1VideoFragment.NewInstance()).Commit();
                    }
                }
                else
                {
                    if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
                    {
                        FragmentManager.BeginTransaction().Replace(Resource.Id.container, Camera2Fragment.NewInstance()).Commit();
                    }
                    else
                    {
                        FragmentManager.BeginTransaction().Replace(Resource.Id.container, Camera1Fragment.NewInstance()).Commit();
                    }
                }
            }

            if (!AndroidUtils.IsGooglePlayServicesInstalled(this) || googleApiClient != null)
            {
                return;
            }

            googleApiClient = new GoogleApiClient.Builder(this)
                              .AddConnectionCallbacks(this)
                              .AddOnConnectionFailedListener(this)
                              .AddApi(LocationServices.API)
                              .Build();

            locRequest = new LocationRequest();
        }