Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            mGaugeView1 = FindViewById <GaugeView>(Resource.Id.gauge_view1);
            mGaugeView2 = FindViewById <GaugeView>(Resource.Id.gauge_view2);
            mGaugeView1.SetTargetValue(value);
            mGaugeView2.SetTargetValue(value);

            _timer = new Timer()
            {
                Interval = 1000
            };
            //Trigger event every second
            _timer.Elapsed += OnTimedEvent;

            _timer.Enabled = true;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SetContentView(Resource.Layout.settings);

            SetResult(Android.App.Result.Canceled);
            _selection = Intent.GetStringExtra(ExtraSelection);

            _activityCommon = new ActivityCommon(this);

            GaugeView gaugeView = FindViewById <GaugeView>(Resource.Id.gauge_view1);

            gaugeView.SetTargetValue(50);
            gaugeView.Visibility = ViewStates.Gone;

            _radioButtonAskForBtEnable = FindViewById <RadioButton>(Resource.Id.radioButtonAskForBtEnable);
            _radioButtonAlwaysEnableBt = FindViewById <RadioButton>(Resource.Id.radioButtonAlwaysEnableBt);
            _radioButtonNoBtHandling   = FindViewById <RadioButton>(Resource.Id.radioButtonNoBtHandling);

            _checkBoxDisableBtAtExit = FindViewById <CheckBox>(Resource.Id.checkBoxDisableBtAtExit);

            _radioButtonCommLockNone   = FindViewById <RadioButton>(Resource.Id.radioButtonCommLockNone);
            _radioButtonCommLockCpu    = FindViewById <RadioButton>(Resource.Id.radioButtonCommLockCpu);
            _radioButtonCommLockDim    = FindViewById <RadioButton>(Resource.Id.radioButtonCommLockDim);
            _radioButtonCommLockBright = FindViewById <RadioButton>(Resource.Id.radioButtonCommLockBright);

            _radioButtonLogLockNone   = FindViewById <RadioButton>(Resource.Id.radioButtonLogLockNone);
            _radioButtonLogLockCpu    = FindViewById <RadioButton>(Resource.Id.radioButtonLogLockCpu);
            _radioButtonLogLockDim    = FindViewById <RadioButton>(Resource.Id.radioButtonLogLockDim);
            _radioButtonLogLockBright = FindViewById <RadioButton>(Resource.Id.radioButtonLogLockBright);

            _checkBoxStoreDataLogSettings = FindViewById <CheckBox>(Resource.Id.checkBoxStoreDataLogSettings);

            _radioButtonStartOffline      = FindViewById <RadioButton>(Resource.Id.radioButtonStartOffline);
            _radioButtonStartConnect      = FindViewById <RadioButton>(Resource.Id.radioButtonStartConnect);
            _radioButtonStartConnectClose = FindViewById <RadioButton>(Resource.Id.radioButtonStartConnectClose);

            _checkBoxDoubleClickForAppExit = FindViewById <CheckBox>(Resource.Id.checkBoxDoubleClickForAppExit);
            _checkBoxSendDataBroadcast     = FindViewById <CheckBox>(Resource.Id.checkBoxSendDataBroadcast);

            _textViewCaptionCpuUsage = FindViewById <TextView>(Resource.Id.textViewCaptionCpuUsage);
            _checkBoxCheckCpuUsage   = FindViewById <CheckBox>(Resource.Id.checkBoxCheckCpuUsage);
            ViewStates viewStateCpuUsage = ActivityCommon.IsCpuStatisticsSupported() ? ViewStates.Visible : ViewStates.Gone;

            _textViewCaptionCpuUsage.Visibility = viewStateCpuUsage;
            _checkBoxCheckCpuUsage.Visibility   = viewStateCpuUsage;

            _checkBoxCheckEcuFiles = FindViewById <CheckBox>(Resource.Id.checkBoxCheckEcuFiles);

            _buttonStorageLocation        = FindViewById <Button>(Resource.Id.buttonStorageLocation);
            _buttonStorageLocation.Click += (sender, args) =>
            {
                SelectMedia();
            };

            _checkBoxCollectDebugInfo = FindViewById <CheckBox>(Resource.Id.checkBoxCollectDebugInfo);

            ViewStates viewStateSnoopLog = _activityCommon.GetConfigHciSnoopLog(out bool _) ? ViewStates.Visible : ViewStates.Gone;

            _checkBoxHciSnoopLog            = FindViewById <CheckBox>(Resource.Id.checkBoxHciSnoopLog);
            _checkBoxHciSnoopLog.Visibility = viewStateSnoopLog;
            _checkBoxHciSnoopLog.Enabled    = false;

            _buttonHciSnoopLog            = FindViewById <Button>(Resource.Id.buttonHciSnoopLog);
            _buttonHciSnoopLog.Visibility = viewStateSnoopLog;
            _buttonHciSnoopLog.Click     += (sender, args) =>
            {
                ShowDevelopmentSettings();
            };

            ReadSettings();
            CheckSelection(_selection);
        }