[NUI] propose Slider's key navigation and edit mode, Add more samples in StyleGuilde
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.StyleGuide / Examples / ProgressExample.cs
1 /*
2  * Copyright(c) 2022 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System.ComponentModel;
18 using Tizen.NUI;
19 using Tizen.NUI.BaseComponents;
20 using Tizen.NUI.Components;
21
22 namespace Tizen.NUI.StyleGuide
23 {
24     // IExample inehrited class will be automatically added in the main examples list.
25     internal class ProgressExample : ContentPage, IExample
26     {
27         private View rootContent;
28         private Progress bufferingProgress, disabledProgress, determinatedProgress, indeterminatedProgress;
29
30         public void Activate()
31         {
32         }
33         public void Deactivate()
34         {
35         }
36
37         /// Modify this method for adding other examples.
38         public ProgressExample() : base()
39         {
40             WidthSpecification = LayoutParamPolicies.MatchParent;
41             HeightSpecification = LayoutParamPolicies.MatchParent;
42
43             // Navigator bar title is added here.
44             AppBar = new AppBar()
45             {
46                 Title = "Progress Default Style",
47             };
48
49             // Example root content view.
50             // you can decorate, add children on this view.
51             rootContent = new View()
52             {
53                 WidthSpecification = LayoutParamPolicies.MatchParent,
54                 HeightSpecification = LayoutParamPolicies.MatchParent,
55
56                 Layout = new LinearLayout()
57                 {
58                     LinearOrientation = LinearLayout.Orientation.Vertical,
59                     HorizontalAlignment = HorizontalAlignment.Center,
60                     VerticalAlignment = VerticalAlignment.Center,
61                     CellPadding = new Size2D(10, 20),
62                 },
63             };
64
65             // CheckBox examples.
66             bufferingProgress = new Progress()
67             {
68                 MinValue = 0,
69                 MaxValue = 100,
70                 BufferValue = 10,
71                 ProgressState = Progress.ProgressStatusType.Buffering,
72             };
73             rootContent.Add(bufferingProgress);
74
75             determinatedProgress = new Progress()
76             {
77                 MinValue = 0,
78                 MaxValue = 100,
79                 CurrentValue = 80,
80                 ProgressState = Progress.ProgressStatusType.Determinate,
81             };
82             rootContent.Add(determinatedProgress);
83
84             indeterminatedProgress = new Progress()
85             {
86                 MinValue = 0,
87                 MaxValue = 100,
88                 ProgressState = Progress.ProgressStatusType.Indeterminate,
89             };
90             rootContent.Add(indeterminatedProgress);
91
92
93             disabledProgress = new Progress()
94             {
95                 MinValue = 0,
96                 MaxValue = 100,
97                 IsEnabled = false,
98                 ProgressState = Progress.ProgressStatusType.Indeterminate,
99             };
100             rootContent.Add(disabledProgress);
101             Content = rootContent;
102         }
103     }
104 }