protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_custom); _progressBar = FindViewById <SmoothProgressBar>(Resource.Id.progressbar); _checkBoxMirror = FindViewById <CheckBox>(Resource.Id.checkbox_mirror); _checkBoxReversed = FindViewById <CheckBox>(Resource.Id.checkbox_reversed); _spinnerInterpolators = FindViewById <Spinner>(Resource.Id.spinner_interpolator); _seekBarSectionsCount = FindViewById <SeekBar>(Resource.Id.seekbar_sections_count); _seekBarStrokeWidth = FindViewById <SeekBar>(Resource.Id.seekbar_stroke_width); _seekBarSeparatorLength = FindViewById <SeekBar>(Resource.Id.seekbar_separator_length); _seekBarSpeed = FindViewById <SeekBar>(Resource.Id.seekbar_speed); _button = FindViewById <Button>(Resource.Id.button); _textViewSpeed = FindViewById <TextView>(Resource.Id.textview_speed); _textViewSectionsCount = FindViewById <TextView>(Resource.Id.textview_sections_count); _textViewSeparatorLength = FindViewById <TextView>(Resource.Id.textview_separator_length); _textViewStrokeWidth = FindViewById <TextView>(Resource.Id.textview_stroke_width); _seekBarSpeed.ProgressChanged += (s, e) => { _speed = ((float)e.Progress + 1) / 10; _textViewSpeed.Text = "Speed: " + _speed; }; _seekBarSectionsCount.ProgressChanged += (s, e) => { _sectionsCount = e.Progress + 1; _textViewSectionsCount.Text = "Sections count: " + _sectionsCount; }; _seekBarSeparatorLength.ProgressChanged += (s, e) => { _separatorLength = e.Progress; _textViewSeparatorLength.Text = string.Format("Separator length: {0}dp", _separatorLength); }; _seekBarStrokeWidth.ProgressChanged += (s, e) => { _strokeWidth = e.Progress; _textViewStrokeWidth.Text = string.Format("Stroke width: {0}dp", _strokeWidth); }; _seekBarSeparatorLength.Progress = 4; _seekBarSectionsCount.Progress = 4; _seekBarStrokeWidth.Progress = 4; _seekBarSpeed.Progress = 9; _spinnerInterpolators.Adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, Resources.GetStringArray(Resource.Array.interpolators)); _button.Click += (s, e) => SetValues(); }
public override void Build(Form pForm) { SmoothProgressBar bar = new SmoothProgressBar(); bar.BackColor = getColorDark(); bar.ProgressBarColor = getColor(); bar.Size = getSize(); bar.Location = GetPosition(); component = bar; pForm.Controls.Add(bar); }
private void TakeDamage(double damage, SmoothProgressBar hpBar) { double newHp = hpBar.Value - damage; if (newHp < 0) { newHp = 0; } else if (newHp > 1000) { newHp = 1000; } hpBar.SmoothValue = newHp; }
public void Include(SmoothProgressBar smoothProgressBar) { smoothProgressBar.Visibility = smoothProgressBar.Visibility; }