| | |
| | | { |
| | | public class TypeSingleFramLayout |
| | | { |
| | | /// <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 = 0xFFEFEFEF; |
| | | private uint DownBackgroundColor = AksCommonMethod.seleBackgroundColor; |
| | | /// <summary> |
| | | /// 单个类型容器 |
| | | /// </summary> |
| | | public FrameLayout singleFramLayout = new FrameLayout |
| | | { |
| | | BackgroundColor = MusicColor.ViewColor, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | //Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(101), |
| | | Height = Application.GetRealHeight(40), |
| | | Radius = (uint)Application.GetRealHeight(20), |
| | | Height = Application.GetRealHeight(34),//40 |
| | | Radius = (uint)Application.GetRealHeight(17), |
| | | }; |
| | | |
| | | public Button btnLeftImage = new Button |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | Gravity = Gravity.CenterVertical, |
| | | IsMoreLines = true, |
| | | Padding=new Padding(0,0,0,0), |
| | | Name = "btnName", |
| | | }; |
| | | |
| | |
| | | { |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | action?.Invoke(singleFramLayout); |
| | | //singleFramLayout.BackgroundColor = this.UpBackgroundColor; |
| | | |
| | | |
| | | //弹起来还原背景颜色 |
| | | }; |
| | | singleFramLayout.MouseUpEventHandler += UpClick; |
| | |
| | | { |
| | | //按下去改变背景颜色 |
| | | //singleFramLayout.BackgroundColor = this.DownBackgroundColor; |
| | | action?.Invoke(singleFramLayout); |
| | | |
| | | }; |
| | | singleFramLayout.MouseDownEventHandler += DownClick; |
| | | btnLeftImage.MouseDownEventHandler += DownClick; |