File tree 3 files changed +10
-10
lines changed
src/NativeCode.Mobile.AppCompat.Renderers
3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,6 @@ public static class EntryExtensions
13
13
{
14
14
private const string EntrySendCompleted = "SendCompleted" ;
15
15
16
- private const BindingFlags InstanceNonPublic = BindingFlags . Instance | BindingFlags . NonPublic ;
17
-
18
16
private static readonly MethodInfo MethodSendCompleted ;
19
17
20
18
/// <summary>
@@ -23,7 +21,7 @@ public static class EntryExtensions
23
21
static EntryExtensions ( )
24
22
{
25
23
var type = typeof ( Entry ) ;
26
- MethodSendCompleted = type . GetMethod ( EntrySendCompleted , InstanceNonPublic ) ;
24
+ MethodSendCompleted = type . GetMethod ( EntrySendCompleted , ReflectionHelper . InstanceNonPublic ) ;
27
25
}
28
26
29
27
/// <summary>
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ namespace NativeCode.Mobile.AppCompat.Renderers.Helpers
9
9
10
10
using View = Android . Views . View ;
11
11
12
- internal static class KeyboardHelper
12
+ public static class KeyboardHelper
13
13
{
14
14
private const string KeyboardExtensionsType = "Xamarin.Forms.Platform.Android.KeyboardExtensions, Xamarin.Forms.Platform.Android" ;
15
15
@@ -21,8 +21,6 @@ internal static class KeyboardHelper
21
21
22
22
private const string KeyboardManagerShowKeyboard = "ShowKeyboard" ;
23
23
24
- private const BindingFlags StaticInternalMethods = BindingFlags . NonPublic | BindingFlags . Static ;
25
-
26
24
private static readonly MethodInfo MethodToInputType ;
27
25
28
26
private static readonly MethodInfo MethodHideKeyboard ;
@@ -38,8 +36,8 @@ static KeyboardHelper()
38
36
MethodToInputType = keyboardExtensionsType . GetMethod ( KeyboardExtensionsToInputType ) ;
39
37
40
38
var keyboardManagerType = Type . GetType ( KeyboardManagerType , true ) ;
41
- MethodHideKeyboard = keyboardManagerType . GetMethod ( KeyboardManagerHideKeyboard , StaticInternalMethods ) ;
42
- MethodShowKeyboard = keyboardManagerType . GetMethod ( KeyboardManagerShowKeyboard , StaticInternalMethods ) ;
39
+ MethodHideKeyboard = keyboardManagerType . GetMethod ( KeyboardManagerHideKeyboard , ReflectionHelper . InternalStatic ) ;
40
+ MethodShowKeyboard = keyboardManagerType . GetMethod ( KeyboardManagerShowKeyboard , ReflectionHelper . InternalStatic ) ;
43
41
}
44
42
45
43
public static InputTypes GetInputType ( Keyboard keyboard )
Original file line number Diff line number Diff line change @@ -3,13 +3,17 @@ namespace NativeCode.Mobile.AppCompat.Renderers.Helpers
3
3
using System ;
4
4
using System . Reflection ;
5
5
6
- internal static class ReflectionHelper
6
+ public static class ReflectionHelper
7
7
{
8
+ public const BindingFlags InstanceNonPublic = BindingFlags . Instance | BindingFlags . NonPublic ;
9
+
10
+ public const BindingFlags InternalStatic = BindingFlags . NonPublic | BindingFlags . Static ;
11
+
8
12
public static readonly object [ ] EmptyParameters = new object [ 0 ] ;
9
13
10
14
public static void SetFieldValue ( object instance , string name , object value )
11
15
{
12
- var field = instance . GetType ( ) . GetField ( name , BindingFlags . Instance | BindingFlags . NonPublic ) ;
16
+ var field = instance . GetType ( ) . GetField ( name , InstanceNonPublic ) ;
13
17
14
18
if ( field == null )
15
19
{
You can’t perform that action at this time.
0 commit comments