public class DeviceCollection : ObservableCollection<AP>\r
{\r
private string title;\r
+ private float iconOpacity;\r
\r
public DeviceCollection(string groupTitle)\r
{\r
title = groupTitle;\r
+ iconOpacity = 0.0f;\r
this.UpdateScanList(null);\r
}\r
\r
OnPropertyChanged(new PropertyChangedEventArgs("Title"));\r
}\r
}\r
+ public float IconOpacity\r
+ {\r
+ get => iconOpacity;\r
+ set\r
+ {\r
+ iconOpacity = value;\r
+ OnPropertyChanged(new PropertyChangedEventArgs("IconOpacity"));\r
+ }\r
+ }\r
\r
public void UpdateScanList(List<AP> apList)\r
{\r
{\r
this.Add(item);\r
}\r
-\r
}\r
\r
public void RemoveScanList()\r
available.UpdateState(ap);\r
}\r
\r
+ public void SetScanningState(bool isScanning)\r
+ {\r
+ available.IconOpacity = isScanning ? 1.0f : 0.0f;\r
+ }\r
+\r
internal void UpdateApState(string bssid, WiFiState state)\r
{\r
available.UpdateApState(bssid, state);\r
mWifi = wifi;
}
+ internal Loading CreateLoadingIcon()
+ {
+ var path = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
+ var imageArray = new string[36];
+ for (int i = 0; i < 36; i++)
+ {
+ if (i < 10)
+ {
+ imageArray[i] = path + "loading/loading_0" + i + ".png";
+ }
+ else
+ {
+ imageArray[i] = path + "loading/loading_" + i + ".png";
+ }
+ }
+
+ return new Loading()
+ {
+ WidthSpecification = 40,
+ HeightSpecification = 40,
+ ImageArray = imageArray,
+ };
+ }
+
internal void CreateComponents()
{
mApSource = new APSource();
{
DefaultTitleItem group = new DefaultTitleItem();
group.WidthSpecification = LayoutParamPolicies.MatchParent;
-
group.Label.SetBinding(TextLabel.TextProperty, "Title");
group.Label.HorizontalAlignment = HorizontalAlignment.Begin;
+ var icon = CreateLoadingIcon();
+ icon.SetBinding(View.OpacityProperty, "IconOpacity");
+ group.Icon = icon;
return group;
}),
IsGrouped = true,
{
if (IsWiFiActive())
{
+ mApSource.SetScanningState(true);
await mWifi.Scan();
List<AP> apList = mWifi.GetScanResult();
mApSource.UpdateScanList(apList);
+ mApSource.SetScanningState(false);
}
}