WiFi mWifi;
APSource mApSource;
+ private static readonly string mImagePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/";
private static readonly int itemCount = 1;
private MenuItem[] menuItems = new MenuItem[itemCount];
mApSource.UpdateApState(e.Bssid, e.State);
}
+ private Selector<Color> GetDefaultColorSelector()
+ {
+ return new Selector<Color>()
+ {
+ Normal = new Color("#17234D"),
+ Focused = new Color("#17234D"),
+ Pressed = new Color("#FF6200"),
+ Disabled = new Color("#CACACA"),
+ };
+ }
+
+ private ImageView GetApIconImageView()
+ {
+ ImageViewStyle style = new ImageViewStyle() {
+ Color = GetDefaultColorSelector(),
+ };
+
+ ImageView icon = new ImageView(style);
+ icon.SetBinding(ImageView.ResourceUrlProperty, "ImageUrl");
+ icon.WidthSpecification = 40;
+ icon.HeightSpecification = 40;
+ return icon;
+ }
+
+ private Button GetInfoButton()
+ {
+ int buttonSize = 25;
+
+ ButtonStyle style = new ButtonStyle() {
+ IsSelectable = true,
+ CornerRadius = 50,
+ BackgroundColor = GetDefaultColorSelector(),
+ };
+
+ Button infoButton = new Button(style)
+ {
+ WidthSpecification = buttonSize,
+ HeightSpecification = buttonSize,
+ IconURL = mImagePath + "wifi_icon_badge_info.png",
+ };
+
+ infoButton.Icon.WidthSpecification = buttonSize;
+ infoButton.Icon.HeightSpecification = buttonSize;
+ infoButton.Clicked += OnInfoClicked;
+
+ return infoButton;
+ }
+
private DataTemplate CreateItemTemplate()
{
return new DataTemplate(() =>
item.SubLabel.SetBinding(TextLabel.TextProperty, "StateInfo");
item.SubLabel.HorizontalAlignment = HorizontalAlignment.Begin;
- ImageViewStyle imageViewStyle = new ImageViewStyle()
- {
- Color = new Selector<Color>()
- {
- Normal = new Color("#17234D"),
- Focused = new Color("#17234D"),
- Pressed = new Color("#FF6200"),
- Disabled = new Color("#CACACA"),
- },
- };
-
- item.Icon = new ImageView(imageViewStyle);
- item.Icon.SetBinding(ImageView.ResourceUrlProperty, "ImageUrl");
- item.Icon.WidthSpecification = 40;
- item.Icon.HeightSpecification = 40;
-
- var infoButton = new Button()
- {
- Text = "i",
- WidthSpecification = 40,
- HeightSpecification = 40,
- };
- //infoButton.Icon.SetBinding(ImageView.ResourceUrlProperty, "InfoImageUrl");
- infoButton.Clicked += OnInfoClicked;
- item.Extra = infoButton;
+ item.Icon = GetApIconImageView();
+ item.Extra = GetInfoButton();
return item;
});