protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.activity_automatic_scaling); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = GetString(Resource.String.automatic_scaling); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); // initialize required widgets mStartText = (TextView)FindViewById(Resource.Id.startAngleText); mSweepText = (TextView)FindViewById(Resource.Id.sweepAngleText); mRadialGauge = (C1RadialGauge)FindViewById(Resource.Id.radialGauge1); // setting default values mStartText.Text = mRadialGauge.StartAngle.ToString(); mSweepText.Text = mRadialGauge.SweepAngle.ToString(); mRadialGauge.Value = 60; mRadialGauge.Max = 200; mRadialGauge.ShowText = GaugeShowText.All; mRadialGauge.Step = 1; mRadialGauge.Animate(); mRadialGauge.AutoScale = true; // setting timer for auto scaling //timer.Elapsed += new System.Timers.ElapsedEventHandler(elapsedEventHandler); //timer.Enabled = true; //timer.AutoReset = true; //timer.Start(); minusButton = (Button)FindViewById(Resource.Id.buttonStartMinus); minusButton.Enabled = false; minusButton.Click += button_Click; plusButton = (Button)FindViewById(Resource.Id.buttonStartPlus); plusButton.Click += button_Click; minusSweepButton = (Button)FindViewById(Resource.Id.buttonSweepMinus); minusSweepButton.Click += button_Click; plusSweepButton = (Button)FindViewById(Resource.Id.buttonSweepPlus); plusSweepButton.Click += button_Click; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.activity_displaying_values); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = GetString(Resource.String.displaying_values); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); // initializing widgets mLinearGauge = (C1LinearGauge)FindViewById(Resource.Id.linearGauge1); mRadialGauge = (C1RadialGauge)FindViewById(Resource.Id.radialGauge1); mShowTextSpinner = (Spinner)FindViewById(Resource.Id.showTextSpinner); mValueText = (TextView)FindViewById(Resource.Id.valueText); // creating and initializing adapter to string array ArrayAdapter adapter1 = ArrayAdapter.CreateFromResource(this, Resource.Array.showTextSpinnerValues, Android.Resource.Layout.SimpleSpinnerItem); // Specify the layout to use when the list of choices appears adapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); // Apply the adapter to the spinner mShowTextSpinner.Adapter = adapter1; mShowTextSpinner.ItemSelected += mShowTextSpinner_ItemSelected; // setting dafault values mValueText.Text = ((int)(mValue * 100)).ToString(); mLinearGauge.ShowText = GaugeShowText.All; mRadialGauge.ShowText = GaugeShowText.All; setRange(0, 40, -65536); setRange(40, 80, -256); setRange(80, 100, -16711936); mLinearGauge.Min = 0; mLinearGauge.Max = 1; mLinearGauge.Step = .01f; // mLinearGauge.Ranges = mRanges; mLinearGauge.ShowRanges = false; mLinearGauge.ShowText = GaugeShowText.All; //mLinearGauge.GaugeWidth = .5f; mLinearGauge.Animate(); mLinearGauge.Format = "0%"; mLinearGauge.Value = mValue; mRadialGauge.Min = 0; mRadialGauge.Max = 1; mRadialGauge.Step = .01f; //mRadialGauge.Ranges = mRanges; mRadialGauge.ShowRanges = false; mRadialGauge.ShowText = GaugeShowText.All; //mRadialGauge.GaugeWidth = .5f; mRadialGauge.Animate(); mRadialGauge.Format = "0%"; mRadialGauge.Value = mValue; Button minusButton = (Button)FindViewById(Resource.Id.buttonMinus); minusButton.Click += button_Click; Button plusButton = (Button)FindViewById(Resource.Id.buttonPlus); plusButton.Click += button_Click; mLinearGauge.ValueChanged += OnValueChanged; mRadialGauge.ValueChanged += OnValueChanged; }