| | |
| | | static VerticalScrolViewLayout functionListView; |
| | | #endregion |
| | | |
| | | List<Function> functionList; |
| | | |
| | | public AddLightScene() |
| | | List<Function> sceneLishtList; |
| | | Scene lightScene; |
| | | public AddLightScene(List<Function> functions,Scene scene) |
| | | { |
| | | bodyView = this; |
| | | functionList = new List<Function>(); |
| | | sceneLishtList = functions; |
| | | lightScene = scene; |
| | | } |
| | | |
| | | public void LoadPage(int titleId) |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView(); |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView(); |
| | | |
| | | /// <summary> |
| | | /// 房间内容显示区域 |
| | |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | functionList.AddRange(FunctionList.List.GetLightList()); |
| | | var lightList = FunctionList.List.GetLightList(); |
| | | |
| | | foreach (var function in lightList) |
| | | { |
| | | var functionDiv = new LightRow(function) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(62), |
| | | Radius = (uint)Application.GetMinRealAverage(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 1, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Tag = function.spk + function.sid |
| | | }; |
| | | functionDiv.LoadDiv(sceneLishtList); |
| | | functionListView.AddChidren(functionDiv); |
| | | |
| | | functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); |
| | | } |
| | | |
| | | |
| | | #region 底部view |
| | | var bottomView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(591), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | this.AddChidren(bottomView); |
| | | |
| | | var btnConfrim = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(12), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealHeight(44), |
| | | Radius = (uint)Application.GetRealHeight(22), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Confirm, |
| | | }; |
| | | bottomView.AddChidren(btnConfrim); |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | var lightSceneDialog = new LightSceneEditDialog(sceneLishtList,lightScene); |
| | | lightSceneDialog.ShowDialog(); |
| | | }; |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public class LightRow : FrameLayout |
| | | { |
| | | #region 区域控件 |
| | | static FrameLayout bodyDiv; |
| | | /// <summary> |
| | | /// 功能/场景icon |
| | | /// </summary> |
| | | Button btnIcon; |
| | | /// <summary> |
| | | /// 功能名称/场景名称 |
| | | /// </summary> |
| | | Button btnName; |
| | | /// <summary> |
| | | /// 楼层信息显示按钮 |
| | | /// </summary> |
| | | Button btnFromFloor; |
| | | /// <summary> |
| | | /// 选中按钮 |
| | | /// </summary> |
| | | Button btnSelect; |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | | Function function; |
| | | #endregion |
| | | public LightRow(Function func) |
| | | { |
| | | bodyDiv = this; |
| | | bodyDiv.Tag = func.sid; |
| | | function = func; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载控制卡片区域 |
| | | /// </summary> |
| | | public void LoadDiv(List<Function> functions) |
| | | { |
| | | btnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png" |
| | | }; |
| | | bodyDiv.AddChidren(btnIcon); |
| | | |
| | | btnName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 10 + 32), |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(24), |
| | | Text = function.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | bodyDiv.AddChidren(btnName); |
| | | |
| | | btnFromFloor = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 10 + 32), |
| | | Y = Application.GetRealHeight(10 + 24), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(18), |
| | | Text = function.GetRoomListName(), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | bodyDiv.AddChidren(btnFromFloor); |
| | | |
| | | btnSelect = new Button() |
| | | { |
| | | X = Application.GetRealWidth(303), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Light/LightScene/CheckIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Light/LightScene/CheckOnIcon.png", |
| | | IsSelected = functions.Find((obj) => obj.deviceId == function.deviceId) != null |
| | | }; |
| | | bodyDiv.AddChidren(btnSelect); |
| | | |
| | | btnSelect.MouseUpEventHandler = (sender, e) => { |
| | | btnSelect.IsSelected = !btnSelect.IsSelected; |
| | | if(btnSelect.IsSelected) |
| | | { |
| | | var addTemp = functions.Find((obj) => obj.deviceId == function.deviceId); |
| | | if (addTemp == null) |
| | | { |
| | | functions.Add(function); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var removeTemp = functions.Find((obj) => obj.deviceId == function.deviceId); |
| | | if (removeTemp != null) |
| | | { |
| | | functions.Remove(removeTemp); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 灯光场景编辑弹窗 |
| | | /// </summary> |
| | | public class LightSceneEditDialog :Dialog |
| | | { |
| | | List<Function> lights; |
| | | |
| | | Scene editScene; |
| | | |
| | | public LightSceneEditDialog(List<Function> functions,Scene scene) |
| | | { |
| | | lights = functions; |
| | | editScene = scene; |
| | | } |
| | | |
| | | |
| | | public void ShowDialog() |
| | | { |
| | | var hadDimming = lights.Find((obj) => obj.spk == SPK.LightDimming) != null; |
| | | var hadCCT = lights.Find((obj) => obj.spk == SPK.LightCCT) != null; |
| | | var hadRGB = lights.Find((obj) => obj.spk == SPK.LightRGB) != null; |
| | | |
| | | var bodyView = new FrameLayout(); |
| | | this.AddChidren(bodyView); |
| | | bodyView.MouseUpEventHandler = (sender, e) => { |
| | | this.Close(); |
| | | }; |
| | | |
| | | var contentView = new FrameLayout() { |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Width = Application.GetRealWidth(343), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | #region 标题区 |
| | | bool inEdit = false;//是否在编辑标题 |
| | | var titleView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(52), |
| | | }; |
| | | contentView.AddChidren(titleView); |
| | | |
| | | var btnTitle = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(52), |
| | | Gravity = Gravity.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextID = StringId.CombinedDimming, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | if (btnTitle.GetTextWidth() > Application.GetRealWidth(197))//247 |
| | | { |
| | | btnTitle.Width = Application.GetRealWidth(197); |
| | | btnTitle.IsMoreLines = true; |
| | | } |
| | | else |
| | | { |
| | | btnTitle.Width = btnTitle.GetTextWidth()+ Application.GetRealWidth(10); |
| | | btnTitle.IsMoreLines = false; |
| | | } |
| | | titleView.AddChidren(btnTitle); |
| | | |
| | | var btnEditIcon = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | X = Application.GetRealWidth(12) + btnTitle.Right, |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Public/Edit.png", |
| | | SelectedImagePath = "Public/HookIcon.png" |
| | | }; |
| | | titleView.AddChidren(btnEditIcon); |
| | | |
| | | EventHandler<MouseEventArgs> dd = (sender, e) => |
| | | { |
| | | inEdit = !inEdit; |
| | | btnEditIcon.IsSelected = inEdit; |
| | | |
| | | if (inEdit) |
| | | { |
| | | btnTitle.Width = btnTitle.GetTextWidth(); |
| | | } |
| | | else |
| | | { |
| | | if (btnTitle.GetTextWidth() > Application.GetRealWidth(197))//247 |
| | | { |
| | | btnTitle.Width = Application.GetRealWidth(197); |
| | | } |
| | | else |
| | | { |
| | | btnTitle.Width = btnTitle.GetTextWidth(); |
| | | } |
| | | editScene.name = btnTitle.Text.Trim(); |
| | | } |
| | | }; |
| | | btnTitle.MouseUpEventHandler = dd; |
| | | btnEditIcon.MouseUpEventHandler = dd; |
| | | |
| | | titleView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor, Y = Application.GetRealHeight(51) }); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | var dimmingLight = editScene.functions.Find((obj) => obj.localFunction.spk == SPK.LightDimming); |
| | | var cctLight = editScene.functions.Find((obj) => obj.localFunction.spk == SPK.LightCCT); |
| | | var rgbLight = editScene.functions.Find((obj) => obj.localFunction.spk == SPK.LightRGB); |
| | | var brightnessValue = 0; |
| | | var cctValue = 27; |
| | | if (cctLight != null) |
| | | { |
| | | int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness).value, out brightnessValue); |
| | | int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out cctValue); |
| | | } |
| | | |
| | | |
| | | //属性设置区域 |
| | | var attrView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(52), |
| | | Width = Application.GetRealWidth(343), |
| | | }; |
| | | //属性设置区域高度 |
| | | int attrViewHight = Application.GetRealHeight(27 + 22); |
| | | attrView.AddChidren(new Button() { Height = Application.GetRealHeight(27) }); |
| | | |
| | | if (hadDimming) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(54 + 11); |
| | | var dimmingView = new FrameLayout(); |
| | | attrView.AddChidren(dimmingView); |
| | | |
| | | |
| | | #region 亮度调节 |
| | | var btnBrightnessText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(1), |
| | | Width = Application.GetRealWidth(224), |
| | | Height = Application.GetRealHeight(21), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.Brightness, |
| | | BackgroundColor = 0xFFFF0000 |
| | | }; |
| | | dimmingView.AddChidren(btnBrightnessText); |
| | | |
| | | var btnMinValuesText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = btnBrightnessText.Bottom, |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "0%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | dimmingView.AddChidren(btnMinValuesText); |
| | | |
| | | var dimmerBar = new DiyImageSeekBar() |
| | | { |
| | | X = Application.GetRealWidth(35 + 22), |
| | | Y = Application.GetRealHeight(11), |
| | | Width = Application.GetRealWidth(210), |
| | | Height = Application.GetRealHeight(54), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImagePath = "Public/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(54), |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | ProgressBarColor = CSS_Color.AuxiliaryColor1, |
| | | MaxValue = 100, |
| | | Progress = brightnessValue, |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | }; |
| | | //dimmingView.AddChidren(dimmerBar); |
| | | |
| | | var btnMaxValuesText = new Button() |
| | | { |
| | | X = dimmerBar.Right, |
| | | Y = btnBrightnessText.Bottom, |
| | | Width = Application.GetRealWidth(45), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "100%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | dimmingView.AddChidren(btnMaxValuesText); |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | | attrView.Height = attrViewHight; |
| | | contentView.AddChidren(attrView); |
| | | contentView.Height = Application.GetRealHeight(52 + 44) + attrViewHight; |
| | | contentView.Gravity = Gravity.Center; |
| | | |
| | | |
| | | |
| | | |
| | | #region bottom View |
| | | var bottomView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(52) + attrViewHight, |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | contentView.AddChidren(bottomView); |
| | | |
| | | var btnSave = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(172), |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextID = StringId.Save, |
| | | }; |
| | | bottomView.AddChidren(btnSave); |
| | | |
| | | var btnComplete = new Button() |
| | | { |
| | | X = Application.GetRealWidth(172), |
| | | Width = Application.GetRealWidth(172), |
| | | Height = Application.GetRealHeight(46), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.Complete |
| | | }; |
| | | bottomView.AddChidren(btnComplete); |
| | | |
| | | //例:右下圆角 大小为50 |
| | | int mRectCornerID = HDLUtils.RectCornerBottomRight; |
| | | btnComplete.SetCornerWithSameRadius((uint)Application.GetMinRealAverage(12), mRectCornerID); |
| | | |
| | | bottomView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | |
| | | btnSave.MouseUpEventHandler = (sender, e) => { |
| | | this.Close(); |
| | | |
| | | |
| | | }; |
| | | |
| | | btnComplete.MouseUpEventHandler = (sender, e) => { |
| | | this.Close(); |
| | | |
| | | }; |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | this.Show(); |
| | | return; |
| | | //只有调光器 |
| | | if (!hadDimming&&!hadCCT&&!hadRGB) |
| | | { |
| | | contentView.Height = Application.GetRealHeight(520); |
| | | contentView.Width = Application.GetRealWidth(343); |
| | | contentView.Gravity = Gravity.Center; |
| | | contentView.Radius = (uint)Application.GetRealWidth(12); |
| | | contentView.AddChidren(titleView); |
| | | } |
| | | else if (hadCCT && hadRGB)// |
| | | { |
| | | contentView.Height = Application.GetRealHeight(520); |
| | | contentView.Width = Application.GetRealWidth(343); |
| | | contentView.Gravity = Gravity.Center; |
| | | contentView.Radius = (uint)Application.GetRealWidth(12); |
| | | contentView.AddChidren(titleView); |
| | | #region 亮度调节 |
| | | var btnBrightnessText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(82), |
| | | Width = Application.GetRealWidth(224), |
| | | Height = Application.GetRealHeight(21), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.Brightness, |
| | | }; |
| | | contentView.AddChidren(btnBrightnessText); |
| | | |
| | | var btnMinValuesText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = btnBrightnessText.Bottom, |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "0%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | contentView.AddChidren(btnMinValuesText); |
| | | |
| | | var dimmerBar = new DiyImageSeekBar() |
| | | { |
| | | X = Application.GetRealWidth(35 + 22), |
| | | Y = Application.GetRealHeight(312), |
| | | Width = Application.GetRealWidth(210), |
| | | Height = Application.GetRealHeight(54), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImagePath = "Public/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(54), |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | ProgressBarColor = CSS_Color.AuxiliaryColor1 , |
| | | MaxValue = 100, |
| | | Progress = brightnessValue, |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | }; |
| | | contentView.AddChidren(dimmerBar); |
| | | |
| | | var btnMaxValuesText = new Button() |
| | | { |
| | | X = dimmerBar.Right, |
| | | Y = btnBrightnessText.Bottom, |
| | | Width = Application.GetRealWidth(45), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "100%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | contentView.AddChidren(btnMaxValuesText); |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region 色温 |
| | | //色温 |
| | | var btnTempClolor = new Button(); |
| | | btnTempClolor.X = Application.GetRealWidth(35); |
| | | btnTempClolor.Y = Application.GetRealHeight(159); |
| | | btnTempClolor.Width = Application.GetRealWidth(224); |
| | | btnTempClolor.Height = Application.GetRealHeight(21); |
| | | btnTempClolor.TextAlignment = TextAlignment.CenterLeft; |
| | | btnTempClolor.TextColor = CSS_Color.FirstLevelTitleColor; |
| | | btnTempClolor.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; |
| | | btnTempClolor.TextID = StringId.ColorTemperature; |
| | | contentView.AddChidren(btnTempClolor); |
| | | |
| | | //2700K |
| | | var btnTempClolorMin = new Button(); |
| | | btnTempClolorMin.Y = btnTempClolor.Bottom + Application.GetRealHeight(9); |
| | | btnTempClolorMin.Width = Application.GetRealWidth(54); |
| | | btnTempClolorMin.Height = Application.GetRealHeight(21); |
| | | btnTempClolorMin.Text = "2700K"; |
| | | btnTempClolorMin.TextAlignment = TextAlignment.CenterRight; |
| | | btnTempClolorMin.TextColor = CSS_Color.PromptingColor1; |
| | | btnTempClolorMin.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; |
| | | contentView.AddChidren(btnTempClolorMin); |
| | | |
| | | //滑动条的背景图片 |
| | | var btnColorTemplatrueBack = new Button(); |
| | | //需要减掉滑动条的左右间距 |
| | | btnColorTemplatrueBack.Width = Application.GetRealWidth(210 - 20 * 2); |
| | | btnColorTemplatrueBack.Height = Application.GetRealHeight(8); |
| | | btnColorTemplatrueBack.Gravity = Gravity.CenterHorizontal; |
| | | btnColorTemplatrueBack.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatureBar.png"; |
| | | contentView.AddChidren(btnColorTemplatrueBack); |
| | | //滑动条控件 |
| | | var barColorTemplatrue = new CCTSeekBarControl(); |
| | | barColorTemplatrue.X = btnTempClolorMin.Right; |
| | | barColorTemplatrue.Y = Application.GetRealHeight(340); |
| | | barColorTemplatrue.MinValue = 27; |
| | | barColorTemplatrue.MaxValue = 65; |
| | | barColorTemplatrue.ProgressBarColor = 0x00000000;//全部透明 |
| | | barColorTemplatrue.ProgressBarUnEnableColor = 0x00000000; |
| | | barColorTemplatrue.SeekBarBackgroundColor = 0x00000000; |
| | | contentView.AddChidren(barColorTemplatrue); |
| | | barColorTemplatrue.Y = btnTempClolorMin.Y - (barColorTemplatrue.Height - btnTempClolorMin.Height) / 2; |
| | | //显示上方的Txt |
| | | barColorTemplatrue.ShowCustomTextView(Application.GetRealWidth(50), CSS_FontSize.PromptFontSize_FirstLevel, CSS_Color.FirstLevelTitleColor); |
| | | var cct = 27; |
| | | int.TryParse(cctLight.status.Find((obj)=>obj.key == FunctionAttributeKey.CCT).value, out cct); |
| | | barColorTemplatrue.Progress = cct; |
| | | //设置初始值 |
| | | barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K"); |
| | | |
| | | //变更背景图的Y轴坐标 |
| | | btnColorTemplatrueBack.Y = barColorTemplatrue.Y + (barColorTemplatrue.Height - btnColorTemplatrueBack.Height) / 2; |
| | | |
| | | //6500K |
| | | var btnTempClolorMax = new Button(); |
| | | btnTempClolorMax.Y = btnTempClolorMin.Y; |
| | | btnTempClolorMax.X = barColorTemplatrue.Right; |
| | | btnTempClolorMax.Width = Application.GetRealWidth(54); |
| | | btnTempClolorMax.Height = Application.GetRealHeight(21); |
| | | btnTempClolorMax.Text = "6500K"; |
| | | btnTempClolorMax.TextAlignment = TextAlignment.CenterLeft; |
| | | btnTempClolorMax.TextColor = CSS_Color.PromptingColor1; |
| | | btnTempClolorMax.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; |
| | | contentView.AddChidren(btnTempClolorMax); |
| | | |
| | | #endregion |
| | | |
| | | #region RGB |
| | | |
| | | var btnCurColor = new Button() |
| | | { |
| | | X = Application.GetRealWidth(24), |
| | | Y = Application.GetRealHeight(241), |
| | | Width = Application.GetMinRealAverage(24), |
| | | Height = Application.GetMinRealAverage(24), |
| | | Radius = (uint)Application.GetMinRealAverage(8), |
| | | BorderColor = CSS_Color.PromptingColor2, |
| | | BorderWidth = 1, |
| | | BackgroundColor = (uint)(0xFF000000 + new Light().GetRGBcolor(new Function(),rgbLight.status.Find((obj) => obj.key == FunctionAttributeKey.RGB).value)) |
| | | }; |
| | | contentView.AddChidren(btnCurColor); |
| | | |
| | | //色盘的桌布控件(限制那个白色滑动球使用) |
| | | var framePickerBack = new FrameLayout(); |
| | | framePickerBack.Gravity = Gravity.CenterHorizontal; |
| | | framePickerBack.Y = Application.GetRealHeight(249); |
| | | framePickerBack.Width = Application.GetMinRealAverage(198); |
| | | framePickerBack.Height = Application.GetMinRealAverage(198); |
| | | contentView.AddChidren(framePickerBack); |
| | | |
| | | var colorPicker = new ColorPicker() |
| | | { |
| | | ColorImagePath = "FunctionIcon/Light/ColorWheel.png", |
| | | }; |
| | | framePickerBack.AddChidren(colorPicker); |
| | | #endregion |
| | | } |
| | | else if (hadDimming && !hadCCT && !hadRGB) |
| | | { |
| | | contentView.Height = Application.GetRealHeight(211); |
| | | contentView.Width = Application.GetRealWidth(343); |
| | | contentView.Gravity = Gravity.Center; |
| | | contentView.Radius = (uint)Application.GetRealWidth(12); |
| | | contentView.AddChidren(titleView); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |