using HDL_ON.UI.Music;
|
using System;
|
using Shared;
|
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
|
{
|
public class TypeMultiFramLayout
|
{
|
/// <summary>
|
/// 是否可以点击
|
/// </summary>
|
private bool mIsClick = true;
|
|
/// <summary>
|
/// 设置控制点击事件
|
/// </summary>
|
/// <param name="isClick">false点击无效</param>
|
public void setClick(bool isClick)
|
{
|
this.mIsClick = isClick;
|
}
|
private uint UpBackgroundColor = MusicColor.ViewColor;
|
private uint DownBackgroundColor = AksCommonMethod.seleBackgroundColor;
|
|
/// <summary>
|
/// 多个类型容器
|
/// </summary>
|
public FrameLayout multiFramLayout = new FrameLayout
|
{
|
BackgroundColor = MusicColor.ViewColor,
|
X = Application.GetRealWidth(16),
|
Width = Application.GetRealWidth(311),
|
Height = Application.GetRealHeight(40),
|
Radius = (uint)Application.GetRealHeight(20),
|
};
|
|
|
|
public FrameLayout leftFramLayout = new FrameLayout
|
{
|
X = Application.GetRealWidth(16),
|
Gravity = Gravity.CenterVertical,
|
Width = Application.GetRealWidth(139),
|
Height = Application.GetRealHeight(23),
|
Radius = (uint)Application.GetRealHeight(20),
|
|
};
|
|
|
public Button btnLeftImage = new Button
|
{
|
Width = Application.GetRealWidth(16),
|
Height = Application.GetRealWidth(16),
|
UnSelectedImagePath = "AksIcon/shixuqi.png",
|
Gravity = Gravity.CenterVertical,
|
Name = "btnBottonLeftImage",
|
};
|
|
public Button btnLeftName = new Button
|
{
|
Width = Application.GetRealWidth(100 + 10),
|
Height = Application.GetRealHeight(23),
|
TextID = StringId.shixuqi,
|
TextSize = TextSize.Text16,
|
TextColor = MusicColor.TextColor,
|
TextAlignment = TextAlignment.CenterLeft,
|
Gravity = Gravity.CenterVertical,
|
};
|
|
|
|
public FrameLayout lineFramLayout = new FrameLayout
|
{
|
BackgroundColor = MusicColor.TextColor,
|
Y = Application.GetRealHeight(10),
|
Width = Application.GetRealWidth(1),
|
Height = Application.GetRealHeight(20),
|
};
|
|
|
|
public FrameLayout rightFramLayout = new FrameLayout
|
{
|
Gravity = Gravity.CenterVertical,
|
Width = Application.GetRealWidth(138),
|
Height = Application.GetRealHeight(23),
|
Radius = (uint)Application.GetRealHeight(20),
|
|
};
|
|
|
public Button btnRightImage = new Button
|
{
|
Width = Application.GetRealWidth(16),
|
Height = Application.GetRealWidth(16),
|
UnSelectedImagePath = "AksIcon/xuanze.png",
|
Gravity = Gravity.CenterRight,
|
};
|
|
|
public Button btnRightName = new Button
|
{
|
Width = Application.GetRealWidth(100 + 16),
|
Height = Application.GetRealHeight(23),
|
TextID = StringId.bofangqi,
|
TextSize = TextSize.Text16,
|
TextColor = MusicColor.TextColor,
|
TextAlignment = TextAlignment.CenterRight,
|
Gravity = Gravity.CenterVertical,
|
Padding = new Padding(0, 0, 0, 0),
|
};
|
|
|
public void AddView(FrameLayout layout)
|
{
|
layout.AddChidren(multiFramLayout);
|
multiFramLayout.AddChidren(leftFramLayout);
|
leftFramLayout.AddChidren(btnLeftImage);
|
leftFramLayout.AddChidren(btnLeftName);
|
multiFramLayout.AddChidren(lineFramLayout);
|
multiFramLayout.AddChidren(rightFramLayout);
|
rightFramLayout.AddChidren(btnRightImage);
|
rightFramLayout.AddChidren(btnRightName);
|
btnLeftName.X = btnLeftImage.Right + Application.GetRealWidth(4);
|
lineFramLayout.X = leftFramLayout.Right;
|
rightFramLayout.X = lineFramLayout.Right;
|
btnRightName.X = Application.GetRealWidth(4);
|
}
|
|
|
public void SetClickUpBackgroundColor(uint backgroundColor)
|
{
|
this.UpBackgroundColor = backgroundColor;
|
|
}
|
|
public void SetClickDownBackgroundColor(uint backgroundColor)
|
{
|
this.DownBackgroundColor = backgroundColor;
|
}
|
|
/// <summary>
|
/// 序时器类型容器
|
/// </summary>
|
/// <param name="action">回调(第一个是父类对象</param>
|
public void SetLeftFlClickListener(Action<FrameLayout> action)
|
{
|
EventHandler<MouseEventArgs> UpClick = (sender, e) =>
|
{
|
//leftFramLayout.BackgroundColor = this.UpBackgroundColor;
|
|
//弹起来还原背景颜色
|
};
|
leftFramLayout.MouseUpEventHandler += UpClick;
|
btnLeftImage.MouseUpEventHandler += UpClick;
|
btnLeftName.MouseUpEventHandler += UpClick;
|
|
|
EventHandler<MouseEventArgs> DownClick = (sender, e) =>
|
{
|
//按下去改变背景颜色
|
//leftFramLayout.BackgroundColor = this.DownBackgroundColor;
|
action?.Invoke(leftFramLayout);
|
};
|
leftFramLayout.MouseDownEventHandler += DownClick;
|
btnLeftImage.MouseDownEventHandler += DownClick;
|
btnLeftName.MouseDownEventHandler += DownClick;
|
}
|
|
/// <summary>
|
/// 播放器类型容器
|
/// </summary>
|
/// <param name="action">回调(第一个是父类对象</param>
|
public void SetRightFlClickListener(Action<FrameLayout> action)
|
{
|
EventHandler<MouseEventArgs> UpClick = (sender, e) =>
|
{
|
action?.Invoke(rightFramLayout);
|
//rightFramLayout.BackgroundColor = this.UpBackgroundColor;
|
|
//弹起来还原背景颜色
|
};
|
rightFramLayout.MouseUpEventHandler += UpClick;
|
btnRightImage.MouseUpEventHandler += UpClick;
|
btnRightName.MouseUpEventHandler += UpClick;
|
|
|
EventHandler<MouseEventArgs> DownClick = (sender, e) =>
|
{
|
//按下去改变背景颜色
|
//rightFramLayout.BackgroundColor =AksCommonMethod.seleBackgroundColor;
|
|
};
|
rightFramLayout.MouseDownEventHandler += DownClick;
|
btnRightImage.MouseDownEventHandler += DownClick;
|
btnRightName.MouseDownEventHandler += DownClick;
|
}
|
|
|
|
}
|
}
|