From 1e0014f5c2e2fe1cfaaacfb2bebe8adc577bc944 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 14 五月 2020 18:01:26 +0800
Subject: [PATCH] 2020-05-14-3
---
HDL_ON/UI/Music/View/SizeClass.cs | 7
HDL-ON_Android/Assets/Phone/MusicIcon/clear.png | 0
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs | 2
HDL-ON_Android/Assets/Language.ini | 4
HDL_ON/UI/UI0-Public/TopViewDivBLL.cs | 2
HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/FloorsManagementPageBLL.cs | 2
HDL_ON/UI/Music/USBMusicList.cs | 2
HDL_ON/UI/Music/A31MusicSourcePage.cs | 15
HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs | 4
HDL_ON/HDL_ON.projitems | 1
HDL_ON/UI/Music/View/TipView.cs | 593 ++++++++++++++++++++---------
HDL-ON_Android/HDL-ON_Android.csproj | 1
HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditPageBLL.cs | 2
HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs | 2
HDL_ON/UI/UI0-Public/PublicAssmebly.cs | 289 +++++++++----
HDL_ON/Common/R.cs | 2
HDL_ON/UI/Music/A31MusicModel.cs | 2
HDL_ON/UI/Music/View/DialogView.cs | 211 ++++++++++
18 files changed, 845 insertions(+), 296 deletions(-)
diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index 7463f87..9d5886b 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -178,4 +178,6 @@
5027=璇疯緭鍏ュ垪琛ㄥ悕
5028=娣诲姞鏂扮殑鍒楄〃
5029=鎻愮ず
-5030=鏄惁纭鍒犻櫎鏂囦欢澶�
\ No newline at end of file
+5030=鏄惁纭鍒犻櫎鏂囦欢澶�
+5031=纭
+5032=鍚嶇О涓虹┖
\ No newline at end of file
diff --git a/HDL-ON_Android/Assets/Phone/MusicIcon/clear.png b/HDL-ON_Android/Assets/Phone/MusicIcon/clear.png
new file mode 100644
index 0000000..4f60550
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/MusicIcon/clear.png
Binary files differ
diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj
index 9a50b1e..288b9ce 100644
--- a/HDL-ON_Android/HDL-ON_Android.csproj
+++ b/HDL-ON_Android/HDL-ON_Android.csproj
@@ -394,6 +394,7 @@
<AndroidAsset Include="Assets\Phone\MusicIcon\next1Selected.png" />
<AndroidAsset Include="Assets\Phone\MusicIcon\prev.png" />
<AndroidAsset Include="Assets\Phone\MusicIcon\prve1.png" />
+ <AndroidAsset Include="Assets\Phone\MusicIcon\clear.png" />
</ItemGroup>
<Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index 6ef922a..994f2de 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -233,5 +233,7 @@
public readonly static int addNewList = 5028;
public readonly static int tip = 5029;
public readonly static int delMusicFile = 5030;
+ public readonly static int confirmMusic = 5031;
+ public readonly static int nameNull = 5032;
}
}
\ No newline at end of file
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index 2fa7d06..8092bfc 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -134,6 +134,7 @@
<Compile Include="$(MSBuildThisFileDirectory)UI\Music\View\TipView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\Music\View\MusicSourceView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\Music\View\SongView.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\Music\View\DialogView.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)UI\" />
diff --git a/HDL_ON/UI/Music/A31MusicModel.cs b/HDL_ON/UI/Music/A31MusicModel.cs
index b165e95..abee446 100644
--- a/HDL_ON/UI/Music/A31MusicModel.cs
+++ b/HDL_ON/UI/Music/A31MusicModel.cs
@@ -47,7 +47,7 @@
/// <summary>
/// 闊充箰鎾斁鍣ㄥ悕绉�
/// </summary>
- public string Name;
+ public string Name=string.Empty;
/// <summary>
/// 涓婁竴娆℃洿鏂扮殑鏃堕棿
/// </summary>
diff --git a/HDL_ON/UI/Music/A31MusicSourcePage.cs b/HDL_ON/UI/Music/A31MusicSourcePage.cs
index 52e37b5..f505d9f 100644
--- a/HDL_ON/UI/Music/A31MusicSourcePage.cs
+++ b/HDL_ON/UI/Music/A31MusicSourcePage.cs
@@ -10,6 +10,8 @@
{
Tag = "Music";
}
+
+
public void Show()
{
#region 鐣岄潰甯冨眬------
@@ -165,24 +167,25 @@
///鎾斁鍣ㄤ慨鏀瑰悕绉颁簨浠�
playNameView.clickBtn.MouseUpEventHandler += (sender, e) =>
{
- new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, A31MusicModel.Current.Name, (playerName) =>
+ new View.TipView().InputBox(StringId.modifyName, A31MusicModel.Current.Name, StringId.nameNull, (playerName) =>
{
+
playNameView.inputTextBtn.Text = playerName;
A31MusicModel.Current.Name = playerName;
string url = "http://" + A31MusicModel.Current.IPAddress + "/httpapi.asp?command=setDeviceName:" + A31MusicModel.Current.Name;
SendMethod.SendCommand(url);
-
});
+
};
///钃濈墮淇敼鍚嶇О浜嬩欢
bluetoothNameView.clickBtn.MouseUpEventHandler += (sender, e) =>
{
- new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, A31MusicModel.Current.Name, (playerName) =>
+ new View.TipView().InputBox(StringId.modifyName, A31MusicModel.Current.Name, StringId.nameNull, (bluetoothName) =>
{
- bluetoothNameView.inputTextBtn.Text = playerName;
- SendMethod.ModifyBluetoothName("MCU+PAS+BT" + playerName.Trim() + "*&");
-
+ bluetoothNameView.inputTextBtn.Text = bluetoothName;
+ SendMethod.ModifyBluetoothName("MCU+PAS+BT" + bluetoothName.Trim() + "*&");
});
+
};
///鎴戠殑鍠滅埍浜嬩欢
myLoveView.clickBtn.MouseUpEventHandler += (sender, e) => {
diff --git a/HDL_ON/UI/Music/USBMusicList.cs b/HDL_ON/UI/Music/USBMusicList.cs
index 96b19c8..920fa9e 100644
--- a/HDL_ON/UI/Music/USBMusicList.cs
+++ b/HDL_ON/UI/Music/USBMusicList.cs
@@ -213,7 +213,7 @@
musicViewFl.AddChidren(addIcon);
addIcon.MouseUpEventHandler = (sender, e) =>
{
- new View.TipView { }.FieListView();
+ new View.DialogView { }.FieListView();
};
//鐐瑰嚮鎺т欢
diff --git a/HDL_ON/UI/Music/View/DialogView.cs b/HDL_ON/UI/Music/View/DialogView.cs
new file mode 100644
index 0000000..cb4c323
--- /dev/null
+++ b/HDL_ON/UI/Music/View/DialogView.cs
@@ -0,0 +1,211 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared;
+namespace HDL_ON.UI.Music.View
+{
+ public class DialogView
+ {
+ public DialogView()
+ {
+ }
+ public void FieListView()
+ {
+ //涓绘帶浠�
+ Dialog dialog = new Dialog()
+ {
+ BackgroundColor = Color.PopupBackgroundColor,
+ };
+ dialog.Show();
+ //鐖舵帶浠�
+ FrameLayout frame = new FrameLayout { };
+ dialog.AddChidren(frame);
+ frame.MouseUpEventHandler += (sen, e) =>
+ {
+ dialog.Close();
+ };
+ //鐧借壊蹇埗鎺т欢
+ FrameLayout dialogFra = new FrameLayout()
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(187),
+ Width = Application.GetRealWidth(344),
+ Height = Application.GetRealHeight(460),
+ BackgroundColor = Color.WhiteColor,
+ Radius = (uint)Application.GetRealHeight(12),
+ };
+ frame.AddChidren(dialogFra);
+ //鏄剧ず澶撮儴淇℃伅鐖舵帶浠�
+ FrameLayout topFra = new FrameLayout()
+ {
+ Width = Application.GetRealWidth(344),
+ Height = Application.GetRealHeight(70),
+ };
+ dialogFra.AddChidren(topFra);
+ //鍙栨秷鎺т欢
+ Button cancelnBtn = new Button
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(24),
+ Width = Application.GetRealWidth(60),
+ Height = Application.GetRealHeight(20),
+ TextID = StringId.cancelMusic,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = Color.MusicNoTxetColor,
+ TextSize = TextSize.Text14,
+ };
+ topFra.AddChidren(cancelnBtn);
+ cancelnBtn.MouseUpEventHandler += (sen, e) =>
+ {
+ dialog.Close();
+ };
+ //鏍囬鎺т欢
+ Button txetBtn = new Button
+ {
+ X = cancelnBtn.Right + Application.GetRealWidth(20),
+ Y = Application.GetRealHeight(23),
+ Width = Application.GetRealWidth(152),
+ Height = Application.GetRealHeight(22),
+ TextColor = Color.TextColor,
+ TextSize = TextSize.Text16,
+ TextAlignment = TextAlignment.Center,
+ TextID = StringId.myList,
+ IsBold = true,
+ };
+ topFra.AddChidren(txetBtn);
+
+ //娣诲姞鍥炬爣鎺т欢
+ Button addIconBtn = new Button
+ {
+ X = Application.GetRealWidth(304),
+ Y = Application.GetRealHeight(20),
+ Width = Application.GetMinRealAverage(28),
+ Height = Application.GetMinRealAverage(28),
+ UnSelectedImagePath = "MusicIcon/addMusic.png",
+ };
+ topFra.AddChidren(addIconBtn);
+
+
+ VerticalScrolViewLayout verticalScrolViewLayout = new VerticalScrolViewLayout
+ {
+ Y = Application.GetRealHeight(70),
+ Height = dialogFra.Height - Application.GetRealHeight(70),
+ Width = Application.GetRealWidth(344),
+ };
+ dialogFra.AddChidren(verticalScrolViewLayout);
+ addIconBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ var fileNameList = new List<string>();
+ fileNameList.Clear();
+ foreach (var stringName in A31MusicModel.Current.FileLists)
+ {
+ fileNameList.Add(stringName.ListName);
+
+ }
+ new TipView().InputBox(StringId.addNewList, "", StringId.listNameNull, StringId.listNamesSame, fileNameList, (name) =>
+ {
+
+ A31MusicModel.Current.FileLists.Add(new FileListInfo { ListName = name, });
+ A31MusicModel.Save();
+ FileView(verticalScrolViewLayout);
+ });
+ };
+ FileView(verticalScrolViewLayout);
+
+ }
+
+ void FileView(VerticalScrolViewLayout verticalScrolViewLayout)
+ {
+ verticalScrolViewLayout.RemoveAll();
+ for (int i = 0; i < A31MusicModel.Current.FileLists.Count; i++)
+ {
+ var list = A31MusicModel.Current.FileLists[i];
+ RowLayout addFlieRow = new RowLayout
+ {
+ Height = Application.GetRealHeight(78),
+ LineColor = Color.WhiteColor,
+ SubViewWidth = Application.GetRealWidth(80),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
+ };
+ verticalScrolViewLayout.AddChidren(addFlieRow);
+ //鏂囦欢鍥炬爣
+ Button fileIconBtn = new Button
+ {
+ X = Application.GetRealWidth(12),
+ Y = Application.GetRealHeight(8),
+ Width = Application.GetMinRealAverage(62),
+ Height = Application.GetMinRealAverage(62),
+ UnSelectedImagePath = "MusicIcon/file.png",
+ };
+ addFlieRow.AddChidren(fileIconBtn);
+
+ //鏂囦欢鍚嶆帶浠�
+ Button fileNameBtn = new Button
+ {
+ X = fileIconBtn.Right + Application.GetRealWidth(12),
+ Y = Application.GetRealHeight(29),
+ Width = Application.GetRealWidth(189),
+ Height = Application.GetRealHeight(20),
+ TextColor = Color.TextColor,
+ TextSize = TextSize.Text14,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = list.ListName,
+ };
+ addFlieRow.AddChidren(fileNameBtn);
+
+ ///缂栬緫鎺т欢
+ var editBtn = new Button
+ {
+ BackgroundColor = Color.MusicEditColor,
+ Text = Language.StringByID(StringId.editMusic),
+ TextColor = Color.WhiteColor,
+ TextSize = TextSize.Text16,
+ };
+ addFlieRow.AddRightView(editBtn);
+
+ editBtn.MouseUpEventHandler += (sender, e) =>
+ {
+
+ var fileNameList = new List<string>();
+ fileNameList.Clear();
+ foreach (var stringName in A31MusicModel.Current.FileLists)
+ {
+ fileNameList.Add(stringName.ListName);
+
+ }
+ new TipView().InputBox(StringId.modifyName, list.ListName, StringId.listNameNull, StringId.listNamesSame, fileNameList, (name) =>
+ {
+
+ if (list.ListName != name)
+ { ///淇敼鍚嶇О涓嶄竴鏍锋洿鏂颁繚瀛�
+ list.ListName = name;
+ fileNameBtn.Text = name;
+ A31MusicModel.Save();
+ }
+ });
+
+ };
+
+ ///鍒犻櫎鎺т欢
+ var delBtn = new Button
+ {
+ BackgroundColor = Color.MusicDelColor,
+ Text = Language.StringByID(StringId.delMusic),
+ TextColor = Color.WhiteColor,
+ TextSize = TextSize.Text16,
+ };
+ addFlieRow.AddRightView(delBtn);
+ delBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ new View.TipView().TipBox(StringId.tip, StringId.delMusicFile, () =>
+ {
+ addFlieRow.RemoveFromParent();
+ A31MusicModel.Current.FileLists.Remove(list);
+ A31MusicModel.Save();
+ });
+ };
+
+ }
+
+
+ }
+ }
+}
diff --git a/HDL_ON/UI/Music/View/SizeClass.cs b/HDL_ON/UI/Music/View/SizeClass.cs
index db64878..7c199ee 100644
--- a/HDL_ON/UI/Music/View/SizeClass.cs
+++ b/HDL_ON/UI/Music/View/SizeClass.cs
@@ -33,6 +33,11 @@
/// </summary>
public static uint WhiteColor = 0xFFFFFFFF;
/// <summary>
+ /// 绾㈣壊鑳屾櫙棰滆壊
+ /// </summary>
+ public static uint RedColor = 0xFFFF4747;
+
+ /// <summary>
/// 绾挎潯棰滆壊
/// </summary>
public static uint LineColor =0xFFECEDEE;
@@ -61,6 +66,8 @@
public static uint TextTimeColor = 0xFF798394;
+ public static uint TextCancelColor = 0xFF798394;
+
}
public static class H_W {
diff --git a/HDL_ON/UI/Music/View/TipView.cs b/HDL_ON/UI/Music/View/TipView.cs
index 6c1149b..62bcf42 100644
--- a/HDL_ON/UI/Music/View/TipView.cs
+++ b/HDL_ON/UI/Music/View/TipView.cs
@@ -1,233 +1,458 @@
锘縰sing System;
+using System.Collections.Generic;
+using HDL_ON.UI.CSS;
using Shared;
+
namespace HDL_ON.UI.Music.View
{
- public class TipView:FrameLayout
+ public class TipView
{
-
- public void FieListView()
+ /// <summary>
+ /// 澶ф鍦嗚鍊�
+ /// </summary>
+ public int RradiusFrameLayout = 15;
+ /// <summary>
+ /// 灏忔鍦嗚鍊�
+ /// </summary>
+ public int radiusEditFrameLayout = 4;
+ /// <summary>
+ /// 杈撳叆妗�
+ /// </summary>
+ /// <param name="titleId">鏍囬鏂囨湰</param>
+ /// <param name="tnputEditTxet">杈撳叆鏂囨湰</param>
+ /// <param name="errorId_IsNullOrEmpty">杈撳叆妗嗘枃鏈负绌鸿嚜瀹氫箟鎻愮ず閿欒鏂囨湰</param>
+ /// <param name="errorId_PresenceP">妫�绱㈠凡瀛樺湪鍚嶇О鑷畾涔夋彁绀洪敊璇枃鏈�</param>
+ /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+ /// <param name="List">琚绱㈠垪琛�</param>
+ /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+ public void InputBox(int titleId, string tnputEditTxet,int errorId_IsNullOrEmpty, int errorId_PresenceP, List<string> List, Action<string> confirmAction)
{
- //涓绘帶浠�
Dialog dialog = new Dialog()
{
BackgroundColor = Color.PopupBackgroundColor,
};
- dialog.Show();
- //鐖舵帶浠�
- FrameLayout frame = new FrameLayout { };
- dialog.AddChidren(frame);
- frame.MouseUpEventHandler += (sen, e) =>
+
+ FrameLayout whiteView = new FrameLayout()
{
- dialog.Close();
- };
- //鐧借壊蹇埗鎺т欢
- FrameLayout dialogFra = new FrameLayout()
- {
- X = Application.GetRealWidth(16),
- Y = Application.GetRealHeight(187),
- Width = Application.GetRealWidth(344),
- Height = Application.GetRealHeight(460),
+ //Gravity = Gravity.Center,
+ X=Application.GetRealWidth(53),
+ Y = Application.GetRealHeight(264),
+ Width = Application.GetRealWidth(270),
+ Height = Application.GetRealHeight(172),
BackgroundColor = Color.WhiteColor,
- Radius = (uint)Application.GetRealHeight(12),
+ BorderColor = 0x00000000,
+ BorderWidth = 0,
+ Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
};
- frame.AddChidren(dialogFra);
- //鏄剧ず澶撮儴淇℃伅鐖舵帶浠�
- FrameLayout topFra = new FrameLayout()
+ dialog.AddChidren(whiteView);
+
+ Button btnTitle = new Button()
{
- Width = Application.GetRealWidth(344),
- Height = Application.GetRealHeight(70),
+ Y = Application.GetRealHeight(20),
+ X=Application.GetRealWidth(35),
+ Height = Application.GetRealHeight(22),
+ Width=Application.GetRealWidth(200),
+ TextColor =Color.SelectedColor,
+ TextSize =TextSize.Text16,
+ TextAlignment = TextAlignment.Center,
+ TextID = titleId,
+
};
- dialogFra.AddChidren(topFra);
- //鍙栨秷鎺т欢
- Button cancelnBtn = new Button
+ whiteView.AddChidren(btnTitle);
+
+ FrameLayout editBjView = new FrameLayout()
{
- X = Application.GetRealWidth(16),
- Y = Application.GetRealHeight(24),
- Width = Application.GetRealWidth(100),
- Height = Application.GetRealHeight(20),
- TextID = StringId.cancelMusic,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = Color.MusicNoTxetColor,
+ // Gravity = Gravity.CenterHorizontal,
+ Y = btnTitle.Bottom + Application.GetRealHeight(16),
+ X=Application.GetRealWidth(24),
+ Width = Application.GetRealWidth(222),
+ Height = Application.GetRealHeight(40),
+ BackgroundColor =Color.ViewColor,
+ BorderColor = 0x00000000,
+ BorderWidth = 0,
+ Radius = (uint)Application.GetMinRealAverage(radiusEditFrameLayout),
+ };
+ whiteView.AddChidren(editBjView);
+
+ EditText editText = new EditText()
+ {
+ X = Application.GetRealWidth(12),
+ Y=Application.GetRealHeight(10),
+ Width = Application.GetRealWidth(160),
+ Height=Application.GetRealHeight(20),
+ Text = tnputEditTxet,
+ TextColor = Color.TextColor,
TextSize = TextSize.Text14,
+ TextAlignment=TextAlignment.CenterLeft,
+
};
- topFra.AddChidren(cancelnBtn);
- cancelnBtn.MouseUpEventHandler += (sen, e) =>
+ editBjView.AddChidren(editText);
+
+ Button clearIconBtn = new Button
+ {
+ X = Application.GetRealWidth(194),
+ Y = Application.GetRealHeight(8),
+ Width = Application.GetMinRealAverage(24),
+ Height = Application.GetMinRealAverage(24),
+ UnSelectedImagePath = "MusicIcon/clear.png",
+ };
+ editBjView.AddChidren(clearIconBtn);
+ clearIconBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ editText.Text = "";
+ };
+
+ Button btnLine = new Button()
+ {
+ Y = whiteView.Height-Application.GetRealHeight(44+1),
+ Height = Application.GetRealHeight(1),
+ BackgroundColor =Color.LineColor,
+ };
+ whiteView.AddChidren(btnLine);
+
+ Button btnCancel = new Button()
+ {
+ Y = btnLine.Bottom,
+ Width = Application.GetRealWidth(135),
+ Height = Application.GetRealHeight(44),
+ TextAlignment = TextAlignment.Center,
+ TextColor = Color.TextCancelColor,
+ TextSize = TextSize.Text16,
+ TextID = StringId.cancelMusic,
+ };
+ whiteView.AddChidren(btnCancel);
+
+ Button btnConfirm = new Button()
+ {
+ X = btnCancel.Right,
+ Y = btnLine.Bottom,
+ Width = Application.GetRealWidth(135),
+ Height = Application.GetRealHeight(44),
+ TextAlignment = TextAlignment.Center,
+ TextColor = Color.WhiteColor,
+ IsBold = true,
+ TextSize = TextSize.Text16,
+ TextID = StringId.confirmMusic,
+ BackgroundColor = Color.SelectedColor,
+ Gravity = Gravity.BottomRight,
+ };
+ whiteView.AddChidren(btnConfirm);
+ btnConfirm.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomRight);
+
+ dialog.Show();
+ btnCancel.MouseUpEventHandler += (sender, e) =>
{
dialog.Close();
};
- //鏍囬鎺т欢
- Button txetBtn = new Button
+ Button btnTip = new Button
{
- X = cancelnBtn.Right + Application.GetRealWidth(20),
- Y = Application.GetRealHeight(23),
- Width = Application.GetRealWidth(100),
+ Width = Application.GetRealWidth(0),
+ };
+ whiteView.AddChidren(btnTip);//涓�鐩撮敊璇紝涓�鐩寸寷鐐癸紝涓�鐩村姞鎺т欢
+ btnConfirm.MouseUpEventHandler += (sender, e) =>
+ {
+ string listNameText = editText.Text.Trim();
+ if (string.IsNullOrEmpty(listNameText) || List.Contains(listNameText))
+ {
+ string tipMsgString = "";
+ if (string.IsNullOrEmpty(editText.Text.Trim()))
+ {
+ tipMsgString = Language.StringByID(errorId_IsNullOrEmpty);
+ }
+ else
+ {
+ tipMsgString = Language.StringByID(errorId_PresenceP);
+ }
+
+ whiteView.Height = Application.GetRealHeight(183);
+ btnLine.Y = whiteView.Height - Application.GetRealHeight(44 + 1);
+ btnCancel.Y = btnLine.Bottom;
+ btnConfirm.Y = btnLine.Bottom;
+ btnConfirm.Gravity = Gravity.BottomRight;
+
+ btnTip.X = Application.GetRealWidth(24);
+ btnTip.Y = editBjView.Bottom + Application.GetRealHeight(12);
+ btnTip.Width = Application.GetRealWidth(222);
+ btnTip.Height = Application.GetRealHeight(17);
+ btnTip.Text = tipMsgString;
+ btnTip.TextColor = Color.RedColor;
+ btnTip.TextSize = TextSize.Text12;
+ btnTip.TextAlignment = TextAlignment.CenterLeft;
+
+ return;
+ }
+
+
+ confirmAction(editText.Text.Trim());
+ dialog.Close();
+ };
+
+ }
+
+ /// <summary>
+ /// 杈撳叆妗�
+ /// </summary>
+ /// <param name="titleId">鏍囬鏂囨湰</param>
+ /// <param name="tnputEditTxet">杈撳叆鏂囨湰</param>
+ /// <param name="errorId_IsNullOrEmpty">杈撳叆妗嗘湰鏂囦负绌鸿嚜瀹氫箟鎻愮ず閿欒鏂囨湰</param>
+ /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+ public void InputBox(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, Action<string> confirmAction)
+ {
+ Dialog dialog = new Dialog()
+ {
+ BackgroundColor = Color.PopupBackgroundColor,
+ };
+
+ FrameLayout whiteView = new FrameLayout()
+ {
+ //Gravity = Gravity.Center,
+ X = Application.GetRealWidth(53),
+ Y = Application.GetRealHeight(264),
+ Width = Application.GetRealWidth(270),
+ Height = Application.GetRealHeight(172),
+ BackgroundColor = Color.WhiteColor,
+ BorderColor = 0x00000000,
+ BorderWidth = 0,
+ Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
+ };
+ dialog.AddChidren(whiteView);
+
+ Button btnTitle = new Button()
+ {
+ Y = Application.GetRealHeight(20),
+ X = Application.GetRealWidth(35),
Height = Application.GetRealHeight(22),
- TextColor = Color.TextColor,
+ Width = Application.GetRealWidth(200),
+ TextColor = Color.SelectedColor,
TextSize = TextSize.Text16,
TextAlignment = TextAlignment.Center,
- TextID = StringId.myList,
- IsBold=true,
- };
- topFra.AddChidren(txetBtn);
+ TextID = titleId,
- //娣诲姞鍥炬爣鎺т欢
- Button addIconBtn = new Button
- {
- X = Application.GetRealWidth(304),
- Y = Application.GetRealHeight(20),
- Width = Application.GetMinRealAverage(28),
- Height = Application.GetMinRealAverage(28),
- UnSelectedImagePath = "MusicIcon/addMusic.png",
};
- topFra.AddChidren(addIconBtn);
-
+ whiteView.AddChidren(btnTitle);
- VerticalScrolViewLayout verticalScrolViewLayout = new VerticalScrolViewLayout
+ FrameLayout editBjView = new FrameLayout()
{
- Y = Application.GetRealHeight(70),
- Height = dialogFra.Height - Application.GetRealHeight(70),
- Width = Application.GetRealWidth(344),
+ // Gravity = Gravity.CenterHorizontal,
+ Y = btnTitle.Bottom + Application.GetRealHeight(16),
+ X = Application.GetRealWidth(24),
+ Width = Application.GetRealWidth(222),
+ Height = Application.GetRealHeight(40),
+ BackgroundColor = Color.ViewColor,
+ BorderColor = 0x00000000,
+ BorderWidth = 0,
+ Radius = (uint)Application.GetMinRealAverage(radiusEditFrameLayout),
};
- dialogFra.AddChidren(verticalScrolViewLayout);
- addIconBtn.MouseUpEventHandler += (sender, e) =>
+ whiteView.AddChidren(editBjView);
+
+ EditText editText = new EditText()
{
- new PublicAssmebly().LoadDialog_EditParater(StringId.addNewList, StringId.listNameInput, "", (name) =>
- {
- if (string.IsNullOrEmpty(name))
- {
- //鍒楄〃鍚嶄负绌�
- new PublicAssmebly().TipMsg(StringId.tip, StringId.listNameNull);
- return;
- }
- foreach (var lists in A31MusicModel.Current.FileLists)
- {
- if (lists.ListName == name)
- {
- //鍒楄〃鍚嶇О鐩稿悓
- new PublicAssmebly().TipMsg(StringId.tip, StringId.listNamesSame);
- return;
- }
- }
- A31MusicModel.Current.FileLists.Add(new FileListInfo { ListName = name, });
- A31MusicModel.Save();
- FileView(verticalScrolViewLayout);
- });
+ X = Application.GetRealWidth(12),
+ Y = Application.GetRealHeight(10),
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(20),
+ Text = tnputEditTxet,
+ TextColor = Color.TextColor,
+ TextSize = TextSize.Text14,
+ TextAlignment = TextAlignment.CenterLeft,
};
- FileView(verticalScrolViewLayout);
+ editBjView.AddChidren(editText);
+
+ Button clearIconBtn = new Button
+ {
+ X = Application.GetRealWidth(194),
+ Y = Application.GetRealHeight(8),
+ Width = Application.GetMinRealAverage(24),
+ Height = Application.GetMinRealAverage(24),
+ UnSelectedImagePath = "MusicIcon/clear.png",
+ };
+ editBjView.AddChidren(clearIconBtn);
+ clearIconBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ editText.Text = "";
+ };
+
+ Button btnLine = new Button()
+ {
+ Y = whiteView.Height - Application.GetRealHeight(44 + 1),
+ Height = Application.GetRealHeight(1),
+ BackgroundColor = Color.LineColor,
+ };
+ whiteView.AddChidren(btnLine);
+
+ Button btnCancel = new Button()
+ {
+ Y = btnLine.Bottom,
+ Width = Application.GetRealWidth(135),
+ Height = Application.GetRealHeight(44),
+ TextAlignment = TextAlignment.Center,
+ TextColor = Color.TextCancelColor,
+ TextSize = TextSize.Text16,
+ TextID = StringId.cancelMusic,
+ };
+ whiteView.AddChidren(btnCancel);
+
+ Button btnConfirm = new Button()
+ {
+ X = btnCancel.Right,
+ Y = btnLine.Bottom,
+ Width = Application.GetRealWidth(135),
+ Height = Application.GetRealHeight(44),
+ TextAlignment = TextAlignment.Center,
+ TextColor = Color.WhiteColor,
+ IsBold = true,
+ TextSize = TextSize.Text16,
+ TextID = StringId.confirmMusic,
+ BackgroundColor = Color.SelectedColor,
+ Gravity=Gravity.BottomRight,
+ };
+ whiteView.AddChidren(btnConfirm);
+ btnConfirm.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomRight);
+ dialog.Show();
+ btnCancel.MouseUpEventHandler += (sender, e) =>
+ {
+ dialog.Close();
+ };
+
+ Button btnTip = new Button
+ {
+ Width = Application.GetRealWidth(0),
+ };
+ whiteView.AddChidren(btnTip);//涓�鐩撮敊璇紝涓�鐩寸寷鐐癸紝涓�鐩村姞鎺т欢
+
+ btnConfirm.MouseUpEventHandler += (sender, e) =>
+ {
+ if (string.IsNullOrEmpty(editText.Text.Trim()))
+ {
+
+ whiteView.Height = Application.GetRealHeight(183);
+ btnLine.Y = whiteView.Height - Application.GetRealHeight(44 + 1);
+ btnCancel.Y = btnLine.Bottom;
+ btnConfirm.Y = btnLine.Bottom;
+ btnConfirm.Gravity = Gravity.BottomRight;
+
+ btnTip.X = Application.GetRealWidth(24);
+ btnTip.Y = editBjView.Bottom + Application.GetRealHeight(12);
+ btnTip.Width = Application.GetRealWidth(222);
+ btnTip.Height = Application.GetRealHeight(17);
+ btnTip.Text = Language.StringByID(errorId_IsNullOrEmpty);
+ btnTip.TextColor = Color.RedColor;
+ btnTip.TextSize = TextSize.Text12;
+ btnTip.TextAlignment = TextAlignment.CenterLeft;
+ return;
+ }
+
+
+ confirmAction(editText.Text.Trim());
+ dialog.Close();
+ };
}
- void FileView(VerticalScrolViewLayout verticalScrolViewLayout)
+
+ /// <summary>
+ /// 纭畾鎻愮ず妗�
+ /// </summary>
+ /// <param name="titleId">鏍囬鏂囨湰</param>
+ /// <param name="tipTxet">鑷畾涔夋彁绀烘枃鏈�</param>
+ /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+ public void TipBox(int titleId, int tipTxet, Action confirmAction)
{
- verticalScrolViewLayout.RemoveAll();
- for (int i = 0; i < A31MusicModel.Current.FileLists.Count; i++)
+ Dialog dialog = new Dialog()
{
- var list = A31MusicModel.Current.FileLists[i];
- RowLayout addFlieRow = new RowLayout
- {
- Height = Application.GetRealHeight(78),
- LineColor = Color.WhiteColor,
- SubViewWidth = Application.GetRealWidth(80),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
- };
- verticalScrolViewLayout.AddChidren(addFlieRow);
- //鏂囦欢鍥炬爣
- Button fileIconBtn = new Button
- {
- X = Application.GetRealWidth(12),
- Y = Application.GetRealHeight(8),
- Width = Application.GetMinRealAverage(62),
- Height = Application.GetMinRealAverage(62),
- UnSelectedImagePath = "MusicIcon/file.png",
- };
- addFlieRow.AddChidren(fileIconBtn);
+ BackgroundColor = Color.PopupBackgroundColor,
+ };
- //鏂囦欢鍚嶆帶浠�
- Button fileNameBtn = new Button
- {
- X = fileIconBtn.Right + Application.GetRealWidth(12),
- Y = Application.GetRealHeight(29),
- Width = Application.GetRealWidth(189),
- Height = Application.GetRealHeight(20),
- TextColor = Color.TextColor,
- TextSize = TextSize.Text14,
- TextAlignment = TextAlignment.CenterLeft,
- Text = list.ListName,
- };
- addFlieRow.AddChidren(fileNameBtn);
+ FrameLayout whiteView = new FrameLayout()
+ {
+ //Gravity = Gravity.Center,
+ X = Application.GetRealWidth(53),
+ Y = Application.GetRealHeight(264),
+ Width = Application.GetRealWidth(270),
+ Height = Application.GetRealHeight(140),
+ BackgroundColor = Color.WhiteColor,
+ BorderColor = 0x00000000,
+ BorderWidth = 0,
+ Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
+ };
+ dialog.AddChidren(whiteView);
- ///缂栬緫鎺т欢
- var editBtn = new Button
- {
- BackgroundColor = Color.MusicEditColor,
- Text = Language.StringByID(StringId.editMusic),
- TextColor = Color.WhiteColor,
- TextSize = TextSize.Text16,
- };
- addFlieRow.AddRightView(editBtn);
+ Button titleBtn = new Button()
+ {
+ Y = Application.GetRealHeight(20),
+ X = Application.GetRealWidth(35),
+ Height = Application.GetRealHeight(22),
+ Width = Application.GetRealWidth(270 - 35 * 2),
+ TextColor = Color.SelectedColor,
+ TextSize = TextSize.Text16,
+ TextAlignment = TextAlignment.Center,
+ TextID = titleId,
+ };
+ whiteView.AddChidren(titleBtn);
- editBtn.MouseUpEventHandler += (sender, e) =>
- {
- new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, list.ListName, (name) =>
- {
- if (string.IsNullOrEmpty(name))
- {
- //鍒楄〃鍚嶄负绌�
- new PublicAssmebly().TipMsg(StringId.tip, StringId.listNameNull);
- return;
- }
- foreach (var lists in A31MusicModel.Current.FileLists)
- {
- if (lists.ListName == name)
- {
- //鍒楄〃鍚嶇О鐩稿悓
- new PublicAssmebly().TipMsg(StringId.tip, StringId.listNamesSame);
- return;
- }
- }
+ Button tipBtn = new Button()
+ {
+ Y = titleBtn.Bottom + Application.GetRealHeight(8),
+ X = Application.GetRealWidth(20),
+ Height = Application.GetRealHeight(22),
+ Width = Application.GetRealWidth(270 - 20 * 2),
+ TextColor = Color.TextCancelColor,
+ TextSize = TextSize.Text12,
+ TextAlignment = TextAlignment.Center,
+ TextID = tipTxet,
+ };
+ whiteView.AddChidren(tipBtn);
- var file = A31MusicModel.Current.FileLists.Find((c) => { return c.ListName == list.ListName; });
- if (file != null)
- {
- if (file.ListName != name)
- { ///淇敼鍚嶇О涓嶄竴鏍锋洿鏂颁繚瀛�
- file.ListName = name;
- fileNameBtn.Text = name;
- A31MusicModel.Save();
- }
- }
- if (list.ListName != name)
- { ///淇敼鍚嶇О涓嶄竴鏍锋洿鏂颁繚瀛�
- list.ListName = name;
- fileNameBtn.Text = name;
- A31MusicModel.Save();
- }
- });
- };
+ Button btnLine = new Button()
+ {
+ Y = whiteView.Height - Application.GetRealHeight(44 + 1),
+ Height = Application.GetRealHeight(1),
+ BackgroundColor = Color.LineColor,
+ };
+ whiteView.AddChidren(btnLine);
- ///鍒犻櫎鎺т欢
- var delBtn = new Button
- {
- BackgroundColor = Color.MusicDelColor,
- Text = Language.StringByID(StringId.delMusic),
- TextColor = Color.WhiteColor,
- TextSize=TextSize.Text16,
- };
- addFlieRow.AddRightView(delBtn);
- delBtn.MouseUpEventHandler += (sender, e) =>
- {
- new PublicAssmebly().TipMsg(StringId.tip, StringId.delMusicFile, () =>
- {
- addFlieRow.RemoveFromParent();
- A31MusicModel.Current.FileLists.Remove(list);
- A31MusicModel.Save();
- });
+ Button btnCancel = new Button()
+ {
+ Y = btnLine.Bottom,
+ Width = Application.GetRealWidth(135),
+ Height = Application.GetRealHeight(44),
+ TextAlignment = TextAlignment.Center,
+ TextColor = Color.TextCancelColor,
+ TextSize = TextSize.Text16,
+ TextID = StringId.cancelMusic,
+ };
+ whiteView.AddChidren(btnCancel);
- };
+ Button btnConfirm = new Button()
+ {
+ X = btnCancel.Right,
+ Y = btnLine.Bottom,
+ Width = Application.GetRealWidth(135),
+ Height = Application.GetRealHeight(44),
+ TextAlignment = TextAlignment.Center,
+ TextColor = Color.WhiteColor,
+ IsBold = true,
+ TextSize = TextSize.Text16,
+ TextID = StringId.confirmMusic,
+ BackgroundColor = Color.SelectedColor,
+ Gravity = Gravity.BottomRight,
+ };
+ whiteView.AddChidren(btnConfirm);
+ btnConfirm.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomRight);
+ dialog.Show();
+ btnCancel.MouseUpEventHandler += (sender, e) =>
+ {
+ dialog.Close();
+ };
- }
-
+ btnConfirm.MouseUpEventHandler += (sender, e) =>
+ {
+ confirmAction();
+ dialog.Close();
+ };
}
+
}
}
diff --git a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
index 66f14fc..cb4721e 100644
--- a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
+++ b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
@@ -1,4 +1,5 @@
锘縰sing System;
+using System.Collections.Generic;
using System.Threading;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
@@ -8,12 +9,63 @@
{
public partial class PublicAssmebly
{
+
+ void EditParaterEvent(Button btnConfirm, int errorId_IsNullOrEmpty, int errorId_ContainsPar, List<string> list, EditText editText, Action<string> callBackAction,
+ FrameLayout contentView, Button btnLine, Button btnBottomLine, Button btnCancel, FrameLayout editView, Dialog dialog)
+ {
+ btnConfirm.MouseUpEventHandler += (sender, e) =>
+ {
+ btnConfirm.IsSelected = false;
+
+ if (string.IsNullOrEmpty(editText.Text.Trim()) || list.Contains(editText.Text.Trim()))
+ {
+ string tipMsgString = "";
+ if (string.IsNullOrEmpty(editText.Text.Trim()))
+ {
+ tipMsgString = Language.StringByID(errorId_IsNullOrEmpty);
+ }
+ else
+ {
+ tipMsgString = Language.StringByID(errorId_ContainsPar);
+ }
+
+ contentView.Height = Application.GetRealHeight(183);
+ btnLine.Y = Application.GetRealHeight(139);
+ btnBottomLine.Y = btnLine.Bottom;
+ btnCancel.Y = btnLine.Bottom;
+ btnConfirm.Y = btnLine.Bottom;
+
+
+ var btnTip = new Button()
+ {
+ X = editView.X,
+ Y = editView.Bottom,
+ Width = Application.GetRealWidth(182),
+ Height = Application.GetRealHeight(30),
+ Text = tipMsgString,
+ TextColor = CSS_Color.WarningColor,
+ TextSize = CSS_FontSize.TextFontSize,
+ IsMoreLines = true,
+ TextAlignment = TextAlignment.CenterLeft,
+ };
+ contentView.AddChidren(btnTip);
+
+ return;
+ }
+
+
+ callBackAction(editText.Text.Trim());
+ dialog.Close();
+ };
+ }
+
+
/// <summary>
/// 鍔犺浇淇敼鍙傛暟鐨勫皬寮圭獥
/// 淇濆瓨鎸夐挳浜嬩欢闇�瑕佸皢
/// </summary>
/// <param name="callBackAction">鍥炶皟鍑芥暟</param>
- public void LoadDialog_EditParater(int titleId, string editParater, Action<string> callBackAction)
+ public void LoadDialog_EditParater(int titleId, string editParater, Action<string> callBackAction, int errorId_IsNullOrEmpty, int errorId_ContainsPar, List<string> baseList)
{
Dialog dialog = new Dialog()
{
@@ -116,66 +168,106 @@
dialog.Show();
- btnCancel.MouseDownEventHandler += (sender, e) => {
+ btnCancel.MouseDownEventHandler += (sender, e) =>
+ {
btnCancel.IsSelected = true;
};
- btnCancel.MouseUpEventHandler += (sender, e) => {
+ btnCancel.MouseUpEventHandler += (sender, e) =>
+ {
btnCancel.IsSelected = false;
dialog.Close();
};
- btnConfirm.MouseDownEventHandler += (sender, e) => {
+ btnConfirm.MouseDownEventHandler += (sender, e) =>
+ {
btnConfirm.IsSelected = true;
};
- btnConfirm.MouseUpEventHandler += (sender, e) =>
- {
- btnConfirm.IsSelected = false;
- //闇�瑕佹彁绀洪敊璇俊鎭湪绐楀彛寮圭獥涔嬩笂鐨�
- if ((titleId == StringId.EditFloorName && etParater.Text.Trim() != editParater) || titleId == StringId.AddFloors)
- {
- var tipMsgString = titleId == StringId.EditFloorName ? Language.StringByID(StringId.AddFloorFailed_FloorAlreadyExist) : Language.StringByID(StringId.AddFloorFailed_FloorAlreadyExist);
+ EditParaterEvent(btnConfirm, errorId_IsNullOrEmpty, errorId_ContainsPar, baseList, etParater, callBackAction,
+ contentView, btnLine, btnBottomLine, btnCancel, editView, dialog);
+ //btnConfirm.MouseUpEventHandler += (sender, e) =>
+ //{
+ // btnConfirm.IsSelected = false;
- if (string.IsNullOrEmpty(etParater.Text.Trim()))
- {
- // tipMsgString = Language.StringByID(StringId.FloorNameCannotBeEmpty);
- return;
- }
+ // if (string.IsNullOrEmpty(etParater.Text.Trim())|| list.Contains(etParater.Text.Trim()))
+ // {
+ // string tipMsgString = "";
+ // if (string.IsNullOrEmpty(etParater.Text.Trim()))
+ // {
+ // tipMsgString = Language.StringByID(errorId_IsNullOrEmpty);
+ // }
+ // else
+ // {
+ // tipMsgString = Language.StringByID(errorId_ContainsPar);
+ // }
- if (DB_ResidenceData.residenceData.floors.Contains(etParater.Text.Trim()))
- {
- contentView.Height = Application.GetRealHeight(183);
- btnLine.Y = Application.GetRealHeight(139);
- btnBottomLine.Y = btnLine.Bottom;
- btnCancel.Y = btnLine.Bottom;
- btnConfirm.Y = btnLine.Bottom;
+ // contentView.Height = Application.GetRealHeight(183);
+ // btnLine.Y = Application.GetRealHeight(139);
+ // btnBottomLine.Y = btnLine.Bottom;
+ // btnCancel.Y = btnLine.Bottom;
+ // btnConfirm.Y = btnLine.Bottom;
- var btnTip = new Button()
- {
- X = editView.X,
- Y = editView.Bottom,
- Width = Application.GetRealWidth(182),
- Height = Application.GetRealHeight(30),
- Text = tipMsgString,
- TextColor = CSS_Color.WarningColor,
- TextSize = CSS_FontSize.TextFontSize,
- };
- contentView.AddChidren(btnTip);
+ // var btnTip = new Button()
+ // {
+ // X = editView.X,
+ // Y = editView.Bottom,
+ // Width = Application.GetRealWidth(182),
+ // Height = Application.GetRealHeight(30),
+ // Text = tipMsgString,
+ // TextColor = CSS_Color.WarningColor,
+ // TextSize = CSS_FontSize.TextFontSize,
+ // };
+ // contentView.AddChidren(btnTip);
- return;
- }
+ // return;
+ // }
- callBackAction(etParater.Text.Trim());
- }
+ // //闇�瑕佹彁绀洪敊璇俊鎭湪绐楀彛寮圭獥涔嬩笂鐨�
+ // if ((titleId == StringId.EditFloorName && etParater.Text.Trim() != editParater) || titleId == StringId.AddFloors)
+ // {
+ // var tipMsgString = titleId == StringId.EditFloorName ? Language.StringByID(StringId.AddFloorFailed_FloorAlreadyExist) : Language.StringByID(StringId.AddFloorFailed_FloorAlreadyExist);
- if (titleId == StringId.RoomName || titleId == StringId.ChangeName || titleId == StringId.ResidenceName || titleId == StringId.UesrName)
- {
- if (editParater != etParater.Text.Trim())
- {
- callBackAction(etParater.Text.Trim());
- }
- }
- dialog.Close();
- };
+ // if (string.IsNullOrEmpty(etParater.Text.Trim()))
+ // {
+ // tipMsgString = Language.StringByID(StringId.FloorNameCannotBeEmpty);
+ // //return;
+ // }
+
+ // if (DB_ResidenceData.residenceData.floors.Contains(etParater.Text.Trim()))
+ // {
+ // contentView.Height = Application.GetRealHeight(183);
+ // btnLine.Y = Application.GetRealHeight(139);
+ // btnBottomLine.Y = btnLine.Bottom;
+ // btnCancel.Y = btnLine.Bottom;
+ // btnConfirm.Y = btnLine.Bottom;
+
+
+ // var btnTip = new Button()
+ // {
+ // X = editView.X,
+ // Y = editView.Bottom,
+ // Width = Application.GetRealWidth(182),
+ // Height = Application.GetRealHeight(30),
+ // Text = tipMsgString,
+ // TextColor = CSS_Color.WarningColor,
+ // TextSize = CSS_FontSize.TextFontSize,
+ // };
+ // contentView.AddChidren(btnTip);
+
+ // return;
+ // }
+
+ // callBackAction(etParater.Text.Trim());
+ // }
+
+ // if(titleId == StringId.RoomName || titleId == StringId.ChangeName || titleId == StringId.ResidenceName || titleId == StringId.UesrName)
+ // {
+ // if(editParater != etParater.Text.Trim())
+ // {
+ // callBackAction(etParater.Text.Trim());
+ // }
+ // }
+ // dialog.Close();
+ //};
}
@@ -185,7 +277,7 @@
/// 淇濆瓨鎸夐挳浜嬩欢闇�瑕佸皢
/// </summary>
/// <param name="callBackAction">鍥炶皟鍑芥暟</param>
- public void LoadDialog_EditParater(int titleId, int tipTitleId, string editParater, Action<string> callBackAction)
+ public void LoadDialog_EditParater(int titleId, int tipTitleId, string editParater, Action<string> callBackAction, int errorId_IsNullOrEmpty, int errorId_ContainsPar, List<string> baseList)
{
Dialog dialog = new Dialog()
{
@@ -301,66 +393,70 @@
dialog.Show();
- btnCancel.MouseDownEventHandler += (sender, e) => {
+ btnCancel.MouseDownEventHandler += (sender, e) =>
+ {
btnCancel.IsSelected = true;
};
- btnCancel.MouseUpEventHandler += (sender, e) => {
+ btnCancel.MouseUpEventHandler += (sender, e) =>
+ {
btnCancel.IsSelected = false;
dialog.Close();
};
- btnConfirm.MouseDownEventHandler += (sender, e) => {
+ btnConfirm.MouseDownEventHandler += (sender, e) =>
+ {
btnConfirm.IsSelected = true;
};
- btnConfirm.MouseUpEventHandler += (sender, e) =>
- {
- btnConfirm.IsSelected = false;
- //闇�瑕佹彁绀洪敊璇俊鎭湪绐楀彛寮圭獥涔嬩笂鐨�
- if ((titleId == StringId.EditFloorName && etParater.Text.Trim() != editParater) || titleId == StringId.AddFloors)
- {
- var tipMsgString = titleId == StringId.EditFloorName ? Language.StringByID(StringId.AddFloorFailed_FloorAlreadyExist) : Language.StringByID(StringId.AddFloorFailed_FloorAlreadyExist);
+ EditParaterEvent(btnConfirm, errorId_IsNullOrEmpty, errorId_ContainsPar, baseList, etParater, callBackAction,
+ contentView, btnLine, btnBottomLine, btnCancel, editView, dialog);
+ //btnConfirm.MouseUpEventHandler += (sender, e) =>
+ //{
+ // btnConfirm.IsSelected = false;
+ // //闇�瑕佹彁绀洪敊璇俊鎭湪绐楀彛寮圭獥涔嬩笂鐨�
+ // if ((titleId == StringId.EditFloorName && etParater.Text.Trim() != editParater) || titleId == StringId.AddFloors)
+ // {
+ // var tipMsgString = titleId == StringId.EditFloorName ? Language.StringByID(StringId.AddFloorFailed_FloorAlreadyExist) : Language.StringByID(StringId.AddFloorFailed_FloorAlreadyExist);
- if (string.IsNullOrEmpty(etParater.Text.Trim()))
- {
- tipMsgString = Language.StringByID(StringId.FloorNameCannotBeEmpty);
- return;
- }
+ // if (string.IsNullOrEmpty(etParater.Text.Trim()))
+ // {
+ // tipMsgString = Language.StringByID(StringId.FloorNameCannotBeEmpty);
+ // return;
+ // }
- if (DB_ResidenceData.residenceData.floors.Contains(etParater.Text.Trim()))
- {
- contentView.Height = Application.GetRealHeight(183);
- btnLine.Y = Application.GetRealHeight(139);
- btnBottomLine.Y = btnLine.Bottom;
- btnCancel.Y = btnLine.Bottom;
- btnConfirm.Y = btnLine.Bottom;
+ // if (DB_ResidenceData.residenceData.floors.Contains(etParater.Text.Trim()))
+ // {
+ // contentView.Height = Application.GetRealHeight(183);
+ // btnLine.Y = Application.GetRealHeight(139);
+ // btnBottomLine.Y = btnLine.Bottom;
+ // btnCancel.Y = btnLine.Bottom;
+ // btnConfirm.Y = btnLine.Bottom;
+ // var btnTip = new Button()
+ // {
+ // X = editView.X,
+ // Y = editView.Bottom,
+ // Width = Application.GetRealWidth(182),
+ // Height = Application.GetRealHeight(30),
+ // Text = tipMsgString,
+ // TextColor = CSS_Color.WarningColor,
+ // TextSize = CSS_FontSize.TextFontSize,
+ // };
+ // contentView.AddChidren(btnTip);
- var btnTip = new Button()
- {
- X = editView.X,
- Y = editView.Bottom,
- Width = Application.GetRealWidth(182),
- Height = Application.GetRealHeight(30),
- Text = tipMsgString,
- TextColor = CSS_Color.WarningColor,
- TextSize = CSS_FontSize.TextFontSize,
- };
- contentView.AddChidren(btnTip);
+ // return;
+ // }
- return;
- }
+ // callBackAction(etParater.Text.Trim());
+ // }
- callBackAction(etParater.Text.Trim());
- }
-
- if (titleId == StringId.RoomName || titleId == StringId.ChangeName || titleId == StringId.ResidenceName || titleId == StringId.UesrName || titleId == StringId.addNewList)
- {
- if (editParater != etParater.Text.Trim())
- {
- callBackAction(etParater.Text.Trim());
- }
- }
- dialog.Close();
- };
+ // if (titleId == StringId.RoomName || titleId == StringId.ChangeName || titleId == StringId.ResidenceName || titleId == StringId.UesrName)
+ // {
+ // if (editParater != etParater.Text.Trim())
+ // {
+ // callBackAction(etParater.Text.Trim());
+ // }
+ // }
+ // dialog.Close();
+ //};
}
@@ -531,7 +627,8 @@
dialog.Show();
- new Thread(() => {
+ new Thread(() =>
+ {
Thread.Sleep(1500);
Application.RunOnMainThread(() =>
{
diff --git a/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs b/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs
index f30ab94..07afa08 100644
--- a/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs
+++ b/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs
@@ -59,7 +59,7 @@
break;
}
}
- new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors,newFloorName , callBackAction);
+ // new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors,newFloorName , callBackAction);
break;
case "rooms":
callBack("", "");
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
index 285c2f0..f88fa3e 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
@@ -172,7 +172,7 @@
})
{ IsBackground = true }.Start();
};
- new PublicAssmebly().LoadDialog_EditParater(StringId.UesrName, MainPage.LoginUser.userName, callBack);
+ // new PublicAssmebly().LoadDialog_EditParater(StringId.UesrName, MainPage.LoginUser.userName, callBack);
};
btnUserName.MouseUpEventHandler = eventHandler;
btnEditUserNameIcon.MouseUpEventHandler = eventHandler;
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/FloorsManagementPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/FloorsManagementPageBLL.cs
index e65646a..a73ca25 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/FloorsManagementPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/FloorsManagementPageBLL.cs
@@ -39,7 +39,7 @@
row.Tag = newName;
}
};
- new PublicAssmebly().LoadDialog_EditParater(StringId.EditFloorName, btn.Text, editCallBack);
+ // new PublicAssmebly().LoadDialog_EditParater(StringId.EditFloorName, btn.Text, editCallBack);
};
}
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs
index 2fb09ca..f97f544 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs
@@ -95,7 +95,7 @@
})
{ IsBackground = true }.Start();
};
- new PublicAssmebly().LoadDialog_EditParater(StringId.ResidenceName, DB_ResidenceData.residenceData.residecenInfo.Name, callBack);
+ // new PublicAssmebly().LoadDialog_EditParater(StringId.ResidenceName, DB_ResidenceData.residenceData.residecenInfo.Name, callBack);
};
btnResidenceName.MouseUpEventHandler = eventHandler;
btnEditResidenceNameIcon.MouseUpEventHandler = eventHandler;
@@ -142,7 +142,7 @@
});
}
};
- new PublicAssmebly().LoadDialog_EditParater(StringId.ResidenceName, DB_ResidenceData.residenceData.residecenInfo.Name, callBack);
+ // new PublicAssmebly().LoadDialog_EditParater(StringId.ResidenceName, DB_ResidenceData.residenceData.residecenInfo.Name, callBack);
};
btnResidenceAddress.MouseUpEventHandler = eventHandler;
btnLocationAddressIcon.MouseUpEventHandler = eventHandler;
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditPageBLL.cs
index 4545f39..1b17009 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditPageBLL.cs
@@ -121,7 +121,7 @@
};
EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
{
- new PublicAssmebly().LoadDialog_EditParater(StringId.RoomName, room.name, callBack);
+ //new PublicAssmebly().LoadDialog_EditParater(StringId.RoomName, room.name, callBack);
};
btnEditRoomNameIcon.MouseUpEventHandler = eventHandler;
roomNameRow.MouseUpEventHandler = eventHandler;
diff --git a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs
index 6225cc6..c84dbb2 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs
@@ -37,7 +37,7 @@
btnFunctionName.Text = name;
DB_ResidenceData.residenceData.SaveResidenceData();
};
- new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, function.name, callBackAction);
+ //new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, function.name, callBackAction);
};
btnEditName.MouseUpEventHandler = eventHandler;
btnFunctionName.MouseUpEventHandler = eventHandler;
--
Gitblit v1.8.0