陈嘉乐
2020-05-25 258d1675d02d3610cb302514fb5c86ab68ee6571
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
using System;
using System.Collections.Generic;
using Shared;
namespace HDL_ON.UI.Music
{
    public class A31LoveList : FrameLayout
    {
        public A31LoveList()
        {
            Tag = "Music";
        }
 
        VerticalScrolViewLayout middViewLayout;
        public void Show()
        {
            #region   界面布局------
            this.BackgroundColor = Color.ViewColor;
            var topView = new TopView();
            this.AddChidren(topView.TopFLayoutView());
            topView.topNameBtn.TextID = StringId.myLove;
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
            {
                //if (updateSelectedMusicThread != null || updateSelectedMusicThread.IsAlive)
                //{
                //    updateSelectedMusicThread.Abort();
                //}
                this.RemoveFromParent();
            };
 
 
            middViewLayout = new VerticalScrolViewLayout
            {
                BackgroundColor = Color.WhiteColor,
                Y = topView.fLayout.Bottom,
                Height = Application.GetRealHeight(H_W.H - H_W.T_Height),
            };
            this.AddChidren(middViewLayout);
            FileView();
            #endregion
        }
 
        void FileView()
        {
            for (int i = 0; i < 2; i++)
            {
                RowLayout addFlieRow = new RowLayout
                {
                    Height = Application.GetRealHeight(104),
                    LineColor = Color.WhiteColor,
                    SubViewWidth = Application.GetRealWidth(90),//改变编辑控件宽度多少;
                };
                middViewLayout.AddChidren(addFlieRow);
                //文件图标
                Button fileIconBtn = new Button
                {
                    X = Application.GetRealWidth(16),
                    Y = Application.GetRealHeight(8),
                    Width = Application.GetMinRealAverage(88),
                    Height = Application.GetMinRealAverage(88),
 
                };
                addFlieRow.AddChidren(fileIconBtn);
                //播放/暂停图标
                Button playIconBtn = new Button
                {
                    X = Application.GetRealWidth(78),
                    Y = Application.GetRealHeight(70),
                    Width = Application.GetMinRealAverage(24),
                    Height = Application.GetMinRealAverage(24),
                    UnSelectedImagePath = "MusicIcon/filePause.png",
                    SelectedImagePath = "MusicIcon/filePlay.png",
                };
                addFlieRow.AddChidren(playIconBtn);
 
                playIconBtn.MouseUpEventHandler += (sender, e) =>
                {
                    //点击按钮随机播放音乐
                };
                //文件名控件
                Button fileNameBtn = new Button
                {
                    X = fileIconBtn.Right + Application.GetRealWidth(16),
                    Y = Application.GetRealHeight(42),
                    Width = Application.GetRealWidth(217),
                    Height = Application.GetRealHeight(20),
                    TextColor = Color.TextColor,
                    TextSize = TextSize.Text14,
                    TextAlignment = TextAlignment.CenterLeft,
                };
                addFlieRow.AddChidren(fileNameBtn);
                if (i == 0)
                {
                    fileIconBtn.UnSelectedImagePath = "MusicIcon/loveMusic.png";
                    fileNameBtn.TextID = StringId.a31Music;
                }
                else
                {
                    fileIconBtn.UnSelectedImagePath = "MusicIcon/loveRadio.png";
                    fileNameBtn.TextID = StringId.radioLove;
                }
 
                Button clickBtn = new Button
                {
                    X = fileIconBtn.Right + Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(375 - 138),
                    Height = Application.GetRealHeight(104),
                };
                addFlieRow.AddChidren(clickBtn);
                clickBtn.MouseUpEventHandler += (sender, e) =>
                {
                    if (fileNameBtn.Text == Language.StringByID(StringId.a31Music))
                    {
                        ///喜爱音乐列表
                        A31LoveMusicList a31LoveMusicList = new A31LoveMusicList();
                        MainPage.BasePageView.AddChidren(a31LoveMusicList);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        a31LoveMusicList.Show();
                        a31LoveMusicList.UpdateSelectedMusic();
                    }
                    else
                    {
                        ///喜爱电台列表
                        A31LoveRadioList a31LoveRadioList = new A31LoveRadioList();
                        MainPage.BasePageView.AddChidren(a31LoveRadioList);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        a31LoveRadioList.Show();
                        a31LoveRadioList.UpdateSelectedMusic();
                    }
 
                };
 
            }
        }
    }
}