| | |
| | | using System; |
| | | using HDL_ON.Entity; |
| | | using Shared; |
| | | namespace HDL_ON.UI |
| | | { |
| | | public partial class EnvironmentalSciencePage |
| | |
| | | |
| | | } |
| | | |
| | | void LoadEvent_ChangeWeatherIcon(Shared.Button btnWeatherIcon) |
| | | public static void LoadEvent_UpdataStatus(Function updateTemp) |
| | | { |
| | | Application.RunOnMainThread(() =>{ |
| | | if (bodyView != null) |
| | | { |
| | | for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++) |
| | | { |
| | | var sensorTag = updateTemp.sid; |
| | | var view = bodyView.sensorListView.GetChildren(i); |
| | | if (view.GetType() == typeof(FrameLayout)) |
| | | { |
| | | if(view.Tag.ToString() != sensorTag) |
| | | { |
| | | continue; |
| | | } |
| | | for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++) |
| | | { |
| | | var btn = (view as FrameLayout).GetChildren(j); |
| | | if (btn.GetType() == typeof(Button)) |
| | | { |
| | | if (btn.Tag!=null) |
| | | { |
| | | var tag = btn.Tag.ToString(); |
| | | if (tag == "SensorValues") |
| | | { |
| | | (btn as Button).Text = updateTemp.GetAttrState(FunctionAttributeKey.Value); |
| | | } |
| | | else if (tag == "SensorLevel") |
| | | { |
| | | (btn as Button).TextID = bodyView.sensorTemp.GetLevelTextList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | } |
| | | } |
| | | } |
| | | else if (btn.GetType() == typeof(ArcSeekBar)) |
| | | { |
| | | (btn as ArcSeekBar).ProgressBarColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | |
| | | (btn as ArcSeekBar).Progress = (96 / bodyView.sensorTemp.GetLevelColorList(updateTemp.spk).Count) * bodyView.sensorTemp.GetCurLevel(updateTemp); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | void LoadEvent_ChangeWeatherIcon(Button btnWeatherIcon) |
| | | { |
| | | |
| | | switch (MainPage.cityInfo.weather) |