Exemplo n.º 1
0
        protected void btnLowHumidity_Click(object sender, EventArgs e)
        {
            colors = ColorConversion.GetColorSetupFromXML();
            var newColor = BeginLowColorPickerDialog(colors.HumidityColor.LowColor,
                                                     typeof(HumidityColor));
            var hsv = newColor.ToWindowsColor().ToHsv();

            colors.HumidityColor.LowColor.H = hsv.H.ToString();
            colors.HumidityColor.LowColor.S = hsv.S.ToString();
            colors.HumidityColor.LowColor.V = hsv.V.ToString();
            colors.SaveToXML();
            btnLowHumidity.SetBackgroundColor(newColor);
        }
Exemplo n.º 2
0
        public override void OnBackPressed()
        {
            colors = ColorConversion.GetColorSetupFromXML();
            colors.TemperatureColor.LowColor.Threshold  = txtLowTemp.Text;
            colors.TemperatureColor.HighColor.Threshold = txtHighTemp.Text;
            colors.HumidityColor.LowColor.Threshold     = txtLowHumidity.Text;
            colors.HumidityColor.HighColor.Threshold    = txtHighHumidity.Text;
            colors.SaveToXML();
            var dweetResponse = Http.Post(Constants.DweetPostColorsHttp, new NameValueCollection
            {
                { "type", "colors" },
                { "value", ColorConversion.GetXMLString() }
            });

            base.OnBackPressed();
            var layout = (LinearLayout)FindViewById(Resource.Id.parentLayout);

            layout.RequestFocus();
        }
Exemplo n.º 3
0
        protected void btnHighTemp_Click(object sender, EventArgs e)
        {
            List <TextView> emptyView;

            if (VerifyValues(out emptyView) == false)
            {
                btnHighTemp.SetBackgroundColor(Color.Red);
                return;
            }
            colors = ColorConversion.GetColorSetupFromXML();
            var newColor = BeginHighColorPickerDialog(colors.TemperatureColor.HighColor,
                                                      typeof(TemperatureColor));
            var hsv = newColor.ToWindowsColor().ToHsv();

            colors.TemperatureColor.HighColor.H = hsv.H.ToString();
            colors.TemperatureColor.HighColor.S = hsv.S.ToString();
            colors.TemperatureColor.HighColor.V = hsv.V.ToString();
            colors.SaveToXML();
            btnHighTemp.SetBackgroundColor(newColor);
        }