-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
EntryRendererExtensions.cs
62 lines (59 loc) · 2.09 KB
/
EntryRendererExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using Android.Views.InputMethods;
namespace Xamarin.Forms.Platform.Android
{
internal static class EntryRendererExtensions
{
internal static ImeAction ToAndroidImeAction(this ReturnType returnType)
{
switch (returnType)
{
case ReturnType.Go:
return ImeAction.Go;
case ReturnType.Next:
return ImeAction.Next;
case ReturnType.Send:
return ImeAction.Send;
case ReturnType.Search:
return ImeAction.Search;
case ReturnType.Done:
return ImeAction.Done;
case ReturnType.Default:
return ImeAction.Done;
default:
throw new System.NotImplementedException($"ReturnType {returnType} not supported");
}
}
public static ImeAction ToAndroidImeOptions(this PlatformConfiguration.AndroidSpecific.ImeFlags flags)
{
switch (flags)
{
case PlatformConfiguration.AndroidSpecific.ImeFlags.Previous:
return ImeAction.Previous;
case PlatformConfiguration.AndroidSpecific.ImeFlags.Next:
return ImeAction.Next;
case PlatformConfiguration.AndroidSpecific.ImeFlags.Search:
return ImeAction.Search;
case PlatformConfiguration.AndroidSpecific.ImeFlags.Send:
return ImeAction.Send;
case PlatformConfiguration.AndroidSpecific.ImeFlags.Go:
return ImeAction.Go;
case PlatformConfiguration.AndroidSpecific.ImeFlags.None:
return ImeAction.None;
case PlatformConfiguration.AndroidSpecific.ImeFlags.ImeMaskAction:
return ImeAction.ImeMaskAction;
case PlatformConfiguration.AndroidSpecific.ImeFlags.NoPersonalizedLearning:
return (ImeAction)ImeFlags.NoPersonalizedLearning;
case PlatformConfiguration.AndroidSpecific.ImeFlags.NoExtractUi:
return (ImeAction)ImeFlags.NoExtractUi;
case PlatformConfiguration.AndroidSpecific.ImeFlags.NoAccessoryAction:
return (ImeAction)ImeFlags.NoAccessoryAction;
case PlatformConfiguration.AndroidSpecific.ImeFlags.NoFullscreen:
return (ImeAction)ImeFlags.NoFullscreen;
case PlatformConfiguration.AndroidSpecific.ImeFlags.Default:
case PlatformConfiguration.AndroidSpecific.ImeFlags.Done:
default:
return ImeAction.Done;
}
}
}
}