2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 namespace ElmSharp.Test.Wearable
20 public class LabelTest6 : TestCaseBase
22 public override string TestName => "LabelTest6";
23 public override string TestDescription => "To test Horizontal align of Label";
26 public override void Run(Window window)
29 Background bg = new Background(window)
38 window.AddResizeObject(bg);
40 Conformant conformant = new Conformant(window);
42 Box box = new Box(window);
44 conformant.SetContent(box);
46 box.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
48 var label = new Label(window);
49 var label2 = new Label(window);
50 var button = new Button(window);
52 box.SetLayoutCallback(() =>
54 label.Geometry = new Rect(10, box.Geometry.Y, box.Geometry.Width - 20, 100);
55 label2.Geometry = new Rect(10, label.Geometry.Y + 120, box.Geometry.Width - 20, 100);
56 button.Geometry = new Rect(0, box.Geometry.Y + 300, box.Geometry.Width, 200);
60 label.BackgroundColor = Color.Aqua;
61 label.LineWrapType = WrapType.Word;
62 label.IsEllipsis = false;
63 label.TextStyle = "DEFAULT = 'align=left'";
65 label2.BackgroundColor = Color.Aqua;
66 label2.LineWrapType = WrapType.None;
67 label2.IsEllipsis = false;
68 label2.TextStyle = "DEFAULT = 'align=left'";
76 button.SetAlignment(-1, -1);
77 button.SetWeight(1, 1);
78 button.Text = "Append";
83 button.Clicked += (s, e) =>
85 string alpahbat = "ABCDEFGHIJKLMOPQRSTUVWXYZ";
86 label.Text += alpahbat[count % alpahbat.Length];
87 label.Text += alpahbat[count % alpahbat.Length];
88 label2.Text += alpahbat[count % alpahbat.Length];
89 label2.Text += alpahbat[count % alpahbat.Length];