wxr
2020-03-13 171bf03f3664226eeff2b20ee9bd2e914b63a17d
HDL_ON/UI/UI0-Public/PublicAssmebly.cs
@@ -5,8 +5,9 @@
namespace HDL_ON.UI
{
    public class PublicAssmebly
    public partial class PublicAssmebly
    {
        /*
        /// <summary>
        /// 向framelayout添加顶部区域
        /// </summary>
@@ -48,6 +49,51 @@
            };
            frame.AddChidren(btnTilte);
        }
        /// <summary>
        /// 向framelayout添加顶部区域
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="tilte"></param>
        public void LoadTopView(FrameLayout frame, string tilte ,Action action)
        {
            FrameLayout view = new FrameLayout()
            {
                Height = Application.GetRealHeight(64),
                BackgroundColor = CSS_Color.TopViewColor,
            };
            frame.AddChidren(view);
            Button btnBack = new Button()
            {
                X = Application.GetRealWidth(10),
                Y = Application.GetRealHeight(29),
                Width = Application.GetRealWidth(40),
                Height = Application.GetRealHeight(28),
                UnSelectedImagePath = "Public/BackIcon.png",
            };
            frame.AddChidren(btnBack);
            btnBack.MouseUpEventHandler += (sender, e) =>
            {
                action();
                frame.RemoveFromParent();
            };
            Button btnTilte = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(30),
                Width = Application.GetRealWidth(150),
                Height = Application.GetRealHeight(25),
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.HeadlineFontSize,
                TextColor = CSS_Color.FirstLevelTitleColor,
                Text = tilte
            };
            frame.AddChidren(btnTilte);
        }
        /// <summary>
        /// 向dialog添加顶部区域
@@ -229,7 +275,7 @@
            };
        }
        */
        /// <summary>
        /// 加载修改参数的小弹窗
@@ -239,7 +285,7 @@
        {
            Dialog dialog = new Dialog()
            {
                BackgroundColor = 0x99000000,
                BackgroundColor = CSS_Color.DialogTransparentColor1,
            };
            FrameLayout contentView = new FrameLayout()
@@ -379,7 +425,7 @@
                    callBackAction(etParater.Text.Trim());
                }
                if(titleId == StringId.RoomName)
                if(titleId == StringId.RoomName || titleId == StringId.ChangeName)
                {
                    if(editParater != etParater.Text.Trim())
                    {
@@ -401,7 +447,7 @@
        {
            Dialog dialog = new Dialog()
            {
                BackgroundColor = 0x99000000,
                BackgroundColor = CSS_Color.DialogTransparentColor1,
            };
            FrameLayout contentView = new FrameLayout()
@@ -513,6 +559,90 @@
        }
        /// <summary>
        /// 加载提示弹窗
        /// </summary>
        /// <param name="titleId"></param>
        /// <param name="msgId"></param>
        public void TipMsg(int titleId, int msgId)
        {
            Dialog dialog = new Dialog()
            {
                BackgroundColor = CSS_Color.DialogTransparentColor1,
            };
            FrameLayout contentView = new FrameLayout()
            {
                Gravity = Gravity.Center,
                Width = Application.GetRealWidth(270),
                Height = Application.GetRealHeight(140),
                BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
                BorderColor = 0x00000000,
                BorderWidth = 0,
                Radius = (uint)Application.GetMinRealAverage(10),
            };
            dialog.AddChidren(contentView);
            Button btnTitle = new Button()
            {
                Y = Application.GetRealHeight(16),
                Height = Application.GetRealHeight(30),
                TextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextAlignment = TextAlignment.Center,
                IsBold = true,
                TextID = titleId,
            };
            contentView.AddChidren(btnTitle);
            Button btnMsg = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Height = Application.GetRealHeight(25),
                Y = btnTitle.Bottom,
                Width = Application.GetRealHeight(200),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.TextualColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextID = msgId,
            };
            contentView.AddChidren(btnMsg);
            Button btnLine = new Button()
            {
                Y = Application.GetRealHeight(96),
                Height = Application.GetRealHeight(1),
                BackgroundColor = CSS.CSS_Color.DividingLineColor,
            };
            contentView.AddChidren(btnLine);
            Button btnConfirm = new Button()
            {
                Y = btnLine.Bottom,
                Height = Application.GetRealHeight(43),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.TextualColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                SelectedTextColor = CSS_Color.MainBackgroundColor,
                SelectedBackgroundColor = CSS_Color.MainColor,
                TextID = StringId.Confirm,
            };
            contentView.AddChidren(btnConfirm);
            dialog.Show();
            btnConfirm.MouseDownEventHandler += (sender, e) =>
            {
                btnConfirm.IsSelected = true;
            };
            btnConfirm.MouseUpEventHandler += (sender, e) =>
            {
                btnConfirm.IsSelected = false;
                dialog.Close();
            };
        }
    }
}