| | |
| | | { |
| | | public class VerticalBoutonFLayout:BaseFramLayout |
| | | { |
| | | /// <summary> |
| | | /// 是否可以点击 |
| | | /// </summary> |
| | | private bool mIsClick = true; |
| | | |
| | | /// <summary> |
| | | /// 设置控制点击事件 |
| | | /// </summary> |
| | | /// <param name="isClick">false点击无效</param> |
| | | public void setClick(bool isClick) |
| | | { |
| | | this.mIsClick = isClick; |
| | | } |
| | | public const int widthFrameLayout = 80; |
| | | public const int heightFrameLayout = 140; |
| | | public const int heightFrameLayout = 140-15; |
| | | public const int cornerValue = 12; |
| | | |
| | | public VerticalBoutonFLayout(int width = widthFrameLayout, int height = heightFrameLayout) |
| | |
| | | Radius = (uint)Application.GetRealHeight(cornerValue); |
| | | } |
| | | |
| | | |
| | | |
| | | //public FrameLayout fLayout = new FrameLayout |
| | | //{ |
| | | // Y = Application.GetRealHeight(16), |
| | | // Width = Application.GetRealWidth(widthFrameLayout - 8), |
| | | // Height = Application.GetRealHeight(heightFrameLayout - 16), |
| | | // Radius = (uint)Application.GetRealHeight(cornerValue), |
| | | // BackgroundColor = MusicColor.ViewColor, |
| | | //}; |
| | | |
| | | |
| | | public FrameLayout ONFLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealWidth(40), |
| | | Width = Application.GetRealWidth(40), |
| | | Radius = (uint)Application.GetRealHeight(20), |
| | | Radius = (uint)Application.GetRealWidth(20), |
| | | BackgroundColor = MusicColor.WhiteColor, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | |
| | | Gravity = Gravity.Center, |
| | | TextColor = MusicColor.MusicTxet14SelectedColor, |
| | | TextSize = TextSize.Text14, |
| | | IsBold=true, |
| | | }; |
| | | |
| | | public Button btnName = new Button |
| | |
| | | TextColor = MusicColor.TextColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Padding = new Padding(0, 20, 0, 20), |
| | | Padding = new Padding(0, 8, 0, 8), |
| | | IsMoreLines = true, |
| | | Text="none" |
| | | }; |
| | |
| | | { |
| | | Height = Application.GetRealWidth(40), |
| | | Width = Application.GetRealWidth(40), |
| | | Radius = (uint)Application.GetRealHeight(20), |
| | | Radius = (uint)Application.GetRealWidth(20), |
| | | BackgroundColor = MusicColor.WhiteColor, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | |
| | | Gravity = Gravity.Center, |
| | | TextColor = 0xFFA5AEBC, |
| | | TextSize = TextSize.Text14, |
| | | IsBold = true, |
| | | }; |
| | | |
| | | |
| | |
| | | public void AddView(FrameLayout parent) |
| | | { |
| | | parent.AddChidren(this); |
| | | //this.AddChidren(fLayout); |
| | | this.AddChidren(ONFLayout); |
| | | ONFLayout.AddChidren(ONButton); |
| | | this.AddChidren(btnName); |
| | | this.AddChidren(OFFFLayout); |
| | | OFFFLayout.AddChidren(OFFButton); |
| | | |
| | | ONFLayout.Y = Application.GetRealHeight(11); |
| | | btnName.Y = ONFLayout.Bottom + Application.GetRealHeight(11); |
| | | OFFFLayout.Y = btnName.Bottom + Application.GetRealHeight(11); |
| | |
| | | { |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | action?.Invoke(OFFFLayout, OFFButton); |
| | | OFFFLayout.BackgroundColor = MusicColor.WhiteColor; |
| | | OFFButton.TextColor = 0xFFA5AEBC; |
| | | |
| | | //弹起来还原背景颜色 |
| | | }; |
| | | OFFFLayout.MouseUpEventHandler += UpClick; |
| | | OFFButton.MouseUpEventHandler += UpClick; |
| | | |
| | | |
| | | //EventHandler<MouseEventArgs> MoveClick = (sender, e) => |
| | | //{ |
| | | // this.BackgroundColor = 0x00000000; |
| | | // //弹起来还原背景颜色 |
| | | //}; |
| | | //this.MouseMoveEventHandler += MoveClick; |
| | | //btnImage.MouseMoveEventHandler += MoveClick; |
| | | //btnName.MouseMoveEventHandler += MoveClick; |
| | | EventHandler<MouseEventArgs> CancelClick = (sender, e) => |
| | | { |
| | | OFFFLayout.BackgroundColor = MusicColor.WhiteColor; |
| | | OFFButton.TextColor = 0xFFA5AEBC; |
| | | //弹起来还原背景颜色 |
| | | }; |
| | | OFFFLayout.MouseUpOutsideEventHandler += CancelClick; |
| | | OFFButton.MouseUpOutsideEventHandler += CancelClick; |
| | | |
| | | EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | { |
| | | //按下去改变背景颜色 |
| | | OFFFLayout.BackgroundColor = MusicColor.MusicTxet14SelectedColor; |
| | | OFFButton.TextColor = MusicColor.WhiteColor; |
| | | action?.Invoke(OFFFLayout, OFFButton); |
| | | |
| | | }; |
| | | OFFFLayout.MouseDownEventHandler += DownClick; |
| | | OFFButton.MouseDownEventHandler += DownClick; |