--- /dev/null
+/*
+ * 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; }
+ }
+}
+++ /dev/null
-/*
- * 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; }
- }
-}
private TermsProvider termsProvider;
private TextLabel agreeLabel;
- private Switch agreeSwitch;
+ private CheckBox agreeCheckBox;
private TapGestureDetector tapGestureDetector;
private ScrollableBase scroller;
private TextLabel termsContent;
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();
};
Layout = new LinearLayout
{
LinearOrientation = LinearLayout.Orientation.Horizontal,
- LinearAlignment = LinearLayout.Alignment.CenterVertical,
+ LinearAlignment = LinearLayout.Alignment.Bottom,
CellPadding = DpUtils.ToPixels(new Size2D(16, 0)),
},
};
ihaveread.Add(guide);
ihaveread.Add(agreeLabel);
bounding.Add(scroller);
- footnote.Add(agreeSwitch);
+ footnote.Add(agreeCheckBox);
footnote.Add(ihaveread);
content.Add(bounding);
{
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;
// 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);
}
// 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);
}