Debug("+");
var passwordField = new TextField()
{
- WidthSpecification = 600,
- BackgroundColor = Color.Silver,
+ WidthSpecification = 534,
+ HeightSpecification = 48,
+ BackgroundColor = Color.White,
PlaceholderText = Resources.IDS_WIFI_HEADER_PASSWORD,
};
PropertyMap p1 = inputSetting.OutputMap;
passwordField.InputMethodSettings = p1;
- var hiddenInput = new Tizen.NUI.Text.HiddenInput();
- hiddenInput.Mode = HiddenInputModeType.ShowLastCharacter;
- hiddenInput.SubstituteCharacter = '*';
- hiddenInput.SubstituteCount = 0;
- hiddenInput.ShowLastCharacterDuration = 1000;
- passwordField.SetHiddenInput(hiddenInput);
+ mPasswordField = passwordField;
+ UpdateHiddenProperty(true);
return passwordField;
}
{
Color = new Selector<Color>()
{
- Normal = new Color("#17234D"),
+ Normal = new Color("#FFFFFF"),
Focused = new Color("#17234D"),
Pressed = new Color("#FF6200"),
Disabled = new Color("#CACACA"),
{
LinearOrientation = LinearLayout.Orientation.Vertical,
},
- WidthSpecification = LayoutParamPolicies.MatchParent,
- HeightSpecification = LayoutParamPolicies.WrapContent,
+ IsSelectable = false,
};
- mPasswordField = CreatePasswordField();
- mPasswordField.TextChanged += OnTextChanged;
- connectView.Add(mPasswordField);
+ TextLabel label = new TextLabel(Resources.IDS_WIFI_BODY_TYPE_PASSWORD);
+ label.Padding = new Extents(5, 5, 5, 20);
+ connectView.Add(label);
+
+ connectView.Add(CreatePasswordEntryItem());
if(mAp.IsWps)
{
var cancelButton = new Button()
{
Text = Resources.IDS_WIFI_SK_CANCEL,
+ WidthSpecification = 252,
+ HeightSpecification = 48,
};
cancelButton.Clicked += OnCancelClicked;
mConnectButton = new Button()
{
Text = Resources.IDS_WIFI_BODY_CONNECT,
+ WidthSpecification = 252,
+ HeightSpecification = 48,
};
mConnectButton.IsEnabled = false;
mConnectButton.Clicked += OnConnectClicked;
};
}
+ private void UpdateHiddenProperty(bool hide)
+ {
+ Debug("+");
+ var hiddenInput = new Tizen.NUI.Text.HiddenInput();
+ if (hide)
+ {
+ hiddenInput.Mode = HiddenInputModeType.ShowLastCharacter;
+ hiddenInput.SubstituteCharacter = '*';
+ hiddenInput.SubstituteCount = 0;
+ hiddenInput.ShowLastCharacterDuration = 1000;
+ }
+ else
+ {
+ hiddenInput.Mode = HiddenInputModeType.HideNone;
+ }
+ mPasswordField.SetHiddenInput(hiddenInput);
+ mPasswordField.Text = mPasswordField.Text;
+ }
+
+ private Selector<Color> GetDefaultColorSelector()
+ {
+ return new Selector<Color>()
+ {
+ Normal = new Color("#FFFFFF"),
+ Focused = new Color("#17234D"),
+ Pressed = new Color("#FF6200"),
+ Disabled = new Color("#CACACA"),
+ };
+ }
+
+ private Button CreateButton(string iconImagePath)
+ {
+ int buttonSize = 48;
+
+ ButtonStyle style = new ButtonStyle()
+ {
+ IsSelectable = true,
+ CornerRadius = 50,
+ BackgroundColor = GetDefaultColorSelector(),
+ };
+
+ Button button = new Button(style)
+ {
+ WidthSpecification = buttonSize,
+ HeightSpecification = buttonSize,
+ IconURL = Resources.GetPath() + iconImagePath,
+ IsSelectable = false,
+ };
+
+ return button;
+ }
+
+ private Button GetCrossButton()
+ {
+ string crossIconImagePath = "/images/cross_icon.png";
+ Button crossButton = CreateButton(crossIconImagePath);
+ crossButton.Clicked += OnCrossButtonClicked;
+
+ return crossButton;
+ }
+
+ private Button GetEyeButton()
+ {
+ string eyeIconImagePath = "/images/eye_icon.png";
+ Button eyeButton = CreateButton(eyeIconImagePath);
+ eyeButton.Clicked += OnEyeButtonClicked;
+ eyeButton.IsSelectable = true;
+
+ return eyeButton;
+ }
+
+ private View CreatePasswordEntryItem()
+ {
+ View passwordEntryView = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ },
+ HeightSpecification = 48,
+ Padding = new Extents(5, 5, 10,0),
+ };
+
+ mPasswordField = CreatePasswordField();
+ mPasswordField.TextChanged += OnTextChanged;
+
+ passwordEntryView.Add(mPasswordField);
+ passwordEntryView.Add(GetCrossButton());
+ passwordEntryView.Add(GetEyeButton());
+
+ return passwordEntryView;
+ }
+
+ private void OnEyeButtonClicked(object sender, ClickedEventArgs e)
+ {
+ Debug("+");
+ Button button = (Button)sender;
+ var hiddenInput = mPasswordField.GetHiddenInput();
+
+ if (button.IsSelected)
+ {
+ Debug("Show Password Selected");
+ UpdateHiddenProperty(false);
+ }
+ else {
+ Debug("Show Password UnSelected");
+ UpdateHiddenProperty(true);
+ }
+
+ }
+
+ private void OnCrossButtonClicked(object sender, ClickedEventArgs e)
+ {
+ Debug("+");
+ Button button = (Button)sender;
+ mPasswordField.Text = "";
+ }
+
private void OnCancelClicked(object source, ClickedEventArgs args)
{
NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();