protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); mCameraView = FindViewById <CameraView>(Resource.Id.camera); if (mCameraView != null) { mCameraView.AddCallback(new CameraViewCallback(mCameraView)); } FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.take_picture); if (fab != null) { fab.SetOnClickListener(new ClickListener(mCameraView)); } Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); if (SupportActionBar != null) { SupportActionBar.SetDisplayShowTitleEnabled(false); } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.Inflate(Resource.Layout.FragmentTakePhoto, container, false); _cameraButton = v.FindViewById <FloatingActionButton> (Resource.Id.fab); _cameraView = v.FindViewById <CameraView> (Resource.Id.cameraView); _cameraView.AddCallback(new CameraViewCallback(_onImageDecoded)); return(v); }