| | |
| | | /// <summary> |
| | | /// SceneIcon |
| | | /// </summary> |
| | | public Button SceneIcon; |
| | | public ImageView SceneIcon; |
| | | /// <summary> |
| | | /// statu |
| | | /// </summary> |
| | |
| | | /// scene |
| | | /// </summary> |
| | | public SceneUI scene; |
| | | /// <summary> |
| | | /// CollectionAction |
| | | /// </summary> |
| | | public Action CollectionAction; |
| | | |
| | | /// <summary> |
| | | /// IsSelected |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// SceneMainView |
| | | /// </summary> |
| | | /// <param name="x"></param> |
| | | /// <param name="y"></param> |
| | | public SceneMainView(int x, int y) |
| | | { |
| | | X = Application.GetRealWidth(x); |
| | | Y = Application.GetRealHeight(y); |
| | | Width = Application.GetMinRealAverage(487); |
| | | Height = Application.GetMinRealAverage(348); |
| | | Width = Application.GetRealWidth(487); |
| | | Height = Application.GetRealHeight(358); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void InitFrame() |
| | | { |
| | | CardBG = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(487), |
| | | Height = Application.GetMinRealAverage(348), |
| | | UnSelectedImagePath = "Item/FunctionCardView.png", |
| | | Gravity = Gravity.CenterHorizontal |
| | | }; |
| | | AddChidren(CardBG); |
| | | |
| | | SceneIcon = new Button |
| | | { |
| | | X = Application.GetMinRealAverage(14), |
| | | Width = Application.GetMinRealAverage(458), |
| | | Height = Application.GetRealHeight(305), |
| | | Gravity = Gravity.CenterHorizontal |
| | | }; |
| | | AddChidren(SceneIcon); |
| | | SceneIcon.SetViewShadow(true); |
| | | |
| | | |
| | | //sceneBG = new Button |
| | | //CardBG = new Button |
| | | //{ |
| | | // Width = Application.GetMinRealAverage(487), |
| | | // Height = Application.GetMinRealAverage(348), |
| | | // UnSelectedImagePath = "Item/SceneCard.png", |
| | | // UnSelectedImagePath = "Item/FunctionCardView.png", |
| | | // Gravity = Gravity.CenterHorizontal |
| | | //}; |
| | | //AddChidren(sceneBG); |
| | | //AddChidren(CardBG); |
| | | |
| | | SceneIcon = new ImageView |
| | | { |
| | | X=Application.GetRealWidth(14), |
| | | Width = Application.GetMinRealAverage(458), |
| | | Height = Application.GetMinRealAverage(305), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius= (uint)Application.GetRealHeight(17) |
| | | }; |
| | | AddChidren(SceneIcon); |
| | | //SceneIcon.SetViewShadow(true); |
| | | //SceneIcon.SetCornerWithSameRadius(Application.GetRealHeight(100), HDLUtils.RectCornerBottomRight); |
| | | |
| | | sceneBG = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(487), |
| | | Height = Application.GetMinRealAverage(348), |
| | | UnSelectedImagePath = "Scene/Background.png", |
| | | Gravity = Gravity.CenterHorizontal |
| | | }; |
| | | AddChidren(sceneBG); |
| | | |
| | | TimeButton = new Button() |
| | | { |
| | | X = Application.GetMinRealAverage(40), |
| | | Y = Application.GetMinRealAverage(17), |
| | | Width = Application.GetMinRealAverage(320), |
| | | X = Application.GetMinRealAverage(30), |
| | | Y = Application.GetMinRealAverage(20), |
| | | Width = Application.GetMinRealAverage(63), |
| | | Height = Application.GetMinRealAverage(63), |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor3, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | |
| | | |
| | | CollectButton = new Button |
| | | { |
| | | X = Application.GetMinRealAverage(366), |
| | | Y = Application.GetMinRealAverage(14), |
| | | X = Application.GetMinRealAverage(350), |
| | | Y = Application.GetMinRealAverage(1), |
| | | Width = Application.GetMinRealAverage(107), |
| | | Height = Application.GetMinRealAverage(107), |
| | | UnSelectedImagePath = "Item/Collection1.png", |
| | |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | IsBold = true |
| | | }; |
| | | AddChidren(SceneNameButton); |
| | | } |
| | |
| | | CollectButton.MouseUpEventHandler += CollectionEvent; |
| | | SceneIcon.MouseUpEventHandler += SceneUpHandler; |
| | | SceneNameButton.MouseUpEventHandler += SceneUpHandler; |
| | | sceneBG.MouseUpEventHandler += SceneUpHandler; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="name"></param> |
| | | public void SetTimeText(string name) |
| | | { |
| | | TimeButton.Width = Application.GetMinRealAverage(320); |
| | | TimeButton.Width = Application.GetMinRealAverage(280); |
| | | TimeButton.Height = Application.GetMinRealAverage(63); |
| | | TimeButton.UnSelectedImagePath = string.Empty; |
| | | TimeButton.Text = name; |
| | | TimeButton.TextSize = 14; |
| | | TimeButton.IsBold = true; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | if (scene.IconPathType == 0) |
| | | { |
| | | SceneIcon.UnSelectedImagePath = iconPath; |
| | | SceneIcon.ImagePath = iconPath; |
| | | } |
| | | else |
| | | { |
| | | SceneIcon.UnSelectedImagePath = System.IO.Path.Combine(Config.Instance.FullPath, iconPath); |
| | | SceneIcon.ImagePath = System.IO.Path.Combine(Config.Instance.FullPath, iconPath); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | return; |
| | | } |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.ControlSceneFail); |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.ControlSceneFail)); |
| | | } |
| | | |
| | | scene.RemainTime = scene.SceneDelayTime; |
| | | scene.SceneDelayTime = 0; |
| | | Common.Room.CurrentRoom.ModifySceneDelayTime(scene); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | while (scene.RemainTime > 0) |
| | |
| | | /// <param name="mouseEventArgs"></param> |
| | | private void CollectionEvent(object sender,MouseEventArgs mouseEventArgs) |
| | | { |
| | | (sender as Button).IsSelected = !(sender as Button).IsSelected; |
| | | if ((sender as Button).IsSelected) |
| | | if (Common.Room.CurrentRoom.IsLove) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().AddScene(scene); |
| | | Common.Room.CurrentRoom.GetLoveRoom().DeleteScene(scene); |
| | | CollectionAction?.Invoke(); |
| | | } |
| | | else |
| | | { |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().RemoveScene(scene); |
| | | (sender as Button).IsSelected = !(sender as Button).IsSelected; |
| | | if ((sender as Button).IsSelected) |
| | | { |
| | | Common.Room.CurrentRoom.GetLoveRoom().AddScene(scene); |
| | | } |
| | | else |
| | | { |
| | | Common.Room.CurrentRoom.GetLoveRoom().DeleteScene(scene); |
| | | } |
| | | } |
| | | scene.Save(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | var timeSelect = new SelectTime(); |
| | | CommonPage.Instance.AddChidren(timeSelect); |
| | | timeSelect.TempTime = scene.DelayTime; |
| | | timeSelect.TempTime = scene.SceneDelayTime; |
| | | timeSelect.Init(); |
| | | timeSelect.TimeAction = (t) => |
| | | { |
| | | scene.SceneDelayTime = t; |
| | | SetTimeByDelayTime(t); |
| | | |
| | | Common.Room.CurrentRoom.ModifySceneDelayTime(scene); |
| | | }; |
| | | } |
| | | |