Skip to content

Commit

Permalink
Merge pull request mopsicus#61 from oahceh/master
Browse files Browse the repository at this point in the history
add ReturnKeyType.Send
  • Loading branch information
mopsicus authored Feb 26, 2021
2 parents c9c10ac + 2a55590 commit bf25c4c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ private void Create(int id, JSONObject data) {
imeOptions |= EditorInfo.IME_ACTION_DONE;
} else if (returnKeyType.equals("Search")) {
imeOptions |= EditorInfo.IME_ACTION_SEARCH;
} else if (returnKeyType.equals("Send")) {
imeOptions |= EditorInfo.IME_ACTION_SEND;
}
edit.setImeOptions(imeOptions);
edit.setGravity(gravity);
Expand Down
2 changes: 2 additions & 0 deletions Unity/Assets/Plugins/iOS/MobileInput.mm
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ - (void)create:(NSDictionary *)data {
returnKeyType = UIReturnKeyDone;
} else if ([returnKeyTypeString isEqualToString:@"Search"]) {
returnKeyType = UIReturnKeySearch;
} else if ([returnKeyTypeString isEqualToString:@"Send"]) {
returnKeyType = UIReturnKeySend;
}
fontSize = fontSize / [UIScreen mainScreen].scale;
UIFont *uiFont = [UIFont systemFontOfSize:fontSize];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public override void OnInspectorGUI () {
EditorGUI.BeginChangeCheck ();
GUILayout.Space (OFFSET);
GUILayout.Label ("Select type for Return button:");
_target.ReturnKey = (MobileInputField.ReturnKeyType) GUILayout.Toolbar ((int) _target.ReturnKey, new string[] { "Default", "Next", "Done", "Search" });
_target.ReturnKey = (MobileInputField.ReturnKeyType) GUILayout.Toolbar ((int) _target.ReturnKey, new string[] { "Default", "Next", "Done", "Search", "Send" });
GUILayout.Space (OFFSET);
GUILayout.Label ("Options:");
GUILayout.Space (SPACE);
Expand Down
3 changes: 2 additions & 1 deletion Unity/Assets/Scripts/UnityMobileInput/MobileInputField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public enum ReturnKeyType {
Default,
Next,
Done,
Search
Search,
Send
}

/// <summary>
Expand Down

0 comments on commit bf25c4c

Please sign in to comment.