public void UpdateCell(UserLog.LogEntry data)
        {
            this.BackgroundColor = StyleSettings.ThemePrimaryDarkLightenedColor();

            lblTime.Text      = data.Timestamp.ToString("T");
            lblTime.TextColor = StyleSettings.ThemePrimaryColor();

            lblText.Text      = data.Message;
            lblText.TextColor = StyleSettings.TextOnDarkColor();

            if (data.Icon != UserLog.Icon.None)
            {
                imgAlert.Hidden = false;
                switch (data.Icon)
                {
                case UserLog.Icon.Warning:
                    imgAlert.Image = UIImage.FromBundle("ic_warning_white");
                    break;

                case UserLog.Icon.Error:
                    imgAlert.Image = UIImage.FromBundle("ic_error_white");
                    break;

                default:
                    imgAlert.Image = UIImage.FromBundle("ic_error_white");
                    break;
                }
            }
            else
            {
                imgAlert.Hidden = true;
            }
        }
示例#2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Set Localized Strings
            String title = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_1_title", null).PrepareForLabel();

            lblTitle.Text = title;

            String body = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_1_text_1", null).PrepareForLabel();

            lblBody.Text = body;

            // Set UI elements
            View.BackgroundColor = StyleSettings.ThemePrimaryDarkLightenedColor();
            lblTitle.TextColor   = StyleSettings.ThemePrimaryColor();
            lblBody.TextColor    = StyleSettings.TextOnDarkColor();
        }
示例#3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            storyboard = UIStoryboard.FromName("MainStoryboard", null);

            // Perform any additional setup after loading the view, typically from a nib.
            MenuTableSource          = new MenuTableSource(tableView, this);
            tableView.Source         = MenuTableSource;
            tableView.SeparatorColor = StyleSettings.ThemePrimaryDarkLightenedColor();

            UIView view = new UIView(new CGRect(0, 0, 1, 1));

            tableView.TableFooterView = view;

            lblTitle.Text = _appName;
        }
