public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { RelativeLayout mediarelativelayout =new RelativeLayout(nn_activity); var mediarelativelayoutparam=new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent,RelativeLayout.LayoutParams.MatchParent); mediarelativelayout.LayoutParameters = mediarelativelayoutparam; mediarelativelayout.SetBackgroundColor (Color.White); Button playbut = new Button (nn_activity); RelativeLayout.LayoutParams playbutparam=new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent,RelativeLayout.LayoutParams.MatchParent); playbut.Alpha = 0; playbutparam.AddRule(LayoutRules.CenterInParent); playbut.LayoutParameters = playbutparam; playbut.Click -=OntouchVideoView; playbut.Click += OntouchVideoView; mediarelativelayout.AddView (playbut); textureview = new TextureView (nn_activity); textureview.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); textureview.Rotation = 90; textureview.SurfaceTextureListener = this; mediarelativelayout.AddView (textureview); return mediarelativelayout; }
protected override void OnElementChanged (ElementChangedEventArgs<Page> e) { base.OnElementChanged (e); if (e.OldElement != null || Element == null) return; try { activity = this.Context as Activity; view = activity.LayoutInflater.Inflate(Resource.Layout.CameraLayout, this, false); cameraType = CameraFacing.Back; textureView = view.FindViewById<TextureView> (Resource.Id.textureView); textureView.SurfaceTextureListener = this; takePhotoButton = view.FindViewById<global::Android.Widget.Button> (Resource.Id.takePhotoButton); takePhotoButton.Click += TakePhotoButtonTapped; switchCameraButton = view.FindViewById<global::Android.Widget.Button> (Resource.Id.switchCameraButton); switchCameraButton.Click += SwitchCameraButtonTapped; toggleFlashButton = view.FindViewById<global::Android.Widget.Button> (Resource.Id.toggleFlashButton); toggleFlashButton.Click += ToggleFlashButtonTapped; AddView (view); } catch (Exception ex) { //Xamarin.Insights.Report (ex); } }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); _textureView = new TextureView (this); _textureView.SurfaceTextureListener = this; SetContentView (_textureView); }
void SetupUserInterface () { activity = this.Context as Activity; view = activity.LayoutInflater.Inflate (Resource.Layout.CameraLayout, this, false); cameraType = CameraFacing.Back; textureView = view.FindViewById<TextureView> (Resource.Id.textureView); textureView.SurfaceTextureListener = this; }
// * // * // * Called when the activity is first created. // protected override void OnCreate(Bundle icicle) { base.OnCreate(icicle); if (!LibsChecker.CheckVitamioLibs(this)) return; SetContentView(Resource.Layout.mediaplayer_3); mTextureView = FindViewById<TextureView>(Resource.Id.surface); mTextureView.SurfaceTextureListener = this; }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); RequestWindowFeature (WindowFeatures.NoTitle); _textureView = new TextureView (this); _textureView.SurfaceTextureListener = this; _textureView.Touch += OnTouch; SetContentView (_textureView); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _textureView = new TextureView(this); _textureView.SurfaceTextureListener = this; _textureView.Touch += (sender, args) => GetPhoto(); RequestedOrientation = ScreenOrientation.Portrait; SetContentView(_textureView); }
public void Initialize() { var view = Inflate(Context, Resource.Layout.PhotoCaptureView, this); _shutterButton = view.FindViewById<ImageView>(Resource.Id.ShutterButton); _swapCameraButton = view.FindViewById<ImageView>(Resource.Id.SwapCameraButton); _cameraPreviewSurface = view.FindViewById<TextureView>(Resource.Id.CameraTextureView); if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { _controller = new Camera2Controller(this); } else { _controller = new CameraController(this); } _shutterButton.Click += (s, e) => _controller.TakePicture(); _swapCameraButton.Click += (s, e) => _controller.SwapCameras(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if (this.Intent != null) { var receiverID = this.Intent.GetStringExtra(KEY_RECEIVER_ID); if(receiverID != null) _receiverID = new Guid(receiverID); } this.SetContentView(Resource.Layout.activity_camera); try { cameraType = CameraFacing.Back; textureView = this.FindViewById<TextureView>(Resource.Id.textureView); textureView.SurfaceTextureListener = this; takePhotoButton = this.FindViewById<global::Android.Widget.Button>(Resource.Id.takePhotoButton); takePhotoButton.Click += TakePhotoButtonTapped; switchCameraButton = this.FindViewById<global::Android.Widget.Button>(Resource.Id.switchCameraButton); switchCameraButton.Click += SwitchCameraButtonTapped; toggleFlashButton = this.FindViewById<global::Android.Widget.Button>(Resource.Id.toggleFlashButton); toggleFlashButton.Click += ToggleFlashButtonTapped; } catch (Exception ex) { Xamarin.Insights.Report(ex); } }
public override void OnViewCreated(View view, Bundle savedInstanceState) { mTextureView = (TextureView)view.FindViewById (Resource.Id.TextureView); mTextureView.SurfaceTextureListener = mSurfaceTextureListener; view.FindViewById (Resource.Id.TextureView).SetOnClickListener (this); }
protected override void OnElementChanged(ElementChangedEventArgs<Page> e) { base.OnElementChanged(e); if (e.OldElement != null || Element == null) return; try { var activity = this.Context as Activity; activity.RequestedOrientation = ScreenOrientation.Landscape; view = activity.LayoutInflater.Inflate(Resource.Layout.CameraLayout, this, false); _textureView = view.FindViewById<TextureView>(Resource.Id.textureView); _textureView.SurfaceTextureListener = this; cameraType = CameraFacing.Back; AddView(view); } catch (Exception ex) { Console.WriteLine("Roland error...." + ex.Message); } }