protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activity_bullet_graph);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.Title = GetString(Resource.String.bulletgraph);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            // initializing widgets
            mBulletGraph = (C1BulletGraph)FindViewById(Resource.Id.bulletGraph1);
            mBadText     = (TextView)FindViewById(Resource.Id.badText);
            mGoodText    = (TextView)FindViewById(Resource.Id.goodText);
            mTargetText  = (TextView)FindViewById(Resource.Id.targetText);

            // setting default values
            mBulletGraph.Value    = mValue;
            mBulletGraph.Bad      = mBad;
            mBulletGraph.Good     = mGood;
            mBulletGraph.Max      = 100;
            mBulletGraph.Target   = mTarget;
            mBulletGraph.ShowText = GaugeShowText.None;
            mBulletGraph.Step     = 1;
            // properties set in XML layout
            // mBulletGraph.setGaugeWidth(.5f);

            mBadText.Text    = mBad.ToString();
            mGoodText.Text   = mGood.ToString();
            mTargetText.Text = mTarget.ToString();

            Button button = (Button)FindViewById(Resource.Id.buttonBadMinus);

            button.Click += button_Click;
            button        = (Button)FindViewById(Resource.Id.buttonBadPlus);
            button.Click += button_Click;

            button        = (Button)FindViewById(Resource.Id.buttonGoodMinus);
            button.Click += button_Click;
            button        = (Button)FindViewById(Resource.Id.buttonGoodPlus);
            button.Click += button_Click;

            button        = (Button)FindViewById(Resource.Id.buttonTargetMinus);
            button.Click += button_Click;
            button        = (Button)FindViewById(Resource.Id.buttonTargetPlus);
            button.Click += button_Click;
        }
Exemple #2
0
 protected override UIView CreateCellContent(GridCellType cellType, object cellContentType, GridRow row)
 {
     if (cellType == GridCellType.Cell)
     {
         var gauge = new C1BulletGraph();
         gauge.Max    = 10000;
         gauge.Target = 7000;
         gauge.Bad    = 1000;
         gauge.Good   = 6000;
         return(gauge);
     }
     else
     {
         return(base.CreateCellContent(cellType, cellContentType, row));
     }
 }
Exemple #3
0
 protected override View CreateCellContent(GridCellType cellType, object cellContentType, GridRow row)
 {
     if (cellType == GridCellType.Cell)
     {
         var gauge = new C1BulletGraph(Grid.Context);
         gauge.IsAnimated = false;
         gauge.Max        = 10000;
         gauge.Target     = 7000;
         gauge.Bad        = 1000;
         gauge.Good       = 6000;
         gauge.IsReadOnly = true;
         return(gauge);
     }
     else
     {
         return(base.CreateCellContent(cellType, cellContentType, row));
     }
 }
Exemple #4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activity_direction);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.Title = GetString(Resource.String.direction);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            // initializing widgets
            mBulletGraph      = (C1BulletGraph)FindViewById(Resource.Id.bulletGraph1);
            mLinearGauge      = (C1LinearGauge)FindViewById(Resource.Id.linearGauge1);
            mDirectionSpinner = (Spinner)FindViewById(Resource.Id.directionSpinner);
            mLayout           = (LinearLayout)FindViewById(Resource.Id.layout1);

            // creating and initializing adapter to string array
            ArrayAdapter adapter1 = ArrayAdapter.CreateFromResource(this, Resource.Array.directionSpinnerValues, 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
            mDirectionSpinner.Adapter       = adapter1;
            mDirectionSpinner.ItemSelected += mDirectionSpinner_ItemSelected;

            // setting dafault values
            mBulletGraph.Value    = 40;
            mBulletGraph.Bad      = 45;
            mBulletGraph.Good     = 80;
            mBulletGraph.Max      = 100;
            mBulletGraph.Target   = 90;
            mBulletGraph.Step     = 1;
            mBulletGraph.ShowText = GaugeShowText.All;
            //mBulletGraph.GaugeWidth = .5f;

            mLinearGauge.Value    = 40;
            mLinearGauge.Min      = 0;
            mLinearGauge.Max      = 100;
            mLinearGauge.ShowText = GaugeShowText.All;
            //mLinearGauge.GaugeWidth = .5f;
        }
Exemple #5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activity_getting_started);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.Title = GetString(Resource.String.getting_started);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            // initializing widgets
            mRadialGauge = (C1RadialGauge)FindViewById(Resource.Id.radialGauge1);
            mLinearGauge = (C1LinearGauge)FindViewById(Resource.Id.linearGauge1);
            mBulletGraph = (C1BulletGraph)FindViewById(Resource.Id.bulletGraph1);
            mValueText   = (TextView)FindViewById(Resource.Id.valueText);

            // setting dafault values
            mValueText.Text         = mValue.ToString();
            mBulletGraph.Enabled    = true;
            mBulletGraph.Value      = mValue;
            mBulletGraph.Bad        = 45;
            mBulletGraph.Good       = 80;
            mBulletGraph.Min        = mMin;
            mBulletGraph.Max        = mMax;
            mBulletGraph.Target     = 90;
            mBulletGraph.ShowText   = GaugeShowText.All;
            mBulletGraph.Step       = 1;
            mBulletGraph.IsReadOnly = false;
            mBulletGraph.IsAnimated = true;

            mLinearGauge.Enabled    = true;
            mLinearGauge.Value      = mValue;
            mLinearGauge.Min        = mMin;
            mLinearGauge.Max        = mMax;
            mLinearGauge.Step       = 1;
            mLinearGauge.ShowText   = GaugeShowText.All;
            mLinearGauge.IsReadOnly = false;
            mLinearGauge.IsAnimated = true;

            mRadialGauge.Enabled    = true;
            mRadialGauge.Value      = mValue;
            mRadialGauge.Min        = mMin;
            mRadialGauge.Max        = mMax;
            mRadialGauge.Step       = 1;
            mRadialGauge.ShowText   = GaugeShowText.All;
            mRadialGauge.IsReadOnly = false;
            mRadialGauge.IsAnimated = true;

            Button minusButton = (Button)FindViewById(Resource.Id.buttonValueMinus);

            minusButton.Click += button_Click;
            Button plusButton = (Button)FindViewById(Resource.Id.buttonValuePlus);

            plusButton.Click += button_Click;

            mLinearGauge.ValueChanged += OnValueChanged;
            mRadialGauge.ValueChanged += OnValueChanged;
            mBulletGraph.ValueChanged += OnValueChanged;
        }