File was renamed from HDL_ON/UI/UI2/FuntionControlView/Light/RelayFragment.cs |
| | |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public partial class RelayFragment : FrameLayout |
| | | public partial class RelayPage : FrameLayout |
| | | { |
| | | |
| | | #region 控件集合 |
| | |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | | Function function; |
| | | Light light; |
| | | #endregion |
| | | |
| | | public RelayFragment(Function func) |
| | | public RelayPage(Light func) |
| | | { |
| | | bodyView = this; |
| | | function = func; |
| | | light = func; |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), function); |
| | | new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), light); |
| | | |
| | | controlView = new FrameLayout() |
| | | { |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, |
| | | Text = function.name, |
| | | Text = light.name, |
| | | }; |
| | | controlView.AddChidren(btnFunctionName); |
| | | |
| | |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = function.GetRoomListName() |
| | | Text = light.GetRoomListName() |
| | | }; |
| | | controlView.AddChidren(btnFromFoorAndRoom); |
| | | |
| | |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetMinRealAverage(40), |
| | | Height = Application.GetMinRealAverage(40), |
| | | UnSelectedImagePath = "Collection/CollectionIcon.png", |
| | | SelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | SelectedImagePath = "Collection/CollectionIcon.png", |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = light.collection |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | |
| | | |
| | | btnSwitchIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | Width = Application.GetRealWidth(168), |
| | | Height = Application.GetRealHeight(288), |
| | | UnSelectedImagePath = "FunctionIcon/Light/RelayCloseIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Light/RelayOpenIcon.png" |
| | | SelectedImagePath = "FunctionIcon/Light/RelayOpenIcon.png", |
| | | IsSelected = light.state != 0 |
| | | }; |
| | | controlView.AddChidren(btnSwitchIcon); |
| | | |
| | |
| | | Y = Application.GetRealHeight(462), |
| | | Width = Application.GetMinRealAverage(40), |
| | | Height = Application.GetMinRealAverage(40), |
| | | UnSelectedImagePath = "Public/SwitchClose.png", |
| | | SelectedImagePath = "Public/SwitchOn.png", |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | IsSelected = light.state != 0 |
| | | }; |
| | | controlView.AddChidren(btnSwitch); |
| | | |