From 34e965100d635346e2d4cd6e6013bdaed66b3004 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 02 一月 2020 19:52:13 +0800
Subject: [PATCH] 2019.1.2-3
---
ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs | 33 +++++++++++++++++++++++----------
1 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
index c8c1092..e8e8acc 100644
--- a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
@@ -38,7 +38,7 @@
/// 鏀惰棌鎸夐挳
/// </summary>
private Button collectionBtn;
-
+
/// <summary>
/// 寮�鍏�
/// </summary>
@@ -47,7 +47,7 @@
/// 婊戞潯
/// </summary>
private WaveSeekBar levelSeekBar;
-
+
private Button StatuBtn;
/// <summary>
@@ -146,7 +146,8 @@
}
dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData;
switchBtn.IsSelected = dimmableLight.OnOffStatus == 1;
- StatuBtn.Text = CommonFormResouce.GetSwitchStatu(switchBtn.IsSelected);
+ StatuBtn.Text = switchBtn.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { device.GetDeviceStatu()}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}";
+
if (switchBtn.IsSelected == true)
{
levelSeekBar.IsClickable = true;
@@ -179,10 +180,12 @@
dimmableLight.Level = attriButeList[0].AttriButeData;
dimmableLight.LastDateTime = DateTime.Now;
levelSeekBar.Progress = (int)(dimmableLight.Level*1.0/MaxLevel*100);
+ StatuBtn.Text = switchBtn.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { device.GetDeviceStatu()}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}";
+
break;
}
}
-
+
}
}
catch (Exception ex)
@@ -193,7 +196,7 @@
}
else if (typeTag == "OnlineStatusChange")
{
-
+
}
}
@@ -375,7 +378,8 @@
Gravity = Gravity.CenterHorizontal,
Text = device.CommonDevice.DeviceEpointName,
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 15
+ TextSize = 15,
+ IsBold=true
};
itemView.AddChidren(deviceNameBtn);
@@ -386,8 +390,10 @@
Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as DimmableLight).OnOffStatus == 1)
+ Text = dimmableLight.Level>0?$"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { device.GetDeviceStatu()}" :$"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}",
+ TextSize=10
};
+
itemView.AddChidren(StatuBtn);
levelSeekBar = new WaveSeekBar()
@@ -399,8 +405,10 @@
WavePadding = Application.GetRealWidth(8),
MaxValue=100,
Progress = (int)(dimmableLight.Level*1.0/MaxLevel*100),
- WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor
+ WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor,
+ CornerRadius= Application.GetRealHeight(58)
};
+
itemView.AddChidren(levelSeekBar);
if (dimmableLight.OnOffStatus == 1)
@@ -417,12 +425,14 @@
levelSeekBar.OnStartTrackingTouchEvent += (sender, e) =>
{
OnProgressButtonMove(levelSeekBar.Progress);
+ levelSeekBar.IsProgressTextShow = false;
ProgressBtn.Visible = true;
};
levelSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
{
ProgressBtn.Visible = false;
+ levelSeekBar.IsProgressTextShow = true;
};
levelSeekBar.OnProgressChangedEvent += (send2, e2) =>
@@ -436,6 +446,8 @@
dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0));
};
+ InitProgressBtn(itemView);
+
InitProgressBtn(itemView);
switchBtn = new Button()
@@ -485,7 +497,8 @@
Height = Application.GetRealHeight(50),
Text = room.Name,
TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor
+ TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
+ TextSize = 12
};
itemView.AddChidren(roomName);
}
@@ -541,7 +554,7 @@
private void Switch_MouseUpEvent(object sender, MouseEventArgs eventArgs)
{
switchBtn.IsSelected = !switchBtn.IsSelected;
- StatuBtn.Text = CommonFormResouce.GetSwitchStatu(switchBtn.IsSelected);
+ StatuBtn.Text = switchBtn.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { device.GetDeviceStatu()}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}";
if (switchBtn.IsSelected == true)
{
dimmableLight.SwitchControl(1);
--
Gitblit v1.8.0