示例#4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            // Set Localized Strings
            String title = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_6_title", null).PrepareForLabel();

            lblTitle.Text = title;

            String body1 = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_6_text", null).PrepareForLabel();

            lblText.Text = body1;

            // Set UI elements
            View.BackgroundColor = StyleSettings.ThemePrimaryDarkLightenedColor();
            lblTitle.TextColor   = StyleSettings.ThemePrimaryColor();
            lblText.TextColor    = StyleSettings.TextOnDarkColor();
        }
        public void UpdateCell(UploadQueueViewModel.UploadQueueItem data)
        {
            this.BackgroundColor = StyleSettings.ThemePrimaryDarkLightenedColor();

            lblFileName.Text      = data.Filename;
            lblFileName.TextColor = StyleSettings.TextOnDarkColor();

            lblRecorded.Text      = NSBundle.MainBundle.LocalizedString("Vernacular_P0_label_file_creation", null).PrepareForLabel();
            lblRecorded.TextColor = StyleSettings.SubtleTextOnBrightColor();

            lblDate.Text      = data.Created.ToString("ddd dd MMMMM yyyy hh:mm");
            lblDate.TextColor = StyleSettings.TextOnDarkColor();

            lblSize.Text      = NSBundle.MainBundle.LocalizedString("Vernacular_P0_label_file_size", null).PrepareForLabel();
            lblSize.TextColor = StyleSettings.SubtleTextOnBrightColor();

            int ksize = (int)Math.Ceiling(data.FileSize / 1024.0);

            lblSizeData.Text      = string.Format(NSBundle.MainBundle.LocalizedString("Vernacular_P0_label_file_size_value", null).PrepareForLabel(), ksize);
            lblSizeData.TextColor = StyleSettings.TextOnDarkColor();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Set Localized Strings
            String title = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_5_title", null).PrepareForLabel();

            lblTitle.Text = title;

            String body1 = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_5_explanation", null).PrepareForLabel();

            lblBody1.Text = body1;

            String btn = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_5_calibrate", null).ToUpper().PrepareForLabel();

            btnCalibrate.SetTitle(btn, UIControlState.Normal);

            // Set UI elements
            View.BackgroundColor = StyleSettings.ThemePrimaryDarkLightenedColor();
            lblTitle.TextColor   = StyleSettings.ThemePrimaryColor();
            lblBody1.TextColor   = StyleSettings.TextOnDarkColor();
            lblBody2.TextColor   = StyleSettings.TextOnDarkColor();
            btnCalibrate.SetTitleColor(StyleSettings.TextOnDarkColor(), UIControlState.Normal);
            btnCalibrate.BackgroundColor    = StyleSettings.ThemePrimaryColor();
            btnCalibrate.Layer.CornerRadius = 5;

            // Init calibrator
            _calibrator = Calibrator.Create();

            btnCalibrate.TouchUpInside += (object sender, EventArgs e) => {
                if (_calibrating)
                {
                    return;
                }
                _calibrating = true;
                Calibrate();
            };
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Set Localized Strings
            String title = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_7_title", null).PrepareForLabel();

            lblTitle.Text = title;

            String body1 = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_7_text_1", null).PrepareForLabel();

            lblBody1.Text = body1;

            String body2 = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_7_text_2", null).PrepareForLabel();

            lblBody2.Text = body2;

            String btn = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_done", null).ToUpper().PrepareForLabel();

            btnGo.SetTitle(btn, UIControlState.Normal);

            String calibrationLabel = NSBundle.MainBundle.LocalizedString("Vernacular_P0_calibration_not_done", null);

            lblCalibration.Text   = calibrationLabel;
            lblCalibration.Hidden = false;

            // Set UI elements
            View.BackgroundColor     = StyleSettings.ThemePrimaryDarkLightenedColor();
            lblTitle.TextColor       = StyleSettings.ThemePrimaryColor();
            lblBody1.TextColor       = StyleSettings.TextOnDarkColor();
            lblBody2.TextColor       = StyleSettings.TextOnDarkColor();
            lblCalibration.TextColor = StyleSettings.LightGrayColor();
            btnGo.SetTitleColor(StyleSettings.TextOnDarkColor(), UIControlState.Normal);
            btnGo.Layer.CornerRadius = 5;
#if DEBUG
            btnGo.Enabled = true;
#else
            btnGo.Enabled = false;
#endif
            btnGo.BackgroundColor = StyleSettings.LightGrayColor();

            if (Settings.CalibrationDone)
            {
                btnGo.Enabled         = true;
                btnGo.BackgroundColor = StyleSettings.ThemePrimaryColor();
                lblCalibration.Hidden = true;
            }

            btnGo.TouchUpInside += (object sender, EventArgs e) => {
                if (NSUserDefaults.StandardUserDefaults.BoolForKey(PreferencesSettings.FirstLaunchKey))
                {
                    IntroVC.DismissViewController(true, null);
                }
                else
                {
                    NSUserDefaults.StandardUserDefaults.SetBool(true, PreferencesSettings.FirstLaunchKey);
                    var window = UIApplication.SharedApplication.KeyWindow;
                    window.RootViewController = new RootViewController();
                }
            };
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Set Localized Strings
            String title = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_4_title", null).PrepareForLabel();

            lblTitle.Text = title;

            String body1 = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_4_question", null).PrepareForLabel();

            lblBody1.Text = body1;

            String matString   = NSBundle.MainBundle.LocalizedString("Vernacular_P0_anchorage_mat", null).PrepareForLabel();
            String staffString = NSBundle.MainBundle.LocalizedString("Vernacular_P0_anchorage_bracket", null).PrepareForLabel();
            String otherString = NSBundle.MainBundle.LocalizedString("Vernacular_P0_anchorage_pocket", null).PrepareForLabel();

            lblBody2.Text = staffString;

            String bottom = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_bottom_question_notice", null).PrepareForLabel();

            lblBottom.Text = bottom;

            // Set UI elements
            View.BackgroundColor = StyleSettings.ThemePrimaryDarkLightenedColor();
            lblTitle.TextColor   = StyleSettings.ThemePrimaryColor();
            lblBody1.TextColor   = StyleSettings.TextOnDarkColor();
            lblBody2.TextColor   = StyleSettings.ThemePrimaryColor();
            lblBottom.TextColor  = StyleSettings.SubduedTextOnDarkColor();
            btnMat.SetTitle("", UIControlState.Normal);
            btnStaff.SetTitle("", UIControlState.Normal);
            btnOther.SetTitle("", UIControlState.Normal);

            // Set button backgrounds
            btnStaff.ClipsToBounds = true;
            btnStaff.ContentMode   = UIViewContentMode.ScaleAspectFit;
            btnStaff.SetBackgroundImage(ChangeImageColor.GetColoredImage("icon_bracket", StyleSettings.ThemePrimaryColor()), UIControlState.Normal);
            btnMat.ClipsToBounds = true;
            btnMat.ContentMode   = UIViewContentMode.ScaleAspectFit;
            btnMat.SetBackgroundImage(UIImage.FromBundle("icon_mat"), UIControlState.Normal);
            btnOther.ClipsToBounds = true;
            btnOther.ContentMode   = UIViewContentMode.ScaleAspectFit;
            btnOther.SetBackgroundImage(UIImage.FromBundle("icon_pocket"), UIControlState.Normal);

            // Button handlers

            // car button
            btnMat.TouchUpInside += delegate {
                btnMat.SetBackgroundImage(ChangeImageColor.GetColoredImage("icon_mat", StyleSettings.ThemePrimaryColor()), UIControlState.Normal);
                btnStaff.SetBackgroundImage(UIImage.FromBundle("icon_bracket"), UIControlState.Normal);
                btnOther.SetBackgroundImage(UIImage.FromBundle("icon_pocket"), UIControlState.Normal);

                lblBody2.Text = matString;
                selectAnchorage(AnchorageType.MobileMat);
            };

            // motorcycle button
            btnStaff.TouchUpInside += delegate {
                btnStaff.SetBackgroundImage(ChangeImageColor.GetColoredImage("icon_bracket", StyleSettings.ThemePrimaryColor()), UIControlState.Normal);
                btnMat.SetBackgroundImage(UIImage.FromBundle("icon_mat"), UIControlState.Normal);
                btnOther.SetBackgroundImage(UIImage.FromBundle("icon_pocket"), UIControlState.Normal);

                lblBody2.Text = staffString;
                selectAnchorage(AnchorageType.MobileBracket);
            };

            // truck button
            btnOther.TouchUpInside += delegate {
                btnOther.SetBackgroundImage(ChangeImageColor.GetColoredImage("icon_pocket", StyleSettings.ThemePrimaryColor()), UIControlState.Normal);
                btnStaff.SetBackgroundImage(UIImage.FromBundle("icon_bracket"), UIControlState.Normal);
                btnMat.SetBackgroundImage(UIImage.FromBundle("icon_mat"), UIControlState.Normal);

                lblBody2.Text = otherString;
                selectAnchorage(AnchorageType.Pocket);
            };
        }
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     View.BackgroundColor = StyleSettings.ThemePrimaryDarkLightenedColor();
 }
