public override Android.Views.View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); Preference = GaganPreference.Load(Activity); var view = inflater.Inflate(Resource.Layout.Setting, container, false); TextCamUrl = view.FindViewById <TextView>(Resource.Id.EditCamUrl); TextCamUrl.Text = Preference.CamUrl; BtnSetCamUrl = view.FindViewById <Button>(Resource.Id.BtnSetCamUrl); BtnSetCamUrl.Click += (s, e) => { var activity = Activity as ControllerActivity; Preference.CamUrl = TextCamUrl.Text; activity?.BeginStream(); }; SeekServoLeft = view.FindViewById <SeekBar>(Resource.Id.SeekLeftCamPos); SeekServoLeft.Progress = Preference.ServoPosLeft; BtnSetServoLeft = view.FindViewById <Button>(Resource.Id.BtnSetServoLeft); BtnSetServoLeft.Click += (s, e) => Controller?.SetCamLeftPos(SeekServoLeft.Progress); SeekServoRight = view.FindViewById <SeekBar>(Resource.Id.SeekRightCamPos); SeekServoRight.Progress = Preference.ServoPosRight; BtnSetServoRight = view.FindViewById <Button>(Resource.Id.BtnSetServoRight); BtnSetServoRight.Click += (s, e) => Controller?.SetCamRightPos(SeekServoRight.Progress); return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = inflater.Inflate(Resource.Layout.CameraView, container, false); CamView = view.FindViewById <MjpegView>(Resource.Id.CameraView); StopButton = view.FindViewById <Button>(Resource.Id.BtnStop); Pref = GaganPreference.Load(Activity); return(view); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Addr = Intent.GetStringExtra(ExtraKeyAddr); if (string.IsNullOrEmpty(Addr)) { Finish(); return; } Pref = GaganPreference.Load(this); SetContentView(Resource.Layout.Control); var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.controller_toolbar); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); CamView = FindViewById <MjpegView>(Resource.Id.CamView); CamView?.SetResolution(640, 480); BeginStream(); //TextMessage = FindViewById<TextView>(Resource.Id.TextConnectMessage); //Controller = new GaganController(this); //Controller.BcoreConnectionChanged += OnConnectedBcore; //Controller.ConnectBcore(Addr); //SettingFragment = SettingFragment.newInstance(); //SettingFragment.Controller = Controller; //ControllerFragment = ControllerFragment.NewInstance(); //ControllerFragment.Controller = Controller; //var transaction = FragmentManager.BeginTransaction(); //transaction.Add(Resource.Id.FrameFragment, ControllerFragment); //transaction.Hide(ControllerFragment); //transaction.Add(Resource.Id.FrameFragment, SettingFragment); //transaction.Hide(SettingFragment); //transaction.Commit(); }