| | |
| | | /// <summary> |
| | | /// SceneIcon |
| | | /// </summary> |
| | | public Button SceneIcon; |
| | | public ImageView SceneIcon; |
| | | /// <summary> |
| | | /// statu |
| | | /// </summary> |
| | |
| | | }; |
| | | AddChidren(CardBG); |
| | | |
| | | SceneIcon = new Button |
| | | SceneIcon = new ImageView |
| | | { |
| | | X = Application.GetMinRealAverage(14), |
| | | Width = Application.GetMinRealAverage(458), |
| | | Height = Application.GetRealHeight(305), |
| | | Gravity = Gravity.CenterHorizontal |
| | | Height = Application.GetMinRealAverage(305), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | AddChidren(SceneIcon); |
| | | SceneIcon.SetViewShadow(true); |
| | | SceneIcon.SetCornerWithSameRadius(Application.GetRealHeight(100), HDLUtils.RectCornerBottomRight); |
| | | |
| | | sceneBG = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(487), |
| | | Height = Application.GetMinRealAverage(348), |
| | | UnSelectedImagePath = "Item/SceneCard.png", |
| | | Gravity = Gravity.CenterHorizontal |
| | | }; |
| | | AddChidren(sceneBG); |
| | | //sceneBG = new Button |
| | | //{ |
| | | // Width = Application.GetMinRealAverage(487), |
| | | // Height = Application.GetMinRealAverage(348), |
| | | // UnSelectedImagePath = "Item/SceneCard.png", |
| | | // Gravity = Gravity.CenterHorizontal |
| | | //}; |
| | | //AddChidren(sceneBG); |
| | | |
| | | TimeButton = new Button() |
| | | { |
| | |
| | | Y = Application.GetMinRealAverage(239), |
| | | Width = Application.GetMinRealAverage(279), |
| | | Height = Application.GetMinRealAverage(60), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | |
| | | /// </summary> |
| | | private void InitStatu() |
| | | { |
| | | SetIimeByDelayTime(scene.SceneDelayTime); |
| | | SetTimeByDelayTime(scene.SceneDelayTime); |
| | | SetSceneNameText(scene.Name); |
| | | SetIcon(scene.IconPath); |
| | | SetCollect(Common.Room.CurrentRoom.GetLoveRoom().SceneUIFilePathList.Contains(scene.FileName)); |
| | |
| | | TimeButton.MouseUpEventHandler += SetTimeEvents; |
| | | CollectButton.MouseUpEventHandler += CollectionEvent; |
| | | SceneIcon.MouseUpEventHandler += SceneUpHandler; |
| | | sceneBG.MouseUpEventHandler += SceneUpHandler; |
| | | SceneNameButton.MouseUpEventHandler += SceneUpHandler; |
| | | } |
| | | |
| | |
| | | /// SetIimeByDelayTime |
| | | /// </summary> |
| | | /// <param name="time"></param> |
| | | public void SetIimeByDelayTime(int time) |
| | | public void SetTimeByDelayTime(int time) |
| | | { |
| | | if (time > 0) |
| | | { |
| | |
| | | /// <param name="iconPath"></param> |
| | | public void SetIcon(string iconPath) |
| | | { |
| | | SceneIcon.UnSelectedImagePath = iconPath; |
| | | if (scene.IconPathType == 0) |
| | | { |
| | | SceneIcon.ImagePath = iconPath; |
| | | } |
| | | else |
| | | { |
| | | SceneIcon.ImagePath = System.IO.Path.Combine(Config.Instance.FullPath, iconPath); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.ControlSceneFail); |
| | | } |
| | | |
| | | var times = scene.SceneDelayTime; |
| | | scene.RemainTime = times; |
| | | scene.RemainTime = scene.SceneDelayTime; |
| | | scene.SceneDelayTime = 0; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | while (times > 0) |
| | | while (scene.RemainTime > 0) |
| | | { |
| | | System.Threading.Thread.Sleep(1000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | SetTimeText(CommonFormResouce.GetTimeString(times)); |
| | | SetTimeText(CommonFormResouce.GetTimeString(scene.RemainTime)); |
| | | }); |
| | | times -= 1; |
| | | scene.RemainTime -= 1; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | timeSelect.TimeAction = (t) => |
| | | { |
| | | scene.SceneDelayTime = t; |
| | | SetIimeByDelayTime(t); |
| | | SetTimeByDelayTime(t); |
| | | }; |
| | | } |
| | | |