Change Agree Switch to Checkbox 03/265203/2
authorKrzysztof Wieclaw/IoT & UI Sample (PLT) /SRPOL/Engineer/Samsung Electronics <k.wieclaw@samsung.com>
Tue, 12 Oct 2021 14:47:20 +0000 (16:47 +0200)
committerKrzysztof Wieclaw/IoT & UI Sample (PLT) /SRPOL/Engineer/Samsung Electronics <k.wieclaw@samsung.com>
Thu, 14 Oct 2021 17:16:56 +0000 (19:16 +0200)
Change-Id: I23a14fe8747dc4b1511479ac00761ba8ca6206e8
Signed-off-by: Krzysztof Wieclaw/IoT & UI Sample (PLT) /SRPOL/Engineer/Samsung Electronics <k.wieclaw@samsung.com>
Oobe/Oobe.Terms/Styles/ButtonStyles.cs [new file with mode: 0644]
Oobe/Oobe.Terms/Styles/SwitchStyles.cs [deleted file]
Oobe/Oobe.Terms/Views/TermsView.cs

diff --git a/Oobe/Oobe.Terms/Styles/ButtonStyles.cs b/Oobe/Oobe.Terms/Styles/ButtonStyles.cs
new file mode 100644 (file)
index 0000000..63b172e
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+
+namespace Oobe.Terms.Styles
+{
+    public class ButtonStyles
+    {
+        private static ButtonStyle iHaveReadAndAgreeSwitchStyle = new ButtonStyle
+        {
+            Overlay = new ImageViewStyle
+            {
+                Size = new Size(24, 24),
+                ResourceUrl = new Selector<string>
+                {
+                    Normal = NUIApplication.Current.DirectoryInfo.Resource + "switch/07_check_off_active.png",
+                    Selected = NUIApplication.Current.DirectoryInfo.Resource + "switch/07_check_on_active.png",
+                    Disabled = NUIApplication.Current.DirectoryInfo.Resource + "switch/07_check_off_disabled.png",
+                },
+            },
+        };
+
+        public static ButtonStyle IHaveReadAndAgreeSwitchStyle { get => iHaveReadAndAgreeSwitchStyle; }
+    }
+}
diff --git a/Oobe/Oobe.Terms/Styles/SwitchStyles.cs b/Oobe/Oobe.Terms/Styles/SwitchStyles.cs
deleted file mode 100644 (file)
index 9838ae0..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-
-namespace Oobe.Terms.Styles
-{
-    public class SwitchStyles
-    {
-        private static SwitchStyle iHaveReadAndAgreeSwitchStyle = new SwitchStyle
-        {
-            Thumb = new ImageViewStyle
-            {
-                Size = new Size(24, 24),
-                ResourceUrl = new Selector<string>
-                {
-                    Normal = NUIApplication.Current.DirectoryInfo.Resource + "switch/07_check_off_active.png",
-                    Selected = NUIApplication.Current.DirectoryInfo.Resource + "switch/07_check_on_active.png",
-                    Disabled = NUIApplication.Current.DirectoryInfo.Resource + "switch/07_check_off_disabled.png",
-                },
-            },
-        };
-
-        public static SwitchStyle IHaveReadAndAgreeSwitchStyle { get => iHaveReadAndAgreeSwitchStyle; }
-    }
-}
index c36690afe88dccbf19f4c7fb2111faab45fc1ccf..ee28780401afbb66a6a79024600882519c9e0f23 100644 (file)
@@ -31,7 +31,7 @@ namespace Oobe.Terms.Views
         private TermsProvider termsProvider;
 
         private TextLabel agreeLabel;
-        private Switch agreeSwitch;
+        private CheckBox agreeCheckBox;
         private TapGestureDetector tapGestureDetector;
         private ScrollableBase scroller;
         private TextLabel termsContent;
@@ -120,12 +120,12 @@ namespace Oobe.Terms.Views
             TextLabel guide = new TextLabel(TextLabelStyles.GuideTextLabelStyle);
             guide.TranslatableText = "YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE";
 
-            agreeSwitch = new Switch(SwitchStyles.IHaveReadAndAgreeSwitchStyle);
-            agreeSwitch.Size2D = DpUtils.ToPixels(new Size2D(24, 24));
-            agreeSwitch.Margin = DpUtils.ToPixels(new Extents(0, 0, 0, 2));
-            agreeSwitch.IsSelected = false;
-            agreeSwitch.IsEnabled = false;
-            agreeSwitch.Clicked += (obj, args) =>
+            agreeCheckBox = new CheckBox(Oobe.Terms.Styles.ButtonStyles.IHaveReadAndAgreeSwitchStyle);
+            agreeCheckBox.Size2D = DpUtils.ToPixels(new Size2D(24, 24));
+            agreeCheckBox.Margin = DpUtils.ToPixels(new Extents(0, 0, 0, 2));
+            agreeCheckBox.IsSelected = false;
+            agreeCheckBox.IsEnabled = false;
+            agreeCheckBox.Clicked += (obj, args) =>
             {
                 TermsToggle();
             };
@@ -140,7 +140,7 @@ namespace Oobe.Terms.Views
                 Layout = new LinearLayout
                 {
                     LinearOrientation = LinearLayout.Orientation.Horizontal,
-                    LinearAlignment = LinearLayout.Alignment.CenterVertical,
+                    LinearAlignment = LinearLayout.Alignment.Bottom,
                     CellPadding = DpUtils.ToPixels(new Size2D(16, 0)),
                 },
             };
@@ -157,7 +157,7 @@ namespace Oobe.Terms.Views
             ihaveread.Add(guide);
             ihaveread.Add(agreeLabel);
             bounding.Add(scroller);
-            footnote.Add(agreeSwitch);
+            footnote.Add(agreeCheckBox);
             footnote.Add(ihaveread);
 
             content.Add(bounding);
@@ -204,13 +204,13 @@ namespace Oobe.Terms.Views
                 {
                     NextButton.State = States.Normal;
                     NextButton.IsEnabled = true;
-                    agreeSwitch.IsSelected = true;
+                    agreeCheckBox.IsSelected = true;
                 }
                 else
                 {
                     NextButton.State = States.Disabled;
                     NextButton.IsEnabled = false;
-                    agreeSwitch.IsSelected = false;
+                    agreeCheckBox.IsSelected = false;
                 }
 
                 nextEnabled = value;
@@ -239,8 +239,8 @@ namespace Oobe.Terms.Views
                     // when changing control state. Fix it by reapplying special style
                     // remove below line when issue get fixed
                     agreeLabel.ApplyStyle(TextLabelStyles.IHaveReadAndAgreeTextStyle);
-                    agreeSwitch.IsEnabled = true;
-                    agreeSwitch.State = States.Normal;
+                    agreeCheckBox.IsEnabled = true;
+                    agreeCheckBox.State = States.Normal;
                     tapGestureDetector.Detected += OnTapGestureDetected;
                     tapGestureDetector.Attach(agreeLabel);
                 }
@@ -252,8 +252,8 @@ namespace Oobe.Terms.Views
                     // when changing control state. Fix it by reapplying special style
                     // remove below line when issue get fixed
                     agreeLabel.ApplyStyle(TextLabelStyles.IHaveReadAndAgreeTextStyleDisabled);
-                    agreeSwitch.IsEnabled = false;
-                    agreeSwitch.State = States.Disabled;
+                    agreeCheckBox.IsEnabled = false;
+                    agreeCheckBox.State = States.Disabled;
                     tapGestureDetector.Detected -= OnTapGestureDetected;
                     tapGestureDetector.Detach(agreeLabel);
                 }