From a051c37a96a4b518b1bf1689252649c32430194f Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期五, 10 四月 2020 15:49:12 +0800
Subject: [PATCH] 2020-04-10-0-1
---
ZigbeeApp/Shared/Phone/Device/CommonForm/ButtonLineForm.cs | 48 ++++++++++++++++++++++++++++++++++++------------
1 files changed, 36 insertions(+), 12 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/ButtonLineForm.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/ButtonLineForm.cs
index a4f3a70..78e5035 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/ButtonLineForm.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/ButtonLineForm.cs
@@ -3,7 +3,7 @@
namespace Shared.Phone.Device.CommonForm
{
- public class ButtonLineForm:FrameLayout
+ public class ButtonLineForm : FrameLayout
{
/// <summary>
/// name
@@ -12,7 +12,7 @@
/// <summary>
/// line
/// </summary>
- public Line Line;
+ public Button Line;
/// <summary>
/// isSelected
/// </summary>
@@ -46,14 +46,12 @@
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- public ButtonLineForm(int x, int y, int width, int height)
+ public ButtonLineForm(int x, int y)
{
X = Application.GetRealWidth(x);
Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(width);
- Height = Application.GetRealHeight(height);
+ Width = Application.GetRealWidth(100);
+ Height = Application.GetRealHeight(85);
}
/// <summary>
@@ -64,13 +62,24 @@
NameBtn = new Button()
{
Width = Width,
- Height = Height - 3,
- TextColor=ZigbeeColor.Current.GXCTextGrayColor4,
- SelectedTextColor=ZigbeeColor.Current.GXCTextDeepBlackColor
+ Height = Height - Application.GetRealHeight(6),
+ TextColor = ZigbeeColor.Current.GXCTextGrayColor4,
+ SelectedTextColor = ZigbeeColor.Current.GXCTextBlackColor,
+ TextSize = CommonFormResouce.TextSize,
+ TextAlignment = TextAlignment.CenterLeft
};
AddChidren(NameBtn);
- Line = new Line(Height,Width/2,2);
+ Line = new Button
+ {
+ X = 0,
+ Y = Height - Application.GetRealHeight(6),
+ Width = 10,
+ Height = Application.GetRealHeight(6),
+ Radius = (uint)Application.GetRealHeight(6 / 2),
+ BackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor,
+ Visible = false
+ };
AddChidren(Line);
}
@@ -81,6 +90,18 @@
public void SetTitle(string title)
{
NameBtn.Text = title;
+ RefreshWidth();
+ }
+
+ /// <summary>
+ /// RefreshWidth
+ /// </summary>
+ public void RefreshWidth()
+ {
+ NameBtn.Width = NameBtn.GetTextWidth() + Application.GetRealWidth(100);
+ Width = NameBtn.Width;
+ Line.X = NameBtn.GetTextWidth() / 4;
+ Line.Width= NameBtn.GetTextWidth() / 2;
}
/// <summary>
@@ -98,7 +119,10 @@
/// <param name="statu"></param>
public void SetStatu(bool statu)
{
- NameBtn.IsSelected = Line.IsSelected = statu;
+ NameBtn.IsSelected = Line.Visible = statu;
+ NameBtn.TextSize = statu ? CommonFormResouce.TextSize_Selected : CommonFormResouce.TextSize;
+ NameBtn.IsBold = statu;
+ RefreshWidth();
}
}
}
--
Gitblit v1.8.0