コード例 #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");
 }
コード例 #2
0
ファイル: StateListener.cs プロジェクト: mrjslau/TOP2018
 public StateListener(Camera2Fragment owner)
 {
     if (owner == null)
     {
         throw new System.ArgumentNullException("owner");
     }
     this.owner = owner;
 }
コード例 #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;
        }
コード例 #4
0
 public CameraCaptureSessionCallback(Camera2Fragment owner)
 {
     Owner = owner;
 }
コード例 #5
0
 public CaptureStillPictureSessionCallback(Camera2Fragment owner)
 {
     this.owner = owner ?? throw new System.ArgumentNullException("owner");
 }
コード例 #6
0
 public ImageAvailableListener(Camera2Fragment frag, File file)
 {
     this.Fragment = frag;
     this.File     = file;
 }
コード例 #7
0
 public CaptureListener(Camera2Fragment owner)
 {
     this.owner = owner ?? throw new System.ArgumentNullException("owner");
 }
コード例 #8
0
 public SurfaceTextureListener(Camera2Fragment owner)
 {
     Owner = owner;
 }
コード例 #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();
        }