示例#10
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Set Localized Strings
            String title = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_3_title", null).PrepareForLabel();

            lblTitle.Text = title;

            String body1 = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_3_question", null).PrepareForLabel();

            lblBody1.Text = body1;

            String motorcycleString = NSBundle.MainBundle.LocalizedString("Vernacular_P0_vehicle_motorcycle", null).PrepareForLabel();
            String carString        = NSBundle.MainBundle.LocalizedString("Vernacular_P0_vehicle_car", null).PrepareForLabel();
            String truckString      = NSBundle.MainBundle.LocalizedString("Vernacular_P0_vehicle_truck", null).PrepareForLabel();

            lblBody2.Text = carString;

            String bottom = NSBundle.MainBundle.LocalizedString("Vernacular_P0_tutorial_bottom_question_notice", null).PrepareForLabel();

            lblBottom.Text = bottom;

            // Set UI String elements
            View.BackgroundColor = StyleSettings.ThemePrimaryDarkLightenedColor();
            lblTitle.TextColor   = StyleSettings.ThemePrimaryColor();
            lblBody1.TextColor   = StyleSettings.TextOnDarkColor();
            lblBody2.TextColor   = StyleSettings.ThemePrimaryColor();
            lblBottom.TextColor  = StyleSettings.SubduedTextOnDarkColor();
            btnCar.SetTitle("", UIControlState.Normal);
            btnMotorcycle.SetTitle("", UIControlState.Normal);
            btnTruck.SetTitle("", UIControlState.Normal);

            // Set button backgrounds
            btnMotorcycle.ClipsToBounds = true;
            btnMotorcycle.ContentMode   = UIViewContentMode.ScaleAspectFit;
            btnMotorcycle.SetBackgroundImage(UIImage.FromBundle("icon_motorcycle"), UIControlState.Normal);
            btnCar.ClipsToBounds = true;
            btnCar.ContentMode   = UIViewContentMode.ScaleAspectFit;
            btnCar.SetBackgroundImage(ChangeImageColor.GetColoredImage("icon_car", StyleSettings.ThemePrimaryColor()), UIControlState.Normal);
            btnTruck.ClipsToBounds = true;
            btnTruck.ContentMode   = UIViewContentMode.ScaleAspectFit;
            btnTruck.SetBackgroundImage(UIImage.FromBundle("icon_bus"), UIControlState.Normal);

            // Button handlers

            // car button
            btnCar.TouchUpInside += delegate {
                btnCar.SetBackgroundImage(ChangeImageColor.GetColoredImage("icon_car", StyleSettings.ThemePrimaryColor()), UIControlState.Normal);
                btnMotorcycle.SetBackgroundImage(UIImage.FromBundle("icon_motorcycle"), UIControlState.Normal);
                btnTruck.SetBackgroundImage(UIImage.FromBundle("icon_bus"), UIControlState.Normal);

                lblBody2.Text = carString;
                selectVehicle(VehicleType.Car);
            };

            // motorcycle button
            btnMotorcycle.TouchUpInside += delegate {
                btnMotorcycle.SetBackgroundImage(ChangeImageColor.GetColoredImage("icon_motorcycle", StyleSettings.ThemePrimaryColor()), UIControlState.Normal);
                btnCar.SetBackgroundImage(UIImage.FromBundle("icon_car"), UIControlState.Normal);
                btnTruck.SetBackgroundImage(UIImage.FromBundle("icon_bus"), UIControlState.Normal);

                lblBody2.Text = motorcycleString;
                selectVehicle(VehicleType.Motorcycle);
            };

            // truck button
            btnTruck.TouchUpInside += delegate {
                btnTruck.SetBackgroundImage(ChangeImageColor.GetColoredImage("icon_bus", StyleSettings.ThemePrimaryColor()), UIControlState.Normal);
                btnMotorcycle.SetBackgroundImage(UIImage.FromBundle("icon_motorcycle"), UIControlState.Normal);
                btnCar.SetBackgroundImage(UIImage.FromBundle("icon_car"), UIControlState.Normal);

                lblBody2.Text = truckString;
                selectVehicle(VehicleType.Truck);
            };
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Initialize Recorder
            RVM = new RecordingViewModel();

            // Perform any additional setup after loading the view, typically from a nib.
            // Init audio session
            AudioSession.Initialize(null, NSRunLoop.NSDefaultRunLoopMode);
            AudioSession.AudioRouteChanged += AudioSession_AudioRouteChanged;

            // Init call event handler
            callcenter.CallEventHandler += callState.CallEvent;

            // Set menu button
            UIImageView menuImageView = new UIImageView();

            menuImageView.Bounds = new CGRect(0, 0, 20, 20);
            menuImageView.Image  = UIImage.FromBundle("threelines");

            menuButton = new UIBarButtonItem(
                menuImageView.Image,
                UIBarButtonItemStyle.Plain,
                (s, e) => {
                System.Diagnostics.Debug.WriteLine("menu button tapped");
                if (RVM.IsRecording)
                {
                    SidebarController.ToggleMenu();
                    var okAlertController = UIAlertController.Create("", UiStrings.MainNotificationSuspendUserAction, UIAlertControllerStyle.Alert);
                    //Add Action
                    okAlertController.AddAction(UIAlertAction.Create(NSBundle.MainBundle.GetLocalizedString("Vernacular_P0_dialog_ok"), UIAlertActionStyle.Default, alert => {
                        RVM.StopRecordingCommand.Execute(null);
                    }));

                    PresentViewController(okAlertController, true, null);
                }
                else
                {
                    SidebarController.ToggleMenu();
                }
            }
                );

            // Add button to item array
            barButtonItems [0] = menuButton;
            NavigationItem.LeftBarButtonItem = menuButton;

            // Set bottom view labels
            lblTitle.Text = "";
            lblBody.Text  = "";

            // Set start button style
            btnStart.SetBackgroundImage(UIImage.FromBundle("CarButton"), UIControlState.Normal);
            View.BackgroundColor = StyleSettings.ThemePrimaryDarkLightenedColor();
            btnStart.SetTitle("", UIControlState.Normal);

            // Add square to stop || TODO: change to image
            UIView stopSquare = new UIView(new RectangleF(
                                               (float)(btnStop.Bounds.X + 15),
                                               (float)(btnStop.Bounds.Y + 15),
                                               (float)(btnStop.Bounds.Width - 30),
                                               (float)(btnStop.Bounds.Height - 30))
                                           );

            // Set stop button attributes
            stopButtonTranslation      = btnStopBottomConstraint.Constant;
            stopSquare.BackgroundColor = UIColor.White;
            btnStop.SetBackgroundImage(UIImage.FromBundle("srs-stop-btn"), UIControlState.Normal);
            btnStop.Layer.CornerRadius = btnStop.Bounds.Width / 2;

            lblLeft.Hidden   = true;
            lblCenter.Hidden = true;
            lblRight.Hidden  = true;

            // Set initial status of vehicle type & support
            btnSupport.Hidden        = true;
            btnVehicle.Hidden        = true;
            lblCalibration.Hidden    = true;
            lblCalibration.Text      = NSBundle.MainBundle.LocalizedString("Vernacular_P0_label_setup", null);
            lblCalibration.TextColor = StyleSettings.SubduedTextOnDarkColor();

            // Logic
            btnStart.TouchUpInside += (object sender, EventArgs e) => {
                if (Settings.CalibrationDone)
                {
                    if (RVM.IsRecording)
                    {
                        return;
                    }

                    var passengerNumberPickerVC = Storyboard.InstantiateViewController("PassengerNumberPickerViewController") as PassengerNumberPickerViewController;
                    passengerNumberPickerVC.ModalPresentationStyle = UIModalPresentationStyle.OverCurrentContext;
                    passengerNumberPickerVC.ModalTransitionStyle   = UIModalTransitionStyle.CoverVertical;
                    passengerNumberPickerVC.parentVC = this;
                    NavigationController.PresentViewController(passengerNumberPickerVC, true, null);
                }
                else
                {
                    // TODO: warn user that calibration has to be done
                }
            };

            btnStop.TouchUpInside += (object sender, EventArgs e) => {
                UnbindFromService();
                AnimateStopButton();
                RVM.OnDestroy();
                StopRecording();
                UpdateRecordButtonUi();
                UploadData();
                lblCenter.Hidden = true;
            };

            btnVehicle.TouchUpInside += (object sender, EventArgs e) => {
                OpenSettingsVC();
            };

            btnSupport.TouchUpInside += (object sender, EventArgs e) => {
                OpenSettingsVC();
            };
        }