[ElmSharp.Wearable] deprecate AngleRatio, fix incorrect default value of AngleRatio...
[platform/core/csapi/tizenfx.git] / test / ElmSharp.Wearable.Test / TC / CircleSpinnerTest2.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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 ElmSharp.Wearable;
18
19 namespace ElmSharp.Test.TC
20 {
21     class CircleSpinnerTest2 : TestCaseBase
22     {
23         public override string TestName => "CircleSpinnerTest2";
24         public override string TestDescription => "To test basic operation of Circle Spinner with Marker";
25
26         public override void Run(Window window)
27         {
28             Log.Debug(TestName, "CircleSpinnerTest run");
29             Conformant conformant = new Conformant(window);
30             conformant.Show();
31
32             Layout layout = new Layout(window);
33             layout.SetTheme("layout", "circle", "spinner");
34             conformant.SetContent(layout);
35
36             var surface = new CircleSurface(conformant);
37             CircleSpinner spn1 = new CircleSpinner(conformant, surface)
38             {
39                 Text = "Spinner Test",
40                 LabelFormat = "%d Value",
41                 Style = "circle",
42                 AngleRatio = 3.0,
43                 Minimum = 0,
44                 Maximum = 360,
45                 Value = 0,
46                 Step = 10,
47                 Interval = 0.5,
48                 AlignmentX = -1,
49                 AlignmentY = 1,
50                 WeightX = 1,
51                 WeightY = 1,
52                 // change marker
53                 MarkerLineWidth = 40,
54                 MarkerColor = Color.Pink,
55                 MarkerRadius = 100,
56             };
57             ((IRotaryActionWidget)spn1).Activate();
58             spn1.AddSpecialValue(50, "50 match !!!!");
59             layout.SetContent(spn1);
60
61             Button btn = new Button(layout) {
62                 Text = "OK",
63                 Style = "bottom",
64             };
65
66             layout.SetPartContent("elm.swallow.btn", btn);
67             layout.SetPartText("elm.text", "Set value");
68         }
69     }
70 }