public event EventHandler TextBlockFocused;
public event EventHandler TextBlockUnfocused;
+ public event EventHandler LayoutFocused;
+ public event EventHandler LayoutUnfocused;
+
public bool IsTextBlockFocused => _isTexstBlockFocused;
ELayout _editfieldLayout;
return _editfieldLayout;
}
- protected ELayout EditfieldLayout
- {
- get
- {
- return _editfieldLayout;
- }
- }
-
protected virtual ELayout CreateEditFieldLayout(EvasObject parent)
{
var layout = new ELayout(parent);
{
SetFocusOnTextBlock(false);
layout.SignalEmit("elm,state,unfocused", "");
+ LayoutUnfocused?.Invoke(this, EventArgs.Empty);
};
layout.Focused += (s, e) =>
{
AllowFocus(false);
layout.SignalEmit("elm,state,focused", "");
+ LayoutFocused?.Invoke(this, EventArgs.Empty);
};
layout.KeyDown += (s, e) =>
if (Control != null)
{
Control.TextBlockFocused -= OnTextBlockFocused;
+ if (Device.Idiom == TargetIdiom.TV)
+ {
+ Control.LayoutFocused -= OnLayoutFocused;
+ Control.LayoutUnfocused -= OnLayoutUnfocused;
+ }
CleanView();
}
}
InputPanelShowByOnDemand = true,
};
entry.SetVerticalTextAlignment("elm.text", 0.5);
+ entry.HorizontalTextAlignment = Native.TextAlignment.Center;
entry.TextBlockFocused += OnTextBlockFocused;
+
+ if (Device.Idiom == TargetIdiom.TV)
+ {
+ entry.LayoutFocused += OnLayoutFocused;
+ entry.LayoutUnfocused += OnLayoutUnfocused;
+ }
+
SetNativeControl(entry);
}
base.OnElementChanged(e);
Control.PlaceholderColor = Element.TitleColor.ToNative();
}
+ void OnLayoutFocused(object sender, EventArgs e)
+ {
+ Control.FontSize = Control.FontSize * 1.5;
+ }
+
+ void OnLayoutUnfocused(object sender, EventArgs e)
+ {
+ Control.FontSize = Control.FontSize / 1.5;
+ }
+
void OnTextBlockFocused(object sender, EventArgs e)
{
// For EFL Entry, the event will occur even if it is currently disabled.