Skip to content

Commit 02f6b77

Browse files
committed
fix iOS, Android and UWP
1 parent a1003dd commit 02f6b77

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

sources/engine/Stride.UI/Controls/EditText.Android.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
using Android.Text.Method;
1111
using Stride.Core;
1212
using Stride.Games;
13+
using Stride.Input;
1314
using Exception = System.Exception;
15+
using KeyEvent = Android.Views.KeyEvent;
1416

1517
namespace Stride.UI.Controls
1618
{
@@ -228,7 +230,7 @@ private void OnMinLinesChangedImpl()
228230
editText.Post(editTextSetMinLinesAction);
229231
}
230232

231-
private void ActivateEditTextImpl()
233+
private void ActivateEditTextImpl(InputManager inputManager)
232234
{
233235
lock (syncRoot)
234236
{
@@ -250,7 +252,7 @@ private void ActivateEditTextImpl()
250252
}
251253
}
252254

253-
private void DeactivateEditTextImpl()
255+
private void DeactivateEditTextImpl(InputManager inputManager)
254256
{
255257
lock (syncRoot)
256258
{
@@ -265,8 +267,6 @@ private void DeactivateEditTextImpl()
265267
activeEditText = null;
266268

267269
GetGameContext().HideEditTextPopup();
268-
269-
FocusedElement = null;
270270
}
271271
}
272272

sources/engine/Stride.UI/Controls/EditText.UWP.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Stride.Core;
99
using Stride.Core.Annotations;
1010
using Stride.Games;
11+
using Stride.Input;
1112

1213
namespace Stride.UI.Controls
1314
{
@@ -42,7 +43,7 @@ private void OnMinLinesChangedImpl()
4243
{
4344
}
4445

45-
private void ActivateEditTextImpl()
46+
private void ActivateEditTextImpl(InputManager inputManager)
4647
{
4748
// try to show the virtual keyboard if no hardward keyboard available
4849
Windows.UI.ViewManagement.InputPane.GetForCurrentView().TryShow();
@@ -103,7 +104,7 @@ private void EditText_TextChanged(object sender, Windows.UI.Xaml.Controls.TextCh
103104
UpdateSelectionFromEditImpl();
104105
}
105106

106-
private void DeactivateEditTextImpl()
107+
private void DeactivateEditTextImpl(InputManager inputManager)
107108
{
108109
if (editText != null)
109110
{
@@ -119,7 +120,6 @@ private void DeactivateEditTextImpl()
119120
editText = null;
120121
activeEditText = null;
121122
}
122-
FocusedElement = null;
123123
}
124124

125125
private void UpdateTextToEditImpl()

sources/engine/Stride.UI/Controls/EditText.iOS.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Stride.Core;
1111
using Stride.Core.Annotations;
1212
using Stride.Games;
13+
using Stride.Input;
1314
using Stride.UI.Events;
1415

1516
namespace Stride.UI.Controls
@@ -127,7 +128,6 @@ private static void TextFieldOnEditingDidEnd(object sender, EventArgs eventArgs)
127128
currentActiveEditText.IsSelectionActive = false;
128129
barView.Hidden = true;
129130
overlayView.Hidden = true;
130-
FocusedElement = null;
131131

132132
if (currentActiveEditText != null)
133133
{
@@ -171,7 +171,7 @@ private void OnMinLinesChangedImpl()
171171
{
172172
}
173173

174-
private void ActivateEditTextImpl()
174+
private void ActivateEditTextImpl(InputManager inputManager)
175175
{
176176
EnsureGameContext();
177177

@@ -199,7 +199,7 @@ private bool ShouldChangeCharacters(UITextField theTextField, NSRange range, str
199199
return replacementSize < 0 || theTextField.Text.Length + replacementSize <= MaxLength;
200200
}
201201

202-
private void DeactivateEditTextImpl()
202+
private void DeactivateEditTextImpl(InputManager inputManager)
203203
{
204204
attachedTextField.EditingChanged -= TextFieldOnValueChanged;
205205
attachedTextField.ShouldChangeCharacters -= ShouldChangeCharacters;

0 commit comments

Comments
 (0)