--- /dev/null
+using System;
+using System.Collections.Generic;
+using Tizen.NUI;
+using Tizen.NUI.Binding;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using Oobe.Common.Utils;
+
+namespace Oobe.Common.Controls
+{
+ public class CarouselPicker : Control
+ {
+ public event EventHandler SelectedItemChanged;
+
+ private Oobe.Common.Controls.ScrollableBase scrollableBase;
+ private View itemsListView;
+ private View upperLine, lowerLine;
+
+ private Vector3 textCenterColorHSV = new Vector3();
+ private Vector3 textOuterColorHSV = new Vector3();
+
+ private float textCenterOpacity;
+ private float textOuterOpacity;
+
+ private List<CarouselPickerItemData> items = new List<CarouselPickerItemData>();
+
+ public CarouselPicker() : base()
+ {
+ }
+
+ public CarouselPicker(CarouselPickerStyle style) : base(style)
+ {
+ //TODO fix a bug with style not properly applied by base class
+ ApplyStyle(style);
+ }
+
+ public void AddItem(CarouselPickerItemData item)
+ {
+ var view = CreateItemView(item);
+ itemsListView.Add(view);
+ items.Add(item);
+ }
+
+ public void RemoveItem(CarouselPickerItemData item)
+ {
+ var index = items.IndexOf(item);
+ items.Remove(item);
+ itemsListView.Children.RemoveAt(index);
+ }
+
+ private int selectedItemIndex = 0;
+ public int SelectedItemIndex
+ {
+ get
+ {
+ return selectedItemIndex;
+ }
+ set
+ {
+ //always scroll
+ scrollableBase.ScrollToIndex(value);
+ if (selectedItemIndex != value)
+ {
+ SelectedItemChanged?.Invoke(this, null);
+ selectedItemIndex = value;
+ }
+ }
+ }
+
+ public override void ApplyStyle(ViewStyle viewStyle)
+ {
+ base.ApplyStyle(viewStyle);
+
+ CarouselPickerStyle style = viewStyle as CarouselPickerStyle;
+
+ if (style != null)
+ {
+ Layout = new LinearLayout
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ LinearAlignment = LinearLayout.Alignment.Center,
+ };
+ ClippingMode = ClippingModeType.ClipToBoundingBox;
+
+ // Animatable properties
+ textCenterColorHSV = Style.CenterText?.TextColor?.All?.ToHSV() ?? new Vector3();
+ textCenterOpacity = Style.CenterText?.Opacity?.All ?? 1.0f;
+
+ textOuterColorHSV = Style.OuterText?.TextColor?.All?.ToHSV() ?? new Vector3();
+ textOuterOpacity = Style.OuterText?.Opacity?.All ?? 1.0f;
+
+
+ if (itemsListView != null)
+ {
+ scrollableBase?.Remove(itemsListView);
+ itemsListView.Dispose();
+ }
+
+ itemsListView = new View
+ {
+ Layout = new LinearLayout
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ },
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.WrapContent,
+ };
+
+ if (scrollableBase != null)
+ {
+ Remove(scrollableBase);
+ scrollableBase.Dispose();
+ }
+
+ scrollableBase = new Oobe.Common.Controls.ScrollableBase
+ {
+ ClippingMode = ClippingModeType.Disabled,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ SnapToPage = true,
+ ScrollingDirection = ScrollableBase.Direction.Vertical,
+ ScrollEnabled = true,
+ SizeHeight = CalculateScrollerSize(),
+ FlickDistanceMultiplierRange = new Vector2(4.6f, 5.8f),
+ EventsView = this,
+ };
+
+ scrollableBase.ScrollEvent += (sender, args) =>
+ {
+ UpdateItems();
+ };
+ scrollableBase.ScrollAnimationEndEvent += (sender, args) =>
+ {
+ if (selectedItemIndex != scrollableBase.CurrentPage)
+ {
+ selectedItemIndex = scrollableBase.CurrentPage;
+ SelectedItemChanged?.Invoke(this, null);
+ }
+ };
+
+ if (upperLine != null)
+ {
+ Remove(upperLine);
+ upperLine.Dispose();
+ }
+
+ upperLine = new View()
+ {
+ BackgroundColor = Style.LinesColor,
+ Size2D = new Size2D(0, 1),
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ Position2D = new Position2D(0, 93),
+ Opacity = 0.95f,
+ };
+
+ if (lowerLine != null)
+ {
+ Remove(lowerLine);
+ lowerLine.Dispose();
+ }
+
+ lowerLine = new View()
+ {
+ BackgroundColor = Style.LinesColor,
+ Size2D = new Size2D(0, 1),
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ Position2D = new Position2D(0, 156),
+ Opacity = 0.95f,
+ };
+
+ scrollableBase.Add(itemsListView);
+
+ Add(upperLine);
+ Add(scrollableBase);
+ Add(lowerLine);
+ }
+ }
+
+ private float CalculateScrollerSize()
+ {
+ float size = 0.0f;
+
+ size += Style.CenterText?.Size2D?.Height ?? 0.0f;
+ size += (float)Style.CenterText?.Margin?.Top;
+ size += (float)Style.CenterText?.Margin?.Bottom;
+
+ return size;
+ }
+
+ private View CreateItemView(CarouselPickerItemData item)
+ {
+ var view = new TextLabel();
+ // TODO for some reason TextLabel(Style.CenterText)
+ // or view.ApplyStyle(Style.CenterText) do not work here so set
+ // everything manually
+ // var view = new TextLabel(Style.CenterText);
+ // view.ApplyStyle(Style.CenterText);
+ view.Text = item.Text;
+ view.TranslatableText = item.TranslatableText;
+ view.Size2D = Style.CenterText?.Size2D ?? new Size2D();
+ view.PixelSize = Style.CenterText?.PixelSize ?? 10.0f;
+ view.Margin = Style.CenterText?.Margin ?? new Extents();
+ view.HorizontalAlignment = Style.CenterText?.HorizontalAlignment ?? HorizontalAlignment.Center;
+ view.VerticalAlignment = Style.CenterText?.VerticalAlignment ?? VerticalAlignment.Center;
+ view.Opacity = Style.CenterText?.Opacity?.All ?? 1.0f;
+ //TODO other properties?
+ return view;
+ }
+
+ protected override void OnUpdate()
+ {
+ base.OnUpdate();
+ UpdateItems();
+ }
+
+ protected override void Dispose(Tizen.NUI.DisposeTypes type)
+ {
+ if (disposed)
+ {
+ return;
+ }
+
+ if (type == DisposeTypes.Explicit)
+ {
+ // Dispose all containing widgets
+ scrollableBase.Dispose();
+ upperLine.Dispose();
+ lowerLine.Dispose();
+ }
+
+ base.Dispose(type);
+ }
+
+ public new CarouselPickerStyle Style => ViewStyle as CarouselPickerStyle;
+
+ protected override ViewStyle GetViewStyle()
+ {
+ var ret = new CarouselPickerStyle();
+ return ret;
+ }
+
+ private void CreateMainList()
+ {
+ }
+
+ private Vector3 ScaleVector(Vector3 from, Vector3 to, float percent)
+ {
+ percent = Math.Clamp(percent, 0.0f, 1.0f);
+
+ float a = from[0] + (to[0] - from[0]) * percent;
+ float b = from[1] + (to[1] - from[1]) * percent;
+ float c = from[2] + (to[2] - from[2]) * percent;
+
+ return new Vector3(a, b, c);
+ }
+
+ private float ScaleScalar(float from, float to, float percent)
+ {
+ percent = Math.Clamp(percent, 0.0f, 1.0f);
+ return from + (to - from) * percent;
+ }
+
+ private void UpdateItems()
+ {
+ float mid = itemsListView.PositionY - (int)(scrollableBase.Size2D.Height / 2.0f);
+ int threshold = 80; // after this value the color will become outer
+
+ foreach (View view in itemsListView.Children)
+ {
+ TextLabel itemView = view as TextLabel;
+ if (itemView == null) continue;
+
+ float viewMid = view.PositionY + view.Size2D.Height / 2.0f;
+ float percent = Math.Abs(viewMid + mid) / threshold;
+
+ itemView.Opacity = ScaleScalar(textCenterOpacity, textOuterOpacity, percent);
+ itemView.TextColor = ColorUtils.ColorFromHSV(ScaleVector(textCenterColorHSV, textOuterColorHSV, percent));
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace Oobe.Common.Controls
+{
+ public class CarouselPickerItemData
+ {
+ public CarouselPickerItemData()
+ {
+ }
+
+ public string Text { get; set; }
+
+ public string TranslatableText { get; set; }
+ }
+}
--- /dev/null
+using System;
+using Tizen.NUI;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+
+namespace Oobe.Common.Controls
+{
+ public class CarouselPickerStyle : ControlStyle
+ {
+ public CarouselPickerStyle() : base()
+ {
+ InitSubStyle();
+ }
+
+ public TextLabelStyle CenterText { get; set; }
+
+ public TextLabelStyle OuterText { get; set; }
+
+ public Color LinesColor { get; set; }
+
+ private void InitSubStyle()
+ {
+ CenterText = new TextLabelStyle
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center
+ };
+ OuterText = new TextLabelStyle
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center
+ };
+ LinesColor = Color.Black;
+ }
+
+ public override void CopyFrom(BindableObject bindableObject)
+ {
+ base.CopyFrom(bindableObject);
+
+ CarouselPickerStyle carouselSelectorStyle = bindableObject as CarouselPickerStyle;
+
+ if (carouselSelectorStyle != null)
+ {
+ CenterText?.CopyFrom(carouselSelectorStyle.CenterText);
+ OuterText?.CopyFrom(carouselSelectorStyle.OuterText);
+ LinesColor = carouselSelectorStyle.LinesColor;
+ }
+ }
+ }
+}
--- /dev/null
+/* Copyright (c) 2019 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 System;
+using Tizen.NUI.BaseComponents;
+using System.ComponentModel;
+using System.Diagnostics;
+using Tizen.NUI.Components;
+using Tizen.NUI;
+
+namespace Oobe.Common.Controls
+{
+ /// <summary>
+ /// [Draft] This class provides a View that can scroll a single View with a layout. This View can be a nest of Views.
+ /// </summary>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ScrollableBase : Control
+ {
+ static bool LayoutDebugScrollableBase = false; // Debug flag
+ private Direction mScrollingDirection = Direction.Vertical;
+ private bool mScrollEnabled = true;
+ private int mPageWidth = 0;
+ private int mPageHeight = 0;
+
+ private class ScrollableBaseCustomLayout : LayoutGroup
+ {
+ protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
+ {
+ Extents padding = Padding;
+ float totalHeight = padding.Top + padding.Bottom;
+ float totalWidth = padding.Start + padding.End;
+
+ MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK;
+ MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK;
+
+ Direction scrollingDirection = Direction.Vertical;
+ ScrollableBase scrollableBase = this.Owner as ScrollableBase;
+ if (scrollableBase)
+ {
+ scrollingDirection = scrollableBase.ScrollingDirection;
+ }
+
+ // measure child, should be a single scrolling child
+ foreach( LayoutItem childLayout in LayoutChildren )
+ {
+ if (childLayout != null)
+ {
+ // Get size of child
+ // Use an Unspecified MeasureSpecification mode so scrolling child is not restricted to it's parents size in Height (for vertical scrolling)
+ // or Width for horizontal scrolling
+ MeasureSpecification unrestrictedMeasureSpec = new MeasureSpecification( heightMeasureSpec.Size, MeasureSpecification.ModeType.Unspecified);
+
+ if (scrollingDirection == Direction.Vertical)
+ {
+ MeasureChild( childLayout, widthMeasureSpec, unrestrictedMeasureSpec ); // Height unrestricted by parent
+ }
+ else
+ {
+ MeasureChild( childLayout, unrestrictedMeasureSpec, heightMeasureSpec ); // Width unrestricted by parent
+ }
+
+ float childWidth = childLayout.MeasuredWidth.Size.AsDecimal();
+ float childHeight = childLayout.MeasuredHeight.Size.AsDecimal();
+
+ // Determine the width and height needed by the children using their given position and size.
+ // Children could overlap so find the left most and right most child.
+ Position2D childPosition = childLayout.Owner.Position2D;
+ float childLeft = childPosition.X;
+ float childTop = childPosition.Y;
+
+ // Store current width and height needed to contain all children.
+ Extents childMargin = childLayout.Margin;
+ totalWidth = childWidth + childMargin.Start + childMargin.End;
+ totalHeight = childHeight + childMargin.Top + childMargin.Bottom;
+
+ if (childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ {
+ childWidthState = MeasuredSize.StateType.MeasuredSizeTooSmall;
+ }
+ if (childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ {
+ childHeightState = MeasuredSize.StateType.MeasuredSizeTooSmall;
+ }
+ }
+ }
+
+
+ MeasuredSize widthSizeAndState = ResolveSizeAndState(new LayoutLength(totalWidth + Padding.Start + Padding.End), widthMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
+ MeasuredSize heightSizeAndState = ResolveSizeAndState(new LayoutLength(totalHeight + Padding.Top + Padding.Bottom), heightMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
+ totalWidth = widthSizeAndState.Size.AsDecimal();
+ totalHeight = heightSizeAndState.Size.AsDecimal();
+
+ // Ensure layout respects it's given minimum size
+ totalWidth = Math.Max( totalWidth, SuggestedMinimumWidth.AsDecimal() );
+ totalHeight = Math.Max( totalHeight, SuggestedMinimumHeight.AsDecimal() );
+
+ widthSizeAndState.State = childWidthState;
+ heightSizeAndState.State = childHeightState;
+
+ SetMeasuredDimensions( ResolveSizeAndState( new LayoutLength(totalWidth + Padding.Start + Padding.End), widthMeasureSpec, childWidthState ),
+ ResolveSizeAndState( new LayoutLength(totalHeight + Padding.Top + Padding.Bottom), heightMeasureSpec, childHeightState ) );
+
+ // Size of ScrollableBase is changed. Change Page width too.
+ scrollableBase.mPageWidth = (int)MeasuredWidth.Size.AsRoundedValue();
+ scrollableBase.mPageHeight = (int)MeasuredHeight.Size.AsRoundedValue();
+ Tizen.Log.Debug("ScrollableBase", $"Page.Width: {scrollableBase.mPageWidth}");
+ Tizen.Log.Debug("ScrollableBase", $"Page.Height: {scrollableBase.mPageHeight}");
+ }
+
+ protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
+ {
+ ScrollableBase scrollableBase = this.Owner as ScrollableBase;
+ foreach( LayoutItem childLayout in LayoutChildren )
+ {
+ if( childLayout != null )
+ {
+ LayoutLength childWidth = childLayout.MeasuredWidth.Size;
+ LayoutLength childHeight = childLayout.MeasuredHeight.Size;
+
+ Position2D childPosition = childLayout.Owner.Position2D;
+ Extents padding = Padding;
+ Extents childMargin = childLayout.Margin;
+
+ LayoutLength childLeft = new LayoutLength(childPosition.X + childMargin.Start + padding.Start);
+ LayoutLength childTop = new LayoutLength(childPosition.Y + childMargin.Top + padding.Top);
+
+ childLayout.Layout( childLeft, childTop, childLeft + childWidth, childTop + childHeight );
+ }
+ }
+ // workaround issue with ScrollableBase not properly scrolling
+ // to index when ScrollToIndex is used before layouting
+ scrollableBase.ScrollToIndex(scrollableBase.CurrentPage);
+ }
+ } // ScrollableBaseCustomLayout
+
+ /// <summary>
+ /// The direction axis to scroll.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public enum Direction
+ {
+ /// <summary>
+ /// Horizontal axis.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ Horizontal,
+
+ /// <summary>
+ /// Vertical axis.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ Vertical
+ }
+
+ /// <summary>
+ /// [Draft] Configurable speed threshold that register the gestures as a flick.
+ /// If the flick speed less than the threshold then will not be considered a flick.
+ /// </summary>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float FlickThreshold { get; set; } = 0.2f;
+
+ /// <summary>
+ /// [Draft] Configurable duration modifer for the flick animation.
+ /// Determines the speed of the scroll, large value results in a longer flick animation. Range (0.1 - 1.0)
+ /// </summary>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float FlickAnimationSpeed { get; set; } = 0.4f;
+
+ /// <summary>
+ /// [Draft] Configurable modifer for the distance to be scrolled when flicked detected.
+ /// It a ratio of the ScrollableBase's length. (not child's length).
+ /// First value is the ratio of the distance to scroll with the weakest flick.
+ /// Second value is the ratio of the distance to scroll with the strongest flick.
+ /// Second > First.
+ /// </summary>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector2 FlickDistanceMultiplierRange { get; set; } = new Vector2(0.6f, 1.8f);
+
+ /// <summary>
+ /// [Draft] Scrolling direction mode.
+ /// Default is Vertical scrolling.
+ /// </summary>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Direction ScrollingDirection
+ {
+ get
+ {
+ return mScrollingDirection;
+ }
+ set
+ {
+ if(value != mScrollingDirection)
+ {
+ mScrollingDirection = value;
+ mPanGestureDetector.RemoveDirection(value == Direction.Horizontal ? PanGestureDetector.DirectionVertical : PanGestureDetector.DirectionHorizontal);
+ mPanGestureDetector.AddDirection(value == Direction.Horizontal ? PanGestureDetector.DirectionHorizontal : PanGestureDetector.DirectionVertical);
+ }
+ }
+ }
+
+ /// <summary>
+ /// [Draft] Enable or disable scrolling.
+ /// </summary>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool ScrollEnabled
+ {
+ get
+ {
+ return mScrollEnabled;
+ }
+ set
+ {
+ if (value != mScrollEnabled)
+ {
+ mScrollEnabled = value;
+ if(mScrollEnabled)
+ {
+ mPanGestureDetector.Detected += OnPanGestureDetected;
+ mTapGestureDetector.Detected += OnTapGestureDetected;
+ }
+ else
+ {
+ mPanGestureDetector.Detected -= OnPanGestureDetected;
+ mTapGestureDetector.Detected -= OnTapGestureDetected;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// [Draft] Pages mode, enables moving to the next or return to current page depending on pan displacement.
+ /// Default is false.
+ /// </summary>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool SnapToPage { set; get; } = false;
+
+ /// <summary>
+ /// [Draft] Get current page.
+ /// Working propery with SnapToPage property.
+ /// </summary>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int CurrentPage { get; private set; } = 0;
+
+ /// <summary>
+ /// [Draft] Duration of scroll animation.
+ /// </summary>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+
+ public int ScrollDuration { set; get; } = 125;
+ /// <summary>
+ /// [Draft] Scroll Available area.
+ /// </summary>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Rectangle ScrollAvailableArea { set; get; }
+
+ /// <summary>
+ /// ScrollEventArgs is a class to record scroll event arguments which will sent to user.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ScrollEventArgs : EventArgs
+ {
+ Position position;
+
+ /// <summary>
+ /// Default constructor.
+ /// </summary>
+ /// <param name="position">Current scroll position</param>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ public ScrollEventArgs(Position position)
+ {
+ this.position = position;
+ }
+
+ /// <summary>
+ /// [Draft] Current scroll position.
+ /// </summary>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Position Position
+ {
+ get
+ {
+ return position;
+ }
+ }
+ }
+
+ /// <summary>
+ /// An event emitted when user starts dragging ScrollableBase, user can subscribe or unsubscribe to this event handler.<br />
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<ScrollEventArgs> ScrollDragStartEvent;
+
+ /// <summary>
+ /// An event emitted when user stops dragging ScrollableBase, user can subscribe or unsubscribe to this event handler.<br />
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<ScrollEventArgs> ScrollDragEndEvent;
+
+
+ /// <summary>
+ /// An event emitted when the scrolling slide animation starts, user can subscribe or unsubscribe to this event handler.<br />
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<ScrollEventArgs> ScrollAnimationStartEvent;
+
+ /// <summary>
+ /// An event emitted when the scrolling slide animation ends, user can subscribe or unsubscribe to this event handler.<br />
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<ScrollEventArgs> ScrollAnimationEndEvent;
+
+
+ /// <summary>
+ /// An event emitted when scrolling, user can subscribe or unsubscribe to this event handler.<br />
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<ScrollEventArgs> ScrollEvent;
+
+ private Animation scrollAnimation;
+ private float maxScrollDistance;
+ private float childTargetPosition = 0.0f;
+ private PanGestureDetector mPanGestureDetector;
+ private TapGestureDetector mTapGestureDetector;
+ private View mScrollingChild;
+ private float multiplier =1.0f;
+ private bool scrolling = false;
+ private float ratioOfScreenWidthToCompleteScroll = 0.4f;
+ private float totalDisplacementForPan = 0.0f;
+
+ // If false then can only flick pages when the current animation/scroll as ended.
+ private bool flickWhenAnimating = false;
+ private PropertyNotification propertyNotification;
+
+ /// <summary>
+ /// [Draft] Constructor
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ScrollableBase() : base()
+ {
+ mPanGestureDetector = new PanGestureDetector();
+ //mPanGestureDetector.Attach(this);
+ mPanGestureDetector.AddDirection(PanGestureDetector.DirectionVertical);
+ mPanGestureDetector.Detected += OnPanGestureDetected;
+
+ mTapGestureDetector = new TapGestureDetector();
+ //mTapGestureDetector.Attach(this);
+ mTapGestureDetector.Detected += OnTapGestureDetected;
+
+
+ ClippingMode = ClippingModeType.ClipToBoundingBox;
+
+ mScrollingChild = new View();
+ mScrollingChild.Name = "DefaultScrollingChild";
+
+ Layout = new ScrollableBaseCustomLayout();
+ EventsView = this;
+ }
+
+ private void OnPropertyChanged(object source, PropertyNotification.NotifyEventArgs args)
+ {
+ OnScroll();
+ }
+
+ /// <summary>
+ /// Called after a child has been added to the owning view.
+ /// </summary>
+ /// <param name="view">The child which has been added.</param>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override void OnChildAdd(View view)
+ {
+ if(mScrollingChild.Name != "DefaultScrollingChild")
+ {
+ propertyNotification.Notified -= OnPropertyChanged;
+ mScrollingChild.RemovePropertyNotification(propertyNotification);
+ }
+
+ mScrollingChild = view;
+ propertyNotification = mScrollingChild?.AddPropertyNotification("position", PropertyCondition.Step(1.0f));
+ propertyNotification.Notified += OnPropertyChanged;
+
+ {
+ if (Children.Count > 1)
+ Tizen.Log.Error("ScrollableBase", $"Only 1 child should be added to ScrollableBase.");
+ }
+ }
+
+ /// <summary>
+ /// Called after a child has been removed from the owning view.
+ /// </summary>
+ /// <param name="view">The child which has been removed.</param>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override void OnChildRemove(View view)
+ {
+ propertyNotification.Notified -= OnPropertyChanged;
+ mScrollingChild.RemovePropertyNotification(propertyNotification);
+
+ mScrollingChild = new View();
+ }
+
+
+ /// <summary>
+ /// Scrolls to the item at the specified index.
+ /// </summary>
+ /// <param name="index">Index of item.</param>
+ /// <since_tizen> 6 </since_tizen>
+ /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void ScrollToIndex(int index)
+ {
+ if(mScrollingChild.ChildCount-1 < index || index < 0)
+ {
+ return;
+ }
+
+ if(SnapToPage)
+ {
+ CurrentPage = index;
+ }
+
+ float destinationX;
+ if (ScrollingDirection == Direction.Horizontal)
+ {
+ destinationX = -(mScrollingChild.Children[CurrentPage].Position.X + mScrollingChild.Children[CurrentPage].CurrentSize.Width/2 - CurrentSize.Width/2); // set to middle of current page
+ } else
+ {
+ destinationX = -(mScrollingChild.Children[CurrentPage].Position.Y + mScrollingChild.Children[CurrentPage].CurrentSize.Height/2 - CurrentSize.Height/2); // set to middle of current page
+ }
+
+ AnimateChildTo(ScrollDuration, destinationX);
+ }
+
+ private void OnScrollDragStart()
+ {
+ ScrollEventArgs eventArgs = new ScrollEventArgs(mScrollingChild.CurrentPosition);
+ ScrollDragStartEvent?.Invoke(this, eventArgs);
+ }
+
+ private void OnScrollDragEnd()
+ {
+ ScrollEventArgs eventArgs = new ScrollEventArgs(mScrollingChild.CurrentPosition);
+ ScrollDragEndEvent?.Invoke(this, eventArgs);
+ }
+
+ private void OnScrollAnimationStart()
+ {
+ ScrollEventArgs eventArgs = new ScrollEventArgs(mScrollingChild.CurrentPosition);
+ ScrollAnimationStartEvent?.Invoke(this, eventArgs);
+ }
+
+ private void OnScrollAnimationEnd()
+ {
+ ScrollEventArgs eventArgs = new ScrollEventArgs(mScrollingChild.CurrentPosition);
+ ScrollAnimationEndEvent?.Invoke(this, eventArgs);
+ }
+
+ private void OnScroll()
+ {
+ ScrollEventArgs eventArgs = new ScrollEventArgs(mScrollingChild.CurrentPosition);
+ ScrollEvent?.Invoke(this, eventArgs);
+ }
+
+ private void StopScroll()
+ {
+ if (scrollAnimation != null)
+ {
+ if (scrollAnimation.State == Animation.States.Playing)
+ {
+ Debug.WriteLineIf(LayoutDebugScrollableBase, "StopScroll Animation Playing");
+ scrollAnimation.Stop(Animation.EndActions.Cancel);
+ OnScrollAnimationEnd();
+ }
+ scrollAnimation.Clear();
+ }
+ }
+
+ // static constructor registers the control type
+ static ScrollableBase()
+ {
+ // ViewRegistry registers control type with DALi type registry
+ // also uses introspection to find any properties that need to be registered with type registry
+ CustomViewRegistry.Instance.Register(CreateInstance, typeof(ScrollableBase));
+ }
+
+ internal static CustomView CreateInstance()
+ {
+ return new ScrollableBase();
+ }
+
+ private void AnimateChildTo(int duration, float axisPosition)
+ {
+ Tizen.Log.Debug("ScrollableBase", "AnimationTo Animation Duration:" + duration + " Destination:" + axisPosition);
+
+ StopScroll(); // Will replace previous animation so will stop existing one.
+
+ if (scrollAnimation == null)
+ {
+ scrollAnimation = new Animation();
+ scrollAnimation.Finished += ScrollAnimationFinished;
+ }
+
+ scrollAnimation.Duration = duration;
+ scrollAnimation.DefaultAlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOutSine);
+ scrollAnimation.AnimateTo(mScrollingChild, (ScrollingDirection == Direction.Horizontal) ? "PositionX" : "PositionY", axisPosition);
+ scrolling = true;
+ OnScrollAnimationStart();
+ scrollAnimation.Play();
+ }
+
+ private void ScrollBy(float displacement, bool animate)
+ {
+ if (GetChildCount() == 0 || displacement == 0 || maxScrollDistance < 0)
+ {
+ return;
+ }
+
+ float childCurrentPosition = (ScrollingDirection == Direction.Horizontal) ? mScrollingChild.PositionX: mScrollingChild.PositionY;
+
+ Debug.WriteLineIf(LayoutDebugScrollableBase, "ScrollBy childCurrentPosition:" + childCurrentPosition +
+ " displacement:" + displacement,
+ " maxScrollDistance:" + maxScrollDistance );
+
+ childTargetPosition = childCurrentPosition + displacement; // child current position + gesture displacement
+
+ if(ScrollAvailableArea != null)
+ {
+ float minScrollPosition = ScrollingDirection == Direction.Horizontal? ScrollAvailableArea.X:ScrollAvailableArea.Y;
+ float maxScrollPosition = ScrollingDirection == Direction.Horizontal?
+ ScrollAvailableArea.X + ScrollAvailableArea.Width:
+ ScrollAvailableArea.Y + ScrollAvailableArea.Height;
+
+ childTargetPosition = Math.Min( -minScrollPosition, childTargetPosition );
+ childTargetPosition = Math.Max( -maxScrollPosition, childTargetPosition );
+ }
+ else
+ {
+ childTargetPosition = Math.Min(0, childTargetPosition);
+ childTargetPosition = Math.Max(-maxScrollDistance, childTargetPosition);
+ }
+
+ Debug.WriteLineIf( LayoutDebugScrollableBase, "ScrollBy currentAxisPosition:" + childCurrentPosition + "childTargetPosition:" + childTargetPosition);
+
+ if (animate)
+ {
+ // Calculate scroll animaton duration
+ float scrollDistance = 0.0f;
+ if (childCurrentPosition < childTargetPosition)
+ {
+ scrollDistance = Math.Abs(childCurrentPosition + childTargetPosition);
+ }
+ else
+ {
+ scrollDistance = Math.Abs(childCurrentPosition - childTargetPosition);
+ }
+
+ int duration = (int)((320*FlickAnimationSpeed) + (scrollDistance * FlickAnimationSpeed));
+ Debug.WriteLineIf(LayoutDebugScrollableBase, "Scroll Animation Duration:" + duration + " Distance:" + scrollDistance);
+
+ AnimateChildTo(duration, childTargetPosition);
+ }
+ else
+ {
+ // Set position of scrolling child without an animation
+ if (ScrollingDirection == Direction.Horizontal)
+ {
+ mScrollingChild.PositionX = childTargetPosition;
+ }
+ else
+ {
+ mScrollingChild.PositionY = childTargetPosition;
+ }
+ }
+ }
+
+ /// <summary>
+ /// you can override it to clean-up your own resources.
+ /// </summary>
+ /// <param name="type">DisposeTypes</param>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void Dispose(DisposeTypes type)
+ {
+ if (disposed)
+ {
+ return;
+ }
+
+ if (type == DisposeTypes.Explicit)
+ {
+ StopScroll();
+
+ if (mPanGestureDetector != null)
+ {
+ mPanGestureDetector.Detected -= OnPanGestureDetected;
+ mPanGestureDetector.Dispose();
+ mPanGestureDetector = null;
+ }
+
+ if (mTapGestureDetector != null)
+ {
+ mTapGestureDetector.Detected -= OnTapGestureDetected;
+ mTapGestureDetector.Dispose();
+ mTapGestureDetector = null;
+ }
+ }
+ base.Dispose(type);
+ }
+
+ private float CalculateDisplacementFromVelocity(float axisVelocity)
+ {
+ Tizen.Log.Debug("ScrollableBase", "axisVelocity:" + axisVelocity);
+ // Map: flick speed of range (2.0 - 6.0) to flick multiplier of range (0.7 - 1.6)
+ float speedMinimum = FlickThreshold;
+ float speedMaximum = FlickThreshold + 6.0f;
+ float multiplierMinimum = FlickDistanceMultiplierRange.X;
+ float multiplierMaximum = FlickDistanceMultiplierRange.Y;
+
+ float flickDisplacement = 0.0f;
+
+ float speed = Math.Min(4.0f,Math.Abs(axisVelocity));
+
+ Tizen.Log.Debug("ScrollableBase", "ScrollableBase Candidate Flick speed:" + speed);
+
+ if (speed > FlickThreshold)
+ {
+
+ // Flick length is the length of the ScrollableBase.
+ float flickLength = (ScrollingDirection == Direction.Horizontal) ? CurrentSize.Width : CurrentSize.Height;
+
+ // Calculate multiplier by mapping speed between the multiplier minimum and maximum.
+ multiplier =( (speed - speedMinimum) / ( (speedMaximum - speedMinimum) * (multiplierMaximum - multiplierMinimum) ) )+ multiplierMinimum;
+
+ flickDisplacement = ((flickLength * multiplier) * speed) * (axisVelocity > 0.0f ? 1.0f : -1.0f);
+
+ Tizen.Log.Debug("ScrollableBase", "axisVelocity:" + axisVelocity);
+ Tizen.Log.Debug("ScrollableBase", "Calculated FlickDisplacement[" + flickDisplacement);
+ Tizen.Log.Debug("ScrollableBase", "speed[" + speed);
+ Tizen.Log.Debug("ScrollableBase", "multiplier[" + multiplier);
+ }
+ return flickDisplacement;
+ }
+
+ private float CalculateMaximumScrollDistance()
+ {
+ int scrollingChildLength = 0;
+ int scrollerLength = 0;
+ if (ScrollingDirection == Direction.Horizontal)
+ {
+ Debug.WriteLineIf(LayoutDebugScrollableBase, "Horizontal");
+
+ scrollingChildLength = (int)mScrollingChild.Layout.MeasuredWidth.Size.AsRoundedValue();
+ scrollerLength = CurrentSize.Width;
+ }
+ else
+ {
+ Debug.WriteLineIf(LayoutDebugScrollableBase, "Vertical");
+ scrollingChildLength = (int)mScrollingChild.Layout.MeasuredHeight.Size.AsRoundedValue();
+ scrollerLength = CurrentSize.Height;
+ }
+
+ Debug.WriteLineIf(LayoutDebugScrollableBase, "ScrollBy maxScrollDistance:" + (scrollingChildLength - scrollerLength) +
+ " parent length:" + scrollerLength +
+ " scrolling child length:" + scrollingChildLength);
+
+ return Math.Max(scrollingChildLength - scrollerLength,0);
+ }
+
+ private void PageSnap()
+ {
+ Tizen.Log.Debug("ScrollableBase", "PageSnap with pan candidate totalDisplacement:" + totalDisplacementForPan +
+ " currentPage[" + CurrentPage + "]" );
+
+ var axisToCompare = ScrollingDirection == Direction.Horizontal ? mPageWidth : mPageHeight;
+
+ //Increment current page if total displacement enough to warrant a page change.
+ if (Math.Abs(totalDisplacementForPan) > (axisToCompare * ratioOfScreenWidthToCompleteScroll))
+ {
+ // if totalDisplacementForPan < 0 move index forward, backward otherwise
+ int pagesDiff = totalDisplacementForPan > 0.0f ? -1 : 1;
+ pagesDiff += (int)(-totalDisplacementForPan / axisToCompare);
+
+ Tizen.Log.Debug("ScrollableBase", $"totalDisplacement {totalDisplacementForPan}");
+ Tizen.Log.Debug("ScrollableBase", $"axisToCompare {axisToCompare}");
+ Tizen.Log.Debug("ScrollableBase", $"pages diff {pagesDiff}");
+ Tizen.Log.Debug("ScrollableBase", $"CurrentPge {CurrentPage}");
+ CurrentPage = Math.Clamp(CurrentPage + pagesDiff, 0, mScrollingChild.Children.Count - 1);
+ Tizen.Log.Debug("ScrollableBase", $"NextPage {CurrentPage}");
+ }
+
+ float destinationX;
+ // Animate to new page or reposition to current page
+ if (ScrollingDirection == Direction.Horizontal)
+ {
+ destinationX = -(mScrollingChild.Children[CurrentPage].Position.X + mScrollingChild.Children[CurrentPage].CurrentSize.Width/2 - CurrentSize.Width/2); // set to middle of current page
+ Tizen.Log.Debug("ScrollableBase", "Snapping to page[" + CurrentPage + "] to:" + destinationX + " from:" + mScrollingChild.PositionX);
+ } else
+ {
+ destinationX = -(mScrollingChild.Children[CurrentPage].Position.Y + mScrollingChild.Children[CurrentPage].CurrentSize.Height/2 - CurrentSize.Height/2); // set to middle of current page
+ Tizen.Log.Debug("ScrollableBase", "Snapping to page[" + CurrentPage + "] to:" + destinationX + " from:" + mScrollingChild.PositionY);
+ }
+ AnimateChildTo(ScrollDuration, destinationX);
+ }
+
+ private void Flick(float flickDisplacement)
+ {
+ Tizen.Log.Debug("ScrollableBase", $"flickDisplacement: {flickDisplacement}");
+ if (SnapToPage)
+ {
+ if ( ( flickWhenAnimating && scrolling == true) || ( scrolling == false) )
+ {
+ float axisToCompare = ScrollingDirection == Direction.Horizontal ? mPageWidth : mPageHeight;
+
+ int pagesDiff = (int)(-flickDisplacement / axisToCompare);
+ Tizen.Log.Debug("ScrollableBase", $"CurrentPage: {CurrentPage}");
+ Tizen.Log.Debug("ScrollableBase", $"pagasDiff: {pagesDiff}");
+
+ CurrentPage = Math.Clamp(CurrentPage + pagesDiff, 0, mScrollingChild.Children.Count - 1);
+
+ Tizen.Log.Debug("ScrollableBase", $"NextPage: {CurrentPage}");
+
+ float destinationX;
+ if (ScrollingDirection == Direction.Horizontal)
+ {
+ destinationX = -(mScrollingChild.Children[CurrentPage].Position.X + mScrollingChild.Children[CurrentPage].CurrentSize.Width/2.0f - CurrentSize.Width/2.0f); // set to middle of current page
+ } else
+ {
+ destinationX = -(mScrollingChild.Children[CurrentPage].Position.Y + mScrollingChild.Children[CurrentPage].CurrentSize.Height/2.0f - CurrentSize.Height/2.0f); // set to middle of current page
+ }
+ Debug.WriteLineIf(LayoutDebugScrollableBase, "Snapping to :" + destinationX);
+ AnimateChildTo(ScrollDuration, destinationX);
+ }
+ }
+ else
+ {
+ ScrollBy(flickDisplacement, true); // Animate flickDisplacement.
+ }
+ }
+
+ private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
+ {
+ if (e.PanGesture.State == Gesture.StateType.Started)
+ {
+ Debug.WriteLineIf(LayoutDebugScrollableBase, "Gesture Start");
+ if (scrolling && !SnapToPage)
+ {
+ StopScroll();
+ }
+ maxScrollDistance = CalculateMaximumScrollDistance();
+ totalDisplacementForPan = 0.0f;
+ OnScrollDragStart();
+ }
+ else if (e.PanGesture.State == Gesture.StateType.Continuing)
+ {
+ if (ScrollingDirection == Direction.Horizontal)
+ {
+ ScrollBy(e.PanGesture.Displacement.X, false);
+ totalDisplacementForPan += e.PanGesture.Displacement.X;
+ }
+ else
+ {
+ ScrollBy(e.PanGesture.Displacement.Y, false);
+ totalDisplacementForPan += e.PanGesture.Displacement.Y;
+ }
+ Debug.WriteLineIf(LayoutDebugScrollableBase, "OnPanGestureDetected Continue totalDisplacementForPan:" + totalDisplacementForPan);
+ }
+ else if (e.PanGesture.State == Gesture.StateType.Finished)
+ {
+ float axisVelocity = (ScrollingDirection == Direction.Horizontal) ? e.PanGesture.Velocity.X : e.PanGesture.Velocity.Y;
+ float flickDisplacement = CalculateDisplacementFromVelocity(axisVelocity);
+
+ flickDisplacement = CalculateDisplacementFromVelocity(axisVelocity);
+
+ Tizen.Log.Debug("ScrollableBase", "FlickDisplacement:" + flickDisplacement + "TotalDisplacementForPan:" + totalDisplacementForPan);
+ OnScrollDragEnd();
+
+ if (flickDisplacement > 0 | flickDisplacement < 0)// Flick detected
+ {
+ Tizen.Log.Debug("ScrollableBase", "Flick detected from Pan");
+ Flick(flickDisplacement);
+ }
+ else
+ {
+ // End of panning gesture but was not a flick
+ if (SnapToPage)
+ {
+ PageSnap();
+ }
+ }
+ totalDisplacementForPan = 0;
+ }
+ }
+
+ private new void OnTapGestureDetected(object source, TapGestureDetector.DetectedEventArgs e)
+ {
+ if (e.TapGesture.Type == Gesture.GestureType.Tap)
+ {
+ // Stop scrolling if tap detected (press then relase).
+ // Unless in Pages mode, do not want a page change to stop part way.
+ if(scrolling && !SnapToPage)
+ {
+ StopScroll();
+ }
+ }
+ }
+
+ private void ScrollAnimationFinished(object sender, EventArgs e)
+ {
+ scrolling = false;
+ OnScrollAnimationEnd();
+ }
+
+ private View eventsView = null;
+ public View EventsView
+ {
+ get
+ {
+ return eventsView;
+ }
+ set
+ {
+ if (eventsView)
+ {
+ mPanGestureDetector.Detach(eventsView);
+ mTapGestureDetector.Detach(eventsView);
+ }
+ eventsView = value;
+ mPanGestureDetector.Attach(value);
+ mTapGestureDetector.Attach(value);
+ }
+ }
+ }
+
+} // namespace
--- /dev/null
+using System;
+
+namespace Oobe.Common.Interfaces
+{
+ public interface IProcessNavigation
+ {
+ /// <summary>
+ /// Goto next process step.
+ /// </summary>
+ void Next();
+
+ /// <summary>
+ /// Goto previous process step.
+ /// </summary>
+ void Previous();
+
+ /// <summary>
+ /// Finishes process.
+ /// </summary>
+ void Finish();
+ }
+}
--- /dev/null
+using System;
+using Tizen.NUI.BaseComponents;
+using Oobe.Common.Interfaces;
+
+namespace Oobe.Common.Interfaces
+{
+ public abstract class ProcessStep
+ {
+ protected IProcessNavigation Navigation { get; private set; }
+ private bool initialized;
+
+ public void Initialize()
+ {
+ if (initialized)
+ return;
+
+ this.OnInitialized();
+ initialized = true;
+ }
+
+ public virtual void Shutdown()
+ {
+ if (!initialized)
+ return;
+
+ this.OnShutdown();
+ initialized = false;
+ }
+
+ public virtual void Reset()
+ {
+ OnReset();
+ }
+
+ public virtual void OnInitialized()
+ {
+ }
+
+ public virtual void OnShutdown()
+ {
+ }
+
+ public virtual void OnReset()
+ {
+ }
+
+ public virtual View CreateView(IProcessNavigation nav)
+ {
+ return null;
+ }
+ }
+ }
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Library</OutputType>
+ <TargetFramework>tizen80</TargetFramework>
+ <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Tizen.NET" Version="8.0.0.15148">
+ <ExcludeAssets>Runtime</ExcludeAssets>
+ </PackageReference>
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Compile Update="Resources\Translations.Designer.cs">
+ <DesignTime>True</DesignTime>
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Translations.resx</DependentUpon>
+ </Compile>
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Update="Resources\Translations.ko-KR.resx">
+ <Generator>PublicResXFileCodeGenerator</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Update="Resources\Translations.pl-PL.resx">
+ <Generator>PublicResXFileCodeGenerator</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Update="Resources\Translations.resx">
+ <Generator>PublicResXFileCodeGenerator</Generator>
+ <LastGenOutput>Translations.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ </ItemGroup>
+</Project>
--- /dev/null
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Oobe.Common.Resources {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ public class Translations {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Translations() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Oobe.Common.Resources.Translations", typeof(Translations).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Title.
+ /// </summary>
+ public static string _Title {
+ get {
+ return ResourceManager.GetString("_Title", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Choose language.
+ /// </summary>
+ public static string CHOOSE_LANGUAGE {
+ get {
+ return ResourceManager.GetString("CHOOSE_LANGUAGE", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Choose region.
+ /// </summary>
+ public static string CHOOSE_REGION {
+ get {
+ return ResourceManager.GetString("CHOOSE_REGION", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Choose Wi-Fi Network.
+ /// </summary>
+ public static string CHOOSE_WIFI_NETWORK {
+ get {
+ return ResourceManager.GetString("CHOOSE_WIFI_NETWORK", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to CONTINUE.
+ /// </summary>
+ public static string CONTINUE {
+ get {
+ return ResourceManager.GetString("CONTINUE", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to GET STARTED.
+ /// </summary>
+ public static string GET_STARTED {
+ get {
+ return ResourceManager.GetString("GET_STARTED", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to I have read and agree to terms and conditions.
+ /// </summary>
+ public static string I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS {
+ get {
+ return ResourceManager.GetString("I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Poland.
+ /// </summary>
+ public static string POLAND {
+ get {
+ return ResourceManager.GetString("POLAND", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to PREVIOUS.
+ /// </summary>
+ public static string PREVIOUS {
+ get {
+ return ResourceManager.GetString("PREVIOUS", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to SKIP.
+ /// </summary>
+ public static string SKIP {
+ get {
+ return ResourceManager.GetString("SKIP", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to South Korea.
+ /// </summary>
+ public static string SOUTH_KOREA {
+ get {
+ return ResourceManager.GetString("SOUTH_KOREA", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Terms and conditions.
+ /// </summary>
+ public static string TERMS_AND_CONDITIONS {
+ get {
+ return ResourceManager.GetString("TERMS_AND_CONDITIONS", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to United Kingdom.
+ /// </summary>
+ public static string UNITED_KINGDOM {
+ get {
+ return ResourceManager.GetString("UNITED_KINGDOM", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Welcome to Tizen IoT!.
+ /// </summary>
+ public static string WELCOME_TITLE {
+ get {
+ return ResourceManager.GetString("WELCOME_TITLE", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to (You must scroll down and read the whole text above).
+ /// </summary>
+ public static string YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE {
+ get {
+ return ResourceManager.GetString("YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE", resourceCulture);
+ }
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="_Title" xml:space="preserve">
+ <value>변경사항 저장 안 함</value>
+ </data>
+ <data name="CONTINUE" xml:space="preserve">
+ <value>계속</value>
+ </data>
+ <data name="PREVIOUS" xml:space="preserve">
+ <value>이전</value>
+ </data>
+ <data name="SKIP" xml:space="preserve">
+ <value>건너 뛰기</value>
+ </data>
+ <data name="GET_STARTED" xml:space="preserve">
+ <value>시작</value>
+ </data>
+ <data name="CHOOSE_LANGUAGE" xml:space="preserve">
+ <value>언어 선택</value>
+ </data>
+ <data name="CHOOSE_REGION" xml:space="preserve">
+ <value>선택 지역</value>
+ </data>
+ <data name="TERMS_AND_CONDITIONS" xml:space="preserve">
+ <value>이용 약관</value>
+ </data>
+ <data name="YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE" xml:space="preserve">
+ <value>(전체 이용 약관을 스크롤해야 동의가 가능합니다)</value>
+ </data>
+ <data name="I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS" xml:space="preserve">
+ <value>이용 약관을 읽었으며 이에 동의합니다</value>
+ </data>
+ <data name="WELCOME_TITLE" xml:space="preserve">
+ <value>환영합니다 Tizen IoT!</value>
+ </data>
+ <data name="CHOOSE_WIFI_NETWORK" xml:space="preserve">
+ <value>Wi-Fi 연결</value>
+ </data>
+ <data name="UNITED_KINGDOM" xml:space="preserve">
+ <value>영국</value>
+ </data>
+ <data name="SOUTH_KOREA" xml:space="preserve">
+ <value>대한민국</value>
+ </data>
+ <data name="POLAND" xml:space="preserve">
+ <value>폴란드</value>
+ </data>
+</root>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="CONTINUE" xml:space="preserve">
+ <value>DALEJ</value>
+ </data>
+ <data name="PREVIOUS" xml:space="preserve">
+ <value>WSTECZ</value>
+ </data>
+ <data name="SKIP" xml:space="preserve">
+ <value>POMIŃ</value>
+ </data>
+ <data name="GET_STARTED" xml:space="preserve">
+ <value>ROZPOCZNIJ</value>
+ </data>
+ <data name="CHOOSE_LANGUAGE" xml:space="preserve">
+ <value>Wybierz język</value>
+ </data>
+ <data name="CHOOSE_REGION" xml:space="preserve">
+ <value>Wybierz region</value>
+ </data>
+ <data name="TERMS_AND_CONDITIONS" xml:space="preserve">
+ <value>Warunki użytkowania</value>
+ </data>
+ <data name="YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE" xml:space="preserve">
+ <value>(Musisz przewinąć i przeczytać całą treść)</value>
+ </data>
+ <data name="I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS" xml:space="preserve">
+ <value>Przeczytałem i zgadzam się na warunki użytkowania</value>
+ </data>
+ <data name="WELCOME_TITLE" xml:space="preserve">
+ <value>Witaj w Tizen IoT!</value>
+ </data>
+ <data name="CHOOSE_WIFI_NETWORK" xml:space="preserve">
+ <value>Połącz z Wi-Fi</value>
+ </data>
+ <data name="UNITED_KINGDOM" xml:space="preserve">
+ <value>Zjednoczone Królestwo</value>
+ </data>
+ <data name="SOUTH_KOREA" xml:space="preserve">
+ <value>Korea Południowa</value>
+ </data>
+ <data name="POLAND" xml:space="preserve">
+ <value>Polska</value>
+ </data>
+</root>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="_Title" xml:space="preserve">
+ <value>Title</value>
+ </data>
+ <data name="CONTINUE" xml:space="preserve">
+ <value>CONTINUE</value>
+ </data>
+ <data name="PREVIOUS" xml:space="preserve">
+ <value>PREVIOUS</value>
+ </data>
+ <data name="SKIP" xml:space="preserve">
+ <value>SKIP</value>
+ </data>
+ <data name="GET_STARTED" xml:space="preserve">
+ <value>GET STARTED</value>
+ </data>
+ <data name="CHOOSE_LANGUAGE" xml:space="preserve">
+ <value>Choose language</value>
+ </data>
+ <data name="CHOOSE_REGION" xml:space="preserve">
+ <value>Choose region</value>
+ </data>
+ <data name="TERMS_AND_CONDITIONS" xml:space="preserve">
+ <value>Terms and conditions</value>
+ </data>
+ <data name="YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE" xml:space="preserve">
+ <value>(You must scroll down and read the whole text above)</value>
+ </data>
+ <data name="I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS" xml:space="preserve">
+ <value>I have read and agree to terms and conditions</value>
+ </data>
+ <data name="WELCOME_TITLE" xml:space="preserve">
+ <value>Welcome to Tizen IoT!</value>
+ </data>
+ <data name="CHOOSE_WIFI_NETWORK" xml:space="preserve">
+ <value>Choose Wi-Fi Network</value>
+ </data>
+ <data name="UNITED_KINGDOM" xml:space="preserve">
+ <value>United Kingdom</value>
+ </data>
+ <data name="SOUTH_KOREA" xml:space="preserve">
+ <value>South Korea</value>
+ </data>
+ <data name="POLAND" xml:space="preserve">
+ <value>Poland</value>
+ </data>
+</root>
--- /dev/null
+using System;
+using System.Runtime.InteropServices;
+using static Oobe.Common.Services.Vconf;
+
+internal static partial class Interop
+{
+ internal static partial class Vconf
+ {
+ private const string LIBRARY_VCONF = "libvconf.so.0";
+
+ [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_bool")]
+ internal static extern int VconfGetBool(string key, out bool val);
+
+ [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_bool")]
+ internal static extern int VconfSetBool(string key, bool intval);
+
+ [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_int")]
+ internal static extern int VconfGetInt(string key, out int val);
+
+ [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_int")]
+ internal static extern int VconfSetInt(string key, int intval);
+
+ [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_str")]
+ internal static extern string VconfGetStr(string key);
+
+ [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_str")]
+ internal static extern int VconfSetStr(string key, string value);
+
+ [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_notify_key_changed")]
+ internal static extern void VconfNotifyKeyChanged(string key, NotificationCallback callback, IntPtr userData);
+
+ [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_ignore_key_changed")]
+ internal static extern void VconfIgnoreKeyChanged(string key, NotificationCallback callback);
+ }
+}
--- /dev/null
+using System;
+using System.Runtime.InteropServices;
+using Oobe.Common.Utils;
+using static Interop.Vconf;
+
+namespace Oobe.Common.Services
+{
+ /// <summary>
+ /// This class provides the API to use Vconf methods.
+ /// Vconf is a global configuration registry for the device.
+ /// </summary>
+ public static class Vconf
+ {
+ /// <summary>
+ /// Delegate for notification callbacks.
+ /// </summary>
+ /// <param name="node">Pointer to event node.</param>
+ /// <param name="userData">Pointer to event user data.</param>
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public delegate void NotificationCallback(IntPtr node, IntPtr userData);
+
+ /// <summary>
+ /// Gets a boolean value from Vconf.
+ /// </summary>
+ /// <param name="key">The key in Vconf.</param>
+ /// <returns>A value assigned to the specified key.</returns>
+ public static bool GetBool(string key)
+ {
+ int errorCode = VconfGetBool(key, out bool value);
+ if (errorCode != 0)
+ {
+ throw ExceptionFactory.GetException(errorCode);
+ }
+
+ return value;
+ }
+
+ /// <summary>
+ /// Sets a boolean value in Vconf.
+ /// </summary>
+ /// <param name="key">The key in Vconf.</param>
+ /// <param name="value">The value to be set.</param>
+ public static void SetBool(string key, bool value)
+ {
+ int errorCode = VconfSetBool(key, value);
+ if (errorCode != 0)
+ {
+ throw ExceptionFactory.GetException(errorCode);
+ }
+ }
+
+ /// <summary>
+ /// Gets an integer value from Vconf.
+ /// </summary>
+ /// <param name="key">The key in Vconf.</param>
+ /// <returns>A value assigned to the specified key.</returns>
+ public static int GetInt(string key)
+ {
+ int errorCode = VconfGetInt(key, out int value);
+ if (errorCode != 0)
+ {
+ throw ExceptionFactory.GetException(errorCode);
+ }
+
+ return value;
+ }
+
+ /// <summary>
+ /// Sets an integer value in Vconf.
+ /// </summary>
+ /// <param name="key">The key in Vconf.</param>
+ /// <param name="value">The value to be set.</param>
+ public static void SetInt(string key, int value)
+ {
+ int errorCode = VconfSetInt(key, value);
+ if (errorCode != 0)
+ {
+ throw ExceptionFactory.GetException(errorCode);
+ }
+ }
+
+ /// <summary>
+ /// Gets a string value from Vconf.
+ /// </summary>
+ /// <param name="key">The key in Vconf.</param>
+ /// <returns>A value assigned to the specified key.</returns>
+ public static string GetString(string key)
+ {
+ return VconfGetStr(key);
+ }
+
+ /// <summary>
+ /// Sets a string value in Vconf.
+ /// </summary>
+ /// <param name="key">The key in Vconf.</param>
+ /// <param name="value">The value to be set.</param>
+ public static void SetString(string key, string value)
+ {
+ int errorCode = VconfSetStr(key, value);
+ if (errorCode != 0)
+ {
+ throw ExceptionFactory.GetException(errorCode);
+ }
+ }
+
+ /// <summary>
+ /// Registers a callback to a KeyChanged event.
+ /// </summary>
+ /// <param name="key">The key to be observed for changes.</param>
+ /// <param name="callback">The callback to be registered.</param>
+ /// <param name="userData">Additional data.</param>
+ public static void NotifyKeyChanged(string key, NotificationCallback callback, IntPtr? userData = null)
+ {
+ VconfNotifyKeyChanged(key, callback, userData ?? IntPtr.Zero);
+ }
+
+ /// <summary>
+ /// Unregisters a callback from a KeyChanged event.
+ /// </summary>
+ /// <param name="key">The key that was observed for changes.</param>
+ /// <param name="callback">The callback to be unregistered.</param>
+ public static void IgnoreKeyChanged(string key, NotificationCallback callback)
+ {
+ VconfIgnoreKeyChanged(key, callback);
+ }
+ }
+}
--- /dev/null
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI;
+
+namespace Oobe.Common.Styles
+{
+ public class ButtonStyles
+ {
+ public static ButtonStyle Next = GetNextButtonStyle();
+ public static ButtonStyle Previous = GetPreviousButtonStyle();
+ public static ButtonStyle Skip = GetSkipButtonStyle();
+
+ private static ButtonStyle GetPreviousButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_action.png",
+ Pressed = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_pressed.png",
+ Disabled = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_disabled.png",
+ },
+ Text = new TextLabelStyle
+ {
+ PointSize = new Selector<float?>
+ {
+ Normal = 22.0f,
+ Pressed = 24.0f
+ },
+ EnableMarkup = true,
+ TranslatableText = "PREVIOUS",
+ TextColor = new Selector<Color>
+ {
+ Normal = new Color(0.0f, 20.0f / 255.0f, 71 / 255.0f, 1.0f),
+ Pressed = new Color(41.0f / 255.0f, 91.0f / 255.0f, 178 / 255.0f, 1.0f),
+ },
+ FontFamily = GetNavigationFont(),
+ },
+ Size2D = new Size2D(240, 72),
+ };
+
+ private static ButtonStyle GetSkipButtonStyle()
+ {
+ var style = GetNextButtonStyle();
+ style.Text.TranslatableText = "SKIP";
+ return style;
+ }
+
+ private static ButtonStyle GetNextButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_active.svg",
+ Pressed = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_selected.svg",
+ Disabled = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_disabled.svg",
+ },
+ Text = new TextLabelStyle
+ {
+ PointSize = new Selector<float?>
+ {
+ Normal = 22.0f,
+ Pressed = 24.0f
+ },
+ TextColor = Color.White,
+ TranslatableText = "CONTINUE",
+ FontFamily = GetNavigationFont(),
+ },
+ Size2D = new Size2D(240, 72),
+ };
+
+ private static Selector<string> GetNavigationFont()
+ {
+ return new Selector<string>
+ {
+ Normal = "BreezeSans",
+ };
+ }
+ }
+}
--- /dev/null
+using System;
+using Tizen.NUI.Components;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace Oobe.Common.Styles
+{
+ public static class ButtonsExtensions
+ {
+ public static PropertyMap GetFontStyle(this Button button)
+ {
+ // workaround for limitation of settings FontStyle of button text
+ // throught TextLabelStyle class
+ foreach (View child in button.Children)
+ {
+ if (child is TextLabel label)
+ {
+ return label.FontStyle;
+ }
+ }
+ return null;
+ }
+
+ public static void SetFontStyle(this Button button, PropertyMap map)
+ {
+ // workaround for limitation of settings FontStyle of button text
+ // throught TextLabelStyle class
+ foreach (View child in button.Children)
+ {
+ if (child is TextLabel label)
+ {
+ label.FontStyle = map;
+ break;
+ }
+ }
+ }
+ }
+}
--- /dev/null
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI;
+using Oobe.Common.Controls;
+
+namespace Oobe.Common.Styles
+{
+ public class CarouselPickerStyles
+ {
+ public static CarouselPickerStyle Default = new CarouselPickerStyle{
+ CenterText = new TextLabelStyle{
+ Size2D = new Size2D(312, 26),
+ PixelSize = 20.0f,
+ Margin = new Extents(24, 24, 16, 16),
+ HorizontalAlignment = HorizontalAlignment.Center,
+ TextColor = new Color(0, 20.0f / 255.0f, 71.0f / 255.0f, 1.0f),
+ Opacity = 1.0f,
+ },
+ OuterText = new TextLabelStyle{
+ Size2D = new Size2D(312, 26),
+ PixelSize = 20.0f,
+ Margin = new Extents(24, 24, 16, 16),
+ HorizontalAlignment = HorizontalAlignment.Center,
+ TextColor = new Color(195.0f / 255.0f, 202.0f / 255.0f, 210.0f / 255.0f, 1.0f),
+ Opacity = 0.4f,
+ },
+ LinesColor = new Color(0, 20.0f / 255.0f, 71.0f / 255.0f, 1.0f),
+ };
+ }
+}
--- /dev/null
+using Tizen.NUI;
+
+namespace Oobe.Common.Styles
+{
+ public static class FontsStyles
+ {
+ public static PropertyMap AddLightFontStyle(this PropertyMap propertyMap)
+ {
+ return propertyMap.Add("weight", new PropertyValue("light"));
+ }
+
+ public static PropertyMap AddRegularFontStyle(this PropertyMap propertyMap)
+ {
+ return propertyMap.Add("weight", new PropertyValue("regular"));
+ }
+
+ public static PropertyMap AddBoldFontStyle(this PropertyMap propertyMap)
+ {
+ return propertyMap.Add("weight", new PropertyValue("bold"));
+ }
+ }
+}
--- /dev/null
+using Tizen.NUI;
+using System;
+
+namespace Oobe.Common.Utils
+{
+ public static class ColorUtils
+ {
+ // source: https://www.cs.rit.edu/~ncs/color/t_convert.html
+ public static Vector3 ToHSV(this Color color)
+ {
+ float h, s, v;
+ float min, max, delta;
+
+ min = Math.Min(color.R, Math.Min(color.G, color.B));
+ max = Math.Max(color.R, Math.Max(color.G, color.B));
+ v = max;
+
+ if (max == min)
+ {
+ // in grayscale
+ return new Vector3(0.0f, 0.0f, v);
+ }
+
+ delta = max - min;
+ s = delta / max; // s
+
+ if( color.R == max )
+ h = ( color.G - color.B ) / delta; // between yellow & magenta
+ else if( color.G == max )
+ h = 2 + ( color.B - color.R ) / delta; // between cyan & yellow
+ else
+ h = 4 + ( color.R - color.G ) / delta; // between magenta & cyan
+
+ h *= 60; // degrees
+ if( h < 0 )
+ h += 360;
+
+ return new Vector3(h, s, v);
+ }
+
+ public static Color ColorFromHSV(Vector3 hsv)
+ {
+ int i;
+ float r, g, b;
+ float f, p, q, t;
+ float h = hsv[0];
+ float s = hsv[1];
+ float v = hsv[2];
+
+ if (s == 0) {
+ // achromatic (grey)
+ r = g = b = v;
+ return new Color(r, g, b, 1.0f);
+ }
+
+ h /= 60; // sector 0 to 5
+ i = (int)Math.Floor( h );
+ f = h - i; // factorial part of h
+ p = v * ( 1 - s );
+ q = v * ( 1 - s * f );
+ t = v * ( 1 - s * ( 1 - f ) );
+
+ switch( i ) {
+ case 0:
+ r = v;
+ g = t;
+ b = p;
+ break;
+ case 1:
+ r = q;
+ g = v;
+ b = p;
+ break;
+ case 2:
+ r = p;
+ g = v;
+ b = t;
+ break;
+ case 3:
+ r = p;
+ g = q;
+ b = v;
+ break;
+ case 4:
+ r = t;
+ g = p;
+ b = v;
+ break;
+ default: // case 5:
+ r = v;
+ g = p;
+ b = q;
+ break;
+ }
+ return new Color(r, g, b, 1.0f);
+ }
+ }
+}
--- /dev/null
+using System;
+using Tizen.Internals.Errors;
+
+namespace Oobe.Common.Utils
+{
+ /// <summary>
+ /// This class provides the API to translate Tizen Error Codes to .NET exceptions.
+ /// </summary>
+ public static class ExceptionFactory
+ {
+ /// <summary>
+ /// Gets the exception that best corresponds to the given error code.
+ /// </summary>
+ /// <param name="errorCode">The Tizen Error Code to be translated.</param>
+ /// <returns>An exception object.</returns>
+ public static Exception GetException(int errorCode)
+ {
+ var msg = ErrorFacts.GetErrorMessage(errorCode);
+ var c = (ErrorCode)errorCode;
+
+ switch (c)
+ {
+ case ErrorCode.NotSupported:
+ return new NotSupportedException(msg);
+
+ case ErrorCode.OutOfMemory:
+ return new OutOfMemoryException(msg);
+
+ case ErrorCode.InvalidParameter:
+ return new ArgumentException(msg);
+
+ case ErrorCode.InvalidOperation:
+ return new InvalidOperationException(msg);
+
+ case ErrorCode.PermissionDenied:
+ return new UnauthorizedAccessException(msg);
+
+ default:
+ return new Exception(msg);
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace Oobe.Common.Utils
+{
+ public class Popup
+ {
+ private View view;
+ private Layer layer = null;
+
+ public Popup(View view, bool centered = false)
+ {
+ this.view = view;
+ if (centered)
+ {
+ view.PositionUsesPivotPoint = true;
+ view.PivotPoint = new Position(0.5f, 0.5f);
+ view.ParentOrigin = new Position(0.5f, 0.5f);
+ }
+ }
+
+ public void Show()
+ {
+ if (layer != null)
+ {
+ layer.Visibility = true;
+ }
+ else
+ {
+ ShowCore();
+ }
+ }
+
+ public void Hide()
+ {
+ if (layer != null)
+ {
+ layer.Visibility = false;
+ }
+ }
+
+ public void Dismiss()
+ {
+ if (layer != null)
+ {
+ Window.Instance.RemoveLayer(layer);
+ layer.Dispose();
+ layer = null;
+ }
+ }
+
+ private void ShowCore()
+ {
+ Dismiss();
+ layer = new Layer();
+ var gray = new Tizen.NUI.Components.Control()
+ {
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ BackgroundColor = new Color(0f, 0f, 0f, 0.1f),
+ };
+ gray.TouchEvent += (s, e) =>
+ {
+ if (e.Touch.GetState(0) == PointStateType.Up)
+ {
+ Dismiss();
+ }
+ return true;
+ };
+ layer.Add(gray);
+
+ view.TouchEvent += (s, e) => false; //prevent gray view reacting
+ layer.Add(view);
+ Window.Instance.AddLayer(layer);
+ }
+ }
+}
--- /dev/null
+<svg id="_02_CTA_empty_selected" data-name="02_CTA_empty_selected" xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">
+ <rect id="Rectangle_346" data-name="Rectangle 346" width="240" height="72" rx="28" fill="#0a0e4a"/>
+</svg>
--- /dev/null
+<svg id="_02_CTA_empty_disabled" data-name="02_CTA_empty_disabled" xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">
+ <rect id="Rectangle_346" data-name="Rectangle 346" width="240" height="72" rx="28" fill="#c3cad2"/>
+</svg>
--- /dev/null
+<svg id="_02_CTA_empty_selected" data-name="02_CTA_empty_selected" xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">
+ <rect id="Rectangle_346" data-name="Rectangle 346" width="240" height="72" rx="28" fill="#2b5fb9"/>
+</svg>
--- /dev/null
+using Oobe.Common.Interfaces;
+using Oobe.Common.Styles;
+using Tizen.NUI;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using Oobe.Language.Model;
+using Oobe.Common.Controls;
+using Oobe.Common.Utils;
+using Oobe.Common.Resources;
+using System.Linq;
+using System.Globalization;
+using System;
+
+namespace Oobe.Language
+{
+ public class LanguageStep : ProcessStep
+ {
+ private LanguageManger manager;
+
+ public LanguageStep() : base()
+ {
+ }
+
+ public override void OnInitialized()
+ {
+ manager = new LanguageManger();
+ }
+
+ public override View CreateView(IProcessNavigation nav)
+ {
+ View container = new View();
+
+ TextLabel title = new TextLabel();
+ title.TranslatableText = "CHOOSE_LANGUAGE";
+ title.Position2D = new Position2D(410, 160);
+ title.Size2D = new Size2D(364, 58);
+ title.TextColor = new Color(0, 20.0f / 255.0f, 71.0f / 255.0f, 1.0f);
+ title.HorizontalAlignment = HorizontalAlignment.Center;
+ title.Ellipsis = false;
+ title.PixelSize = 48.0f;
+ title.FontFamily = "BreezeSans";
+ title.FontStyle = new PropertyMap().AddLightFontStyle();
+
+ var carousel = new CarouselPicker(CarouselPickerStyles.Default);
+ carousel.Position2D = new Position2D(412, 242);
+ carousel.Size2D = new Size2D(360, 249);
+
+ foreach (LanguageInfo info in manager.Languages)
+ {
+ CarouselPickerItemData item = new CarouselPickerItemData();
+ item.Text = info.LocalName;
+ carousel.AddItem(item);
+ }
+
+ int currentIndex = manager.Languages.FindIndex(x => x == manager.CurrentLanguage);
+ carousel.SelectedItemIndex = currentIndex;
+
+ Button btn = new Button(ButtonStyles.Next);
+ btn.Position2D = new Position2D(888, 512);
+ btn.ClickEvent += (obj, args) =>
+ {
+ if (carousel.SelectedItemIndex >= 0 && carousel.SelectedItemIndex < manager.Languages.Count)
+ {
+ var lang = manager.Languages[carousel.SelectedItemIndex];
+ manager.CurrentLanguage = lang;
+ }
+ nav.Next();
+ };
+ btn.SetFontStyle(new PropertyMap().AddBoldFontStyle());
+
+ carousel.SelectedItemChanged += (sender, args) =>
+ {
+ if (carousel.SelectedItemIndex >= 0 && carousel.SelectedItemIndex < manager.Languages.Count)
+ {
+ string language = manager.Languages[carousel.SelectedItemIndex].Code.Replace("_", "-");
+ var culture = CultureInfo.CreateSpecificCulture(language);
+ title.Text = Translations.ResourceManager.GetString("CHOOSE_LANGUAGE", culture);
+ btn.Text = Translations.ResourceManager.GetString("CONTINUE", culture);
+ }
+ };
+
+ container.Add(title);
+ container.Add(btn);
+ container.Add(carousel);
+
+ // workaround issue with ScrollableBase not properly scrolling
+ // to nth page during creation
+ Timer timer = new Timer(500);
+ timer.Tick += (sender, args) => {
+ int index = manager.Languages.FindIndex(x => x == manager.CurrentLanguage);
+ carousel.SelectedItemIndex = index;
+ return false;
+ };
+ timer.Start();
+
+ return container;
+ }
+ }
+}
--- /dev/null
+using System.Xml.Serialization;
+
+namespace Oobe.Language.Model
+{
+ public class LanguageInfo
+ {
+ [XmlAttribute("code")]
+ public string Code { get; set; }
+ [XmlAttribute("name_en")]
+ public string EnglishName { get; set; }
+ [XmlAttribute("name_local")]
+ public string LocalName { get; set; }
+ [XmlAttribute("message")]
+ public string Message { get; set; }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Oobe.Language.Model
+{
+ [XmlRoot("languages")]
+ public class LanguageInfoList
+ {
+ [XmlElement("language")]
+ public List<LanguageInfo> Languages { get; set; }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.Collections.Generic;
+using Tizen.System;
+using System.Linq;
+using System.IO;
+using System.Xml.Serialization;
+
+namespace Oobe.Language.Model
+{
+ public class LanguageManger
+ {
+ public LanguageManger()
+ {
+ var filename = Tizen.Applications.CoreApplication.Current.DirectoryInfo.Resource + "languages_OOBE.xml";
+
+ using (FileStream xml = File.Open(filename, FileMode.Open, FileAccess.Read))
+ {
+ var xs = new XmlSerializer(typeof(LanguageInfoList));
+ var languageList = (LanguageInfoList)xs.Deserialize(xml);
+ Languages = languageList.Languages;
+ }
+ }
+
+ public List<LanguageInfo> Languages { get; private set; }
+
+ public LanguageInfo CurrentLanguage
+ {
+ get
+ {
+ return Languages.Single(s => s.Code == SystemSettings.LocaleLanguage);
+ }
+ set
+ {
+ if (value != null)
+ {
+ SystemSettings.LocaleLanguage = value.Code;
+ }
+ }
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Library</OutputType>
+ <TargetFramework>tizen80</TargetFramework>
+ <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Tizen.NET" Version="8.0.0.15148">
+ <ExcludeAssets>Runtime</ExcludeAssets>
+ </PackageReference>
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\Oobe.Common\Oobe.Common.csproj" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Folder Include="res\" />
+ </ItemGroup>
+</Project>
--- /dev/null
+<?xml version="1.0"?>
+<languages>
+ <language code="ko_KR" name_en="Korean" name_local="한국어" message="언어 선택" />
+ <language code="en_US" name_en="English (US)" name_local="English" message="Select your language" />
+ <language code="pl_PL" name_en="Polish" name_local="Polski" message="Wybierz swój język" />
+</languages>
--- /dev/null
+using System.Xml.Serialization;
+
+namespace Oobe.Region.Model
+{
+ public class RegionInfo
+ {
+ [XmlAttribute("code")]
+ public string CountryCode { get; set; }
+ [XmlAttribute("name")]
+ public string Name { get; set; }
+ [XmlAttribute("timezone")]
+ public string Timezone{ get; set; }
+ [XmlAttribute("cityname")]
+ public string CityName { get; set; }
+ [XmlAttribute("id")]
+ public string Id { get; set; }
+
+ }
+}
--- /dev/null
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Oobe.Region.Model
+{
+ [XmlRoot("regions")]
+ public class RegionInfoList
+ {
+ [XmlElement("region")]
+ public List<RegionInfo> Regions { get; set; }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Xml.Serialization;
+using Tizen.System;
+using Oobe.Common.Services;
+using System;
+
+namespace Oobe.Region.Model
+{
+ public class RegionManager
+ {
+ private const string CountryCodeVconfKey = "db/setting/country_code";
+ private const string CityNameIdVconfKey = "db/setting/cityname_id";
+
+ public RegionManager()
+ {
+ var filename = Tizen.Applications.CoreApplication.Current.DirectoryInfo.Resource + "regions_OOBE.xml";
+
+ using (FileStream xml = File.Open(filename, FileMode.Open, FileAccess.Read))
+ {
+ var xs = new XmlSerializer(typeof(RegionInfoList));
+ var regionsList = (RegionInfoList)xs.Deserialize(xml);
+ Regions = regionsList.Regions;
+ }
+ }
+
+ public List<RegionInfo> Regions { get; private set; }
+
+ public RegionInfo CurrentRegion
+ {
+ get
+ {
+ return Regions.Single(s => s.Timezone == Vconf.GetString(CountryCodeVconfKey));
+ }
+ set
+ {
+ if (value != null)
+ {
+ SystemSettings.LocaleTimeZone = value.Timezone;
+ SystemSettings.LocaleCountry = value.CountryCode;
+ try {
+ Vconf.SetString(CountryCodeVconfKey, value.CountryCode);
+ Vconf.SetString(CityNameIdVconfKey, value.CityName);
+ }
+ catch (Exception e)
+ {
+ Tizen.Log.Debug("oobe", $"setting vconf keys failed: {e.Message}");
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Library</OutputType>
+ <TargetFramework>tizen80</TargetFramework>
+ <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Tizen.NET" Version="8.0.0.15148">
+ <ExcludeAssets>Runtime</ExcludeAssets>
+ </PackageReference>
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Oobe.Common\Oobe.Common.csproj" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Folder Include="res\" />
+ </ItemGroup>
+</Project>
--- /dev/null
+using Oobe.Common.Styles;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Oobe.Common.Interfaces;
+using Tizen.NUI.Components;
+using Oobe.Region.Model;
+using Oobe.Common.Controls;
+
+namespace Oobe.Region
+{
+ public class RegionStep : ProcessStep
+ {
+ private RegionManager manager;
+
+ public RegionStep() : base()
+ {
+ }
+
+ public override void OnInitialized()
+ {
+ manager = new RegionManager();
+ }
+
+ public override View CreateView(IProcessNavigation nav)
+ {
+ View container = new View();
+
+ TextLabel title = new TextLabel();
+ title.TranslatableText = "CHOOSE_REGION";
+ title.Position2D = new Position2D(410, 160);
+ title.Size2D = new Size2D(364, 58);
+ title.TextColor = new Color(0, 20.0f/255.0f, 71.0f/255.0f, 1.0f);
+ title.HorizontalAlignment = HorizontalAlignment.Center;
+ title.Ellipsis = false;
+ title.PixelSize = 48.0f;
+ title.FontFamily = "BreezeSans";
+ title.FontStyle = new PropertyMap().AddLightFontStyle();
+
+ var carousel = new CarouselPicker(CarouselPickerStyles.Default);
+ carousel.Position2D = new Position2D(412, 242);
+ carousel.Size2D = new Size2D(360, 249);
+
+ foreach (RegionInfo info in manager.Regions)
+ {
+ CarouselPickerItemData item = new CarouselPickerItemData();
+ item.TranslatableText = info.Id;
+ carousel.AddItem(item);
+ }
+
+ Button next = new Button(ButtonStyles.Next);
+ next.Position2D = new Position2D(888, 512);
+ next.ClickEvent += (obj, args) => {
+ if (carousel.SelectedItemIndex >= 0 && carousel.SelectedItemIndex < manager.Regions.Count)
+ {
+ var region = manager.Regions[carousel.SelectedItemIndex];
+ manager.CurrentRegion = region;
+ }
+ nav.Next();
+ };
+ next.SetFontStyle(new PropertyMap().AddBoldFontStyle());
+
+ Button prev = new Button(ButtonStyles.Previous);
+ prev.Position2D = new Position2D(56, 512);
+ prev.ClickEvent += (obj, args) => {
+ nav.Previous();
+ };
+ prev.SetFontStyle(new PropertyMap().AddBoldFontStyle());
+
+ container.Add(carousel);
+ container.Add(title);
+ container.Add(prev);
+ container.Add(next);
+
+ return container;
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0"?>
+<regions>
+ <region code="en_GB" name="United Kingdom" timezone="Europe/London" id="UNITED_KINGDOM" />
+ <region code="ko_KR" name="South Korea" timezone="Asia/Seoul" id="SOUTH_KOREA" />
+ <region code="pl_PL" name="Poland" timezone="Europe/Warsaw" id="POLAND" />
+</regions>
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Library</OutputType>
+ <TargetFramework>tizen80</TargetFramework>
+ <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Tizen.NET" Version="8.0.0.15148">
+ <ExcludeAssets>Runtime</ExcludeAssets>
+ </PackageReference>
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\Oobe.Common\Oobe.Common.csproj" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Folder Include="res\" />
+ </ItemGroup>
+</Project>
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">\r
-\r
- <PropertyGroup>\r
- <OutputType>Library</OutputType>\r
- <TargetFramework>tizen80</TargetFramework>\r
- <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>\r
- </PropertyGroup>\r
-\r
- <ItemGroup>\r
- <PackageReference Include="Tizen.NET" Version="8.0.0.15148">\r
- <ExcludeAssets>Runtime</ExcludeAssets>\r
- </PackageReference>\r
- <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />\r
- </ItemGroup>\r
-\r
- <ItemGroup>\r
- <ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />\r
- </ItemGroup>\r
-\r
- <ItemGroup>\r
- <Folder Include="res\" />\r
- </ItemGroup>\r
-</Project>\r
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Library</OutputType>
+ <TargetFramework>tizen80</TargetFramework>
+ <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Tizen.NET" Version="8.0.0.15148">
+ <ExcludeAssets>Runtime</ExcludeAssets>
+ </PackageReference>
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Oobe.Common\Oobe.Common.csproj" />
+ </ItemGroup>
+</Project>
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">\r
-\r
- <PropertyGroup>\r
- <OutputType>Library</OutputType>\r
- <TargetFramework>tizen80</TargetFramework>\r
- <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>\r
- </PropertyGroup>\r
-\r
- <ItemGroup>\r
- <PackageReference Include="Tizen.NET" Version="8.0.0.15148">\r
- <ExcludeAssets>Runtime</ExcludeAssets>\r
- </PackageReference>\r
- <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />\r
- </ItemGroup>\r
-</Project>\r
--- /dev/null
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Threading.Tasks;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+
+namespace Oobe.Wifi.Controls
+{
+ public class ListView
+ {
+ private Dictionary<View, View> itemToSeparator = new Dictionary<View, View>();
+ private ObservableCollection<View> items;
+ private ScrollableBase scrollableBase = null;
+ private View footer = null;
+ private int width;
+ private int height;
+
+ public ListView(int width, int height)
+ {
+ this.width = width;
+ this.height = height;
+ }
+
+ //code does not handle the case with separators but without footer
+ public Func<View> SeparatorFactory { get; set; } = null;
+
+ public View Footer
+ {
+ get => footer;
+ set
+ {
+ if (footer != null)
+ {
+ LayoutView.Remove(footer);
+ }
+ footer = value;
+ if (footer != null)
+ {
+ LayoutView.Add(footer);
+ (LayoutView.Layout as SequenceLinearLayout)?.KeepAsLast(footer.Layout);
+ }
+ }
+ }
+
+ public ScrollableBase View
+ {
+ get
+ {
+ if (scrollableBase == null)
+ {
+ scrollableBase = new ScrollableBase()
+ {
+ Size = new Size(width, height),
+ ScrollingDirection = ScrollableBase.Direction.Vertical,
+ };
+ }
+ return scrollableBase;
+ }
+ }
+
+ private View LayoutView
+ {
+ get
+ {
+ if (View.Children.Any() == false)
+ {
+ View.Add(new View()
+ {
+ Layout = new SequenceLinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ },
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FitToChildren,
+ });
+ }
+ return View.Children.First();
+ }
+ }
+
+ public ObservableCollection<View> Items
+ {
+ get
+ {
+ return items;
+ }
+ set
+ {
+ if (value != items)
+ {
+ DetachItems();
+ items = value;
+ AttachItems();
+ }
+ }
+ }
+
+ private void DetachItems()
+ {
+ if (items != null)
+ {
+ items.CollectionChanged -= OnCollectionChanged;
+ RemoveItems();
+ LayoutView.HeightResizePolicy = ResizePolicyType.FitToChildren;
+ }
+ }
+
+ //not thread safe
+ private void AttachItems()
+ {
+ if (items != null)
+ {
+ foreach (var item in items)
+ {
+ AddRegularItem(item);
+ }
+ items.CollectionChanged += OnCollectionChanged;
+ }
+ }
+
+ private void OnCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
+ {
+ if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
+ {
+ var item = e.NewItems.OfType<View>().FirstOrDefault();
+ if (item != null)
+ {
+ AddRegularItem(item);
+ }
+ }
+ else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
+ {
+ var item = e.OldItems.OfType<View>().FirstOrDefault();
+ if (item != null)
+ {
+ RemoveRegularItem(item);
+ //if scroll was at the end, make sure it is still properly aligned to the end
+ //Tizen.Log.Debug("demo", $"{View.CurrentPage}");
+ }
+ }
+ else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset)
+ {
+ RemoveItems();
+ }
+ LayoutView.HeightResizePolicy = ResizePolicyType.FitToChildren;
+ }
+
+ private void AddRegularItem(View item)
+ {
+ LayoutView.Add(item);
+ if (SeparatorFactory != null)
+ {
+ if (itemToSeparator.ContainsKey(item)==false)
+ {
+ var separator = SeparatorFactory();
+ itemToSeparator.Add(item, separator);
+ LayoutView.Add(separator);
+ }
+ }
+ }
+
+ private void RemoveRegularItem(View item)
+ {
+ LayoutView.Remove(item);
+ if(itemToSeparator.ContainsKey(item))
+ {
+ LayoutView.Remove(itemToSeparator[item]);
+ itemToSeparator.Remove(item);
+ }
+ }
+
+ private void RemoveItems()
+ {
+ foreach (var child in LayoutView.Children.Where(x => x != Footer).ToList())
+ {
+ LayoutView.Remove(child);
+ }
+ itemToSeparator.Clear();
+ }
+ }
+}
--- /dev/null
+using System.Linq;
+using Tizen.NUI;
+
+namespace Oobe.Wifi.Controls
+{
+ public class SequenceLinearLayout : LinearLayout
+ {
+ private LayoutItem lastItem = null;
+
+ public void KeepAsLast(LayoutItem item)
+ {
+ lastItem = item;
+ if (item != null && item != LayoutChildren.Last())
+ {
+ if (LayoutChildren.Remove(item))
+ {
+ LayoutChildren.Add(item);
+ RequestLayout();
+ }
+ }
+ }
+
+ protected override void OnChildAdd(LayoutItem child)
+ {
+ base.OnChildAdd(child);
+ if (lastItem != null)
+ {
+ if (LayoutChildren.Remove(lastItem))//remove by position, or find from the end
+ {
+ LayoutChildren.Add(lastItem);
+ }
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using Oobe.Common.Styles;
+using Tizen.Network.WiFi;
+using Oobe.Common.Utils;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ class AddNewNetworkPupup : View
+ {
+ public event Action OnDismiss;
+ enum NewNetworkViewMode
+ {
+ NoPassword,
+ PasswordOnly,
+ UserPassword
+ };
+ NewNetworkViewMode currentViewMode;
+ TextLabel titleLabel;
+ TextLabel ssidLabel;
+ TextField ssidTextField;
+ View ssidUnderline;
+ TextLabel securityTypeLabel;
+ Button securityTypeButton;
+ TextLabel usernameLabel;
+ TextField usernameTextField;
+ View usernameUnderline;
+ TextLabel passwordLabel;
+ PasswordEntry passwordEntry;
+ View passwordUnderline;
+ Button revealButton;
+ Button cancelButton;
+ Button addButton;
+ TextLabel failureLabel;
+ WifiUISecurityType currentSecurityType;
+ private string backgroundImagePath = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
+
+ static Color largeTextColor => new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f);
+ static Color smallTextColor => new Color(0.0f, 0xC / 255.0f, 0x2B / 255.0f, 1.0f);
+ static Size labelSize => new Size(600, 19);
+ static Size textControlSize => new Size(583, 27);
+ static Size passwordControlSize => new Size(583, 25);
+ int labelFontSize = 14;
+ int textFontSize = 22;
+ int passwordFontSize = 20;
+
+ public AddNewNetworkPupup()
+ {
+ Tizen.Log.Debug("oobe", "Started creating Add New Network Popup");
+ InitializeStaticElements();
+
+ ResetViewTo(WifiUISecurityType.None);
+ Tizen.Log.Debug("oobe", "Finished creating Add New Network Popup");
+ }
+
+ TextLabel CreateTextLabel(string translatableText, Position2D position = null)
+ {
+ position ??= new Position2D();
+ return new TextLabel
+ {
+ Position = position,
+ Size = labelSize,
+ PixelSize = labelFontSize,
+ TranslatableText = translatableText,
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ TextColor = smallTextColor,
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Center
+ };
+ }
+
+ TextField CreateTextField(string placeholderTranslatableText, Position2D position = null)
+ {
+ position ??= new Position2D();
+ var textField = new TextField
+ {
+ Position = position,
+ Size = textControlSize,
+ PixelSize = textFontSize,
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ TextColor = largeTextColor,
+ TranslatablePlaceholderText = placeholderTranslatableText,
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Center
+ };
+ return textField;
+ }
+
+ View CreateUnderline(Position2D position = null)
+ {
+ position ??= new Position2D();
+ return new View()
+ {
+ Position = position,
+ Size = new Size(600, 1),
+ BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f)
+ };
+ }
+
+ PasswordEntry CreatePasswordEntry(Position2D position = null)
+ {
+ position ??= new Position2D();
+ var passwordEntry = new PasswordEntry
+ {
+ Position = position,
+ Size = passwordControlSize,
+ PixelSize = passwordFontSize,
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ TextColor = largeTextColor,
+ TranslatablePlaceholderText = "WIFI_SECURITY_KEY",
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Center,
+ Revealed = false
+ };
+ return passwordEntry;
+ }
+
+ Button CreateRevealButton(Position2D position = null)
+ {
+ position ??= new Position2D();
+ var button = new Button(ButtonStyles.Reveal)
+ {
+ Size = new Size(32, 32),
+ Position = position,
+ };
+ button.ClickEvent += (s, e) =>
+ {
+ this.passwordEntry.Revealed = !this.passwordEntry.Revealed;
+ button.IsSelected = !button.IsSelected;
+ };
+ return button;
+ }
+
+ void InitializeStaticElements()
+ {
+ this.BackgroundImage = backgroundImagePath;
+ titleLabel = new TextLabel
+ {
+ Position = new Position2D(104, 24),
+ Size = new Size(600, 34),
+ PixelSize = 26,
+ TranslatableText = "WIFI_ADD_NETWORK",
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddLightFontStyle(),
+ TextColor = largeTextColor,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center
+ };
+ this.Add(titleLabel);
+
+ ssidLabel = CreateTextLabel("WIFI_SSID", new Position2D(104, 80));
+ this.Add(ssidLabel);
+
+ ssidTextField = CreateTextField("WIFI_SSID", new Position2D(121, 97));
+ this.Add(ssidTextField);
+
+ ssidUnderline = CreateUnderline(new Position2D(104, 123));
+ this.Add(ssidUnderline);
+
+ securityTypeLabel = CreateTextLabel("WIFI_SECURITY_TYPE", new Position2D(104, 144));
+ this.Add(securityTypeLabel);
+
+ securityTypeButton = new Button
+ {
+ Size = new Size(583, 30),
+ Position2D = new Position2D(121, 161),
+ PointSize = 22,
+ Text = currentSecurityType.GetUIName(),
+ BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f),
+ TextAlignment = HorizontalAlignment.Begin,
+ CellHorizontalAlignment = HorizontalAlignmentType.Center,
+ CellVerticalAlignment = VerticalAlignmentType.Center
+ };
+ securityTypeButton.ClickEvent += (s, e) => OpenSecurityTypePopup();
+ this.Add(securityTypeButton);
+
+ cancelButton = new Button(ButtonStyles.Cancel)
+ {
+ Size = new Size(240, 72)
+ };
+ cancelButton.ClickEvent += (s, e) => OnDismiss?.Invoke();
+ this.Add(cancelButton);
+
+ addButton = new Button(ButtonStyles.OK)
+ {
+ Size = new Size(240, 72),
+ TranslatableText = "WIFI_ADD"
+ };
+ addButton.ClickEvent += async (s, e) =>
+ {
+ Tizen.Log.Debug("oobe", $"Scanning for SSID = {ssidTextField.Text}");
+ IEnumerable<WiFiAP> aps = null;
+ try
+ {
+ await WiFiManager.ScanSpecificAPAsync(ssidTextField.Text);
+ aps = WiFiManager.GetFoundSpecificAPs();
+ Tizen.Log.Debug("oobe", $"Found {aps.Count()} potential APs");
+ }
+ catch
+ {
+ ShowFailureSsidLabel();
+ return;
+ }
+ bool success = false;
+ if(aps is null || aps.Count() == 0)
+ {
+ ShowFailureSsidLabel();
+ return;
+ }
+ foreach (var wifiAp in aps)
+ {
+ Tizen.Log.Debug("oobe", $"Trying to add new network: SSID: {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid}), " +
+ $"Password: {(passwordEntry is null ? "not set" : "XXXXXXXX")}, " +
+ $"Security type: {currentSecurityType.GetUIName()}");
+ wifiAp.SecurityInformation.SecurityType = currentSecurityType.GetApSecurityType();
+ if (!(passwordEntry is null))
+ {
+ wifiAp.SecurityInformation.SetPassphrase(passwordEntry.Password);
+ }
+ Task<bool> task = null;
+ try
+ {
+ var orginal_task = wifiAp.ConnectAsync();
+ task = orginal_task as Task<bool>;
+ }
+ catch(Exception connectionException)
+ {
+ Tizen.Log.Error("oobe", $"Failed to connect to WiFI {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid})" +
+ $"Password: {(passwordEntry is null ? "not set" : "XXXXXXXX")}, " +
+ $"Security type: {currentSecurityType.GetUIName()} " +
+ connectionException.Message);
+ continue;
+ }
+ if (task is null)
+ {
+ Tizen.Log.Error("oobe", "Failed to cast connection task");
+ OnDismiss?.Invoke();
+ continue;
+ }
+ try
+ {
+ if (await task)
+ {
+ success = true;
+ break;
+ }
+ }
+ catch(Exception connectionException)
+ {
+ Tizen.Log.Error("oobe", $"Failed to connect to WiFI {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid})" +
+ $"Password: {(passwordEntry is null? "not set" : "XXXXXXXX")}, " +
+ $"Security type: {currentSecurityType.GetUIName()} " +
+ connectionException.Message);
+ continue;
+ }
+
+ }
+ if (success)
+ {
+ OnDismiss?.Invoke();
+ }
+ else
+ {
+ ShowFailurePasswordLabel();
+ }
+ };
+ this.Add(addButton);
+
+ failureLabel = new TextLabel
+ {
+ Size = new Size2D(),
+ PixelSize = 12,
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ TextColor = new Color(0xAA / 255.0f, 0x18 / 255.0f, 0x18 / 255.0f, 1.0f),
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Center
+ };
+ failureLabel.Hide();
+ this.Add(failureLabel);
+ }
+
+ void OpenSecurityTypePopup()
+ {
+ var view = new ChangeSecurityTypePopup(currentSecurityType);
+ var popup = new Oobe.Common.Utils.Popup(view);
+ view.OnDismiss += () =>
+ {
+ ResetViewTo(view.WifiUISecurityType);
+ popup.Dismiss();
+ };
+ popup.Show();
+ }
+
+ void ResetViewToNoPassword()
+ {
+ Size = new Size(808, 322);
+ Position = new Position2D(236, 118);
+
+ addButton.Position = new Position2D(488, ((int)Size.Height) - 96);
+ cancelButton.Position = new Position2D(80, ((int)Size.Height) - 96);
+
+ if (!(usernameLabel is null))
+ {
+ usernameLabel.Unparent();
+ usernameLabel.Dispose();
+ usernameLabel = null;
+ }
+
+ if (!(usernameTextField is null))
+ {
+ usernameTextField.Unparent();
+ usernameTextField.Dispose();
+ usernameTextField = null;
+ }
+
+ if(!(usernameUnderline is null))
+ {
+ usernameUnderline.Unparent();
+ usernameUnderline.Dispose();
+ usernameUnderline = null;
+ }
+
+ if (!(passwordLabel is null))
+ {
+ passwordLabel.Unparent();
+ passwordLabel.Dispose();
+ passwordLabel = null;
+ }
+
+ if (!(passwordEntry is null))
+ {
+ passwordEntry.Unparent();
+ passwordEntry.Dispose();
+ passwordEntry = null;
+ }
+
+ if (!(passwordUnderline is null))
+ {
+ passwordUnderline.Unparent();
+ passwordUnderline.Dispose();
+ passwordUnderline = null;
+ }
+
+ if (!(revealButton is null))
+ {
+ revealButton.Unparent();
+ revealButton.Dispose();
+ revealButton = null;
+ }
+
+ currentViewMode = NewNetworkViewMode.NoPassword;
+ }
+
+ void ResetViewToPasswordOnly()
+ {
+ Size = new Size2D(808, 382);
+ Position = new Position2D(236, 59);
+
+ addButton.Position = new Position2D(488, ((int)Size.Height) - 96);
+ cancelButton.Position = new Position2D(80, ((int)Size.Height) - 96);
+
+ if (!(usernameLabel is null))
+ {
+ usernameLabel.Unparent();
+ usernameLabel.Dispose();
+ usernameLabel = null;
+ }
+
+ if (!(usernameTextField is null))
+ {
+ usernameTextField.Unparent();
+ usernameTextField.Dispose();
+ usernameTextField = null;
+ }
+
+ if (!(usernameUnderline is null))
+ {
+ usernameUnderline.Unparent();
+ usernameUnderline.Dispose();
+ usernameUnderline = null;
+ }
+
+ if (passwordLabel is null)
+ {
+ passwordLabel = CreateTextLabel("WIFI_SECURITY_KEY");
+ this.Add(passwordLabel);
+ }
+
+ if (passwordEntry is null)
+ {
+ passwordEntry = CreatePasswordEntry();
+ this.Add(passwordEntry);
+ }
+
+ if (passwordUnderline is null)
+ {
+ passwordUnderline = CreateUnderline();
+ this.Add(passwordUnderline);
+ }
+
+ if (revealButton is null)
+ {
+ revealButton = CreateRevealButton();
+ this.Add(revealButton);
+ }
+
+ passwordLabel.Position = new Position2D(104, 208);
+ passwordEntry.Position = new Position2D(121, 225);
+ passwordUnderline.Position = new Position2D(104, 251);
+ revealButton.Position = new Position2D(704, 214);
+
+ currentViewMode = NewNetworkViewMode.PasswordOnly;
+ }
+
+ void ResetViewToUserPassword()
+ {
+ Size = new Size2D(808, 440);
+ Position = new Position2D(236, 0);
+
+ addButton.Position = new Position2D(488, ((int)Size.Height) - 96);
+ cancelButton.Position = new Position2D(80, ((int)Size.Height) - 96);
+
+ if (usernameLabel is null)
+ {
+ usernameLabel = CreateTextLabel("WIFI_USERNAME");
+ this.Add(usernameLabel);
+ }
+
+ if (usernameTextField is null)
+ {
+ usernameTextField = CreateTextField("WIFI_USERNAME");
+ this.Add(usernameTextField);
+ }
+
+ if(usernameUnderline is null)
+ {
+ usernameUnderline = CreateUnderline();
+ this.Add(usernameUnderline);
+ }
+
+ if (passwordLabel is null)
+ {
+ passwordLabel = CreateTextLabel("WIFI_SECURITY_KEY");
+ this.Add(passwordLabel);
+ }
+
+ if (passwordEntry is null)
+ {
+ passwordEntry = CreatePasswordEntry();
+ this.Add(passwordEntry);
+ }
+
+ if(passwordUnderline is null)
+ {
+ passwordUnderline = CreateUnderline();
+ this.Add(passwordUnderline);
+ }
+
+ if (revealButton is null)
+ {
+ revealButton = CreateRevealButton();
+ this.Add(revealButton);
+ }
+
+ usernameLabel.Position2D = new Position2D(104, 208);
+ usernameTextField.Position2D = new Position2D(121, 225);
+ usernameUnderline.Position2D = new Position2D(104, 251);
+ passwordLabel.Position2D = new Position2D(104, 272);
+ passwordEntry.Position2D = new Position2D(121, 289);
+ passwordUnderline.Position2D = new Position2D(104, 315);
+ revealButton.Position = new Position2D(704, 278);
+
+ currentViewMode = NewNetworkViewMode.UserPassword;
+ }
+
+ void ResetViewTo(WifiUISecurityType securityType)
+ {
+ Tizen.Log.Debug("oobe", $"Reseting view to {securityType.GetUIName()}");
+ failureLabel.Hide();
+ currentSecurityType = securityType;
+ securityTypeButton.TranslatableText = securityType.GetUIName();
+ switch (securityType)
+ {
+ case WifiUISecurityType.None:
+ ResetViewToNoPassword();
+ break;
+ case WifiUISecurityType.EAP:
+ case WifiUISecurityType.WEP:
+ case WifiUISecurityType.WPAPSK:
+ case WifiUISecurityType.WPA2PSK:
+ ResetViewToPasswordOnly();
+ break;
+ default:
+ throw new NotImplementedException($"UI for Security type {securityType.GetUIName()} was not implemented");
+ }
+ }
+
+ void ShowFailureSsidLabel()
+ {
+ failureLabel.Show();
+ failureLabel.TranslatableText = "WIFI_SSID_FAILURE";
+ failureLabel.Position2D = ssidTextField.Position2D + new Position2D(0, (int)ssidTextField.Size.Height);
+ }
+
+ void ShowFailurePasswordLabel()
+ {
+ failureLabel.Show();
+ if (currentViewMode == NewNetworkViewMode.NoPassword)
+ {
+ failureLabel.TranslatableText = "WIFI_SSID_FAILURE";
+ failureLabel.Position2D = ssidTextField.Position2D + new Position2D(0, (int)ssidTextField.Size.Height);
+ }
+ else
+ {
+ failureLabel.TranslatableText = "WIFI_SECUIRTY_KEY_FAILURE";
+ failureLabel.Position2D = passwordEntry.Position2D + new Position2D(0, (int)passwordEntry.Size.Height);
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Tizen.Network.WiFi;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ public class ApManager : IDisposable
+ {
+ private Action<WiFiAP> onTapped;
+ private Dictionary<WiFiAP, ApView> apToViewMap = new Dictionary<WiFiAP, ApView>();
+ private CancellationTokenSource updatingCancellation = new CancellationTokenSource();
+
+ public ObservableCollection<View> Views { get; private set; } = new ObservableCollection<View>();
+
+ public ApManager(Action<WiFiAP> onTapped)
+ {
+ this.onTapped = onTapped;
+ WiFiManager.ConnectionStateChanged += OnConnectionStateChanged;
+ RunUpdatingAps();
+ }
+
+ private void OnConnectionStateChanged(object sender, ConnectionStateChangedEventArgs e)
+ {
+ if (apToViewMap.TryGetValue(e.AP, out ApView view))
+ {
+ view.Update(e.AP);
+ }
+ }
+
+ public void UpdateTo(IEnumerable<WiFiAP> aps)
+ {
+ UpdateToNaive(aps);
+ }
+
+ public void UpdateToNaive(IEnumerable<WiFiAP> aps)
+ {
+ foreach (var ap in apToViewMap.Keys)
+ {
+ ap.Dispose();
+ }
+ apToViewMap.Clear();
+ Views.Clear();
+
+ int idx = 0;
+ foreach (var ap in aps)
+ {
+ if (apToViewMap.ContainsKey(ap) == false)
+ {
+ var view = new ApView();
+ view.Update(ap);
+ view.Tapped += () => onTapped(ap);
+
+ apToViewMap.Add(ap, view);
+ Views.Insert(idx, view);
+
+ idx++;
+ }
+ else
+ {
+ Tizen.Log.Error("oobe", $"another AP with the same hash code {ap.NetworkInformation.Essid} {ap.GetHashCode()}");
+ }
+ }
+ }
+
+ public void Dispose()
+ {
+ WiFiManager.ConnectionStateChanged -= OnConnectionStateChanged;
+ updatingCancellation.Cancel();
+ foreach (var ap in apToViewMap.Keys)
+ {
+ ap.Dispose();
+ }
+ }
+
+ private async void RunUpdatingAps()
+ {
+ while (await Delay())
+ {
+ foreach (var (ap, view) in apToViewMap.ToList())
+ {
+ try
+ {
+ ap.Refresh();
+ view.Update(ap);
+ }
+ catch (Exception ex)
+ {
+ Tizen.Log.Error("oobe", $"failed to refresh ap {ap.NetworkInformation.Essid} {ex.ToString()}");
+
+ Views.Remove(view);
+ apToViewMap.Remove(ap);
+ ap.Dispose();
+ }
+ }
+ }
+ }
+
+ private async Task<bool> Delay()
+ {
+ try
+ {
+ await Task.Delay(10_000, updatingCancellation.Token);
+ }
+ catch (Exception)
+ {
+ }
+ return updatingCancellation.IsCancellationRequested == false;
+ }
+ }
+}
--- /dev/null
+using System;
+using Tizen.Network.WiFi;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Oobe.Common.Styles;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ public class ApView : View
+ {
+ public event Action Tapped;
+ private TextLabel detail = null;
+ private View range = null;
+ //detectors have to be kept separately because of GC, there is no link by ref between View and Detector
+ private TapGestureDetector detector;
+
+ public ApView()
+ {
+ Size = new Size(WifiView.ListItemWidth, WifiView.ListItemHeight);
+ Layout = new AbsoluteLayout();
+ }
+
+ public void Update(WiFiAP wifiAp)
+ {
+ if (range == null)
+ {
+ range = new View()
+ {
+ Position = new Position(39, 21),
+ BackgroundImage = GetRangeImage(wifiAp),
+ };
+ this.Add(range);
+
+ this.Add(new TextLabel(wifiAp.NetworkInformation.Essid)
+ {
+ Position = new Position(78, 17),
+ PixelSize = 20f,
+ TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddLightFontStyle(),
+ });
+
+ detail = new TextLabel(GetDetailInfo(wifiAp))
+ {
+ WidthSpecification = LayoutParamPolicies.WrapContent,
+ Position = new Position(79, 45),
+ PixelSize = 14f,
+ TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ };
+ this.Add(detail);
+
+ detector = new TapGestureDetector();
+ detector.Detected += (s, e) => Tapped?.Invoke();
+ detector.Attach(this);
+ }
+ else
+ {
+ range.BackgroundImage = GetRangeImage(wifiAp);
+ detail.Text = GetDetailInfo(wifiAp);
+ detail.WidthSpecification = LayoutParamPolicies.WrapContent;
+ }
+ }
+
+ private static string GetDetailInfo(WiFiAP wifiAp)
+ {
+ //state
+ if (wifiAp.NetworkInformation.ConnectionState == WiFiConnectionState.Connected)
+ {
+ return "Connected";
+ }
+ if (wifiAp.NetworkInformation.ConnectionState == WiFiConnectionState.Association)
+ {
+ return "Connecting...";
+ }
+ //security
+ else if (wifiAp.SecurityInformation.SecurityType == Tizen.Network.Connection.WiFiSecurityType.None)
+ {
+ return "Open";
+ }
+ else if (wifiAp.SecurityInformation.IsPassphraseRequired == false)
+ {
+ return "Saved";
+ }
+ else
+ {
+ return "Secured";
+ }
+ }
+
+ private static string GetRangeImage(WiFiAP wifiAp)
+ {
+ return System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource
+ , $"12_icon_wifi{(int)wifiAp.NetworkInformation.RssiLevel}.png");
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ public class ButtonStyles
+ {
+ public static ButtonStyle Cancel = GetCancelButtonStyle();
+ public static ButtonStyle OK = GetOKButtonStyle();
+ public static ButtonStyle Scan = GetScanButtonStyle();
+ public static ButtonStyle TurnOnOff = GetTurnOnOffButtonStyle();
+ public static ButtonStyle Reveal = GetRevealButtonStyle();
+ public static ButtonStyle AddNetwork = GetAddNetworkButtonStyle();
+
+ private static ButtonStyle GetCancelButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_action.png",
+ Pressed = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_pressed.png",
+ Disabled = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_disabled.png",
+ },
+ Text = new TextLabelStyle
+ {
+ PointSize = new Selector<float?>
+ {
+ Normal = 22.0f,
+ Pressed = 24.0f
+ },
+ EnableMarkup = true,
+ TranslatableText = "WIFI_CANCEL",
+ TextColor = new Selector<Color>
+ {
+ Normal = new Color(0.0f, 20.0f / 255.0f, 71 / 255.0f, 1.0f),
+ Pressed = new Color(41.0f / 255.0f, 91.0f / 255.0f, 178 / 255.0f, 1.0f),
+ },
+ FontFamily = GetNavigationFont(),
+ },
+ Size2D = new Size2D(240, 72),
+ };
+
+ private static ButtonStyle GetScanButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan.png",
+ Pressed = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan_pressed.png",
+ Disabled = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan_disabled.png",
+ },
+ Size2D = new Size2D(72, 32),
+ };
+
+ private static ButtonStyle GetTurnOnOffButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifioff.png",
+ Disabled = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifioff_disabled.png",
+ Selected = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifion.png",
+ DisabledSelected = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifion_disabled.png",
+ },
+ Size2D = new Size2D(72, 32),
+ };
+
+ private static ButtonStyle GetAddNetworkButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_addnetwork.png",
+ Pressed = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_addnetwork_pressed.png",
+ },
+ Size2D = new Size2D(42, 42),
+ };
+
+ private static ButtonStyle GetRevealButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_eye_pw_hidden.png"),
+ Selected = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_eye_pw_visible.png"),
+ },
+ };
+
+ private static ButtonStyle GetOKButtonStyle() => new ButtonStyle
+ {
+ BackgroundImage = new Selector<string>
+ {
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_active.svg",
+ Pressed = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_selected.svg",
+ Disabled = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_disabled.svg",
+ },
+ Text = new TextLabelStyle
+ {
+ PointSize = new Selector<float?>
+ {
+ Normal = 22.0f,
+ Pressed = 24.0f
+ },
+ TextColor = Color.White,
+ TranslatableText = "WIFI_OK",
+ FontFamily = GetNavigationFont(),
+ },
+ Size2D = new Size2D(240, 72),
+ };
+
+ private static Selector<string> GetNavigationFont()
+ {
+ return new Selector<string>
+ {
+ Normal = "BreezeSans",
+ };
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using Oobe.Common.Styles;
+using Tizen.Network.WiFi;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ class ChangeSecurityTypePopup : View
+ {
+ public event Action OnDismiss;
+
+ public WifiUISecurityType WifiUISecurityType { get; private set; }
+ private WifiUISecurityType originalWifUISecurityType;
+ private ListView listView;
+ private ObservableCollection<View> choiceViews = new ObservableCollection<View>();
+ private RadioButtonGroup radioButtonGroup = new RadioButtonGroup();
+
+ public ChangeSecurityTypePopup(WifiUISecurityType wifUISecurityType)
+ {
+ this.originalWifUISecurityType = wifUISecurityType;
+ this.WifiUISecurityType = wifUISecurityType;
+ this.Size = new Size(808, 440);
+ this.Position = new Position(236, 140);
+ this.BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
+
+ InitializeStaticElements();
+ InitializeRadioButtons();
+ }
+
+ public void InitializeStaticElements()
+ {
+ var titleLabel = new TextLabel()
+ {
+ Position = new Position2D(80, 24),
+ Size = new Size(648, 34),
+ PixelSize = 26,
+ TranslatableText = "WIFI_CHOOSE_SECURITY_TYPE",
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddLightFontStyle(),
+ TextColor = new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center
+ };
+ this.Add(titleLabel);
+
+ var cancelButton = new Button(ButtonStyles.Cancel)
+ {
+ Position = new Position(80, 344),
+ Size = new Size(240, 72),
+ };
+ cancelButton.ClickEvent += (s, e) =>
+ {
+ WifiUISecurityType = originalWifUISecurityType;
+ OnDismiss?.Invoke();
+ };
+ this.Add(cancelButton);
+
+ var addButton = new Button(ButtonStyles.OK)
+ {
+ Position = new Position(488, 344),
+ Size = new Size(240, 72),
+ TranslatableText = "WIFI_OK"
+ };
+
+ addButton.ClickEvent += (s, e) =>
+ {
+ OnDismiss?.Invoke();
+ };
+ this.Add(addButton);
+ }
+
+ private void InitializeRadioButtons()
+ {
+ foreach (WifiUISecurityType type in Enum.GetValues(WifiUISecurityType.GetType()))
+ {
+ var view = CreateOption(type);
+ choiceViews.Add(view);
+ }
+ listView = new ListView(768, 238)
+ {
+ Items = choiceViews
+ };
+ listView.View.Position = new Position(0, 82);
+ this.Add(listView.View);
+ }
+
+ private View CreateOption(WifiUISecurityType wifiUISecurityType)
+ {
+ var view = new SecurityTypeView(wifiUISecurityType);
+ if (this.WifiUISecurityType == wifiUISecurityType)
+ {
+ view.Button.IsSelected = true;
+ }
+ radioButtonGroup.Add(view.Button);
+ view.Button.ClickEvent += (s, e) => this.WifiUISecurityType = view.WifiUISecurityType;
+ return view;
+ }
+ }
+}
--- /dev/null
+using Tizen.NUI;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ public class PasswordEntry : Tizen.NUI.BaseComponents.TextField
+ {
+ private bool revealed = false;
+ public string Password => Text;
+
+ public bool Revealed
+ {
+ get => revealed;
+ set
+ {
+ revealed = value;
+ if (revealed)
+ revealPassword();
+ else
+ hidePassword();
+ Text = Text; //for refreshing - causes resetting cursor
+ }
+ }
+
+ private void revealPassword()
+ {
+ var map = new PropertyMap();
+ map.Add("mode", new PropertyValue(0));
+ HiddenInputSettings = map;
+ }
+ private void hidePassword()
+ {
+ var map = new PropertyMap();
+ map.Add("mode", new PropertyValue(4));
+ map.Add("show_last_character_duration", new PropertyValue(500));
+ HiddenInputSettings = map;
+ }
+ }
+}
--- /dev/null
+using System;
+using Tizen.Network.WiFi;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using Oobe.Common.Styles;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ class SecurityTypeView : View
+ {
+ public RadioButton Button;
+ public readonly WifiUISecurityType WifiUISecurityType;
+
+ private TextLabel descriptionTextLabel = null;
+ /*//detectors have to be kept separately because of GC, there is no link by ref between View and Detector
+ private TapGestureDetector detector;*/
+
+ public SecurityTypeView(WifiUISecurityType wifiUISecurityType)
+ {
+ Size = new Size(768, 64);
+ Layout = new AbsoluteLayout();
+ this.WifiUISecurityType = wifiUISecurityType;
+
+ InitializeSubelements();
+ }
+
+ void InitializeSubelements()
+ {
+ Button = new RadioButton
+ {
+ IsSelected = false,
+ Position = new Position(40, 20),
+ Size = new Size(24, 24),
+ CellHorizontalAlignment = HorizontalAlignmentType.Center,
+ CellVerticalAlignment = VerticalAlignmentType.Center
+ };
+ this.Add(Button);
+
+ descriptionTextLabel = new TextLabel
+ {
+ Position = new Position(92, 19),
+ Size = new Size(648, 26),
+ PixelSize = 20,
+ TranslatableText = WifiUISecurityType.GetUIName(),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddLightFontStyle(),
+ TextColor = new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Center
+ };
+ this.Add(descriptionTextLabel);
+ }
+ }
+}
--- /dev/null
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Oobe.Wifi.Controls.Wifi {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ public class Translations {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Translations() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Oobe.Wifi.Controls.Wifi.Translations", typeof(Translations).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to ADD.
+ /// </summary>
+ public static string WIFI_ADD {
+ get {
+ return ResourceManager.GetString("WIFI_ADD", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Add network.
+ /// </summary>
+ public static string WIFI_ADD_NETWORK {
+ get {
+ return ResourceManager.GetString("WIFI_ADD_NETWORK", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Add new....
+ /// </summary>
+ public static string WIFI_ADD_NEW_NETWORK {
+ get {
+ return ResourceManager.GetString("WIFI_ADD_NEW_NETWORK", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to CANCEL.
+ /// </summary>
+ public static string WIFI_CANCEL {
+ get {
+ return ResourceManager.GetString("WIFI_CANCEL", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Choose security type.
+ /// </summary>
+ public static string WIFI_CHOOSE_SECURITY_TYPE {
+ get {
+ return ResourceManager.GetString("WIFI_CHOOSE_SECURITY_TYPE", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Connection failed..
+ /// </summary>
+ public static string WIFI_CONNECTION_FAILED {
+ get {
+ return ResourceManager.GetString("WIFI_CONNECTION_FAILED", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Enter password.
+ /// </summary>
+ public static string WIFI_ENTER_PASSWORD {
+ get {
+ return ResourceManager.GetString("WIFI_ENTER_PASSWORD", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Enter password to join "{0}".
+ /// </summary>
+ public static string WIFI_ENTER_PASSWORD_TO_JOIN {
+ get {
+ return ResourceManager.GetString("WIFI_ENTER_PASSWORD_TO_JOIN", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Invalid password.
+ /// </summary>
+ public static string WIFI_INVALID_PASSWORD {
+ get {
+ return ResourceManager.GetString("WIFI_INVALID_PASSWORD", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to OK.
+ /// </summary>
+ public static string WIFI_OK {
+ get {
+ return ResourceManager.GetString("WIFI_OK", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Scanning....
+ /// </summary>
+ public static string WIFI_SCANNING {
+ get {
+ return ResourceManager.GetString("WIFI_SCANNING", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Invalid password or security type.
+ /// </summary>
+ public static string WIFI_SECUIRTY_KEY_FAILURE {
+ get {
+ return ResourceManager.GetString("WIFI_SECUIRTY_KEY_FAILURE", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Security Key.
+ /// </summary>
+ public static string WIFI_SECURITY_KEY {
+ get {
+ return ResourceManager.GetString("WIFI_SECURITY_KEY", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Security type.
+ /// </summary>
+ public static string WIFI_SECURITY_TYPE {
+ get {
+ return ResourceManager.GetString("WIFI_SECURITY_TYPE", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to EAP.
+ /// </summary>
+ public static string WIFI_SECURITY_TYPE_EAP {
+ get {
+ return ResourceManager.GetString("WIFI_SECURITY_TYPE_EAP", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Open.
+ /// </summary>
+ public static string WIFI_SECURITY_TYPE_OPEN {
+ get {
+ return ResourceManager.GetString("WIFI_SECURITY_TYPE_OPEN", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to WEP.
+ /// </summary>
+ public static string WIFI_SECURITY_TYPE_WEP {
+ get {
+ return ResourceManager.GetString("WIFI_SECURITY_TYPE_WEP", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to WPA2 PSK.
+ /// </summary>
+ public static string WIFI_SECURITY_TYPE_WPA2PSK {
+ get {
+ return ResourceManager.GetString("WIFI_SECURITY_TYPE_WPA2PSK", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to WPA PSK.
+ /// </summary>
+ public static string WIFI_SECURITY_TYPE_WPAPSK {
+ get {
+ return ResourceManager.GetString("WIFI_SECURITY_TYPE_WPAPSK", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Network name.
+ /// </summary>
+ public static string WIFI_SSID {
+ get {
+ return ResourceManager.GetString("WIFI_SSID", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Invalid name or security type.
+ /// </summary>
+ public static string WIFI_SSID_FAILURE {
+ get {
+ return ResourceManager.GetString("WIFI_SSID_FAILURE", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to To see available networks, turn on Wi - Fi..
+ /// </summary>
+ public static string WIFI_TURN_ON_WIFI {
+ get {
+ return ResourceManager.GetString("WIFI_TURN_ON_WIFI", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Username.
+ /// </summary>
+ public static string WIFI_USERNAME {
+ get {
+ return ResourceManager.GetString("WIFI_USERNAME", resourceCulture);
+ }
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="WIFI_ADD_NETWORK" xml:space="preserve">
+ <value>네트워크 추가</value>
+ </data>
+ <data name="WIFI_ADD_NEW_NETWORK" xml:space="preserve">
+ <value>네트워크 추가</value>
+ </data>
+ <data name="WIFI_CANCEL" xml:space="preserve">
+ <value>취소</value>
+ </data>
+ <data name="WIFI_CHOOSE_SECURITY_TYPE" xml:space="preserve">
+ <value>보안 유형을 선택하십시오</value>
+ </data>
+ <data name="WIFI_CONNECTION_FAILED" xml:space="preserve">
+ <value>네트워크에 연결하지 못했습니다.</value>
+ </data>
+ <data name="WIFI_ENTER_PASSWORD" xml:space="preserve">
+ <value>비밀번호를 입력하세요</value>
+ </data>
+ <data name="WIFI_ENTER_PASSWORD_TO_JOIN" xml:space="preserve">
+ <value>"{0}" 에 연결하려면 비밀번호를 입력하세요.</value>
+ </data>
+ <data name="WIFI_INVALID_PASSWORD" xml:space="preserve">
+ <value>잘못된 비밀번호</value>
+ </data>
+ <data name="WIFI_OK" xml:space="preserve">
+ <value>확인</value>
+ </data>
+ <data name="WIFI_SCANNING" xml:space="preserve">
+ <value>찾는 중...</value>
+ </data>
+ <data name="WIFI_SECUIRTY_KEY_FAILURE" xml:space="preserve">
+ <value>잘못된 비밀번호 또는 보안 유형</value>
+ </data>
+ <data name="WIFI_SECURITY_KEY" xml:space="preserve">
+ <value>보안 키</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE" xml:space="preserve">
+ <value>보안 유형</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_EAP" xml:space="preserve">
+ <value>EAP</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_OPEN" xml:space="preserve">
+ <value>Open</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_WEP" xml:space="preserve">
+ <value>WEP</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_WPA2PSK" xml:space="preserve">
+ <value>WPA2 PSK</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_WPAPSK" xml:space="preserve">
+ <value>WPA PSK</value>
+ </data>
+ <data name="WIFI_SSID" xml:space="preserve">
+ <value>네트워크 이름</value>
+ </data>
+ <data name="WIFI_SSID_FAILURE" xml:space="preserve">
+ <value>잘못된 이름 또는 보안 유형</value>
+ </data>
+ <data name="WIFI_TURN_ON_WIFI" xml:space="preserve">
+ <value>연결 가능한 네트워크를 보려면 Wi-Fi를 켜세요.</value>
+ </data>
+ <data name="WIFI_USERNAME" xml:space="preserve">
+ <value>사용자 이름</value>
+ </data>
+</root>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="WIFI_ADD_NEW_NETWORK" xml:space="preserve">
+ <value>Dodaj nową...</value>
+ </data>
+ <data name="WIFI_CANCEL" xml:space="preserve">
+ <value>ANULUJ</value>
+ </data>
+ <data name="WIFI_ADD" xml:space="preserve">
+ <value>DODAJ</value>
+ </data>
+ <data name="WIFI_CONNECTION_FAILED" xml:space="preserve">
+ <value>Połączenie nieudane.</value>
+ </data>
+ <data name="WIFI_ENTER_PASSWORD" xml:space="preserve">
+ <value>Wprowadź hasło</value>
+ </data>
+ <data name="WIFI_ENTER_PASSWORD_TO_JOIN" xml:space="preserve">
+ <value>Wprowadź hasło aby połączyć z "{0}"</value>
+ </data>
+ <data name="WIFI_INVALID_PASSWORD" xml:space="preserve">
+ <value>Hasło nieprawidłowe</value>
+ </data>
+ <data name="WIFI_OK" xml:space="preserve">
+ <value>ZATWIERDŹ</value>
+ </data>
+ <data name="WIFI_SCANNING" xml:space="preserve">
+ <value>Skanowanie...</value>
+ </data>
+ <data name="WIFI_TURN_ON_WIFI" xml:space="preserve">
+ <value>Aby zobaczyć dostępne sieci, włącz Wi - Fi.</value>
+ </data>
+ <data name="WIFI_ADD_NETWORK">
+ <value>Dodaj sieć</value>
+ </data>
+ <data name="WIFI_CHOOSE_SECURITY_TYPE">
+ <value>Wybierz typ zabezpieczeń</value>
+ </data>
+ <data name="WIFI_SSID">
+ <value>Nazwa sieci</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE">
+ <value>Wybierz typ zabezpieczeń</value>
+ </data>
+ <data name="WIFI_USERNAME">
+ <value>Nazwa użytkownika</value>
+ </data>
+ <data name="WIFI_SECURITY_KEY">
+ <value>Klucz zabezpieczeń</value>
+ </data>
+ <data name="WIFI_SSID_FAILURE">
+ <value>Nieprawidłowa nazwa sieci lub typ zabezpieczeń</value>
+ </data>
+ <data name="WIFI_SECUIRTY_KEY_FAILURE">
+ <value>Nieprawidłowy klucz lub typ zabezpieczeń</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_OPEN" xml:space="preserve">
+ <value>Otwarte</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_EAP" xml:space="preserve">
+ <value>EAP</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_WEP" xml:space="preserve">
+ <value>WEP</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_WPAPSK" xml:space="preserve">
+ <value>WPA PSK</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_WPA2PSK" xml:space="preserve">
+ <value>WPA2 PSK</value>
+ </data>
+</root>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="WIFI_ADD_NEW_NETWORK" xml:space="preserve">
+ <value>Add new...</value>
+ </data>
+ <data name="WIFI_CANCEL" xml:space="preserve">
+ <value>CANCEL</value>
+ </data>
+ <data name="WIFI_ADD" xml:space="preserve">
+ <value>ADD</value>
+ </data>
+ <data name="WIFI_CONNECTION_FAILED" xml:space="preserve">
+ <value>Connection failed.</value>
+ </data>
+ <data name="WIFI_ENTER_PASSWORD" xml:space="preserve">
+ <value>Enter password</value>
+ </data>
+ <data name="WIFI_ENTER_PASSWORD_TO_JOIN" xml:space="preserve">
+ <value>Enter password to join "{0}"</value>
+ </data>
+ <data name="WIFI_INVALID_PASSWORD" xml:space="preserve">
+ <value>Invalid password</value>
+ </data>
+ <data name="WIFI_OK" xml:space="preserve">
+ <value>OK</value>
+ </data>
+ <data name="WIFI_SCANNING" xml:space="preserve">
+ <value>Scanning...</value>
+ </data>
+ <data name="WIFI_TURN_ON_WIFI" xml:space="preserve">
+ <value>To see available networks, turn on Wi - Fi.</value>
+ </data>
+ <data name="WIFI_ADD_NETWORK">
+ <value>Add network</value>
+ </data>
+ <data name="WIFI_CHOOSE_SECURITY_TYPE">
+ <value>Choose security type</value>
+ </data>
+ <data name="WIFI_SSID">
+ <value>Network name</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE">
+ <value>Security type</value>
+ </data>
+ <data name="WIFI_USERNAME">
+ <value>Username</value>
+ </data>
+ <data name="WIFI_SECURITY_KEY">
+ <value>Security Key</value>
+ </data>
+ <data name="WIFI_SSID_FAILURE">
+ <value>Invalid name or security type</value>
+ </data>
+ <data name="WIFI_SECUIRTY_KEY_FAILURE">
+ <value>Invalid password or security type</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_OPEN" xml:space="preserve">
+ <value>Open</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_EAP" xml:space="preserve">
+ <value>EAP</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_WEP" xml:space="preserve">
+ <value>WEP</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_WPAPSK" xml:space="preserve">
+ <value>WPA PSK</value>
+ </data>
+ <data name="WIFI_SECURITY_TYPE_WPA2PSK" xml:space="preserve">
+ <value>WPA2 PSK</value>
+ </data>
+</root>
\ No newline at end of file
--- /dev/null
+using System;
+using System.Threading.Tasks;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using Tizen.Network.WiFi;
+using Oobe.Common.Styles;
+using Oobe.Wifi.Controls.Wifi;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ class WifiPasswordPopup : View
+ {
+ public event Action OnDismiss;
+ private PasswordEntry passwordEntry = null;
+ private Button okButton;
+ private Button cancelButton;
+ private Button revealButton;
+ private TextLabel connectionFailure;
+ private const int minPasswordLength = 8;
+ private const int maxPasswordLength = 63;
+ private string backgroundImagePath = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
+ private WiFiAP wifiAp;
+ private bool isConnecting = false;
+
+ public string Password => passwordEntry.Password;
+
+ public WifiPasswordPopup(Tizen.Network.WiFi.WiFiAP wifiAp)
+ {
+ BackgroundImage = backgroundImagePath;
+ Size = new Size(808, 304);
+ Position = new Position(new Position2D(236, 116));
+ this.wifiAp = wifiAp;
+
+ this.Add(new View() //underline
+ {
+ Size = new Size(584, 1),
+ Position = new Position(103, 160),
+ BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f),
+ });
+
+ passwordEntry = new PasswordEntry()
+ {
+ Size = new Size(584, 27),
+ Position = new Position(112, 133),
+ MaxLength = maxPasswordLength,
+ PixelSize = 22,
+ TextColor = new Color(0, 0x0C / 255.0f, 0x2B / 255.0f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ Revealed = false,
+ };
+ passwordEntry.TextChanged += (s, e) => UpdateOKButton();
+
+ this.Add(passwordEntry);
+
+ var titleLabel = new TextLabel
+ {
+ Size = new Size(808, 35),
+ Position = new Position(0, 19),
+ TranslatableText = "WIFI_ENTER_PASSWORD",
+ PixelSize = 28,
+ TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddLightFontStyle(),
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center,
+ };
+ this.Add(titleLabel);
+
+ var subtitleLabel = new TextLabel
+ {
+ Size = new Size(808, 26),
+ Position = new Position(0, 68),
+ //no translatableText because of dynamic content
+ Text = string.Format(Translations.WIFI_ENTER_PASSWORD_TO_JOIN, wifiAp.NetworkInformation.Essid),
+ PixelSize = 20,
+ TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center,
+ };
+ this.Add(subtitleLabel);
+
+ connectionFailure = new TextLabel
+ {
+ Size = new Size(120, 16),
+ Position = new Position(116, 166),
+ TranslatableText = "WIFI_INVALID_PASSWORD",
+ PixelSize = 12,
+ TextColor = new Color(0xAA / 255.0f, 0x18 / 255.0f, 0x18 / 255.0f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Center,
+ };
+ connectionFailure.Hide();
+ this.Add(connectionFailure);
+
+ revealButton = new Button(ButtonStyles.Reveal)
+ {
+ Size = new Size(48, 48),
+ Position = new Position(696, 120),
+ };
+ revealButton.ClickEvent += (s, e) => TogglePasswordVisibility();
+ this.Add(revealButton);
+
+ cancelButton = new Button(ButtonStyles.Cancel)
+ {
+ Size = new Size(240, 72),
+ Position = new Position(80, 200)
+ };
+ cancelButton.ClickEvent += (s, e) =>
+ {
+ OnDismiss.Invoke();
+ };
+ this.Add(cancelButton);
+
+ okButton = new Button(ButtonStyles.OK)
+ {
+ Size = new Size(240, 72),
+ Position = new Position(488, 200),
+ IsEnabled = false
+ };
+ okButton.ClickEvent += async (s, e) =>
+ {
+ isConnecting = true;
+ UpdateOKButton();
+ try
+ {
+ Tizen.Log.Debug("oobe", $"connecting to wifi {wifiAp.NetworkInformation.Essid} with password {"XXXXXXXX"}");
+ wifiAp.SecurityInformation.SetPassphrase(Password);
+ var task = wifiAp.ConnectAsync();
+ await task;
+ if (task.Status == TaskStatus.Faulted)
+ {
+ throw task.Exception;
+ }
+ else
+ {
+ OnDismiss.Invoke();
+ }
+ }
+ catch (Exception ex)
+ {
+ Tizen.Log.Error("oobe", $"{ex.ToString()}");
+ connectionFailure.Show();
+ }
+ finally
+ {
+ isConnecting = false;
+ UpdateOKButton();
+ }
+ };
+ this.Add(okButton);
+ }
+
+ private void TogglePasswordVisibility()
+ {
+ passwordEntry.Revealed = !passwordEntry.Revealed;
+ revealButton.IsSelected = !revealButton.IsSelected;
+ }
+
+ private void UpdateOKButton()
+ {
+ okButton.IsEnabled = (Password.Length >= minPasswordLength) && (isConnecting == false);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Tizen.Network.WiFi;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ internal class WifiState : IDisposable
+ {
+ public event Action OnTurningOnFailed;
+ public event Action OnTurnedOn;
+ public event Action OnTurnedOff;
+ public event Action OnScanStarted;
+ public event Action OnScanFinished;
+
+ public bool IsTurnedOn => WiFiManager.IsActive;
+
+ public WifiState()
+ {
+ WiFiManager.DeviceStateChanged += WiFiManager_DeviceStateChanged;
+ }
+
+ public async Task TurnWifi()
+ {
+ try
+ {
+ if (IsTurnedOn)
+ {
+ await WiFiManager.DeactivateAsync();
+ }
+ else
+ {
+ await WiFiManager.ActivateAsync();
+ if (IsTurnedOn == false)
+ {
+ OnTurningOnFailed?.Invoke();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Tizen.Log.Error("oobe", $"{ex.ToString()}");
+ }
+ }
+
+ public async Task<IEnumerable<WiFiAP>> Scan()
+ {
+ try
+ {
+ OnScanStarted?.Invoke();
+ await WiFiManager.ScanAsync();
+ return WiFiManager.GetFoundAPs();
+ }
+ catch (Exception ex)
+ {
+ Tizen.Log.Error("oobe", $"{ex.ToString()}");
+ }
+ finally
+ {
+ OnScanFinished?.Invoke();
+ }
+ return new List<WiFiAP>();
+ }
+
+ public void Dispose()
+ {
+ WiFiManager.DeviceStateChanged -= WiFiManager_DeviceStateChanged;
+ }
+
+ private void WiFiManager_DeviceStateChanged(object sender, DeviceStateChangedEventArgs e)
+ {
+ if (e.State == WiFiDeviceState.Activated)
+ {
+ OnTurnedOn?.Invoke();
+ }
+ else
+ {
+ OnTurnedOff?.Invoke();
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tizen.Network.Connection;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ enum WifiUISecurityType
+ {
+ None,
+ EAP,
+ WEP,
+ WPAPSK,
+ WPA2PSK
+ }
+
+ static class WifiUISecurityTypeExtensions
+ {
+ public static string GetUIName(this WifiUISecurityType type)
+ {
+ switch (type)
+ {
+ case WifiUISecurityType.None: return "WIFI_SECURITY_TYPE_OPEN";
+ case WifiUISecurityType.EAP: return "WIFI_SECURITY_TYPE_EAP";
+ case WifiUISecurityType.WEP: return "WIFI_SECURITY_TYPE_WEP";
+ case WifiUISecurityType.WPAPSK: return "WIFI_SECURITY_TYPE_WPAPSK";
+ case WifiUISecurityType.WPA2PSK: return "WIFI_SECURITY_TYPE_WPA2PSK";
+ default:
+ throw new ArgumentException("Unknown security type");
+ }
+ }
+
+ public static WiFiSecurityType GetApSecurityType(this WifiUISecurityType type)
+ {
+ switch (type)
+ {
+ case WifiUISecurityType.None: return WiFiSecurityType.None;
+ case WifiUISecurityType.EAP: return WiFiSecurityType.Eap;
+ case WifiUISecurityType.WEP: return WiFiSecurityType.Wep;
+ case WifiUISecurityType.WPAPSK: return WiFiSecurityType.WpaPsk;
+ case WifiUISecurityType.WPA2PSK: return WiFiSecurityType.Wpa2Psk;
+ default:
+ throw new ArgumentException("Unknown security type");
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using Oobe.Common.Styles;
+
+namespace Oobe.Wifi.Controls.Wifi
+{
+ public class WifiView : IDisposable
+ {
+ private View view = null;
+ public const int ListItemWidth = 460;
+ public const int ListItemHeight = 79;//89;
+
+ private WifiState State { get; set; } = new WifiState();
+ private ApManager ApManager { get; set; } = new ApManager(OnApTapped);
+
+ public View View
+ {
+ get
+ {
+ if (view == null)
+ {
+ view = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ },
+ BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "Rectangle_918.png"),
+ //BackgroundColor = Color.Red,
+ //Size = new Size(480, 401),
+ Size = new Size(480, 416),
+ };
+ view.Add(CreateHeader(480, 91));
+
+ view.Add(CreateSeparator());
+
+ view.Add(CreateListViewPlaceHolder());
+ }
+ return view;
+ }
+ }
+
+ private static View CreateSeparator()
+ {
+ return new View()
+ {
+ Size2D = new Size(400, 1),
+ BackgroundColor = new Color(0xC3 / 255f, 0xCA / 255f, 0xD2 / 255f, 1.0f),
+ Margin = new Extents(40, 0, 0, 0),
+ };
+ }
+
+ private static View CreateManualWifiView()
+ {
+ var manualWifi = new View()
+ {
+ Size = new Size(ListItemWidth, ListItemHeight),
+ Layout = new AbsoluteLayout(),
+ };
+
+ var addNewButton = new Button(ButtonStyles.AddNetwork)
+ {
+ Position = new Position(29, 20),
+ Size = new Size(42, 42),
+ };
+
+ addNewButton.ClickEvent += (s, e) => ShowAddNetworkPopup();
+ manualWifi.Add(addNewButton);
+
+ manualWifi.Add(new TextLabel()
+ {
+ TranslatableText = "WIFI_ADD_NEW_NETWORK",
+ Position = new Position(87, 29),
+ PixelSize = 20f,
+ TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ });
+ return manualWifi;
+ }
+
+ private static void ShowAddNetworkPopup()
+ {
+ var view = new AddNewNetworkPupup();
+ var popup = new Common.Utils.Popup(view);
+ view.OnDismiss += popup.Dismiss;
+ popup.Show();
+ }
+
+ private static void ShowPasswordPopup(Tizen.Network.WiFi.WiFiAP wifiAp)
+ {
+ var view = new WifiPasswordPopup(wifiAp);
+ var popup = new Common.Utils.Popup(view);
+ view.OnDismiss += popup.Dismiss;
+ popup.Show();
+ }
+
+ private static void OnApTapped(Tizen.Network.WiFi.WiFiAP wifiAp)
+ {
+ if (wifiAp.NetworkInformation.ConnectionState == Tizen.Network.WiFi.WiFiConnectionState.Connected)
+ {
+ Tizen.Log.Debug("oobe", $"Already connected to {wifiAp.NetworkInformation.Essid}");
+ return;
+ }
+ ShowPasswordPopup(wifiAp);
+ }
+
+ private View CreateHeader(int width, int height)
+ {
+ var header = new View()
+ {
+ Size = new Size(width, height),
+ Layout = new AbsoluteLayout(),
+ };
+
+ header.Add(CreateWifiScanningPlaceHolder());
+
+ var scan = new Button(ButtonStyles.Scan)
+ {
+ Size = new Size(72, 32),
+ Position = new Position(276, 39),
+ };
+ scan.ClickEvent += async (s, e) =>
+ {
+ scan.IsEnabled = false;
+ ApManager.Views.Clear();
+ ApManager.UpdateTo(await State.Scan());
+ scan.IsEnabled = State.IsTurnedOn;
+ };
+ scan.IsEnabled = State.IsTurnedOn;
+ State.OnTurnedOff += () => scan.IsEnabled = State.IsTurnedOn;
+ State.OnTurnedOn += () => scan.IsEnabled = State.IsTurnedOn;
+ header.Add(scan);
+
+ header.Add(CreateTurnOnButton());
+ return header;
+ }
+
+ private Button CreateTurnOnButton()
+ {
+ var button = new Button(ButtonStyles.TurnOnOff)
+ {
+ Size = new Size(72, 32),
+ Position = new Position(369, 39),
+ };
+ button.IsSelected = State.IsTurnedOn;
+
+ State.OnTurnedOff += () => button.IsSelected = State.IsTurnedOn;
+ State.OnTurnedOn += () => button.IsSelected = State.IsTurnedOn;
+
+ button.ClickEvent += async (s, e) =>
+ {
+ button.IsEnabled = false;
+ await State.TurnWifi();
+ button.IsEnabled = true;
+ };
+ return button;
+ }
+
+ private View CreateListViewPlaceHolder()
+ {
+ var view = new View();
+ //var listView = new ListView(480, 324)//314)//480, 335
+ var listView = new ListView(480, 319)
+ {
+ Footer = CreateManualWifiView(),
+ Items = ApManager.Views,
+ SeparatorFactory = CreateSeparator,
+ }.View;
+ view.Add(listView);
+
+ var prompt = new TextLabel()
+ {
+ Position = new Position(40, 21),
+ PixelSize = 20,
+ TextColor = new Color(0, 0x14 / 255f, 0x47 / 255f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ };
+ view.Add(prompt);
+
+ void turnOn()
+ {
+ prompt.Hide();
+ listView.Show();
+ }
+ void turnOff(string message)
+ {
+ listView.Hide();
+ prompt.TranslatableText = message;
+ prompt.Show();
+ }
+ if (State.IsTurnedOn)
+ turnOn();
+ else
+ turnOff("WIFI_TURN_ON_WIFI");
+ State.OnTurnedOff += () => turnOff("WIFI_TURN_ON_WIFI");
+ State.OnTurnedOn += () => turnOn();
+ State.OnTurningOnFailed += () => turnOff("WIFI_CONNECTION_FAILED");
+ return view;
+ }
+
+ private static View CreateScanningView()
+ {
+ var view = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ }
+ };
+
+ var progress = new View()
+ {
+ Size = new Size(22, 23),
+ Margin = new Extents(0, 0, 1, 0),
+ BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_scanning.png"),
+ };
+ view.Add(progress);
+
+ Animation animation = null;
+ progress.VisibilityChanged += (s, e) =>
+ {
+ if (e.Visibility == false)
+ {
+ animation?.Stop();
+ animation?.Clear();
+ animation?.Dispose();
+ animation = null;
+ progress.Orientation = new Rotation(new Radian(new Degree(0)), new Vector3(0, 0, -1));
+ }
+ else if (animation == null)
+ {
+ animation = new Animation(1_000);
+ animation.Looping = true;
+ animation.AnimateTo(progress, "Orientation", new Rotation(new Radian(new Degree(180)), new Vector3(0, 0, -1)), new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear));
+ animation.Play();
+ }
+ };
+
+ view.Add(new TextLabel()
+ {
+ Size = new Size(190, 25),
+ TranslatableText = "WIFI_SCANNING",
+ Margin = new Extents(17, 0, 0, 0),
+ VerticalAlignment = VerticalAlignment.Center,
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ PixelSize = 20f,
+ TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ });
+ return view;
+ }
+
+ private View CreateWifiScanningPlaceHolder()
+ {
+ var view = new View()
+ {
+ Position = new Position(40, 43),
+ };
+
+ var wifi = new TextLabel("Wi-Fi")
+ {
+ //Size = new Size(49, 24),
+ PixelSize = 20f,
+ TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ };
+ view.Add(wifi);
+
+ var scanning = CreateScanningView();
+ view.Add(scanning);
+
+ void startScan()
+ {
+ wifi.Hide();
+ scanning.Show();
+ }
+ void finishScan()
+ {
+ scanning.Hide();
+ wifi.Show();
+ }
+ finishScan();
+ State.OnScanStarted += startScan;
+ State.OnScanFinished += finishScan;
+ return view;
+ }
+
+ public void Dispose()
+ {
+ view = null;
+ ApManager.Dispose();
+ State.Dispose();
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Library</OutputType>
+ <TargetFramework>tizen80</TargetFramework>
+ <LangVersion>8.0</LangVersion>
+ <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Tizen.NET" Version="8.0.0.15148" />
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\Oobe.Common\Oobe.Common.csproj" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Compile Update="Controls\Wifi\Translations.Designer.cs">
+ <DesignTime>True</DesignTime>
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Translations.resx</DependentUpon>
+ </Compile>
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Update="Controls\Wifi\Translations.ko-KR.resx">
+ <Generator>PublicResXFileCodeGenerator</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Update="Controls\Wifi\Translations.pl-PL.resx">
+ <Generator>PublicResXFileCodeGenerator</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Update="Controls\Wifi\Translations.resx">
+ <Generator>PublicResXFileCodeGenerator</Generator>
+ <LastGenOutput>Translations.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ </ItemGroup>
+</Project>
--- /dev/null
+using Oobe.Common.Interfaces;
+using Tizen.NUI.Components;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Oobe.Wifi.Controls.Wifi;
+using Tizen.Network.WiFi;
+using System;
+using System.Collections.Generic;
+using Oobe.Common.Styles;
+
+namespace Oobe.Wifi
+{
+ public class WifiStep : ProcessStep
+ {
+ private WifiView wifiView = null;
+ private EventHandler<ConnectionStateChangedEventArgs> connectionChanged;
+
+ public override View CreateView(IProcessNavigation nav)
+ {
+ DisposeView();
+
+ var view = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ },
+ };
+
+ view.Add(new TextLabel()
+ {
+ TranslatableText = "CHOOSE_WIFI_NETWORK",
+ Size = new Size(0, 58),
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ Margin = new Extents(0, 0, 20, 8),
+ PixelSize = 48.0f,
+ TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddLightFontStyle(),
+ HorizontalAlignment = HorizontalAlignment.Center,
+ });
+
+ wifiView = new WifiView();
+ wifiView.View.Size = new Size(480, 416);
+ wifiView.View.PositionUsesPivotPoint = true;
+ wifiView.View.PivotPoint = new Position(0.5f, 0);
+ wifiView.View.ParentOrigin = new Position(0.5f, 0);
+ view.Add(wifiView.View);
+
+ view.Add(CreateBottomView(nav));
+ return view;
+ }
+
+ private View CreateBottomView(IProcessNavigation nav)
+ {
+ var view = new View()
+ {
+ Size = new Size(1184, 122),
+ Layout = new AbsoluteLayout(),
+ };
+
+ var prev = new Button(Common.Styles.ButtonStyles.Previous)
+ {
+ Position = new Position(56, 10),
+ Size2D = new Size2D(240, 72),
+ };
+ Oobe.Common.Styles.ButtonsExtensions.SetFontStyle(prev, new PropertyMap().AddBoldFontStyle());
+ prev.ClickEvent += (s, e) => nav.Previous();
+ view.Add(prev);
+
+ var next = new Button()
+ {
+ Position = new Position(888, 10),
+ Size2D = new Size2D(240, 72),
+ };
+ next.SetFontStyle(new PropertyMap().AddBoldFontStyle());
+ next.ClickEvent += (s, e) => nav.Next();
+ view.Add(next);
+
+ void applyStyle(bool isConnected) => next.ApplyStyle(isConnected
+ ? Common.Styles.ButtonStyles.Next
+ : Common.Styles.ButtonStyles.Skip);
+ applyStyle(WiFiManager.ConnectionState == WiFiConnectionState.Connected);
+
+ connectionChanged = (s, e) => applyStyle(e.State == WiFiConnectionState.Connected);
+ WiFiManager.ConnectionStateChanged += connectionChanged;
+ return view;
+ }
+
+ public override void OnShutdown()
+ {
+ base.OnShutdown();
+ DisposeView();
+ }
+
+ private void DisposeView()
+ {
+ wifiView?.Dispose();
+ wifiView = null;
+ WiFiManager.ConnectionStateChanged -= connectionChanged;
+ connectionChanged = null;
+ }
+ }
+}
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oobe", "Oobe\Oobe.csproj", "{998E09D0-AD89-4CD4-9C61-824C3D5C7591}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OobeCommon", "OobeCommon\OobeCommon.csproj", "{C95E2A13-6D19-4E14-941F-34075D7C5B3C}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oobe.Common", "Oobe.Common\Oobe.Common.csproj", "{27357F2B-C82B-4D7A-AA9D-B1E450A83054}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OobeLanguage", "OobeLanguage\OobeLanguage.csproj", "{E63AB519-2423-4AD4-90DE-DD37D66C248E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oobe.Language", "Oobe.Language\Oobe.Language.csproj", "{AC2F0BCD-AA11-4003-90B0-F1C382E5D5A9}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OobeRegion", "OobeRegion\OobeRegion.csproj", "{D98E4A90-7105-4D65-8215-E6C37F94F395}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oobe.Region", "Oobe.Region\Oobe.Region.csproj", "{0984A92A-D896-4F63-B8DD-3DB7F492BF60}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OobeWifi", "OobeWifi\OobeWifi.csproj", "{DCF08A67-2636-4CDD-86E4-1633790D13F0}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oobe.Terms", "Oobe.Terms\Oobe.Terms.csproj", "{DED0FC46-E907-4116-9182-3119637FC265}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OobeWelcome", "Oobe.Welcome\OobeWelcome.csproj", "{28277019-EDEA-4F11-8499-13D2A0ADB750}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oobe.Welcome", "Oobe.Welcome\Oobe.Welcome.csproj", "{B5D33F73-CA41-467A-B61C-367AEEBCC22A}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OobeTerms", "Oobe.Terms\OobeTerms.csproj", "{49E07EA6-1807-4CE5-B1C8-764D12FED15C}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oobe.Wifi", "Oobe.Wifi\Oobe.Wifi.csproj", "{7E72B190-EF0F-49DB-88BA-1FB27EF683A6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
{998E09D0-AD89-4CD4-9C61-824C3D5C7591}.Debug|Any CPU.Build.0 = Debug|Any CPU
{998E09D0-AD89-4CD4-9C61-824C3D5C7591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{998E09D0-AD89-4CD4-9C61-824C3D5C7591}.Release|Any CPU.Build.0 = Release|Any CPU
- {C95E2A13-6D19-4E14-941F-34075D7C5B3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C95E2A13-6D19-4E14-941F-34075D7C5B3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C95E2A13-6D19-4E14-941F-34075D7C5B3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C95E2A13-6D19-4E14-941F-34075D7C5B3C}.Release|Any CPU.Build.0 = Release|Any CPU
- {E63AB519-2423-4AD4-90DE-DD37D66C248E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E63AB519-2423-4AD4-90DE-DD37D66C248E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E63AB519-2423-4AD4-90DE-DD37D66C248E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E63AB519-2423-4AD4-90DE-DD37D66C248E}.Release|Any CPU.Build.0 = Release|Any CPU
- {D98E4A90-7105-4D65-8215-E6C37F94F395}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D98E4A90-7105-4D65-8215-E6C37F94F395}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D98E4A90-7105-4D65-8215-E6C37F94F395}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D98E4A90-7105-4D65-8215-E6C37F94F395}.Release|Any CPU.Build.0 = Release|Any CPU
- {DCF08A67-2636-4CDD-86E4-1633790D13F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DCF08A67-2636-4CDD-86E4-1633790D13F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DCF08A67-2636-4CDD-86E4-1633790D13F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DCF08A67-2636-4CDD-86E4-1633790D13F0}.Release|Any CPU.Build.0 = Release|Any CPU
- {28277019-EDEA-4F11-8499-13D2A0ADB750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {28277019-EDEA-4F11-8499-13D2A0ADB750}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {28277019-EDEA-4F11-8499-13D2A0ADB750}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {28277019-EDEA-4F11-8499-13D2A0ADB750}.Release|Any CPU.Build.0 = Release|Any CPU
- {49E07EA6-1807-4CE5-B1C8-764D12FED15C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {49E07EA6-1807-4CE5-B1C8-764D12FED15C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {49E07EA6-1807-4CE5-B1C8-764D12FED15C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {49E07EA6-1807-4CE5-B1C8-764D12FED15C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {27357F2B-C82B-4D7A-AA9D-B1E450A83054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {27357F2B-C82B-4D7A-AA9D-B1E450A83054}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {27357F2B-C82B-4D7A-AA9D-B1E450A83054}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {27357F2B-C82B-4D7A-AA9D-B1E450A83054}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AC2F0BCD-AA11-4003-90B0-F1C382E5D5A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AC2F0BCD-AA11-4003-90B0-F1C382E5D5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AC2F0BCD-AA11-4003-90B0-F1C382E5D5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AC2F0BCD-AA11-4003-90B0-F1C382E5D5A9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0984A92A-D896-4F63-B8DD-3DB7F492BF60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0984A92A-D896-4F63-B8DD-3DB7F492BF60}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0984A92A-D896-4F63-B8DD-3DB7F492BF60}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0984A92A-D896-4F63-B8DD-3DB7F492BF60}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DED0FC46-E907-4116-9182-3119637FC265}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DED0FC46-E907-4116-9182-3119637FC265}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DED0FC46-E907-4116-9182-3119637FC265}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DED0FC46-E907-4116-9182-3119637FC265}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B5D33F73-CA41-467A-B61C-367AEEBCC22A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B5D33F73-CA41-467A-B61C-367AEEBCC22A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B5D33F73-CA41-467A-B61C-367AEEBCC22A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B5D33F73-CA41-467A-B61C-367AEEBCC22A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7E72B190-EF0F-49DB-88BA-1FB27EF683A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7E72B190-EF0F-49DB-88BA-1FB27EF683A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7E72B190-EF0F-49DB-88BA-1FB27EF683A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7E72B190-EF0F-49DB-88BA-1FB27EF683A6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
public override string? GetString(string name)
{
return base.GetString(name)
- ?? OobeWifi.Controls.Wifi.Translations.ResourceManager.GetString(name);
+ ?? Oobe.Wifi.Controls.Wifi.Translations.ResourceManager.GetString(name);
}
public override string? GetString(string name, CultureInfo culture)
{
return base.GetString(name, culture)
- ?? OobeWifi.Controls.Wifi.Translations.ResourceManager.GetString(name, culture);
+ ?? Oobe.Wifi.Controls.Wifi.Translations.ResourceManager.GetString(name, culture);
}
}
}
using Tizen.NUI.Components;
using System;
using System.Globalization;
-using OobeCommon.Resources;
+using Oobe.Common.Resources;
using Oobe.Managers;
namespace Oobe
var culture = CultureInfo.CreateSpecificCulture(language);
CultureInfo.CurrentCulture = culture;
Translations.Culture = culture;
- OobeWifi.Controls.Wifi.Translations.Culture = culture;
+ Oobe.Wifi.Controls.Wifi.Translations.Culture = culture;
}
catch (Exception e)
{
Tizen.Log.Debug("oobe", "Setting Language failed:" + e.Message);
}
}
- NUIApplication.MultilingualResourceManager = new MultiResourceManager("OobeCommon.Resources.Translations", typeof(Translations).Assembly);
+ NUIApplication.MultilingualResourceManager = new MultiResourceManager("Oobe.Common.Resources.Translations", typeof(Translations).Assembly);
Tizen.System.SystemSettings.LocaleLanguageChanged += (s, e) => SetLanguage();
SetLanguage();
}
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />
- <ProjectReference Include="..\OobeLanguage\OobeLanguage.csproj" />
- <ProjectReference Include="..\OobeRegion\OobeRegion.csproj" />
- <ProjectReference Include="..\Oobe.Welcome\OobeWelcome.csproj" />
- <ProjectReference Include="..\Oobe.Terms\OobeTerms.csproj" />
- <ProjectReference Include="..\OobeWifi\OobeWifi.csproj" />
+ <ProjectReference Include="..\Oobe.Common\Oobe.Common.csproj" />
+ <ProjectReference Include="..\Oobe.Language\Oobe.Language.csproj" />
+ <ProjectReference Include="..\Oobe.Region\Oobe.Region.csproj" />
+ <ProjectReference Include="..\Oobe.Welcome\Oobe.Welcome.csproj" />
+ <ProjectReference Include="..\Oobe.Terms\Oobe.Terms.csproj" />
+ <ProjectReference Include="..\Oobe.Wifi\Oobe.Wifi.csproj" />
</ItemGroup>
</Project>
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using Tizen.NUI;
-using Tizen.NUI.Binding;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Oobe.Common.Utils;
-
-namespace Oobe.Common.Controls
-{
- public class CarouselPicker : Control
- {
- public event EventHandler SelectedItemChanged;
-
- private Oobe.Common.Controls.ScrollableBase scrollableBase;
- private View itemsListView;
- private View upperLine, lowerLine;
-
- private Vector3 textCenterColorHSV = new Vector3();
- private Vector3 textOuterColorHSV = new Vector3();
-
- private float textCenterOpacity;
- private float textOuterOpacity;
-
- private List<CarouselPickerItemData> items = new List<CarouselPickerItemData>();
-
- public CarouselPicker() : base()
- {
- }
-
- public CarouselPicker(CarouselPickerStyle style) : base(style)
- {
- //TODO fix a bug with style not properly applied by base class
- ApplyStyle(style);
- }
-
- public void AddItem(CarouselPickerItemData item)
- {
- var view = CreateItemView(item);
- itemsListView.Add(view);
- items.Add(item);
- }
-
- public void RemoveItem(CarouselPickerItemData item)
- {
- var index = items.IndexOf(item);
- items.Remove(item);
- itemsListView.Children.RemoveAt(index);
- }
-
- private int selectedItemIndex = 0;
- public int SelectedItemIndex
- {
- get
- {
- return selectedItemIndex;
- }
- set
- {
- //always scroll
- scrollableBase.ScrollToIndex(value);
- if (selectedItemIndex != value)
- {
- SelectedItemChanged?.Invoke(this, null);
- selectedItemIndex = value;
- }
- }
- }
-
- public override void ApplyStyle(ViewStyle viewStyle)
- {
- base.ApplyStyle(viewStyle);
-
- CarouselPickerStyle style = viewStyle as CarouselPickerStyle;
-
- if (style != null)
- {
- Layout = new LinearLayout
- {
- LinearOrientation = LinearLayout.Orientation.Vertical,
- LinearAlignment = LinearLayout.Alignment.Center,
- };
- ClippingMode = ClippingModeType.ClipToBoundingBox;
-
- // Animatable properties
- textCenterColorHSV = Style.CenterText?.TextColor?.All?.ToHSV() ?? new Vector3();
- textCenterOpacity = Style.CenterText?.Opacity?.All ?? 1.0f;
-
- textOuterColorHSV = Style.OuterText?.TextColor?.All?.ToHSV() ?? new Vector3();
- textOuterOpacity = Style.OuterText?.Opacity?.All ?? 1.0f;
-
-
- if (itemsListView != null)
- {
- scrollableBase?.Remove(itemsListView);
- itemsListView.Dispose();
- }
-
- itemsListView = new View
- {
- Layout = new LinearLayout
- {
- LinearOrientation = LinearLayout.Orientation.Vertical,
- },
- WidthSpecification = LayoutParamPolicies.MatchParent,
- HeightSpecification = LayoutParamPolicies.WrapContent,
- };
-
- if (scrollableBase != null)
- {
- Remove(scrollableBase);
- scrollableBase.Dispose();
- }
-
- scrollableBase = new Oobe.Common.Controls.ScrollableBase
- {
- ClippingMode = ClippingModeType.Disabled,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- SnapToPage = true,
- ScrollingDirection = ScrollableBase.Direction.Vertical,
- ScrollEnabled = true,
- SizeHeight = CalculateScrollerSize(),
- FlickDistanceMultiplierRange = new Vector2(4.6f, 5.8f),
- EventsView = this,
- };
-
- scrollableBase.ScrollEvent += (sender, args) =>
- {
- UpdateItems();
- };
- scrollableBase.ScrollAnimationEndEvent += (sender, args) =>
- {
- if (selectedItemIndex != scrollableBase.CurrentPage)
- {
- selectedItemIndex = scrollableBase.CurrentPage;
- SelectedItemChanged?.Invoke(this, null);
- }
- };
-
- if (upperLine != null)
- {
- Remove(upperLine);
- upperLine.Dispose();
- }
-
- upperLine = new View()
- {
- BackgroundColor = Style.LinesColor,
- Size2D = new Size2D(0, 1),
- WidthResizePolicy = ResizePolicyType.FillToParent,
- Position2D = new Position2D(0, 93),
- Opacity = 0.95f,
- };
-
- if (lowerLine != null)
- {
- Remove(lowerLine);
- lowerLine.Dispose();
- }
-
- lowerLine = new View()
- {
- BackgroundColor = Style.LinesColor,
- Size2D = new Size2D(0, 1),
- WidthResizePolicy = ResizePolicyType.FillToParent,
- Position2D = new Position2D(0, 156),
- Opacity = 0.95f,
- };
-
- scrollableBase.Add(itemsListView);
-
- Add(upperLine);
- Add(scrollableBase);
- Add(lowerLine);
- }
- }
-
- private float CalculateScrollerSize()
- {
- float size = 0.0f;
-
- size += Style.CenterText?.Size2D?.Height ?? 0.0f;
- size += (float)Style.CenterText?.Margin?.Top;
- size += (float)Style.CenterText?.Margin?.Bottom;
-
- return size;
- }
-
- private View CreateItemView(CarouselPickerItemData item)
- {
- var view = new TextLabel();
- // TODO for some reason TextLabel(Style.CenterText)
- // or view.ApplyStyle(Style.CenterText) do not work here so set
- // everything manually
- // var view = new TextLabel(Style.CenterText);
- // view.ApplyStyle(Style.CenterText);
- view.Text = item.Text;
- view.TranslatableText = item.TranslatableText;
- view.Size2D = Style.CenterText?.Size2D ?? new Size2D();
- view.PixelSize = Style.CenterText?.PixelSize ?? 10.0f;
- view.Margin = Style.CenterText?.Margin ?? new Extents();
- view.HorizontalAlignment = Style.CenterText?.HorizontalAlignment ?? HorizontalAlignment.Center;
- view.VerticalAlignment = Style.CenterText?.VerticalAlignment ?? VerticalAlignment.Center;
- view.Opacity = Style.CenterText?.Opacity?.All ?? 1.0f;
- //TODO other properties?
- return view;
- }
-
- protected override void OnUpdate()
- {
- base.OnUpdate();
- UpdateItems();
- }
-
- protected override void Dispose(Tizen.NUI.DisposeTypes type)
- {
- if (disposed)
- {
- return;
- }
-
- if (type == DisposeTypes.Explicit)
- {
- // Dispose all containing widgets
- scrollableBase.Dispose();
- upperLine.Dispose();
- lowerLine.Dispose();
- }
-
- base.Dispose(type);
- }
-
- public new CarouselPickerStyle Style => ViewStyle as CarouselPickerStyle;
-
- protected override ViewStyle GetViewStyle()
- {
- var ret = new CarouselPickerStyle();
- return ret;
- }
-
- private void CreateMainList()
- {
- }
-
- private Vector3 ScaleVector(Vector3 from, Vector3 to, float percent)
- {
- percent = Math.Clamp(percent, 0.0f, 1.0f);
-
- float a = from[0] + (to[0] - from[0]) * percent;
- float b = from[1] + (to[1] - from[1]) * percent;
- float c = from[2] + (to[2] - from[2]) * percent;
-
- return new Vector3(a, b, c);
- }
-
- private float ScaleScalar(float from, float to, float percent)
- {
- percent = Math.Clamp(percent, 0.0f, 1.0f);
- return from + (to - from) * percent;
- }
-
- private void UpdateItems()
- {
- float mid = itemsListView.PositionY - (int)(scrollableBase.Size2D.Height / 2.0f);
- int threshold = 80; // after this value the color will become outer
-
- foreach (View view in itemsListView.Children)
- {
- TextLabel itemView = view as TextLabel;
- if (itemView == null) continue;
-
- float viewMid = view.PositionY + view.Size2D.Height / 2.0f;
- float percent = Math.Abs(viewMid + mid) / threshold;
-
- itemView.Opacity = ScaleScalar(textCenterOpacity, textOuterOpacity, percent);
- itemView.TextColor = ColorUtils.ColorFromHSV(ScaleVector(textCenterColorHSV, textOuterColorHSV, percent));
- }
- }
- }
-}
+++ /dev/null
-using System;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-
-namespace Oobe.Common.Controls
-{
- public class CarouselPickerItemData
- {
- public CarouselPickerItemData()
- {
- }
-
- public string Text { get; set; }
-
- public string TranslatableText { get; set; }
- }
-}
+++ /dev/null
-using System;
-using Tizen.NUI;
-using Tizen.NUI.Components;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Binding;
-
-namespace Oobe.Common.Controls
-{
- public class CarouselPickerStyle : ControlStyle
- {
- public CarouselPickerStyle() : base()
- {
- InitSubStyle();
- }
-
- public TextLabelStyle CenterText { get; set; }
-
- public TextLabelStyle OuterText { get; set; }
-
- public Color LinesColor { get; set; }
-
- private void InitSubStyle()
- {
- CenterText = new TextLabelStyle
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center
- };
- OuterText = new TextLabelStyle
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center
- };
- LinesColor = Color.Black;
- }
-
- public override void CopyFrom(BindableObject bindableObject)
- {
- base.CopyFrom(bindableObject);
-
- CarouselPickerStyle carouselSelectorStyle = bindableObject as CarouselPickerStyle;
-
- if (carouselSelectorStyle != null)
- {
- CenterText?.CopyFrom(carouselSelectorStyle.CenterText);
- OuterText?.CopyFrom(carouselSelectorStyle.OuterText);
- LinesColor = carouselSelectorStyle.LinesColor;
- }
- }
- }
-}
+++ /dev/null
-/* Copyright (c) 2019 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 System;
-using Tizen.NUI.BaseComponents;
-using System.ComponentModel;
-using System.Diagnostics;
-using Tizen.NUI.Components;
-using Tizen.NUI;
-
-namespace Oobe.Common.Controls
-{
- /// <summary>
- /// [Draft] This class provides a View that can scroll a single View with a layout. This View can be a nest of Views.
- /// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ScrollableBase : Control
- {
- static bool LayoutDebugScrollableBase = false; // Debug flag
- private Direction mScrollingDirection = Direction.Vertical;
- private bool mScrollEnabled = true;
- private int mPageWidth = 0;
- private int mPageHeight = 0;
-
- private class ScrollableBaseCustomLayout : LayoutGroup
- {
- protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
- {
- Extents padding = Padding;
- float totalHeight = padding.Top + padding.Bottom;
- float totalWidth = padding.Start + padding.End;
-
- MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK;
- MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK;
-
- Direction scrollingDirection = Direction.Vertical;
- ScrollableBase scrollableBase = this.Owner as ScrollableBase;
- if (scrollableBase)
- {
- scrollingDirection = scrollableBase.ScrollingDirection;
- }
-
- // measure child, should be a single scrolling child
- foreach( LayoutItem childLayout in LayoutChildren )
- {
- if (childLayout != null)
- {
- // Get size of child
- // Use an Unspecified MeasureSpecification mode so scrolling child is not restricted to it's parents size in Height (for vertical scrolling)
- // or Width for horizontal scrolling
- MeasureSpecification unrestrictedMeasureSpec = new MeasureSpecification( heightMeasureSpec.Size, MeasureSpecification.ModeType.Unspecified);
-
- if (scrollingDirection == Direction.Vertical)
- {
- MeasureChild( childLayout, widthMeasureSpec, unrestrictedMeasureSpec ); // Height unrestricted by parent
- }
- else
- {
- MeasureChild( childLayout, unrestrictedMeasureSpec, heightMeasureSpec ); // Width unrestricted by parent
- }
-
- float childWidth = childLayout.MeasuredWidth.Size.AsDecimal();
- float childHeight = childLayout.MeasuredHeight.Size.AsDecimal();
-
- // Determine the width and height needed by the children using their given position and size.
- // Children could overlap so find the left most and right most child.
- Position2D childPosition = childLayout.Owner.Position2D;
- float childLeft = childPosition.X;
- float childTop = childPosition.Y;
-
- // Store current width and height needed to contain all children.
- Extents childMargin = childLayout.Margin;
- totalWidth = childWidth + childMargin.Start + childMargin.End;
- totalHeight = childHeight + childMargin.Top + childMargin.Bottom;
-
- if (childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
- {
- childWidthState = MeasuredSize.StateType.MeasuredSizeTooSmall;
- }
- if (childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
- {
- childHeightState = MeasuredSize.StateType.MeasuredSizeTooSmall;
- }
- }
- }
-
-
- MeasuredSize widthSizeAndState = ResolveSizeAndState(new LayoutLength(totalWidth + Padding.Start + Padding.End), widthMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
- MeasuredSize heightSizeAndState = ResolveSizeAndState(new LayoutLength(totalHeight + Padding.Top + Padding.Bottom), heightMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
- totalWidth = widthSizeAndState.Size.AsDecimal();
- totalHeight = heightSizeAndState.Size.AsDecimal();
-
- // Ensure layout respects it's given minimum size
- totalWidth = Math.Max( totalWidth, SuggestedMinimumWidth.AsDecimal() );
- totalHeight = Math.Max( totalHeight, SuggestedMinimumHeight.AsDecimal() );
-
- widthSizeAndState.State = childWidthState;
- heightSizeAndState.State = childHeightState;
-
- SetMeasuredDimensions( ResolveSizeAndState( new LayoutLength(totalWidth + Padding.Start + Padding.End), widthMeasureSpec, childWidthState ),
- ResolveSizeAndState( new LayoutLength(totalHeight + Padding.Top + Padding.Bottom), heightMeasureSpec, childHeightState ) );
-
- // Size of ScrollableBase is changed. Change Page width too.
- scrollableBase.mPageWidth = (int)MeasuredWidth.Size.AsRoundedValue();
- scrollableBase.mPageHeight = (int)MeasuredHeight.Size.AsRoundedValue();
- Tizen.Log.Debug("ScrollableBase", $"Page.Width: {scrollableBase.mPageWidth}");
- Tizen.Log.Debug("ScrollableBase", $"Page.Height: {scrollableBase.mPageHeight}");
- }
-
- protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
- {
- ScrollableBase scrollableBase = this.Owner as ScrollableBase;
- foreach( LayoutItem childLayout in LayoutChildren )
- {
- if( childLayout != null )
- {
- LayoutLength childWidth = childLayout.MeasuredWidth.Size;
- LayoutLength childHeight = childLayout.MeasuredHeight.Size;
-
- Position2D childPosition = childLayout.Owner.Position2D;
- Extents padding = Padding;
- Extents childMargin = childLayout.Margin;
-
- LayoutLength childLeft = new LayoutLength(childPosition.X + childMargin.Start + padding.Start);
- LayoutLength childTop = new LayoutLength(childPosition.Y + childMargin.Top + padding.Top);
-
- childLayout.Layout( childLeft, childTop, childLeft + childWidth, childTop + childHeight );
- }
- }
- // workaround issue with ScrollableBase not properly scrolling
- // to index when ScrollToIndex is used before layouting
- scrollableBase.ScrollToIndex(scrollableBase.CurrentPage);
- }
- } // ScrollableBaseCustomLayout
-
- /// <summary>
- /// The direction axis to scroll.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public enum Direction
- {
- /// <summary>
- /// Horizontal axis.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- Horizontal,
-
- /// <summary>
- /// Vertical axis.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- Vertical
- }
-
- /// <summary>
- /// [Draft] Configurable speed threshold that register the gestures as a flick.
- /// If the flick speed less than the threshold then will not be considered a flick.
- /// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public float FlickThreshold { get; set; } = 0.2f;
-
- /// <summary>
- /// [Draft] Configurable duration modifer for the flick animation.
- /// Determines the speed of the scroll, large value results in a longer flick animation. Range (0.1 - 1.0)
- /// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public float FlickAnimationSpeed { get; set; } = 0.4f;
-
- /// <summary>
- /// [Draft] Configurable modifer for the distance to be scrolled when flicked detected.
- /// It a ratio of the ScrollableBase's length. (not child's length).
- /// First value is the ratio of the distance to scroll with the weakest flick.
- /// Second value is the ratio of the distance to scroll with the strongest flick.
- /// Second > First.
- /// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Vector2 FlickDistanceMultiplierRange { get; set; } = new Vector2(0.6f, 1.8f);
-
- /// <summary>
- /// [Draft] Scrolling direction mode.
- /// Default is Vertical scrolling.
- /// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Direction ScrollingDirection
- {
- get
- {
- return mScrollingDirection;
- }
- set
- {
- if(value != mScrollingDirection)
- {
- mScrollingDirection = value;
- mPanGestureDetector.RemoveDirection(value == Direction.Horizontal ? PanGestureDetector.DirectionVertical : PanGestureDetector.DirectionHorizontal);
- mPanGestureDetector.AddDirection(value == Direction.Horizontal ? PanGestureDetector.DirectionHorizontal : PanGestureDetector.DirectionVertical);
- }
- }
- }
-
- /// <summary>
- /// [Draft] Enable or disable scrolling.
- /// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool ScrollEnabled
- {
- get
- {
- return mScrollEnabled;
- }
- set
- {
- if (value != mScrollEnabled)
- {
- mScrollEnabled = value;
- if(mScrollEnabled)
- {
- mPanGestureDetector.Detected += OnPanGestureDetected;
- mTapGestureDetector.Detected += OnTapGestureDetected;
- }
- else
- {
- mPanGestureDetector.Detected -= OnPanGestureDetected;
- mTapGestureDetector.Detected -= OnTapGestureDetected;
- }
- }
- }
- }
-
- /// <summary>
- /// [Draft] Pages mode, enables moving to the next or return to current page depending on pan displacement.
- /// Default is false.
- /// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool SnapToPage { set; get; } = false;
-
- /// <summary>
- /// [Draft] Get current page.
- /// Working propery with SnapToPage property.
- /// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int CurrentPage { get; private set; } = 0;
-
- /// <summary>
- /// [Draft] Duration of scroll animation.
- /// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
-
- public int ScrollDuration { set; get; } = 125;
- /// <summary>
- /// [Draft] Scroll Available area.
- /// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Rectangle ScrollAvailableArea { set; get; }
-
- /// <summary>
- /// ScrollEventArgs is a class to record scroll event arguments which will sent to user.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ScrollEventArgs : EventArgs
- {
- Position position;
-
- /// <summary>
- /// Default constructor.
- /// </summary>
- /// <param name="position">Current scroll position</param>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- public ScrollEventArgs(Position position)
- {
- this.position = position;
- }
-
- /// <summary>
- /// [Draft] Current scroll position.
- /// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Position Position
- {
- get
- {
- return position;
- }
- }
- }
-
- /// <summary>
- /// An event emitted when user starts dragging ScrollableBase, user can subscribe or unsubscribe to this event handler.<br />
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ScrollEventArgs> ScrollDragStartEvent;
-
- /// <summary>
- /// An event emitted when user stops dragging ScrollableBase, user can subscribe or unsubscribe to this event handler.<br />
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ScrollEventArgs> ScrollDragEndEvent;
-
-
- /// <summary>
- /// An event emitted when the scrolling slide animation starts, user can subscribe or unsubscribe to this event handler.<br />
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ScrollEventArgs> ScrollAnimationStartEvent;
-
- /// <summary>
- /// An event emitted when the scrolling slide animation ends, user can subscribe or unsubscribe to this event handler.<br />
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ScrollEventArgs> ScrollAnimationEndEvent;
-
-
- /// <summary>
- /// An event emitted when scrolling, user can subscribe or unsubscribe to this event handler.<br />
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ScrollEventArgs> ScrollEvent;
-
- private Animation scrollAnimation;
- private float maxScrollDistance;
- private float childTargetPosition = 0.0f;
- private PanGestureDetector mPanGestureDetector;
- private TapGestureDetector mTapGestureDetector;
- private View mScrollingChild;
- private float multiplier =1.0f;
- private bool scrolling = false;
- private float ratioOfScreenWidthToCompleteScroll = 0.4f;
- private float totalDisplacementForPan = 0.0f;
-
- // If false then can only flick pages when the current animation/scroll as ended.
- private bool flickWhenAnimating = false;
- private PropertyNotification propertyNotification;
-
- /// <summary>
- /// [Draft] Constructor
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ScrollableBase() : base()
- {
- mPanGestureDetector = new PanGestureDetector();
- //mPanGestureDetector.Attach(this);
- mPanGestureDetector.AddDirection(PanGestureDetector.DirectionVertical);
- mPanGestureDetector.Detected += OnPanGestureDetected;
-
- mTapGestureDetector = new TapGestureDetector();
- //mTapGestureDetector.Attach(this);
- mTapGestureDetector.Detected += OnTapGestureDetected;
-
-
- ClippingMode = ClippingModeType.ClipToBoundingBox;
-
- mScrollingChild = new View();
- mScrollingChild.Name = "DefaultScrollingChild";
-
- Layout = new ScrollableBaseCustomLayout();
- EventsView = this;
- }
-
- private void OnPropertyChanged(object source, PropertyNotification.NotifyEventArgs args)
- {
- OnScroll();
- }
-
- /// <summary>
- /// Called after a child has been added to the owning view.
- /// </summary>
- /// <param name="view">The child which has been added.</param>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override void OnChildAdd(View view)
- {
- if(mScrollingChild.Name != "DefaultScrollingChild")
- {
- propertyNotification.Notified -= OnPropertyChanged;
- mScrollingChild.RemovePropertyNotification(propertyNotification);
- }
-
- mScrollingChild = view;
- propertyNotification = mScrollingChild?.AddPropertyNotification("position", PropertyCondition.Step(1.0f));
- propertyNotification.Notified += OnPropertyChanged;
-
- {
- if (Children.Count > 1)
- Tizen.Log.Error("ScrollableBase", $"Only 1 child should be added to ScrollableBase.");
- }
- }
-
- /// <summary>
- /// Called after a child has been removed from the owning view.
- /// </summary>
- /// <param name="view">The child which has been removed.</param>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override void OnChildRemove(View view)
- {
- propertyNotification.Notified -= OnPropertyChanged;
- mScrollingChild.RemovePropertyNotification(propertyNotification);
-
- mScrollingChild = new View();
- }
-
-
- /// <summary>
- /// Scrolls to the item at the specified index.
- /// </summary>
- /// <param name="index">Index of item.</param>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void ScrollToIndex(int index)
- {
- if(mScrollingChild.ChildCount-1 < index || index < 0)
- {
- return;
- }
-
- if(SnapToPage)
- {
- CurrentPage = index;
- }
-
- float destinationX;
- if (ScrollingDirection == Direction.Horizontal)
- {
- destinationX = -(mScrollingChild.Children[CurrentPage].Position.X + mScrollingChild.Children[CurrentPage].CurrentSize.Width/2 - CurrentSize.Width/2); // set to middle of current page
- } else
- {
- destinationX = -(mScrollingChild.Children[CurrentPage].Position.Y + mScrollingChild.Children[CurrentPage].CurrentSize.Height/2 - CurrentSize.Height/2); // set to middle of current page
- }
-
- AnimateChildTo(ScrollDuration, destinationX);
- }
-
- private void OnScrollDragStart()
- {
- ScrollEventArgs eventArgs = new ScrollEventArgs(mScrollingChild.CurrentPosition);
- ScrollDragStartEvent?.Invoke(this, eventArgs);
- }
-
- private void OnScrollDragEnd()
- {
- ScrollEventArgs eventArgs = new ScrollEventArgs(mScrollingChild.CurrentPosition);
- ScrollDragEndEvent?.Invoke(this, eventArgs);
- }
-
- private void OnScrollAnimationStart()
- {
- ScrollEventArgs eventArgs = new ScrollEventArgs(mScrollingChild.CurrentPosition);
- ScrollAnimationStartEvent?.Invoke(this, eventArgs);
- }
-
- private void OnScrollAnimationEnd()
- {
- ScrollEventArgs eventArgs = new ScrollEventArgs(mScrollingChild.CurrentPosition);
- ScrollAnimationEndEvent?.Invoke(this, eventArgs);
- }
-
- private void OnScroll()
- {
- ScrollEventArgs eventArgs = new ScrollEventArgs(mScrollingChild.CurrentPosition);
- ScrollEvent?.Invoke(this, eventArgs);
- }
-
- private void StopScroll()
- {
- if (scrollAnimation != null)
- {
- if (scrollAnimation.State == Animation.States.Playing)
- {
- Debug.WriteLineIf(LayoutDebugScrollableBase, "StopScroll Animation Playing");
- scrollAnimation.Stop(Animation.EndActions.Cancel);
- OnScrollAnimationEnd();
- }
- scrollAnimation.Clear();
- }
- }
-
- // static constructor registers the control type
- static ScrollableBase()
- {
- // ViewRegistry registers control type with DALi type registry
- // also uses introspection to find any properties that need to be registered with type registry
- CustomViewRegistry.Instance.Register(CreateInstance, typeof(ScrollableBase));
- }
-
- internal static CustomView CreateInstance()
- {
- return new ScrollableBase();
- }
-
- private void AnimateChildTo(int duration, float axisPosition)
- {
- Tizen.Log.Debug("ScrollableBase", "AnimationTo Animation Duration:" + duration + " Destination:" + axisPosition);
-
- StopScroll(); // Will replace previous animation so will stop existing one.
-
- if (scrollAnimation == null)
- {
- scrollAnimation = new Animation();
- scrollAnimation.Finished += ScrollAnimationFinished;
- }
-
- scrollAnimation.Duration = duration;
- scrollAnimation.DefaultAlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOutSine);
- scrollAnimation.AnimateTo(mScrollingChild, (ScrollingDirection == Direction.Horizontal) ? "PositionX" : "PositionY", axisPosition);
- scrolling = true;
- OnScrollAnimationStart();
- scrollAnimation.Play();
- }
-
- private void ScrollBy(float displacement, bool animate)
- {
- if (GetChildCount() == 0 || displacement == 0 || maxScrollDistance < 0)
- {
- return;
- }
-
- float childCurrentPosition = (ScrollingDirection == Direction.Horizontal) ? mScrollingChild.PositionX: mScrollingChild.PositionY;
-
- Debug.WriteLineIf(LayoutDebugScrollableBase, "ScrollBy childCurrentPosition:" + childCurrentPosition +
- " displacement:" + displacement,
- " maxScrollDistance:" + maxScrollDistance );
-
- childTargetPosition = childCurrentPosition + displacement; // child current position + gesture displacement
-
- if(ScrollAvailableArea != null)
- {
- float minScrollPosition = ScrollingDirection == Direction.Horizontal? ScrollAvailableArea.X:ScrollAvailableArea.Y;
- float maxScrollPosition = ScrollingDirection == Direction.Horizontal?
- ScrollAvailableArea.X + ScrollAvailableArea.Width:
- ScrollAvailableArea.Y + ScrollAvailableArea.Height;
-
- childTargetPosition = Math.Min( -minScrollPosition, childTargetPosition );
- childTargetPosition = Math.Max( -maxScrollPosition, childTargetPosition );
- }
- else
- {
- childTargetPosition = Math.Min(0, childTargetPosition);
- childTargetPosition = Math.Max(-maxScrollDistance, childTargetPosition);
- }
-
- Debug.WriteLineIf( LayoutDebugScrollableBase, "ScrollBy currentAxisPosition:" + childCurrentPosition + "childTargetPosition:" + childTargetPosition);
-
- if (animate)
- {
- // Calculate scroll animaton duration
- float scrollDistance = 0.0f;
- if (childCurrentPosition < childTargetPosition)
- {
- scrollDistance = Math.Abs(childCurrentPosition + childTargetPosition);
- }
- else
- {
- scrollDistance = Math.Abs(childCurrentPosition - childTargetPosition);
- }
-
- int duration = (int)((320*FlickAnimationSpeed) + (scrollDistance * FlickAnimationSpeed));
- Debug.WriteLineIf(LayoutDebugScrollableBase, "Scroll Animation Duration:" + duration + " Distance:" + scrollDistance);
-
- AnimateChildTo(duration, childTargetPosition);
- }
- else
- {
- // Set position of scrolling child without an animation
- if (ScrollingDirection == Direction.Horizontal)
- {
- mScrollingChild.PositionX = childTargetPosition;
- }
- else
- {
- mScrollingChild.PositionY = childTargetPosition;
- }
- }
- }
-
- /// <summary>
- /// you can override it to clean-up your own resources.
- /// </summary>
- /// <param name="type">DisposeTypes</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override void Dispose(DisposeTypes type)
- {
- if (disposed)
- {
- return;
- }
-
- if (type == DisposeTypes.Explicit)
- {
- StopScroll();
-
- if (mPanGestureDetector != null)
- {
- mPanGestureDetector.Detected -= OnPanGestureDetected;
- mPanGestureDetector.Dispose();
- mPanGestureDetector = null;
- }
-
- if (mTapGestureDetector != null)
- {
- mTapGestureDetector.Detected -= OnTapGestureDetected;
- mTapGestureDetector.Dispose();
- mTapGestureDetector = null;
- }
- }
- base.Dispose(type);
- }
-
- private float CalculateDisplacementFromVelocity(float axisVelocity)
- {
- Tizen.Log.Debug("ScrollableBase", "axisVelocity:" + axisVelocity);
- // Map: flick speed of range (2.0 - 6.0) to flick multiplier of range (0.7 - 1.6)
- float speedMinimum = FlickThreshold;
- float speedMaximum = FlickThreshold + 6.0f;
- float multiplierMinimum = FlickDistanceMultiplierRange.X;
- float multiplierMaximum = FlickDistanceMultiplierRange.Y;
-
- float flickDisplacement = 0.0f;
-
- float speed = Math.Min(4.0f,Math.Abs(axisVelocity));
-
- Tizen.Log.Debug("ScrollableBase", "ScrollableBase Candidate Flick speed:" + speed);
-
- if (speed > FlickThreshold)
- {
-
- // Flick length is the length of the ScrollableBase.
- float flickLength = (ScrollingDirection == Direction.Horizontal) ? CurrentSize.Width : CurrentSize.Height;
-
- // Calculate multiplier by mapping speed between the multiplier minimum and maximum.
- multiplier =( (speed - speedMinimum) / ( (speedMaximum - speedMinimum) * (multiplierMaximum - multiplierMinimum) ) )+ multiplierMinimum;
-
- flickDisplacement = ((flickLength * multiplier) * speed) * (axisVelocity > 0.0f ? 1.0f : -1.0f);
-
- Tizen.Log.Debug("ScrollableBase", "axisVelocity:" + axisVelocity);
- Tizen.Log.Debug("ScrollableBase", "Calculated FlickDisplacement[" + flickDisplacement);
- Tizen.Log.Debug("ScrollableBase", "speed[" + speed);
- Tizen.Log.Debug("ScrollableBase", "multiplier[" + multiplier);
- }
- return flickDisplacement;
- }
-
- private float CalculateMaximumScrollDistance()
- {
- int scrollingChildLength = 0;
- int scrollerLength = 0;
- if (ScrollingDirection == Direction.Horizontal)
- {
- Debug.WriteLineIf(LayoutDebugScrollableBase, "Horizontal");
-
- scrollingChildLength = (int)mScrollingChild.Layout.MeasuredWidth.Size.AsRoundedValue();
- scrollerLength = CurrentSize.Width;
- }
- else
- {
- Debug.WriteLineIf(LayoutDebugScrollableBase, "Vertical");
- scrollingChildLength = (int)mScrollingChild.Layout.MeasuredHeight.Size.AsRoundedValue();
- scrollerLength = CurrentSize.Height;
- }
-
- Debug.WriteLineIf(LayoutDebugScrollableBase, "ScrollBy maxScrollDistance:" + (scrollingChildLength - scrollerLength) +
- " parent length:" + scrollerLength +
- " scrolling child length:" + scrollingChildLength);
-
- return Math.Max(scrollingChildLength - scrollerLength,0);
- }
-
- private void PageSnap()
- {
- Tizen.Log.Debug("ScrollableBase", "PageSnap with pan candidate totalDisplacement:" + totalDisplacementForPan +
- " currentPage[" + CurrentPage + "]" );
-
- var axisToCompare = ScrollingDirection == Direction.Horizontal ? mPageWidth : mPageHeight;
-
- //Increment current page if total displacement enough to warrant a page change.
- if (Math.Abs(totalDisplacementForPan) > (axisToCompare * ratioOfScreenWidthToCompleteScroll))
- {
- // if totalDisplacementForPan < 0 move index forward, backward otherwise
- int pagesDiff = totalDisplacementForPan > 0.0f ? -1 : 1;
- pagesDiff += (int)(-totalDisplacementForPan / axisToCompare);
-
- Tizen.Log.Debug("ScrollableBase", $"totalDisplacement {totalDisplacementForPan}");
- Tizen.Log.Debug("ScrollableBase", $"axisToCompare {axisToCompare}");
- Tizen.Log.Debug("ScrollableBase", $"pages diff {pagesDiff}");
- Tizen.Log.Debug("ScrollableBase", $"CurrentPge {CurrentPage}");
- CurrentPage = Math.Clamp(CurrentPage + pagesDiff, 0, mScrollingChild.Children.Count - 1);
- Tizen.Log.Debug("ScrollableBase", $"NextPage {CurrentPage}");
- }
-
- float destinationX;
- // Animate to new page or reposition to current page
- if (ScrollingDirection == Direction.Horizontal)
- {
- destinationX = -(mScrollingChild.Children[CurrentPage].Position.X + mScrollingChild.Children[CurrentPage].CurrentSize.Width/2 - CurrentSize.Width/2); // set to middle of current page
- Tizen.Log.Debug("ScrollableBase", "Snapping to page[" + CurrentPage + "] to:" + destinationX + " from:" + mScrollingChild.PositionX);
- } else
- {
- destinationX = -(mScrollingChild.Children[CurrentPage].Position.Y + mScrollingChild.Children[CurrentPage].CurrentSize.Height/2 - CurrentSize.Height/2); // set to middle of current page
- Tizen.Log.Debug("ScrollableBase", "Snapping to page[" + CurrentPage + "] to:" + destinationX + " from:" + mScrollingChild.PositionY);
- }
- AnimateChildTo(ScrollDuration, destinationX);
- }
-
- private void Flick(float flickDisplacement)
- {
- Tizen.Log.Debug("ScrollableBase", $"flickDisplacement: {flickDisplacement}");
- if (SnapToPage)
- {
- if ( ( flickWhenAnimating && scrolling == true) || ( scrolling == false) )
- {
- float axisToCompare = ScrollingDirection == Direction.Horizontal ? mPageWidth : mPageHeight;
-
- int pagesDiff = (int)(-flickDisplacement / axisToCompare);
- Tizen.Log.Debug("ScrollableBase", $"CurrentPage: {CurrentPage}");
- Tizen.Log.Debug("ScrollableBase", $"pagasDiff: {pagesDiff}");
-
- CurrentPage = Math.Clamp(CurrentPage + pagesDiff, 0, mScrollingChild.Children.Count - 1);
-
- Tizen.Log.Debug("ScrollableBase", $"NextPage: {CurrentPage}");
-
- float destinationX;
- if (ScrollingDirection == Direction.Horizontal)
- {
- destinationX = -(mScrollingChild.Children[CurrentPage].Position.X + mScrollingChild.Children[CurrentPage].CurrentSize.Width/2.0f - CurrentSize.Width/2.0f); // set to middle of current page
- } else
- {
- destinationX = -(mScrollingChild.Children[CurrentPage].Position.Y + mScrollingChild.Children[CurrentPage].CurrentSize.Height/2.0f - CurrentSize.Height/2.0f); // set to middle of current page
- }
- Debug.WriteLineIf(LayoutDebugScrollableBase, "Snapping to :" + destinationX);
- AnimateChildTo(ScrollDuration, destinationX);
- }
- }
- else
- {
- ScrollBy(flickDisplacement, true); // Animate flickDisplacement.
- }
- }
-
- private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
- {
- if (e.PanGesture.State == Gesture.StateType.Started)
- {
- Debug.WriteLineIf(LayoutDebugScrollableBase, "Gesture Start");
- if (scrolling && !SnapToPage)
- {
- StopScroll();
- }
- maxScrollDistance = CalculateMaximumScrollDistance();
- totalDisplacementForPan = 0.0f;
- OnScrollDragStart();
- }
- else if (e.PanGesture.State == Gesture.StateType.Continuing)
- {
- if (ScrollingDirection == Direction.Horizontal)
- {
- ScrollBy(e.PanGesture.Displacement.X, false);
- totalDisplacementForPan += e.PanGesture.Displacement.X;
- }
- else
- {
- ScrollBy(e.PanGesture.Displacement.Y, false);
- totalDisplacementForPan += e.PanGesture.Displacement.Y;
- }
- Debug.WriteLineIf(LayoutDebugScrollableBase, "OnPanGestureDetected Continue totalDisplacementForPan:" + totalDisplacementForPan);
- }
- else if (e.PanGesture.State == Gesture.StateType.Finished)
- {
- float axisVelocity = (ScrollingDirection == Direction.Horizontal) ? e.PanGesture.Velocity.X : e.PanGesture.Velocity.Y;
- float flickDisplacement = CalculateDisplacementFromVelocity(axisVelocity);
-
- flickDisplacement = CalculateDisplacementFromVelocity(axisVelocity);
-
- Tizen.Log.Debug("ScrollableBase", "FlickDisplacement:" + flickDisplacement + "TotalDisplacementForPan:" + totalDisplacementForPan);
- OnScrollDragEnd();
-
- if (flickDisplacement > 0 | flickDisplacement < 0)// Flick detected
- {
- Tizen.Log.Debug("ScrollableBase", "Flick detected from Pan");
- Flick(flickDisplacement);
- }
- else
- {
- // End of panning gesture but was not a flick
- if (SnapToPage)
- {
- PageSnap();
- }
- }
- totalDisplacementForPan = 0;
- }
- }
-
- private new void OnTapGestureDetected(object source, TapGestureDetector.DetectedEventArgs e)
- {
- if (e.TapGesture.Type == Gesture.GestureType.Tap)
- {
- // Stop scrolling if tap detected (press then relase).
- // Unless in Pages mode, do not want a page change to stop part way.
- if(scrolling && !SnapToPage)
- {
- StopScroll();
- }
- }
- }
-
- private void ScrollAnimationFinished(object sender, EventArgs e)
- {
- scrolling = false;
- OnScrollAnimationEnd();
- }
-
- private View eventsView = null;
- public View EventsView
- {
- get
- {
- return eventsView;
- }
- set
- {
- if (eventsView)
- {
- mPanGestureDetector.Detach(eventsView);
- mTapGestureDetector.Detach(eventsView);
- }
- eventsView = value;
- mPanGestureDetector.Attach(value);
- mTapGestureDetector.Attach(value);
- }
- }
- }
-
-} // namespace
+++ /dev/null
-using System;
-
-namespace Oobe.Common.Interfaces
-{
- public interface IProcessNavigation
- {
- /// <summary>
- /// Goto next process step.
- /// </summary>
- void Next();
-
- /// <summary>
- /// Goto previous process step.
- /// </summary>
- void Previous();
-
- /// <summary>
- /// Finishes process.
- /// </summary>
- void Finish();
- }
-}
+++ /dev/null
-using System;
-using Tizen.NUI.BaseComponents;
-using Oobe.Common.Interfaces;
-
-namespace Oobe.Common.Interfaces
-{
- public abstract class ProcessStep
- {
- protected IProcessNavigation Navigation { get; private set; }
- private bool initialized;
-
- public void Initialize()
- {
- if (initialized)
- return;
-
- this.OnInitialized();
- initialized = true;
- }
-
- public virtual void Shutdown()
- {
- if (!initialized)
- return;
-
- this.OnShutdown();
- initialized = false;
- }
-
- public virtual void Reset()
- {
- OnReset();
- }
-
- public virtual void OnInitialized()
- {
- }
-
- public virtual void OnShutdown()
- {
- }
-
- public virtual void OnReset()
- {
- }
-
- public virtual View CreateView(IProcessNavigation nav)
- {
- return null;
- }
- }
- }
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">\r
-\r
- <PropertyGroup>\r
- <OutputType>Library</OutputType>\r
- <TargetFramework>tizen80</TargetFramework>\r
- <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>\r
- </PropertyGroup>\r
-\r
- <ItemGroup>\r
- <PackageReference Include="Tizen.NET" Version="8.0.0.15148">\r
- <ExcludeAssets>Runtime</ExcludeAssets>\r
- </PackageReference>\r
- <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />\r
- </ItemGroup>\r
-\r
- <ItemGroup>\r
- <Compile Update="Resources\Translations.Designer.cs">\r
- <DesignTime>True</DesignTime>\r
- <AutoGen>True</AutoGen>\r
- <DependentUpon>Translations.resx</DependentUpon>\r
- </Compile>\r
- </ItemGroup>\r
-\r
- <ItemGroup>\r
- <EmbeddedResource Update="Resources\Translations.ko-KR.resx">\r
- <Generator>PublicResXFileCodeGenerator</Generator>\r
- </EmbeddedResource>\r
- <EmbeddedResource Update="Resources\Translations.pl-PL.resx">\r
- <Generator>PublicResXFileCodeGenerator</Generator>\r
- </EmbeddedResource>\r
- <EmbeddedResource Update="Resources\Translations.resx">\r
- <Generator>PublicResXFileCodeGenerator</Generator>\r
- <LastGenOutput>Translations.Designer.cs</LastGenOutput>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
-</Project>\r
+++ /dev/null
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace OobeCommon.Resources {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- public class Translations {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Translations() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- public static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OobeCommon.Resources.Translations", typeof(Translations).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- public static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Title.
- /// </summary>
- public static string _Title {
- get {
- return ResourceManager.GetString("_Title", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Choose language.
- /// </summary>
- public static string CHOOSE_LANGUAGE {
- get {
- return ResourceManager.GetString("CHOOSE_LANGUAGE", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Choose region.
- /// </summary>
- public static string CHOOSE_REGION {
- get {
- return ResourceManager.GetString("CHOOSE_REGION", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Choose Wi-Fi Network.
- /// </summary>
- public static string CHOOSE_WIFI_NETWORK {
- get {
- return ResourceManager.GetString("CHOOSE_WIFI_NETWORK", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to CONTINUE.
- /// </summary>
- public static string CONTINUE {
- get {
- return ResourceManager.GetString("CONTINUE", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to GET STARTED.
- /// </summary>
- public static string GET_STARTED {
- get {
- return ResourceManager.GetString("GET_STARTED", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to I have read and agree to terms and conditions.
- /// </summary>
- public static string I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS {
- get {
- return ResourceManager.GetString("I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Poland.
- /// </summary>
- public static string POLAND {
- get {
- return ResourceManager.GetString("POLAND", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to PREVIOUS.
- /// </summary>
- public static string PREVIOUS {
- get {
- return ResourceManager.GetString("PREVIOUS", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to SKIP.
- /// </summary>
- public static string SKIP {
- get {
- return ResourceManager.GetString("SKIP", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to South Korea.
- /// </summary>
- public static string SOUTH_KOREA {
- get {
- return ResourceManager.GetString("SOUTH_KOREA", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Terms and conditions.
- /// </summary>
- public static string TERMS_AND_CONDITIONS {
- get {
- return ResourceManager.GetString("TERMS_AND_CONDITIONS", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to United Kingdom.
- /// </summary>
- public static string UNITED_KINGDOM {
- get {
- return ResourceManager.GetString("UNITED_KINGDOM", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Welcome to Tizen IoT!.
- /// </summary>
- public static string WELCOME_TITLE {
- get {
- return ResourceManager.GetString("WELCOME_TITLE", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to You must scroll down and read the whole text above.
- /// </summary>
- public static string YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE {
- get {
- return ResourceManager.GetString("YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE", resourceCulture);
- }
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="_Title" xml:space="preserve">
- <value>변경사항 저장 안 함</value>
- </data>
- <data name="CONTINUE" xml:space="preserve">
- <value>계속</value>
- </data>
- <data name="PREVIOUS" xml:space="preserve">
- <value>이전</value>
- </data>
- <data name="SKIP" xml:space="preserve">
- <value>건너 뛰기</value>
- </data>
- <data name="GET_STARTED" xml:space="preserve">
- <value>시작</value>
- </data>
- <data name="CHOOSE_LANGUAGE" xml:space="preserve">
- <value>언어 선택</value>
- </data>
- <data name="CHOOSE_REGION" xml:space="preserve">
- <value>선택 지역</value>
- </data>
- <data name="TERMS_AND_CONDITIONS" xml:space="preserve">
- <value>이용 약관</value>
- </data>
- <data name="YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE" xml:space="preserve">
- <value>(전체 이용 약관을 스크롤해야 동의가 가능합니다)</value>
- </data>
- <data name="I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS" xml:space="preserve">
- <value>이용 약관을 읽었으며 이에 동의합니다</value>
- </data>
- <data name="WELCOME_TITLE" xml:space="preserve">
- <value>환영합니다 Tizen IoT!</value>
- </data>
- <data name="CHOOSE_WIFI_NETWORK" xml:space="preserve">
- <value>Wi-Fi 연결</value>
- </data>
- <data name="UNITED_KINGDOM" xml:space="preserve">
- <value>영국</value>
- </data>
- <data name="SOUTH_KOREA" xml:space="preserve">
- <value>대한민국</value>
- </data>
- <data name="POLAND" xml:space="preserve">
- <value>폴란드</value>
- </data>
-</root>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="CONTINUE" xml:space="preserve">
- <value>DALEJ</value>
- </data>
- <data name="PREVIOUS" xml:space="preserve">
- <value>WSTECZ</value>
- </data>
- <data name="SKIP" xml:space="preserve">
- <value>POMIŃ</value>
- </data>
- <data name="GET_STARTED" xml:space="preserve">
- <value>ROZPOCZNIJ</value>
- </data>
- <data name="CHOOSE_LANGUAGE" xml:space="preserve">
- <value>Wybierz język</value>
- </data>
- <data name="CHOOSE_REGION" xml:space="preserve">
- <value>Wybierz region</value>
- </data>
- <data name="TERMS_AND_CONDITIONS" xml:space="preserve">
- <value>Warunki użytkowania</value>
- </data>
- <data name="YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE" xml:space="preserve">
- <value>(Musisz przewinąć i przeczytać całą treść)</value>
- </data>
- <data name="I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS" xml:space="preserve">
- <value>Przeczytałem i zgadzam się na warunki użytkowania</value>
- </data>
- <data name="WELCOME_TITLE" xml:space="preserve">
- <value>Witaj w Tizen IoT!</value>
- </data>
- <data name="CHOOSE_WIFI_NETWORK" xml:space="preserve">
- <value>Połącz z Wi-Fi</value>
- </data>
- <data name="UNITED_KINGDOM" xml:space="preserve">
- <value>Zjednoczone Królestwo</value>
- </data>
- <data name="SOUTH_KOREA" xml:space="preserve">
- <value>Korea Południowa</value>
- </data>
- <data name="POLAND" xml:space="preserve">
- <value>Polska</value>
- </data>
-</root>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="_Title" xml:space="preserve">
- <value>Title</value>
- </data>
- <data name="CONTINUE" xml:space="preserve">
- <value>CONTINUE</value>
- </data>
- <data name="PREVIOUS" xml:space="preserve">
- <value>PREVIOUS</value>
- </data>
- <data name="SKIP" xml:space="preserve">
- <value>SKIP</value>
- </data>
- <data name="GET_STARTED" xml:space="preserve">
- <value>GET STARTED</value>
- </data>
- <data name="CHOOSE_LANGUAGE" xml:space="preserve">
- <value>Choose language</value>
- </data>
- <data name="CHOOSE_REGION" xml:space="preserve">
- <value>Choose region</value>
- </data>
- <data name="TERMS_AND_CONDITIONS" xml:space="preserve">
- <value>Terms and conditions</value>
- </data>
- <data name="YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE" xml:space="preserve">
- <value>(You must scroll down and read the whole text above)</value>
- </data>
- <data name="I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS" xml:space="preserve">
- <value>I have read and agree to terms and conditions</value>
- </data>
- <data name="WELCOME_TITLE" xml:space="preserve">
- <value>Welcome to Tizen IoT!</value>
- </data>
- <data name="CHOOSE_WIFI_NETWORK" xml:space="preserve">
- <value>Choose Wi-Fi Network</value>
- </data>
- <data name="UNITED_KINGDOM" xml:space="preserve">
- <value>United Kingdom</value>
- </data>
- <data name="SOUTH_KOREA" xml:space="preserve">
- <value>South Korea</value>
- </data>
- <data name="POLAND" xml:space="preserve">
- <value>Poland</value>
- </data>
-</root>
+++ /dev/null
-using System;
-using System.Runtime.InteropServices;
-using static Oobe.Common.Services.Vconf;
-
-internal static partial class Interop
-{
- internal static partial class Vconf
- {
- private const string LIBRARY_VCONF = "libvconf.so.0";
-
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_bool")]
- internal static extern int VconfGetBool(string key, out bool val);
-
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_bool")]
- internal static extern int VconfSetBool(string key, bool intval);
-
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_int")]
- internal static extern int VconfGetInt(string key, out int val);
-
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_int")]
- internal static extern int VconfSetInt(string key, int intval);
-
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_str")]
- internal static extern string VconfGetStr(string key);
-
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_str")]
- internal static extern int VconfSetStr(string key, string value);
-
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_notify_key_changed")]
- internal static extern void VconfNotifyKeyChanged(string key, NotificationCallback callback, IntPtr userData);
-
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_ignore_key_changed")]
- internal static extern void VconfIgnoreKeyChanged(string key, NotificationCallback callback);
- }
-}
+++ /dev/null
-using System;
-using System.Runtime.InteropServices;
-using Oobe.Common.Utils;
-using static Interop.Vconf;
-
-namespace Oobe.Common.Services
-{
- /// <summary>
- /// This class provides the API to use Vconf methods.
- /// Vconf is a global configuration registry for the device.
- /// </summary>
- public static class Vconf
- {
- /// <summary>
- /// Delegate for notification callbacks.
- /// </summary>
- /// <param name="node">Pointer to event node.</param>
- /// <param name="userData">Pointer to event user data.</param>
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public delegate void NotificationCallback(IntPtr node, IntPtr userData);
-
- /// <summary>
- /// Gets a boolean value from Vconf.
- /// </summary>
- /// <param name="key">The key in Vconf.</param>
- /// <returns>A value assigned to the specified key.</returns>
- public static bool GetBool(string key)
- {
- int errorCode = VconfGetBool(key, out bool value);
- if (errorCode != 0)
- {
- throw ExceptionFactory.GetException(errorCode);
- }
-
- return value;
- }
-
- /// <summary>
- /// Sets a boolean value in Vconf.
- /// </summary>
- /// <param name="key">The key in Vconf.</param>
- /// <param name="value">The value to be set.</param>
- public static void SetBool(string key, bool value)
- {
- int errorCode = VconfSetBool(key, value);
- if (errorCode != 0)
- {
- throw ExceptionFactory.GetException(errorCode);
- }
- }
-
- /// <summary>
- /// Gets an integer value from Vconf.
- /// </summary>
- /// <param name="key">The key in Vconf.</param>
- /// <returns>A value assigned to the specified key.</returns>
- public static int GetInt(string key)
- {
- int errorCode = VconfGetInt(key, out int value);
- if (errorCode != 0)
- {
- throw ExceptionFactory.GetException(errorCode);
- }
-
- return value;
- }
-
- /// <summary>
- /// Sets an integer value in Vconf.
- /// </summary>
- /// <param name="key">The key in Vconf.</param>
- /// <param name="value">The value to be set.</param>
- public static void SetInt(string key, int value)
- {
- int errorCode = VconfSetInt(key, value);
- if (errorCode != 0)
- {
- throw ExceptionFactory.GetException(errorCode);
- }
- }
-
- /// <summary>
- /// Gets a string value from Vconf.
- /// </summary>
- /// <param name="key">The key in Vconf.</param>
- /// <returns>A value assigned to the specified key.</returns>
- public static string GetString(string key)
- {
- return VconfGetStr(key);
- }
-
- /// <summary>
- /// Sets a string value in Vconf.
- /// </summary>
- /// <param name="key">The key in Vconf.</param>
- /// <param name="value">The value to be set.</param>
- public static void SetString(string key, string value)
- {
- int errorCode = VconfSetStr(key, value);
- if (errorCode != 0)
- {
- throw ExceptionFactory.GetException(errorCode);
- }
- }
-
- /// <summary>
- /// Registers a callback to a KeyChanged event.
- /// </summary>
- /// <param name="key">The key to be observed for changes.</param>
- /// <param name="callback">The callback to be registered.</param>
- /// <param name="userData">Additional data.</param>
- public static void NotifyKeyChanged(string key, NotificationCallback callback, IntPtr? userData = null)
- {
- VconfNotifyKeyChanged(key, callback, userData ?? IntPtr.Zero);
- }
-
- /// <summary>
- /// Unregisters a callback from a KeyChanged event.
- /// </summary>
- /// <param name="key">The key that was observed for changes.</param>
- /// <param name="callback">The callback to be unregistered.</param>
- public static void IgnoreKeyChanged(string key, NotificationCallback callback)
- {
- VconfIgnoreKeyChanged(key, callback);
- }
- }
-}
+++ /dev/null
-using Tizen.NUI.Components;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI;
-
-namespace Oobe.Common.Styles
-{
- public class ButtonStyles
- {
- public static ButtonStyle Next = GetNextButtonStyle();
- public static ButtonStyle Previous = GetPreviousButtonStyle();
- public static ButtonStyle Skip = GetSkipButtonStyle();
-
- private static ButtonStyle GetPreviousButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_action.png",
- Pressed = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_pressed.png",
- Disabled = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_disabled.png",
- },
- Text = new TextLabelStyle
- {
- PointSize = new Selector<float?>
- {
- Normal = 22.0f,
- Pressed = 24.0f
- },
- EnableMarkup = true,
- TranslatableText = "PREVIOUS",
- TextColor = new Selector<Color>
- {
- Normal = new Color(0.0f, 20.0f / 255.0f, 71 / 255.0f, 1.0f),
- Pressed = new Color(41.0f / 255.0f, 91.0f / 255.0f, 178 / 255.0f, 1.0f),
- },
- FontFamily = GetNavigationFont(),
- },
- Size2D = new Size2D(240, 72),
- };
-
- private static ButtonStyle GetSkipButtonStyle()
- {
- var style = GetNextButtonStyle();
- style.Text.TranslatableText = "SKIP";
- return style;
- }
-
- private static ButtonStyle GetNextButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_active.svg",
- Pressed = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_selected.svg",
- Disabled = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_disabled.svg",
- },
- Text = new TextLabelStyle
- {
- PointSize = new Selector<float?>
- {
- Normal = 22.0f,
- Pressed = 24.0f
- },
- TextColor = Color.White,
- TranslatableText = "CONTINUE",
- FontFamily = GetNavigationFont(),
- },
- Size2D = new Size2D(240, 72),
- };
-
- private static Selector<string> GetNavigationFont()
- {
- return new Selector<string>
- {
- Normal = "BreezeSans",
- };
- }
- }
-}
+++ /dev/null
-using System;
-using Tizen.NUI.Components;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-
-namespace Oobe.Common.Styles
-{
- public static class ButtonsExtensions
- {
- public static PropertyMap GetFontStyle(this Button button)
- {
- // workaround for limitation of settings FontStyle of button text
- // throught TextLabelStyle class
- foreach (View child in button.Children)
- {
- if (child is TextLabel label)
- {
- return label.FontStyle;
- }
- }
- return null;
- }
-
- public static void SetFontStyle(this Button button, PropertyMap map)
- {
- // workaround for limitation of settings FontStyle of button text
- // throught TextLabelStyle class
- foreach (View child in button.Children)
- {
- if (child is TextLabel label)
- {
- label.FontStyle = map;
- break;
- }
- }
- }
- }
-}
+++ /dev/null
-using Tizen.NUI.Components;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI;
-using Oobe.Common.Controls;
-
-namespace Oobe.Common.Styles
-{
- public class CarouselPickerStyles
- {
- public static CarouselPickerStyle Default = new CarouselPickerStyle{
- CenterText = new TextLabelStyle{
- Size2D = new Size2D(312, 26),
- PixelSize = 20.0f,
- Margin = new Extents(24, 24, 16, 16),
- HorizontalAlignment = HorizontalAlignment.Center,
- TextColor = new Color(0, 20.0f / 255.0f, 71.0f / 255.0f, 1.0f),
- Opacity = 1.0f,
- },
- OuterText = new TextLabelStyle{
- Size2D = new Size2D(312, 26),
- PixelSize = 20.0f,
- Margin = new Extents(24, 24, 16, 16),
- HorizontalAlignment = HorizontalAlignment.Center,
- TextColor = new Color(195.0f / 255.0f, 202.0f / 255.0f, 210.0f / 255.0f, 1.0f),
- Opacity = 0.4f,
- },
- LinesColor = new Color(0, 20.0f / 255.0f, 71.0f / 255.0f, 1.0f),
- };
- }
-}
+++ /dev/null
-using Tizen.NUI;
-
-namespace Oobe.Common.Styles
-{
- public static class FontsStyles
- {
- public static PropertyMap AddLightFontStyle(this PropertyMap propertyMap)
- {
- return propertyMap.Add("weight", new PropertyValue("light"));
- }
-
- public static PropertyMap AddRegularFontStyle(this PropertyMap propertyMap)
- {
- return propertyMap.Add("weight", new PropertyValue("regular"));
- }
-
- public static PropertyMap AddBoldFontStyle(this PropertyMap propertyMap)
- {
- return propertyMap.Add("weight", new PropertyValue("bold"));
- }
- }
-}
+++ /dev/null
-using Tizen.NUI;
-using System;
-
-namespace Oobe.Common.Utils
-{
- public static class ColorUtils
- {
- // source: https://www.cs.rit.edu/~ncs/color/t_convert.html
- public static Vector3 ToHSV(this Color color)
- {
- float h, s, v;
- float min, max, delta;
-
- min = Math.Min(color.R, Math.Min(color.G, color.B));
- max = Math.Max(color.R, Math.Max(color.G, color.B));
- v = max;
-
- if (max == min)
- {
- // in grayscale
- return new Vector3(0.0f, 0.0f, v);
- }
-
- delta = max - min;
- s = delta / max; // s
-
- if( color.R == max )
- h = ( color.G - color.B ) / delta; // between yellow & magenta
- else if( color.G == max )
- h = 2 + ( color.B - color.R ) / delta; // between cyan & yellow
- else
- h = 4 + ( color.R - color.G ) / delta; // between magenta & cyan
-
- h *= 60; // degrees
- if( h < 0 )
- h += 360;
-
- return new Vector3(h, s, v);
- }
-
- public static Color ColorFromHSV(Vector3 hsv)
- {
- int i;
- float r, g, b;
- float f, p, q, t;
- float h = hsv[0];
- float s = hsv[1];
- float v = hsv[2];
-
- if (s == 0) {
- // achromatic (grey)
- r = g = b = v;
- return new Color(r, g, b, 1.0f);
- }
-
- h /= 60; // sector 0 to 5
- i = (int)Math.Floor( h );
- f = h - i; // factorial part of h
- p = v * ( 1 - s );
- q = v * ( 1 - s * f );
- t = v * ( 1 - s * ( 1 - f ) );
-
- switch( i ) {
- case 0:
- r = v;
- g = t;
- b = p;
- break;
- case 1:
- r = q;
- g = v;
- b = p;
- break;
- case 2:
- r = p;
- g = v;
- b = t;
- break;
- case 3:
- r = p;
- g = q;
- b = v;
- break;
- case 4:
- r = t;
- g = p;
- b = v;
- break;
- default: // case 5:
- r = v;
- g = p;
- b = q;
- break;
- }
- return new Color(r, g, b, 1.0f);
- }
- }
-}
+++ /dev/null
-using System;
-using Tizen.Internals.Errors;
-
-namespace Oobe.Common.Utils
-{
- /// <summary>
- /// This class provides the API to translate Tizen Error Codes to .NET exceptions.
- /// </summary>
- public static class ExceptionFactory
- {
- /// <summary>
- /// Gets the exception that best corresponds to the given error code.
- /// </summary>
- /// <param name="errorCode">The Tizen Error Code to be translated.</param>
- /// <returns>An exception object.</returns>
- public static Exception GetException(int errorCode)
- {
- var msg = ErrorFacts.GetErrorMessage(errorCode);
- var c = (ErrorCode)errorCode;
-
- switch (c)
- {
- case ErrorCode.NotSupported:
- return new NotSupportedException(msg);
-
- case ErrorCode.OutOfMemory:
- return new OutOfMemoryException(msg);
-
- case ErrorCode.InvalidParameter:
- return new ArgumentException(msg);
-
- case ErrorCode.InvalidOperation:
- return new InvalidOperationException(msg);
-
- case ErrorCode.PermissionDenied:
- return new UnauthorizedAccessException(msg);
-
- default:
- return new Exception(msg);
- }
- }
- }
-}
+++ /dev/null
-using System;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-
-namespace Oobe.Common.Utils
-{
- public class Popup
- {
- private View view;
- private Layer layer = null;
-
- public Popup(View view, bool centered = false)
- {
- this.view = view;
- if (centered)
- {
- view.PositionUsesPivotPoint = true;
- view.PivotPoint = new Position(0.5f, 0.5f);
- view.ParentOrigin = new Position(0.5f, 0.5f);
- }
- }
-
- public void Show()
- {
- if (layer != null)
- {
- layer.Visibility = true;
- }
- else
- {
- ShowCore();
- }
- }
-
- public void Hide()
- {
- if (layer != null)
- {
- layer.Visibility = false;
- }
- }
-
- public void Dismiss()
- {
- if (layer != null)
- {
- Window.Instance.RemoveLayer(layer);
- layer.Dispose();
- layer = null;
- }
- }
-
- private void ShowCore()
- {
- Dismiss();
- layer = new Layer();
- var gray = new Tizen.NUI.Components.Control()
- {
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- BackgroundColor = new Color(0f, 0f, 0f, 0.1f),
- };
- gray.TouchEvent += (s, e) =>
- {
- if (e.Touch.GetState(0) == PointStateType.Up)
- {
- Dismiss();
- }
- return true;
- };
- layer.Add(gray);
-
- view.TouchEvent += (s, e) => false; //prevent gray view reacting
- layer.Add(view);
- Window.Instance.AddLayer(layer);
- }
- }
-}
+++ /dev/null
-<svg id="_02_CTA_empty_selected" data-name="02_CTA_empty_selected" xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">\r
- <rect id="Rectangle_346" data-name="Rectangle 346" width="240" height="72" rx="28" fill="#0a0e4a"/>\r
-</svg>\r
+++ /dev/null
-<svg id="_02_CTA_empty_disabled" data-name="02_CTA_empty_disabled" xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">\r
- <rect id="Rectangle_346" data-name="Rectangle 346" width="240" height="72" rx="28" fill="#c3cad2"/>\r
-</svg>\r
+++ /dev/null
-<svg id="_02_CTA_empty_selected" data-name="02_CTA_empty_selected" xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">\r
- <rect id="Rectangle_346" data-name="Rectangle 346" width="240" height="72" rx="28" fill="#2b5fb9"/>\r
-</svg>\r
+++ /dev/null
-using Oobe.Common.Interfaces;\r
-using Oobe.Common.Styles;\r
-using Tizen.NUI;\r
-using Tizen.NUI.Components;\r
-using Tizen.NUI.BaseComponents;\r
-using Oobe.Language.Model;\r
-using Oobe.Common.Controls;\r
-using Oobe.Common.Utils;\r
-using OobeCommon.Resources;\r
-using System.Linq;\r
-using System.Globalization;\r
-using System;\r
-\r
-namespace Oobe.Language\r
-{\r
- public class LanguageStep : ProcessStep\r
- {\r
- private LanguageManger manager;\r
-\r
- public LanguageStep() : base()\r
- {\r
- }\r
-\r
- public override void OnInitialized()\r
- {\r
- manager = new LanguageManger();\r
- }\r
-\r
- public override View CreateView(IProcessNavigation nav)\r
- {\r
- View container = new View();\r
-\r
- TextLabel title = new TextLabel();\r
- title.TranslatableText = "CHOOSE_LANGUAGE";\r
- title.Position2D = new Position2D(410, 160);\r
- title.Size2D = new Size2D(364, 58);\r
- title.TextColor = new Color(0, 20.0f / 255.0f, 71.0f / 255.0f, 1.0f);\r
- title.HorizontalAlignment = HorizontalAlignment.Center;\r
- title.Ellipsis = false;\r
- title.PixelSize = 48.0f;\r
- title.FontFamily = "BreezeSans";\r
- title.FontStyle = new PropertyMap().AddLightFontStyle();\r
-\r
- var carousel = new CarouselPicker(CarouselPickerStyles.Default);\r
- carousel.Position2D = new Position2D(412, 242);\r
- carousel.Size2D = new Size2D(360, 249);\r
-\r
- foreach (LanguageInfo info in manager.Languages)\r
- {\r
- CarouselPickerItemData item = new CarouselPickerItemData();\r
- item.Text = info.LocalName;\r
- carousel.AddItem(item);\r
- }\r
-\r
- int currentIndex = manager.Languages.FindIndex(x => x == manager.CurrentLanguage);\r
- carousel.SelectedItemIndex = currentIndex;\r
-\r
- Button btn = new Button(ButtonStyles.Next);\r
- btn.Position2D = new Position2D(888, 512);\r
- btn.ClickEvent += (obj, args) =>\r
- {\r
- if (carousel.SelectedItemIndex >= 0 && carousel.SelectedItemIndex < manager.Languages.Count)\r
- {\r
- var lang = manager.Languages[carousel.SelectedItemIndex];\r
- manager.CurrentLanguage = lang;\r
- }\r
- nav.Next();\r
- };\r
- btn.SetFontStyle(new PropertyMap().AddBoldFontStyle());\r
-\r
- carousel.SelectedItemChanged += (sender, args) =>\r
- {\r
- if (carousel.SelectedItemIndex >= 0 && carousel.SelectedItemIndex < manager.Languages.Count)\r
- {\r
- string language = manager.Languages[carousel.SelectedItemIndex].Code.Replace("_", "-");\r
- var culture = CultureInfo.CreateSpecificCulture(language);\r
- title.Text = Translations.ResourceManager.GetString("CHOOSE_LANGUAGE", culture);\r
- btn.Text = Translations.ResourceManager.GetString("CONTINUE", culture);\r
- }\r
- };\r
-\r
- container.Add(title);\r
- container.Add(btn);\r
- container.Add(carousel);\r
-\r
- // workaround issue with ScrollableBase not properly scrolling\r
- // to nth page during creation\r
- Timer timer = new Timer(500);\r
- timer.Tick += (sender, args) => {\r
- int index = manager.Languages.FindIndex(x => x == manager.CurrentLanguage);\r
- carousel.SelectedItemIndex = index;\r
- return false;\r
- };\r
- timer.Start();\r
-\r
- return container;\r
- }\r
- }\r
-}\r
+++ /dev/null
-using System.Xml.Serialization;
-
-namespace Oobe.Language.Model
-{
- public class LanguageInfo
- {
- [XmlAttribute("code")]
- public string Code { get; set; }
- [XmlAttribute("name_en")]
- public string EnglishName { get; set; }
- [XmlAttribute("name_local")]
- public string LocalName { get; set; }
- [XmlAttribute("message")]
- public string Message { get; set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Collections.Generic;
-using System.Xml.Serialization;
-
-namespace Oobe.Language.Model
-{
- [XmlRoot("languages")]
- public class LanguageInfoList
- {
- [XmlElement("language")]
- public List<LanguageInfo> Languages { get; set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Collections.Generic;
-using Tizen.System;
-using System.Linq;
-using System.IO;
-using System.Xml.Serialization;
-
-namespace Oobe.Language.Model
-{
- public class LanguageManger
- {
- public LanguageManger()
- {
- var filename = Tizen.Applications.CoreApplication.Current.DirectoryInfo.Resource + "languages_OOBE.xml";
-
- using (FileStream xml = File.Open(filename, FileMode.Open, FileAccess.Read))
- {
- var xs = new XmlSerializer(typeof(LanguageInfoList));
- var languageList = (LanguageInfoList)xs.Deserialize(xml);
- Languages = languageList.Languages;
- }
- }
-
- public List<LanguageInfo> Languages { get; private set; }
-
- public LanguageInfo CurrentLanguage
- {
- get
- {
- return Languages.Single(s => s.Code == SystemSettings.LocaleLanguage);
- }
- set
- {
- if (value != null)
- {
- SystemSettings.LocaleLanguage = value.Code;
- }
- }
- }
- }
-}
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">\r
-\r
- <PropertyGroup>\r
- <OutputType>Library</OutputType>\r
- <TargetFramework>tizen80</TargetFramework>\r
- <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>\r
- </PropertyGroup>\r
-\r
- <ItemGroup>\r
- <PackageReference Include="Tizen.NET" Version="8.0.0.15148">\r
- <ExcludeAssets>Runtime</ExcludeAssets>\r
- </PackageReference>\r
- <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />\r
- </ItemGroup>\r
-\r
- <ItemGroup>\r
- <ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />\r
- </ItemGroup>\r
-\r
- <ItemGroup>\r
- <Folder Include="res\" />\r
- </ItemGroup>\r
-</Project>\r
+++ /dev/null
-<?xml version="1.0"?>
-<languages>
- <language code="ko_KR" name_en="Korean" name_local="한국어" message="언어 선택" />
- <language code="en_US" name_en="English (US)" name_local="English" message="Select your language" />
- <language code="pl_PL" name_en="Polish" name_local="Polski" message="Wybierz swój język" />
-</languages>
+++ /dev/null
-using System.Xml.Serialization;
-
-namespace Oobe.Region.Model
-{
- public class RegionInfo
- {
- [XmlAttribute("code")]
- public string CountryCode { get; set; }
- [XmlAttribute("name")]
- public string Name { get; set; }
- [XmlAttribute("timezone")]
- public string Timezone{ get; set; }
- [XmlAttribute("cityname")]
- public string CityName { get; set; }
- [XmlAttribute("id")]
- public string Id { get; set; }
-
- }
-}
+++ /dev/null
-using System.Collections.Generic;
-using System.Xml.Serialization;
-
-namespace Oobe.Region.Model
-{
- [XmlRoot("regions")]
- public class RegionInfoList
- {
- [XmlElement("region")]
- public List<RegionInfo> Regions { get; set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Xml.Serialization;
-using Tizen.System;
-using Oobe.Common.Services;
-using System;
-
-namespace Oobe.Region.Model
-{
- public class RegionManager
- {
- private const string CountryCodeVconfKey = "db/setting/country_code";
- private const string CityNameIdVconfKey = "db/setting/cityname_id";
-
- public RegionManager()
- {
- var filename = Tizen.Applications.CoreApplication.Current.DirectoryInfo.Resource + "regions_OOBE.xml";
-
- using (FileStream xml = File.Open(filename, FileMode.Open, FileAccess.Read))
- {
- var xs = new XmlSerializer(typeof(RegionInfoList));
- var regionsList = (RegionInfoList)xs.Deserialize(xml);
- Regions = regionsList.Regions;
- }
- }
-
- public List<RegionInfo> Regions { get; private set; }
-
- public RegionInfo CurrentRegion
- {
- get
- {
- return Regions.Single(s => s.Timezone == Vconf.GetString(CountryCodeVconfKey));
- }
- set
- {
- if (value != null)
- {
- SystemSettings.LocaleTimeZone = value.Timezone;
- SystemSettings.LocaleCountry = value.CountryCode;
- try {
- Vconf.SetString(CountryCodeVconfKey, value.CountryCode);
- Vconf.SetString(CityNameIdVconfKey, value.CityName);
- }
- catch (Exception e)
- {
- Tizen.Log.Debug("oobe", $"setting vconf keys failed: {e.Message}");
- }
- }
- }
- }
- }
-}
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">\r
-\r
- <PropertyGroup>\r
- <OutputType>Library</OutputType>\r
- <TargetFramework>tizen80</TargetFramework>\r
- <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>\r
- </PropertyGroup>\r
-\r
- <ItemGroup>\r
- <PackageReference Include="Tizen.NET" Version="8.0.0.15148">\r
- <ExcludeAssets>Runtime</ExcludeAssets>\r
- </PackageReference>\r
- <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />\r
- </ItemGroup>\r
-\r
- <ItemGroup>\r
- <Folder Include="res\" />\r
- </ItemGroup>\r
-</Project>\r
+++ /dev/null
-using Oobe.Common.Styles;\r
-using Tizen.NUI;\r
-using Tizen.NUI.BaseComponents;\r
-using Oobe.Common.Interfaces;\r
-using Tizen.NUI.Components;\r
-using Oobe.Region.Model;\r
-using Oobe.Common.Controls;\r
-\r
-namespace Oobe.Region\r
-{\r
- public class RegionStep : ProcessStep\r
- {\r
- private RegionManager manager;\r
-\r
- public RegionStep() : base()\r
- {\r
- }\r
-\r
- public override void OnInitialized()\r
- {\r
- manager = new RegionManager();\r
- }\r
-\r
- public override View CreateView(IProcessNavigation nav)\r
- {\r
- View container = new View();\r
-\r
- TextLabel title = new TextLabel();\r
- title.TranslatableText = "CHOOSE_REGION";\r
- title.Position2D = new Position2D(410, 160);\r
- title.Size2D = new Size2D(364, 58);\r
- title.TextColor = new Color(0, 20.0f/255.0f, 71.0f/255.0f, 1.0f);\r
- title.HorizontalAlignment = HorizontalAlignment.Center;\r
- title.Ellipsis = false;\r
- title.PixelSize = 48.0f;\r
- title.FontFamily = "BreezeSans";\r
- title.FontStyle = new PropertyMap().AddLightFontStyle();\r
-\r
- var carousel = new CarouselPicker(CarouselPickerStyles.Default);\r
- carousel.Position2D = new Position2D(412, 242);\r
- carousel.Size2D = new Size2D(360, 249);\r
-\r
- foreach (RegionInfo info in manager.Regions)\r
- {\r
- CarouselPickerItemData item = new CarouselPickerItemData();\r
- item.TranslatableText = info.Id;\r
- carousel.AddItem(item);\r
- }\r
-\r
- Button next = new Button(ButtonStyles.Next);\r
- next.Position2D = new Position2D(888, 512);\r
- next.ClickEvent += (obj, args) => {\r
- if (carousel.SelectedItemIndex >= 0 && carousel.SelectedItemIndex < manager.Regions.Count)\r
- {\r
- var region = manager.Regions[carousel.SelectedItemIndex];\r
- manager.CurrentRegion = region;\r
- }\r
- nav.Next();\r
- };\r
- next.SetFontStyle(new PropertyMap().AddBoldFontStyle());\r
-\r
- Button prev = new Button(ButtonStyles.Previous);\r
- prev.Position2D = new Position2D(56, 512);\r
- prev.ClickEvent += (obj, args) => {\r
- nav.Previous();\r
- };\r
- prev.SetFontStyle(new PropertyMap().AddBoldFontStyle());\r
-\r
- container.Add(carousel);\r
- container.Add(title);\r
- container.Add(prev);\r
- container.Add(next);\r
-\r
- return container;\r
- }\r
- }\r
-}\r
+++ /dev/null
-<?xml version="1.0"?>
-<regions>
- <region code="en_GB" name="United Kingdom" timezone="Europe/London" id="UNITED_KINGDOM" />
- <region code="ko_KR" name="South Korea" timezone="Asia/Seoul" id="SOUTH_KOREA" />
- <region code="pl_PL" name="Poland" timezone="Europe/Warsaw" id="POLAND" />
-</regions>
+++ /dev/null
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Threading.Tasks;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-
-namespace Oobe.Wifi.Controls
-{
- public class ListView
- {
- private Dictionary<View, View> itemToSeparator = new Dictionary<View, View>();
- private ObservableCollection<View> items;
- private ScrollableBase scrollableBase = null;
- private View footer = null;
- private int width;
- private int height;
-
- public ListView(int width, int height)
- {
- this.width = width;
- this.height = height;
- }
-
- //code does not handle the case with separators but without footer
- public Func<View> SeparatorFactory { get; set; } = null;
-
- public View Footer
- {
- get => footer;
- set
- {
- if (footer != null)
- {
- LayoutView.Remove(footer);
- }
- footer = value;
- if (footer != null)
- {
- LayoutView.Add(footer);
- (LayoutView.Layout as SequenceLinearLayout)?.KeepAsLast(footer.Layout);
- }
- }
- }
-
- public ScrollableBase View
- {
- get
- {
- if (scrollableBase == null)
- {
- scrollableBase = new ScrollableBase()
- {
- Size = new Size(width, height),
- ScrollingDirection = ScrollableBase.Direction.Vertical,
- };
- }
- return scrollableBase;
- }
- }
-
- private View LayoutView
- {
- get
- {
- if (View.Children.Any() == false)
- {
- View.Add(new View()
- {
- Layout = new SequenceLinearLayout()
- {
- LinearOrientation = LinearLayout.Orientation.Vertical,
- },
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FitToChildren,
- });
- }
- return View.Children.First();
- }
- }
-
- public ObservableCollection<View> Items
- {
- get
- {
- return items;
- }
- set
- {
- if (value != items)
- {
- DetachItems();
- items = value;
- AttachItems();
- }
- }
- }
-
- private void DetachItems()
- {
- if (items != null)
- {
- items.CollectionChanged -= OnCollectionChanged;
- RemoveItems();
- LayoutView.HeightResizePolicy = ResizePolicyType.FitToChildren;
- }
- }
-
- //not thread safe
- private void AttachItems()
- {
- if (items != null)
- {
- foreach (var item in items)
- {
- AddRegularItem(item);
- }
- items.CollectionChanged += OnCollectionChanged;
- }
- }
-
- private void OnCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
- {
- if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
- {
- var item = e.NewItems.OfType<View>().FirstOrDefault();
- if (item != null)
- {
- AddRegularItem(item);
- }
- }
- else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
- {
- var item = e.OldItems.OfType<View>().FirstOrDefault();
- if (item != null)
- {
- RemoveRegularItem(item);
- //if scroll was at the end, make sure it is still properly aligned to the end
- //Tizen.Log.Debug("demo", $"{View.CurrentPage}");
- }
- }
- else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset)
- {
- RemoveItems();
- }
- LayoutView.HeightResizePolicy = ResizePolicyType.FitToChildren;
- }
-
- private void AddRegularItem(View item)
- {
- LayoutView.Add(item);
- if (SeparatorFactory != null)
- {
- if (itemToSeparator.ContainsKey(item)==false)
- {
- var separator = SeparatorFactory();
- itemToSeparator.Add(item, separator);
- LayoutView.Add(separator);
- }
- }
- }
-
- private void RemoveRegularItem(View item)
- {
- LayoutView.Remove(item);
- if(itemToSeparator.ContainsKey(item))
- {
- LayoutView.Remove(itemToSeparator[item]);
- itemToSeparator.Remove(item);
- }
- }
-
- private void RemoveItems()
- {
- foreach (var child in LayoutView.Children.Where(x => x != Footer).ToList())
- {
- LayoutView.Remove(child);
- }
- itemToSeparator.Clear();
- }
- }
-}
+++ /dev/null
-using System.Linq;
-using Tizen.NUI;
-
-namespace Oobe.Wifi.Controls
-{
- public class SequenceLinearLayout : LinearLayout
- {
- private LayoutItem lastItem = null;
-
- public void KeepAsLast(LayoutItem item)
- {
- lastItem = item;
- if (item != null && item != LayoutChildren.Last())
- {
- if (LayoutChildren.Remove(item))
- {
- LayoutChildren.Add(item);
- RequestLayout();
- }
- }
- }
-
- protected override void OnChildAdd(LayoutItem child)
- {
- base.OnChildAdd(child);
- if (lastItem != null)
- {
- if (LayoutChildren.Remove(lastItem))//remove by position, or find from the end
- {
- LayoutChildren.Add(lastItem);
- }
- }
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Oobe.Common.Styles;
-using Tizen.Network.WiFi;
-using Oobe.Common.Utils;
-
-namespace Oobe.Wifi.Controls.Wifi
-{
- class AddNewNetworkPupup : View
- {
- public event Action OnDismiss;
- enum NewNetworkViewMode
- {
- NoPassword,
- PasswordOnly,
- UserPassword
- };
- NewNetworkViewMode currentViewMode;
- TextLabel titleLabel;
- TextLabel ssidLabel;
- TextField ssidTextField;
- View ssidUnderline;
- TextLabel securityTypeLabel;
- Button securityTypeButton;
- TextLabel usernameLabel;
- TextField usernameTextField;
- View usernameUnderline;
- TextLabel passwordLabel;
- PasswordEntry passwordEntry;
- View passwordUnderline;
- Button revealButton;
- Button cancelButton;
- Button addButton;
- TextLabel failureLabel;
- WifiUISecurityType currentSecurityType;
- private string backgroundImagePath = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
-
- static Color largeTextColor => new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f);
- static Color smallTextColor => new Color(0.0f, 0xC / 255.0f, 0x2B / 255.0f, 1.0f);
- static Size labelSize => new Size(600, 19);
- static Size textControlSize => new Size(583, 27);
- static Size passwordControlSize => new Size(583, 25);
- int labelFontSize = 14;
- int textFontSize = 22;
- int passwordFontSize = 20;
-
- public AddNewNetworkPupup()
- {
- Tizen.Log.Debug("oobe", "Started creating Add New Network Popup");
- InitializeStaticElements();
-
- ResetViewTo(WifiUISecurityType.None);
- Tizen.Log.Debug("oobe", "Finished creating Add New Network Popup");
- }
-
- TextLabel CreateTextLabel(string translatableText, Position2D position = null)
- {
- position ??= new Position2D();
- return new TextLabel
- {
- Position = position,
- Size = labelSize,
- PixelSize = labelFontSize,
- TranslatableText = translatableText,
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- TextColor = smallTextColor,
- HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center
- };
- }
-
- TextField CreateTextField(string placeholderTranslatableText, Position2D position = null)
- {
- position ??= new Position2D();
- var textField = new TextField
- {
- Position = position,
- Size = textControlSize,
- PixelSize = textFontSize,
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- TextColor = largeTextColor,
- TranslatablePlaceholderText = placeholderTranslatableText,
- HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center
- };
- return textField;
- }
-
- View CreateUnderline(Position2D position = null)
- {
- position ??= new Position2D();
- return new View()
- {
- Position = position,
- Size = new Size(600, 1),
- BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f)
- };
- }
-
- PasswordEntry CreatePasswordEntry(Position2D position = null)
- {
- position ??= new Position2D();
- var passwordEntry = new PasswordEntry
- {
- Position = position,
- Size = passwordControlSize,
- PixelSize = passwordFontSize,
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- TextColor = largeTextColor,
- TranslatablePlaceholderText = "WIFI_SECURITY_KEY",
- HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center,
- Revealed = false
- };
- return passwordEntry;
- }
-
- Button CreateRevealButton(Position2D position = null)
- {
- position ??= new Position2D();
- var button = new Button(ButtonStyles.Reveal)
- {
- Size = new Size(32, 32),
- Position = position,
- };
- button.ClickEvent += (s, e) =>
- {
- this.passwordEntry.Revealed = !this.passwordEntry.Revealed;
- button.IsSelected = !button.IsSelected;
- };
- return button;
- }
-
- void InitializeStaticElements()
- {
- this.BackgroundImage = backgroundImagePath;
- titleLabel = new TextLabel
- {
- Position = new Position2D(104, 24),
- Size = new Size(600, 34),
- PixelSize = 26,
- TranslatableText = "WIFI_ADD_NETWORK",
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddLightFontStyle(),
- TextColor = largeTextColor,
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center
- };
- this.Add(titleLabel);
-
- ssidLabel = CreateTextLabel("WIFI_SSID", new Position2D(104, 80));
- this.Add(ssidLabel);
-
- ssidTextField = CreateTextField("WIFI_SSID", new Position2D(121, 97));
- this.Add(ssidTextField);
-
- ssidUnderline = CreateUnderline(new Position2D(104, 123));
- this.Add(ssidUnderline);
-
- securityTypeLabel = CreateTextLabel("WIFI_SECURITY_TYPE", new Position2D(104, 144));
- this.Add(securityTypeLabel);
-
- securityTypeButton = new Button
- {
- Size = new Size(583, 30),
- Position2D = new Position2D(121, 161),
- PointSize = 22,
- Text = currentSecurityType.GetUIName(),
- BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f),
- TextAlignment = HorizontalAlignment.Begin,
- CellHorizontalAlignment = HorizontalAlignmentType.Center,
- CellVerticalAlignment = VerticalAlignmentType.Center
- };
- securityTypeButton.ClickEvent += (s, e) => OpenSecurityTypePopup();
- this.Add(securityTypeButton);
-
- cancelButton = new Button(ButtonStyles.Cancel)
- {
- Size = new Size(240, 72)
- };
- cancelButton.ClickEvent += (s, e) => OnDismiss?.Invoke();
- this.Add(cancelButton);
-
- addButton = new Button(ButtonStyles.OK)
- {
- Size = new Size(240, 72),
- TranslatableText = "WIFI_ADD"
- };
- addButton.ClickEvent += async (s, e) =>
- {
- Tizen.Log.Debug("oobe", $"Scanning for SSID = {ssidTextField.Text}");
- IEnumerable<WiFiAP> aps = null;
- try
- {
- await WiFiManager.ScanSpecificAPAsync(ssidTextField.Text);
- aps = WiFiManager.GetFoundSpecificAPs();
- Tizen.Log.Debug("oobe", $"Found {aps.Count()} potential APs");
- }
- catch
- {
- ShowFailureSsidLabel();
- return;
- }
- bool success = false;
- if(aps is null || aps.Count() == 0)
- {
- ShowFailureSsidLabel();
- return;
- }
- foreach (var wifiAp in aps)
- {
- Tizen.Log.Debug("oobe", $"Trying to add new network: SSID: {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid}), " +
- $"Password: {(passwordEntry is null ? "not set" : "XXXXXXXX")}, " +
- $"Security type: {currentSecurityType.GetUIName()}");
- wifiAp.SecurityInformation.SecurityType = currentSecurityType.GetApSecurityType();
- if (!(passwordEntry is null))
- {
- wifiAp.SecurityInformation.SetPassphrase(passwordEntry.Password);
- }
- Task<bool> task = null;
- try
- {
- var orginal_task = wifiAp.ConnectAsync();
- task = orginal_task as Task<bool>;
- }
- catch(Exception connectionException)
- {
- Tizen.Log.Error("oobe", $"Failed to connect to WiFI {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid})" +
- $"Password: {(passwordEntry is null ? "not set" : "XXXXXXXX")}, " +
- $"Security type: {currentSecurityType.GetUIName()} " +
- connectionException.Message);
- continue;
- }
- if (task is null)
- {
- Tizen.Log.Error("oobe", "Failed to cast connection task");
- OnDismiss?.Invoke();
- continue;
- }
- try
- {
- if (await task)
- {
- success = true;
- break;
- }
- }
- catch(Exception connectionException)
- {
- Tizen.Log.Error("oobe", $"Failed to connect to WiFI {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid})" +
- $"Password: {(passwordEntry is null? "not set" : "XXXXXXXX")}, " +
- $"Security type: {currentSecurityType.GetUIName()} " +
- connectionException.Message);
- continue;
- }
-
- }
- if (success)
- {
- OnDismiss?.Invoke();
- }
- else
- {
- ShowFailurePasswordLabel();
- }
- };
- this.Add(addButton);
-
- failureLabel = new TextLabel
- {
- Size = new Size2D(),
- PixelSize = 12,
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- TextColor = new Color(0xAA / 255.0f, 0x18 / 255.0f, 0x18 / 255.0f, 1.0f),
- HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center
- };
- failureLabel.Hide();
- this.Add(failureLabel);
- }
-
- void OpenSecurityTypePopup()
- {
- var view = new ChangeSecurityTypePopup(currentSecurityType);
- var popup = new Oobe.Common.Utils.Popup(view);
- view.OnDismiss += () =>
- {
- ResetViewTo(view.WifiUISecurityType);
- popup.Dismiss();
- };
- popup.Show();
- }
-
- void ResetViewToNoPassword()
- {
- Size = new Size(808, 322);
- Position = new Position2D(236, 118);
-
- addButton.Position = new Position2D(488, ((int)Size.Height) - 96);
- cancelButton.Position = new Position2D(80, ((int)Size.Height) - 96);
-
- if (!(usernameLabel is null))
- {
- usernameLabel.Unparent();
- usernameLabel.Dispose();
- usernameLabel = null;
- }
-
- if (!(usernameTextField is null))
- {
- usernameTextField.Unparent();
- usernameTextField.Dispose();
- usernameTextField = null;
- }
-
- if(!(usernameUnderline is null))
- {
- usernameUnderline.Unparent();
- usernameUnderline.Dispose();
- usernameUnderline = null;
- }
-
- if (!(passwordLabel is null))
- {
- passwordLabel.Unparent();
- passwordLabel.Dispose();
- passwordLabel = null;
- }
-
- if (!(passwordEntry is null))
- {
- passwordEntry.Unparent();
- passwordEntry.Dispose();
- passwordEntry = null;
- }
-
- if (!(passwordUnderline is null))
- {
- passwordUnderline.Unparent();
- passwordUnderline.Dispose();
- passwordUnderline = null;
- }
-
- if (!(revealButton is null))
- {
- revealButton.Unparent();
- revealButton.Dispose();
- revealButton = null;
- }
-
- currentViewMode = NewNetworkViewMode.NoPassword;
- }
-
- void ResetViewToPasswordOnly()
- {
- Size = new Size2D(808, 382);
- Position = new Position2D(236, 59);
-
- addButton.Position = new Position2D(488, ((int)Size.Height) - 96);
- cancelButton.Position = new Position2D(80, ((int)Size.Height) - 96);
-
- if (!(usernameLabel is null))
- {
- usernameLabel.Unparent();
- usernameLabel.Dispose();
- usernameLabel = null;
- }
-
- if (!(usernameTextField is null))
- {
- usernameTextField.Unparent();
- usernameTextField.Dispose();
- usernameTextField = null;
- }
-
- if (!(usernameUnderline is null))
- {
- usernameUnderline.Unparent();
- usernameUnderline.Dispose();
- usernameUnderline = null;
- }
-
- if (passwordLabel is null)
- {
- passwordLabel = CreateTextLabel("WIFI_SECURITY_KEY");
- this.Add(passwordLabel);
- }
-
- if (passwordEntry is null)
- {
- passwordEntry = CreatePasswordEntry();
- this.Add(passwordEntry);
- }
-
- if (passwordUnderline is null)
- {
- passwordUnderline = CreateUnderline();
- this.Add(passwordUnderline);
- }
-
- if (revealButton is null)
- {
- revealButton = CreateRevealButton();
- this.Add(revealButton);
- }
-
- passwordLabel.Position = new Position2D(104, 208);
- passwordEntry.Position = new Position2D(121, 225);
- passwordUnderline.Position = new Position2D(104, 251);
- revealButton.Position = new Position2D(704, 214);
-
- currentViewMode = NewNetworkViewMode.PasswordOnly;
- }
-
- void ResetViewToUserPassword()
- {
- Size = new Size2D(808, 440);
- Position = new Position2D(236, 0);
-
- addButton.Position = new Position2D(488, ((int)Size.Height) - 96);
- cancelButton.Position = new Position2D(80, ((int)Size.Height) - 96);
-
- if (usernameLabel is null)
- {
- usernameLabel = CreateTextLabel("WIFI_USERNAME");
- this.Add(usernameLabel);
- }
-
- if (usernameTextField is null)
- {
- usernameTextField = CreateTextField("WIFI_USERNAME");
- this.Add(usernameTextField);
- }
-
- if(usernameUnderline is null)
- {
- usernameUnderline = CreateUnderline();
- this.Add(usernameUnderline);
- }
-
- if (passwordLabel is null)
- {
- passwordLabel = CreateTextLabel("WIFI_SECURITY_KEY");
- this.Add(passwordLabel);
- }
-
- if (passwordEntry is null)
- {
- passwordEntry = CreatePasswordEntry();
- this.Add(passwordEntry);
- }
-
- if(passwordUnderline is null)
- {
- passwordUnderline = CreateUnderline();
- this.Add(passwordUnderline);
- }
-
- if (revealButton is null)
- {
- revealButton = CreateRevealButton();
- this.Add(revealButton);
- }
-
- usernameLabel.Position2D = new Position2D(104, 208);
- usernameTextField.Position2D = new Position2D(121, 225);
- usernameUnderline.Position2D = new Position2D(104, 251);
- passwordLabel.Position2D = new Position2D(104, 272);
- passwordEntry.Position2D = new Position2D(121, 289);
- passwordUnderline.Position2D = new Position2D(104, 315);
- revealButton.Position = new Position2D(704, 278);
-
- currentViewMode = NewNetworkViewMode.UserPassword;
- }
-
- void ResetViewTo(WifiUISecurityType securityType)
- {
- Tizen.Log.Debug("oobe", $"Reseting view to {securityType.GetUIName()}");
- failureLabel.Hide();
- currentSecurityType = securityType;
- securityTypeButton.TranslatableText = securityType.GetUIName();
- switch (securityType)
- {
- case WifiUISecurityType.None:
- ResetViewToNoPassword();
- break;
- case WifiUISecurityType.EAP:
- case WifiUISecurityType.WEP:
- case WifiUISecurityType.WPAPSK:
- case WifiUISecurityType.WPA2PSK:
- ResetViewToPasswordOnly();
- break;
- default:
- throw new NotImplementedException($"UI for Security type {securityType.GetUIName()} was not implemented");
- }
- }
-
- void ShowFailureSsidLabel()
- {
- failureLabel.Show();
- failureLabel.TranslatableText = "WIFI_SSID_FAILURE";
- failureLabel.Position2D = ssidTextField.Position2D + new Position2D(0, (int)ssidTextField.Size.Height);
- }
-
- void ShowFailurePasswordLabel()
- {
- failureLabel.Show();
- if (currentViewMode == NewNetworkViewMode.NoPassword)
- {
- failureLabel.TranslatableText = "WIFI_SSID_FAILURE";
- failureLabel.Position2D = ssidTextField.Position2D + new Position2D(0, (int)ssidTextField.Size.Height);
- }
- else
- {
- failureLabel.TranslatableText = "WIFI_SECUIRTY_KEY_FAILURE";
- failureLabel.Position2D = passwordEntry.Position2D + new Position2D(0, (int)passwordEntry.Size.Height);
- }
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Tizen.Network.WiFi;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-
-namespace Oobe.Wifi.Controls.Wifi
-{
- public class ApManager : IDisposable
- {
- private Action<WiFiAP> onTapped;
- private Dictionary<WiFiAP, ApView> apToViewMap = new Dictionary<WiFiAP, ApView>();
- private CancellationTokenSource updatingCancellation = new CancellationTokenSource();
-
- public ObservableCollection<View> Views { get; private set; } = new ObservableCollection<View>();
-
- public ApManager(Action<WiFiAP> onTapped)
- {
- this.onTapped = onTapped;
- WiFiManager.ConnectionStateChanged += OnConnectionStateChanged;
- RunUpdatingAps();
- }
-
- private void OnConnectionStateChanged(object sender, ConnectionStateChangedEventArgs e)
- {
- if (apToViewMap.TryGetValue(e.AP, out ApView view))
- {
- view.Update(e.AP);
- }
- }
-
- public void UpdateTo(IEnumerable<WiFiAP> aps)
- {
- UpdateToNaive(aps);
- }
-
- public void UpdateToNaive(IEnumerable<WiFiAP> aps)
- {
- foreach (var ap in apToViewMap.Keys)
- {
- ap.Dispose();
- }
- apToViewMap.Clear();
- Views.Clear();
-
- int idx = 0;
- foreach (var ap in aps)
- {
- if (apToViewMap.ContainsKey(ap) == false)
- {
- var view = new ApView();
- view.Update(ap);
- view.Tapped += () => onTapped(ap);
-
- apToViewMap.Add(ap, view);
- Views.Insert(idx, view);
-
- idx++;
- }
- else
- {
- Tizen.Log.Error("oobe", $"another AP with the same hash code {ap.NetworkInformation.Essid} {ap.GetHashCode()}");
- }
- }
- }
-
- public void Dispose()
- {
- WiFiManager.ConnectionStateChanged -= OnConnectionStateChanged;
- updatingCancellation.Cancel();
- foreach (var ap in apToViewMap.Keys)
- {
- ap.Dispose();
- }
- }
-
- private async void RunUpdatingAps()
- {
- while (await Delay())
- {
- foreach (var (ap, view) in apToViewMap.ToList())
- {
- try
- {
- ap.Refresh();
- view.Update(ap);
- }
- catch (Exception ex)
- {
- Tizen.Log.Error("oobe", $"failed to refresh ap {ap.NetworkInformation.Essid} {ex.ToString()}");
-
- Views.Remove(view);
- apToViewMap.Remove(ap);
- ap.Dispose();
- }
- }
- }
- }
-
- private async Task<bool> Delay()
- {
- try
- {
- await Task.Delay(10_000, updatingCancellation.Token);
- }
- catch (Exception)
- {
- }
- return updatingCancellation.IsCancellationRequested == false;
- }
- }
-}
+++ /dev/null
-using System;
-using Tizen.Network.WiFi;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Oobe.Common.Styles;
-
-namespace Oobe.Wifi.Controls.Wifi
-{
- public class ApView : View
- {
- public event Action Tapped;
- private TextLabel detail = null;
- private View range = null;
- //detectors have to be kept separately because of GC, there is no link by ref between View and Detector
- private TapGestureDetector detector;
-
- public ApView()
- {
- Size = new Size(WifiView.ListItemWidth, WifiView.ListItemHeight);
- Layout = new AbsoluteLayout();
- }
-
- public void Update(WiFiAP wifiAp)
- {
- if (range == null)
- {
- range = new View()
- {
- Position = new Position(39, 21),
- BackgroundImage = GetRangeImage(wifiAp),
- };
- this.Add(range);
-
- this.Add(new TextLabel(wifiAp.NetworkInformation.Essid)
- {
- Position = new Position(78, 17),
- PixelSize = 20f,
- TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddLightFontStyle(),
- });
-
- detail = new TextLabel(GetDetailInfo(wifiAp))
- {
- WidthSpecification = LayoutParamPolicies.WrapContent,
- Position = new Position(79, 45),
- PixelSize = 14f,
- TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- };
- this.Add(detail);
-
- detector = new TapGestureDetector();
- detector.Detected += (s, e) => Tapped?.Invoke();
- detector.Attach(this);
- }
- else
- {
- range.BackgroundImage = GetRangeImage(wifiAp);
- detail.Text = GetDetailInfo(wifiAp);
- detail.WidthSpecification = LayoutParamPolicies.WrapContent;
- }
- }
-
- private static string GetDetailInfo(WiFiAP wifiAp)
- {
- //state
- if (wifiAp.NetworkInformation.ConnectionState == WiFiConnectionState.Connected)
- {
- return "Connected";
- }
- if (wifiAp.NetworkInformation.ConnectionState == WiFiConnectionState.Association)
- {
- return "Connecting...";
- }
- //security
- else if (wifiAp.SecurityInformation.SecurityType == Tizen.Network.Connection.WiFiSecurityType.None)
- {
- return "Open";
- }
- else if (wifiAp.SecurityInformation.IsPassphraseRequired == false)
- {
- return "Saved";
- }
- else
- {
- return "Secured";
- }
- }
-
- private static string GetRangeImage(WiFiAP wifiAp)
- {
- return System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource
- , $"12_icon_wifi{(int)wifiAp.NetworkInformation.RssiLevel}.png");
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-
-namespace Oobe.Wifi.Controls.Wifi
-{
- public class ButtonStyles
- {
- public static ButtonStyle Cancel = GetCancelButtonStyle();
- public static ButtonStyle OK = GetOKButtonStyle();
- public static ButtonStyle Scan = GetScanButtonStyle();
- public static ButtonStyle TurnOnOff = GetTurnOnOffButtonStyle();
- public static ButtonStyle Reveal = GetRevealButtonStyle();
- public static ButtonStyle AddNetwork = GetAddNetworkButtonStyle();
-
- private static ButtonStyle GetCancelButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_action.png",
- Pressed = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_pressed.png",
- Disabled = NUIApplication.Current.DirectoryInfo.Resource + "button/02_butt_2_empty_disabled.png",
- },
- Text = new TextLabelStyle
- {
- PointSize = new Selector<float?>
- {
- Normal = 22.0f,
- Pressed = 24.0f
- },
- EnableMarkup = true,
- TranslatableText = "WIFI_CANCEL",
- TextColor = new Selector<Color>
- {
- Normal = new Color(0.0f, 20.0f / 255.0f, 71 / 255.0f, 1.0f),
- Pressed = new Color(41.0f / 255.0f, 91.0f / 255.0f, 178 / 255.0f, 1.0f),
- },
- FontFamily = GetNavigationFont(),
- },
- Size2D = new Size2D(240, 72),
- };
-
- private static ButtonStyle GetScanButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan.png",
- Pressed = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan_pressed.png",
- Disabled = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan_disabled.png",
- },
- Size2D = new Size2D(72, 32),
- };
-
- private static ButtonStyle GetTurnOnOffButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifioff.png",
- Disabled = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifioff_disabled.png",
- Selected = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifion.png",
- DisabledSelected = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifion_disabled.png",
- },
- Size2D = new Size2D(72, 32),
- };
-
- private static ButtonStyle GetAddNetworkButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_addnetwork.png",
- Pressed = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_addnetwork_pressed.png",
- },
- Size2D = new Size2D(42, 42),
- };
-
- private static ButtonStyle GetRevealButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_eye_pw_hidden.png"),
- Selected = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_eye_pw_visible.png"),
- },
- };
-
- private static ButtonStyle GetOKButtonStyle() => new ButtonStyle
- {
- BackgroundImage = new Selector<string>
- {
- Normal = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_active.svg",
- Pressed = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_selected.svg",
- Disabled = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_disabled.svg",
- },
- Text = new TextLabelStyle
- {
- PointSize = new Selector<float?>
- {
- Normal = 22.0f,
- Pressed = 24.0f
- },
- TextColor = Color.White,
- TranslatableText = "WIFI_OK",
- FontFamily = GetNavigationFont(),
- },
- Size2D = new Size2D(240, 72),
- };
-
- private static Selector<string> GetNavigationFont()
- {
- return new Selector<string>
- {
- Normal = "BreezeSans",
- };
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Oobe.Common.Styles;
-using Tizen.Network.WiFi;
-
-namespace Oobe.Wifi.Controls.Wifi
-{
- class ChangeSecurityTypePopup : View
- {
- public event Action OnDismiss;
-
- public WifiUISecurityType WifiUISecurityType { get; private set; }
- private WifiUISecurityType originalWifUISecurityType;
- private ListView listView;
- private ObservableCollection<View> choiceViews = new ObservableCollection<View>();
- private RadioButtonGroup radioButtonGroup = new RadioButtonGroup();
-
- public ChangeSecurityTypePopup(WifiUISecurityType wifUISecurityType)
- {
- this.originalWifUISecurityType = wifUISecurityType;
- this.WifiUISecurityType = wifUISecurityType;
- this.Size = new Size(808, 440);
- this.Position = new Position(236, 140);
- this.BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
-
- InitializeStaticElements();
- InitializeRadioButtons();
- }
-
- public void InitializeStaticElements()
- {
- var titleLabel = new TextLabel()
- {
- Position = new Position2D(80, 24),
- Size = new Size(648, 34),
- PixelSize = 26,
- TranslatableText = "WIFI_CHOOSE_SECURITY_TYPE",
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddLightFontStyle(),
- TextColor = new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center
- };
- this.Add(titleLabel);
-
- var cancelButton = new Button(ButtonStyles.Cancel)
- {
- Position = new Position(80, 344),
- Size = new Size(240, 72),
- };
- cancelButton.ClickEvent += (s, e) =>
- {
- WifiUISecurityType = originalWifUISecurityType;
- OnDismiss?.Invoke();
- };
- this.Add(cancelButton);
-
- var addButton = new Button(ButtonStyles.OK)
- {
- Position = new Position(488, 344),
- Size = new Size(240, 72),
- TranslatableText = "WIFI_OK"
- };
-
- addButton.ClickEvent += (s, e) =>
- {
- OnDismiss?.Invoke();
- };
- this.Add(addButton);
- }
-
- private void InitializeRadioButtons()
- {
- foreach (WifiUISecurityType type in Enum.GetValues(WifiUISecurityType.GetType()))
- {
- var view = CreateOption(type);
- choiceViews.Add(view);
- }
- listView = new ListView(768, 238)
- {
- Items = choiceViews
- };
- listView.View.Position = new Position(0, 82);
- this.Add(listView.View);
- }
-
- private View CreateOption(WifiUISecurityType wifiUISecurityType)
- {
- var view = new SecurityTypeView(wifiUISecurityType);
- if (this.WifiUISecurityType == wifiUISecurityType)
- {
- view.Button.IsSelected = true;
- }
- radioButtonGroup.Add(view.Button);
- view.Button.ClickEvent += (s, e) => this.WifiUISecurityType = view.WifiUISecurityType;
- return view;
- }
- }
-}
+++ /dev/null
-using Tizen.NUI;
-
-namespace Oobe.Wifi.Controls.Wifi
-{
- public class PasswordEntry : Tizen.NUI.BaseComponents.TextField
- {
- private bool revealed = false;
- public string Password => Text;
-
- public bool Revealed
- {
- get => revealed;
- set
- {
- revealed = value;
- if (revealed)
- revealPassword();
- else
- hidePassword();
- Text = Text; //for refreshing - causes resetting cursor
- }
- }
-
- private void revealPassword()
- {
- var map = new PropertyMap();
- map.Add("mode", new PropertyValue(0));
- HiddenInputSettings = map;
- }
- private void hidePassword()
- {
- var map = new PropertyMap();
- map.Add("mode", new PropertyValue(4));
- map.Add("show_last_character_duration", new PropertyValue(500));
- HiddenInputSettings = map;
- }
- }
-}
+++ /dev/null
-using System;
-using Tizen.Network.WiFi;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Oobe.Common.Styles;
-
-namespace Oobe.Wifi.Controls.Wifi
-{
- class SecurityTypeView : View
- {
- public event Action Tapped;
- public RadioButton Button;
- public readonly WifiUISecurityType WifiUISecurityType;
-
- private TextLabel descriptionTextLabel = null;
- /*//detectors have to be kept separately because of GC, there is no link by ref between View and Detector
- private TapGestureDetector detector;*/
-
- public SecurityTypeView(WifiUISecurityType wifiUISecurityType)
- {
- Size = new Size(768, 64);
- Layout = new AbsoluteLayout();
- this.WifiUISecurityType = wifiUISecurityType;
-
- InitializeSubelements();
- }
-
- void InitializeSubelements()
- {
- Button = new RadioButton
- {
- IsSelected = false,
- Position = new Position(40, 20),
- Size = new Size(24, 24),
- CellHorizontalAlignment = HorizontalAlignmentType.Center,
- CellVerticalAlignment = VerticalAlignmentType.Center
- };
- this.Add(Button);
-
- descriptionTextLabel = new TextLabel
- {
- Position = new Position(92, 19),
- Size = new Size(648, 26),
- PixelSize = 20,
- TranslatableText = WifiUISecurityType.GetUIName(),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddLightFontStyle(),
- TextColor = new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
- HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center
- };
- this.Add(descriptionTextLabel);
- }
- }
-}
+++ /dev/null
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace OobeWifi.Controls.Wifi {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- public class Translations {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Translations() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- public static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OobeWifi.Controls.Wifi.Translations", typeof(Translations).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- public static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Add new....
- /// </summary>
- public static string WIFI_ADD_NEW_NETWORK {
- get {
- return ResourceManager.GetString("WIFI_ADD_NEW_NETWORK", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to CANCEL.
- /// </summary>
- public static string WIFI_CANCEL {
- get {
- return ResourceManager.GetString("WIFI_CANCEL", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Connection failed..
- /// </summary>
- public static string WIFI_CONNECTION_FAILED {
- get {
- return ResourceManager.GetString("WIFI_CONNECTION_FAILED", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Enter password.
- /// </summary>
- public static string WIFI_ENTER_PASSWORD {
- get {
- return ResourceManager.GetString("WIFI_ENTER_PASSWORD", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Enter password to join "{0}".
- /// </summary>
- public static string WIFI_ENTER_PASSWORD_TO_JOIN {
- get {
- return ResourceManager.GetString("WIFI_ENTER_PASSWORD_TO_JOIN", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Invalid password.
- /// </summary>
- public static string WIFI_INVALID_PASSWORD {
- get {
- return ResourceManager.GetString("WIFI_INVALID_PASSWORD", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to OK.
- /// </summary>
- public static string WIFI_OK {
- get {
- return ResourceManager.GetString("WIFI_OK", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Scanning....
- /// </summary>
- public static string WIFI_SCANNING {
- get {
- return ResourceManager.GetString("WIFI_SCANNING", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to To see available networks, turn on Wi - Fi..
- /// </summary>
- public static string WIFI_TURN_ON_WIFI {
- get {
- return ResourceManager.GetString("WIFI_TURN_ON_WIFI", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to .
- /// </summary>
- public static string WIFI_UI_SECURITY_TYPE_EAP {
- get {
- return ResourceManager.GetString("WIFI_UI_SECURITY_TYPE_EAP", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to .
- /// </summary>
- public static string WIFI_UI_SECURITY_TYPE_OPEN {
- get {
- return ResourceManager.GetString("WIFI_UI_SECURITY_TYPE_OPEN", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to .
- /// </summary>
- public static string WIFI_UI_SECURITY_TYPE_WEP {
- get {
- return ResourceManager.GetString("WIFI_UI_SECURITY_TYPE_WEP", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to .
- /// </summary>
- public static string WIFI_UI_SECURITY_TYPE_WPA {
- get {
- return ResourceManager.GetString("WIFI_UI_SECURITY_TYPE_WPA", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to .
- /// </summary>
- public static string WIFI_UI_SECURITY_TYPE_WPA2 {
- get {
- return ResourceManager.GetString("WIFI_UI_SECURITY_TYPE_WPA2", resourceCulture);
- }
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="WIFI_ADD_NETWORK" xml:space="preserve">
- <value>네트워크 추가</value>
- </data>
- <data name="WIFI_ADD_NEW_NETWORK" xml:space="preserve">
- <value>네트워크 추가</value>
- </data>
- <data name="WIFI_CANCEL" xml:space="preserve">
- <value>취소</value>
- </data>
- <data name="WIFI_CHOOSE_SECURITY_TYPE" xml:space="preserve">
- <value>보안 유형을 선택하십시오</value>
- </data>
- <data name="WIFI_CONNECTION_FAILED" xml:space="preserve">
- <value>네트워크에 연결하지 못했습니다.</value>
- </data>
- <data name="WIFI_ENTER_PASSWORD" xml:space="preserve">
- <value>비밀번호를 입력하세요</value>
- </data>
- <data name="WIFI_ENTER_PASSWORD_TO_JOIN" xml:space="preserve">
- <value>"{0}" 에 연결하려면 비밀번호를 입력하세요.</value>
- </data>
- <data name="WIFI_INVALID_PASSWORD" xml:space="preserve">
- <value>잘못된 비밀번호</value>
- </data>
- <data name="WIFI_OK" xml:space="preserve">
- <value>확인</value>
- </data>
- <data name="WIFI_SCANNING" xml:space="preserve">
- <value>찾는 중...</value>
- </data>
- <data name="WIFI_SECUIRTY_KEY_FAILURE" xml:space="preserve">
- <value>잘못된 비밀번호 또는 보안 유형</value>
- </data>
- <data name="WIFI_SECURITY_KEY" xml:space="preserve">
- <value>보안 키</value>
- </data>
- <data name="WIFI_SECURITY_TYPE" xml:space="preserve">
- <value>보안 유형</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_EAP" xml:space="preserve">
- <value>EAP</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_OPEN" xml:space="preserve">
- <value>Open</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_WEP" xml:space="preserve">
- <value>WEP</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_WPA2PSK" xml:space="preserve">
- <value>WPA2 PSK</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_WPAPSK" xml:space="preserve">
- <value>WPA PSK</value>
- </data>
- <data name="WIFI_SSID" xml:space="preserve">
- <value>네트워크 이름</value>
- </data>
- <data name="WIFI_SSID_FAILURE" xml:space="preserve">
- <value>잘못된 이름 또는 보안 유형</value>
- </data>
- <data name="WIFI_TURN_ON_WIFI" xml:space="preserve">
- <value>연결 가능한 네트워크를 보려면 Wi-Fi를 켜세요.</value>
- </data>
- <data name="WIFI_USERNAME" xml:space="preserve">
- <value>사용자 이름</value>
- </data>
-</root>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="WIFI_ADD_NEW_NETWORK" xml:space="preserve">
- <value>Dodaj nową...</value>
- </data>
- <data name="WIFI_CANCEL" xml:space="preserve">
- <value>ANULUJ</value>
- </data>
- <data name="WIFI_ADD" xml:space="preserve">
- <value>DODAJ</value>
- </data>
- <data name="WIFI_CONNECTION_FAILED" xml:space="preserve">
- <value>Połączenie nieudane.</value>
- </data>
- <data name="WIFI_ENTER_PASSWORD" xml:space="preserve">
- <value>Wprowadź hasło</value>
- </data>
- <data name="WIFI_ENTER_PASSWORD_TO_JOIN" xml:space="preserve">
- <value>Wprowadź hasło aby połączyć z "{0}"</value>
- </data>
- <data name="WIFI_INVALID_PASSWORD" xml:space="preserve">
- <value>Hasło nieprawidłowe</value>
- </data>
- <data name="WIFI_OK" xml:space="preserve">
- <value>ZATWIERDŹ</value>
- </data>
- <data name="WIFI_SCANNING" xml:space="preserve">
- <value>Skanowanie...</value>
- </data>
- <data name="WIFI_TURN_ON_WIFI" xml:space="preserve">
- <value>Aby zobaczyć dostępne sieci, włącz Wi - Fi.</value>
- </data>
- <data name="WIFI_ADD_NETWORK">
- <value>Dodaj sieć</value>
- </data>
- <data name="WIFI_CHOOSE_SECURITY_TYPE">
- <value>Wybierz typ zabezpieczeń</value>
- </data>
- <data name="WIFI_SSID">
- <value>Nazwa sieci</value>
- </data>
- <data name="WIFI_SECURITY_TYPE">
- <value>Wybierz typ zabezpieczeń</value>
- </data>
- <data name="WIFI_USERNAME">
- <value>Nazwa użytkownika</value>
- </data>
- <data name="WIFI_SECURITY_KEY">
- <value>Klucz zabezpieczeń</value>
- </data>
- <data name="WIFI_SSID_FAILURE">
- <value>Nieprawidłowa nazwa sieci lub typ zabezpieczeń</value>
- </data>
- <data name="WIFI_SECUIRTY_KEY_FAILURE">
- <value>Nieprawidłowy klucz lub typ zabezpieczeń</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_OPEN" xml:space="preserve">
- <value>Otwarte</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_EAP" xml:space="preserve">
- <value>EAP</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_WEP" xml:space="preserve">
- <value>WEP</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_WPAPSK" xml:space="preserve">
- <value>WPA PSK</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_WPA2PSK" xml:space="preserve">
- <value>WPA2 PSK</value>
- </data>
-</root>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="WIFI_ADD_NEW_NETWORK" xml:space="preserve">
- <value>Add new...</value>
- </data>
- <data name="WIFI_CANCEL" xml:space="preserve">
- <value>CANCEL</value>
- </data>
- <data name="WIFI_ADD" xml:space="preserve">
- <value>ADD</value>
- </data>
- <data name="WIFI_CONNECTION_FAILED" xml:space="preserve">
- <value>Connection failed.</value>
- </data>
- <data name="WIFI_ENTER_PASSWORD" xml:space="preserve">
- <value>Enter password</value>
- </data>
- <data name="WIFI_ENTER_PASSWORD_TO_JOIN" xml:space="preserve">
- <value>Enter password to join "{0}"</value>
- </data>
- <data name="WIFI_INVALID_PASSWORD" xml:space="preserve">
- <value>Invalid password</value>
- </data>
- <data name="WIFI_OK" xml:space="preserve">
- <value>OK</value>
- </data>
- <data name="WIFI_SCANNING" xml:space="preserve">
- <value>Scanning...</value>
- </data>
- <data name="WIFI_TURN_ON_WIFI" xml:space="preserve">
- <value>To see available networks, turn on Wi - Fi.</value>
- </data>
- <data name="WIFI_ADD_NETWORK">
- <value>Add network</value>
- </data>
- <data name="WIFI_CHOOSE_SECURITY_TYPE">
- <value>Choose security type</value>
- </data>
- <data name="WIFI_SSID">
- <value>Network name</value>
- </data>
- <data name="WIFI_SECURITY_TYPE">
- <value>Security type</value>
- </data>
- <data name="WIFI_USERNAME">
- <value>Username</value>
- </data>
- <data name="WIFI_SECURITY_KEY">
- <value>Security Key</value>
- </data>
- <data name="WIFI_SSID_FAILURE">
- <value>Invalid name or security type</value>
- </data>
- <data name="WIFI_SECUIRTY_KEY_FAILURE">
- <value>Invalid password or security type</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_OPEN" xml:space="preserve">
- <value>Open</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_EAP" xml:space="preserve">
- <value>EAP</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_WEP" xml:space="preserve">
- <value>WEP</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_WPAPSK" xml:space="preserve">
- <value>WPA PSK</value>
- </data>
- <data name="WIFI_SECURITY_TYPE_WPA2PSK" xml:space="preserve">
- <value>WPA2 PSK</value>
- </data>
-</root>
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Threading.Tasks;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Tizen.Network.WiFi;
-using Oobe.Common.Styles;
-using OobeWifi.Controls.Wifi;
-
-namespace Oobe.Wifi.Controls.Wifi
-{
- class WifiPasswordPopup : View
- {
- public event Action OnDismiss;
- private PasswordEntry passwordEntry = null;
- private Button okButton;
- private Button cancelButton;
- private Button revealButton;
- private TextLabel connectionFailure;
- private const int minPasswordLength = 8;
- private const int maxPasswordLength = 63;
- private string backgroundImagePath = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
- private WiFiAP wifiAp;
- private bool isConnecting = false;
-
- public string Password => passwordEntry.Password;
-
- public WifiPasswordPopup(Tizen.Network.WiFi.WiFiAP wifiAp)
- {
- BackgroundImage = backgroundImagePath;
- Size = new Size(808, 304);
- Position = new Position(new Position2D(236, 116));
- this.wifiAp = wifiAp;
-
- this.Add(new View() //underline
- {
- Size = new Size(584, 1),
- Position = new Position(103, 160),
- BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f),
- });
-
- passwordEntry = new PasswordEntry()
- {
- Size = new Size(584, 27),
- Position = new Position(112, 133),
- MaxLength = maxPasswordLength,
- PixelSize = 22,
- TextColor = new Color(0, 0x0C / 255.0f, 0x2B / 255.0f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- Revealed = false,
- };
- passwordEntry.TextChanged += (s, e) => UpdateOKButton();
-
- this.Add(passwordEntry);
-
- var titleLabel = new TextLabel
- {
- Size = new Size(808, 35),
- Position = new Position(0, 19),
- TranslatableText = "WIFI_ENTER_PASSWORD",
- PixelSize = 28,
- TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddLightFontStyle(),
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center,
- };
- this.Add(titleLabel);
-
- var subtitleLabel = new TextLabel
- {
- Size = new Size(808, 26),
- Position = new Position(0, 68),
- //no translatableText because of dynamic content
- Text = string.Format(Translations.WIFI_ENTER_PASSWORD_TO_JOIN, wifiAp.NetworkInformation.Essid),
- PixelSize = 20,
- TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center,
- };
- this.Add(subtitleLabel);
-
- connectionFailure = new TextLabel
- {
- Size = new Size(120, 16),
- Position = new Position(116, 166),
- TranslatableText = "WIFI_INVALID_PASSWORD",
- PixelSize = 12,
- TextColor = new Color(0xAA / 255.0f, 0x18 / 255.0f, 0x18 / 255.0f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center,
- };
- connectionFailure.Hide();
- this.Add(connectionFailure);
-
- revealButton = new Button(ButtonStyles.Reveal)
- {
- Size = new Size(48, 48),
- Position = new Position(696, 120),
- };
- revealButton.ClickEvent += (s, e) => TogglePasswordVisibility();
- this.Add(revealButton);
-
- cancelButton = new Button(ButtonStyles.Cancel)
- {
- Size = new Size(240, 72),
- Position = new Position(80, 200)
- };
- cancelButton.ClickEvent += (s, e) =>
- {
- OnDismiss.Invoke();
- };
- this.Add(cancelButton);
-
- okButton = new Button(ButtonStyles.OK)
- {
- Size = new Size(240, 72),
- Position = new Position(488, 200),
- IsEnabled = false
- };
- okButton.ClickEvent += async (s, e) =>
- {
- isConnecting = true;
- UpdateOKButton();
- try
- {
- Tizen.Log.Debug("oobe", $"connecting to wifi {wifiAp.NetworkInformation.Essid} with password {"XXXXXXXX"}");
- wifiAp.SecurityInformation.SetPassphrase(Password);
- var task = wifiAp.ConnectAsync();
- await task;
- if (task.Status == TaskStatus.Faulted)
- {
- throw task.Exception;
- }
- else
- {
- OnDismiss.Invoke();
- }
- }
- catch (Exception ex)
- {
- Tizen.Log.Error("oobe", $"{ex.ToString()}");
- connectionFailure.Show();
- }
- finally
- {
- isConnecting = false;
- UpdateOKButton();
- }
- };
- this.Add(okButton);
- }
-
- private void TogglePasswordVisibility()
- {
- passwordEntry.Revealed = !passwordEntry.Revealed;
- revealButton.IsSelected = !revealButton.IsSelected;
- }
-
- private void UpdateOKButton()
- {
- okButton.IsEnabled = (Password.Length >= minPasswordLength) && (isConnecting == false);
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using Tizen.Network.WiFi;
-
-namespace Oobe.Wifi.Controls.Wifi
-{
- internal class WifiState : IDisposable
- {
- public event Action OnTurningOnFailed;
- public event Action OnTurnedOn;
- public event Action OnTurnedOff;
- public event Action OnScanStarted;
- public event Action OnScanFinished;
-
- public bool IsTurnedOn => WiFiManager.IsActive;
-
- public WifiState()
- {
- WiFiManager.DeviceStateChanged += WiFiManager_DeviceStateChanged;
- }
-
- public async Task TurnWifi()
- {
- try
- {
- if (IsTurnedOn)
- {
- await WiFiManager.DeactivateAsync();
- }
- else
- {
- await WiFiManager.ActivateAsync();
- if (IsTurnedOn == false)
- {
- OnTurningOnFailed?.Invoke();
- }
- }
- }
- catch (Exception ex)
- {
- Tizen.Log.Error("oobe", $"{ex.ToString()}");
- }
- }
-
- public async Task<IEnumerable<WiFiAP>> Scan()
- {
- try
- {
- OnScanStarted?.Invoke();
- await WiFiManager.ScanAsync();
- return WiFiManager.GetFoundAPs();
- }
- catch (Exception ex)
- {
- Tizen.Log.Error("oobe", $"{ex.ToString()}");
- }
- finally
- {
- OnScanFinished?.Invoke();
- }
- return new List<WiFiAP>();
- }
-
- public void Dispose()
- {
- WiFiManager.DeviceStateChanged -= WiFiManager_DeviceStateChanged;
- }
-
- private void WiFiManager_DeviceStateChanged(object sender, DeviceStateChangedEventArgs e)
- {
- if (e.State == WiFiDeviceState.Activated)
- {
- OnTurnedOn?.Invoke();
- }
- else
- {
- OnTurnedOff?.Invoke();
- }
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tizen.Network.Connection;
-
-namespace Oobe.Wifi.Controls.Wifi
-{
- enum WifiUISecurityType
- {
- None,
- EAP,
- WEP,
- WPAPSK,
- WPA2PSK
- }
-
- static class WifiUISecurityTypeExtensions
- {
- public static string GetUIName(this WifiUISecurityType type)
- {
- switch (type)
- {
- case WifiUISecurityType.None: return "WIFI_SECURITY_TYPE_OPEN";
- case WifiUISecurityType.EAP: return "WIFI_SECURITY_TYPE_EAP";
- case WifiUISecurityType.WEP: return "WIFI_SECURITY_TYPE_WEP";
- case WifiUISecurityType.WPAPSK: return "WIFI_SECURITY_TYPE_WPAPSK";
- case WifiUISecurityType.WPA2PSK: return "WIFI_SECURITY_TYPE_WPA2PSK";
- default:
- throw new ArgumentException("Unknown security type");
- }
- }
-
- public static WiFiSecurityType GetApSecurityType(this WifiUISecurityType type)
- {
- switch (type)
- {
- case WifiUISecurityType.None: return WiFiSecurityType.None;
- case WifiUISecurityType.EAP: return WiFiSecurityType.Eap;
- case WifiUISecurityType.WEP: return WiFiSecurityType.Wep;
- case WifiUISecurityType.WPAPSK: return WiFiSecurityType.WpaPsk;
- case WifiUISecurityType.WPA2PSK: return WiFiSecurityType.Wpa2Psk;
- default:
- throw new ArgumentException("Unknown security type");
- }
- }
- }
-}
+++ /dev/null
-using System;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Oobe.Common.Styles;
-
-namespace Oobe.Wifi.Controls.Wifi
-{
- public class WifiView : IDisposable
- {
- private View view = null;
- public const int ListItemWidth = 460;
- public const int ListItemHeight = 79;//89;
-
- private WifiState State { get; set; } = new WifiState();
- private ApManager ApManager { get; set; } = new ApManager(OnApTapped);
-
- public View View
- {
- get
- {
- if (view == null)
- {
- view = new View()
- {
- Layout = new LinearLayout()
- {
- LinearOrientation = LinearLayout.Orientation.Vertical,
- },
- BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "Rectangle_918.png"),
- //BackgroundColor = Color.Red,
- //Size = new Size(480, 401),
- Size = new Size(480, 416),
- };
- view.Add(CreateHeader(480, 91));
-
- view.Add(CreateSeparator());
-
- view.Add(CreateListViewPlaceHolder());
- }
- return view;
- }
- }
-
- private static View CreateSeparator()
- {
- return new View()
- {
- Size2D = new Size(400, 1),
- BackgroundColor = new Color(0xC3 / 255f, 0xCA / 255f, 0xD2 / 255f, 1.0f),
- Margin = new Extents(40, 0, 0, 0),
- };
- }
-
- private static View CreateManualWifiView()
- {
- var manualWifi = new View()
- {
- Size = new Size(ListItemWidth, ListItemHeight),
- Layout = new AbsoluteLayout(),
- };
-
- var addNewButton = new Button(ButtonStyles.AddNetwork)
- {
- Position = new Position(29, 20),
- Size = new Size(42, 42),
- };
-
- addNewButton.ClickEvent += (s, e) => ShowAddNetworkPopup();
- manualWifi.Add(addNewButton);
-
- manualWifi.Add(new TextLabel()
- {
- TranslatableText = "WIFI_ADD_NEW_NETWORK",
- Position = new Position(87, 29),
- PixelSize = 20f,
- TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- });
- return manualWifi;
- }
-
- private static void ShowAddNetworkPopup()
- {
- var view = new AddNewNetworkPupup();
- var popup = new Common.Utils.Popup(view);
- view.OnDismiss += popup.Dismiss;
- popup.Show();
- }
-
- private static void ShowPasswordPopup(Tizen.Network.WiFi.WiFiAP wifiAp)
- {
- var view = new WifiPasswordPopup(wifiAp);
- var popup = new Common.Utils.Popup(view);
- view.OnDismiss += popup.Dismiss;
- popup.Show();
- }
-
- private static void OnApTapped(Tizen.Network.WiFi.WiFiAP wifiAp)
- {
- if (wifiAp.NetworkInformation.ConnectionState == Tizen.Network.WiFi.WiFiConnectionState.Connected)
- {
- Tizen.Log.Debug("oobe", $"Already connected to {wifiAp.NetworkInformation.Essid}");
- return;
- }
- ShowPasswordPopup(wifiAp);
- }
-
- private View CreateHeader(int width, int height)
- {
- var header = new View()
- {
- Size = new Size(width, height),
- Layout = new AbsoluteLayout(),
- };
-
- header.Add(CreateWifiScanningPlaceHolder());
-
- var scan = new Button(ButtonStyles.Scan)
- {
- Size = new Size(72, 32),
- Position = new Position(276, 39),
- };
- scan.ClickEvent += async (s, e) =>
- {
- scan.IsEnabled = false;
- ApManager.Views.Clear();
- ApManager.UpdateTo(await State.Scan());
- scan.IsEnabled = State.IsTurnedOn;
- };
- scan.IsEnabled = State.IsTurnedOn;
- State.OnTurnedOff += () => scan.IsEnabled = State.IsTurnedOn;
- State.OnTurnedOn += () => scan.IsEnabled = State.IsTurnedOn;
- header.Add(scan);
-
- header.Add(CreateTurnOnButton());
- return header;
- }
-
- private Button CreateTurnOnButton()
- {
- var button = new Button(ButtonStyles.TurnOnOff)
- {
- Size = new Size(72, 32),
- Position = new Position(369, 39),
- };
- button.IsSelected = State.IsTurnedOn;
-
- State.OnTurnedOff += () => button.IsSelected = State.IsTurnedOn;
- State.OnTurnedOn += () => button.IsSelected = State.IsTurnedOn;
-
- button.ClickEvent += async (s, e) =>
- {
- button.IsEnabled = false;
- await State.TurnWifi();
- button.IsEnabled = true;
- };
- return button;
- }
-
- private View CreateListViewPlaceHolder()
- {
- var view = new View();
- //var listView = new ListView(480, 324)//314)//480, 335
- var listView = new ListView(480, 319)
- {
- Footer = CreateManualWifiView(),
- Items = ApManager.Views,
- SeparatorFactory = CreateSeparator,
- }.View;
- view.Add(listView);
-
- var prompt = new TextLabel()
- {
- Position = new Position(40, 21),
- PixelSize = 20,
- TextColor = new Color(0, 0x14 / 255f, 0x47 / 255f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- };
- view.Add(prompt);
-
- void turnOn()
- {
- prompt.Hide();
- listView.Show();
- }
- void turnOff(string message)
- {
- listView.Hide();
- prompt.TranslatableText = message;
- prompt.Show();
- }
- if (State.IsTurnedOn)
- turnOn();
- else
- turnOff("WIFI_TURN_ON_WIFI");
- State.OnTurnedOff += () => turnOff("WIFI_TURN_ON_WIFI");
- State.OnTurnedOn += () => turnOn();
- State.OnTurningOnFailed += () => turnOff("WIFI_CONNECTION_FAILED");
- return view;
- }
-
- private static View CreateScanningView()
- {
- var view = new View()
- {
- Layout = new LinearLayout()
- {
- LinearOrientation = LinearLayout.Orientation.Horizontal,
- }
- };
-
- var progress = new View()
- {
- Size = new Size(22, 23),
- Margin = new Extents(0, 0, 1, 0),
- BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_scanning.png"),
- };
- view.Add(progress);
-
- Animation animation = null;
- progress.VisibilityChanged += (s, e) =>
- {
- if (e.Visibility == false)
- {
- animation?.Stop();
- animation?.Clear();
- animation?.Dispose();
- animation = null;
- progress.Orientation = new Rotation(new Radian(new Degree(0)), new Vector3(0, 0, -1));
- }
- else if (animation == null)
- {
- animation = new Animation(1_000);
- animation.Looping = true;
- animation.AnimateTo(progress, "Orientation", new Rotation(new Radian(new Degree(180)), new Vector3(0, 0, -1)), new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear));
- animation.Play();
- }
- };
-
- view.Add(new TextLabel()
- {
- Size = new Size(190, 25),
- TranslatableText = "WIFI_SCANNING",
- Margin = new Extents(17, 0, 0, 0),
- VerticalAlignment = VerticalAlignment.Center,
- HorizontalAlignment = HorizontalAlignment.Begin,
- PixelSize = 20f,
- TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- });
- return view;
- }
-
- private View CreateWifiScanningPlaceHolder()
- {
- var view = new View()
- {
- Position = new Position(40, 43),
- };
-
- var wifi = new TextLabel("Wi-Fi")
- {
- //Size = new Size(49, 24),
- PixelSize = 20f,
- TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- };
- view.Add(wifi);
-
- var scanning = CreateScanningView();
- view.Add(scanning);
-
- void startScan()
- {
- wifi.Hide();
- scanning.Show();
- }
- void finishScan()
- {
- scanning.Hide();
- wifi.Show();
- }
- finishScan();
- State.OnScanStarted += startScan;
- State.OnScanFinished += finishScan;
- return view;
- }
-
- public void Dispose()
- {
- view = null;
- ApManager.Dispose();
- State.Dispose();
- }
- }
-}
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">\r
-\r
- <PropertyGroup>\r
- <OutputType>Library</OutputType>\r
- <TargetFramework>tizen80</TargetFramework>\r
- <LangVersion>8.0</LangVersion>\r
- <TargetFrameworkIndentifier>Tizen</TargetFrameworkIndentifier>\r
- </PropertyGroup>\r
-\r
- <ItemGroup>\r
- <PackageReference Include="Tizen.NET" Version="8.0.0.15148" />\r
- <PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />\r
- </ItemGroup>\r
-\r
- <ItemGroup>\r
- <ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />\r
- </ItemGroup>\r
-\r
- <ItemGroup>\r
- <Compile Update="Controls\Wifi\Translations.Designer.cs">\r
- <DesignTime>True</DesignTime>\r
- <AutoGen>True</AutoGen>\r
- <DependentUpon>Translations.resx</DependentUpon>\r
- </Compile>\r
- </ItemGroup>\r
-\r
- <ItemGroup>\r
- <EmbeddedResource Update="Controls\Wifi\Translations.ko-KR.resx">\r
- <Generator>PublicResXFileCodeGenerator</Generator>\r
- </EmbeddedResource>\r
- <EmbeddedResource Update="Controls\Wifi\Translations.pl-PL.resx">\r
- <Generator>PublicResXFileCodeGenerator</Generator>\r
- </EmbeddedResource>\r
- <EmbeddedResource Update="Controls\Wifi\Translations.resx">\r
- <Generator>PublicResXFileCodeGenerator</Generator>\r
- <LastGenOutput>Translations.Designer.cs</LastGenOutput>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
-</Project>\r
+++ /dev/null
-using Oobe.Common.Interfaces;
-using Tizen.NUI.Components;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Oobe.Wifi.Controls.Wifi;
-using Tizen.Network.WiFi;
-using System;
-using System.Collections.Generic;
-using Oobe.Common.Styles;
-
-namespace Oobe.Wifi
-{
- public class WifiStep : ProcessStep
- {
- private WifiView wifiView = null;
- private EventHandler<ConnectionStateChangedEventArgs> connectionChanged;
-
- public override View CreateView(IProcessNavigation nav)
- {
- DisposeView();
-
- var view = new View()
- {
- Layout = new LinearLayout()
- {
- LinearOrientation = LinearLayout.Orientation.Vertical,
- },
- };
-
- view.Add(new TextLabel()
- {
- TranslatableText = "CHOOSE_WIFI_NETWORK",
- Size = new Size(0, 58),
- WidthResizePolicy = ResizePolicyType.FillToParent,
- Margin = new Extents(0, 0, 20, 8),
- PixelSize = 48.0f,
- TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddLightFontStyle(),
- HorizontalAlignment = HorizontalAlignment.Center,
- });
-
- wifiView = new WifiView();
- wifiView.View.Size = new Size(480, 416);
- wifiView.View.PositionUsesPivotPoint = true;
- wifiView.View.PivotPoint = new Position(0.5f, 0);
- wifiView.View.ParentOrigin = new Position(0.5f, 0);
- view.Add(wifiView.View);
-
- view.Add(CreateBottomView(nav));
- return view;
- }
-
- private View CreateBottomView(IProcessNavigation nav)
- {
- var view = new View()
- {
- Size = new Size(1184, 122),
- Layout = new AbsoluteLayout(),
- };
-
- var prev = new Button(Common.Styles.ButtonStyles.Previous)
- {
- Position = new Position(56, 10),
- Size2D = new Size2D(240, 72),
- };
- Oobe.Common.Styles.ButtonsExtensions.SetFontStyle(prev, new PropertyMap().AddBoldFontStyle());
- prev.ClickEvent += (s, e) => nav.Previous();
- view.Add(prev);
-
- var next = new Button()
- {
- Position = new Position(888, 10),
- Size2D = new Size2D(240, 72),
- };
- next.SetFontStyle(new PropertyMap().AddBoldFontStyle());
- next.ClickEvent += (s, e) => nav.Next();
- view.Add(next);
-
- void applyStyle(bool isConnected) => next.ApplyStyle(isConnected
- ? Common.Styles.ButtonStyles.Next
- : Common.Styles.ButtonStyles.Skip);
- applyStyle(WiFiManager.ConnectionState == WiFiConnectionState.Connected);
-
- connectionChanged = (s, e) => applyStyle(e.State == WiFiConnectionState.Connected);
- WiFiManager.ConnectionStateChanged += connectionChanged;
- return view;
- }
-
- public override void OnShutdown()
- {
- base.OnShutdown();
- DisposeView();
- }
-
- private void DisposeView()
- {
- wifiView?.Dispose();
- wifiView = null;
- WiFiManager.ConnectionStateChanged -= connectionChanged;
- connectionChanged = null;
- }
- }
-}