File tree 4 files changed +10
-4
lines changed
NativeCode.Mobile.AppCompat/FormsAppCompat/Adapters
NativeCode.Mobile.AppCompat.Renderers/Renderers
4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ protected override void OnElementChanged(ElementChangedEventArgs<Button> e)
26
26
// in the base method.
27
27
if ( this . Control == null )
28
28
{
29
- var control = new AppCompatButton ( this . Context . GetAppCompatThemedContext ( ) ) ;
29
+ var context = this . Context . GetAppCompatThemedContext ( ) ;
30
+ var control = new AppCompatButton ( context ) ;
30
31
this . SetNativeControl ( control ) ;
31
32
32
33
control . SetOnClickListener ( ButtonClickListener . Instance ) ;
Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
67
67
68
68
if ( e . OldElement == null )
69
69
{
70
- var control = new AppCompatEntryEditText ( this . Context . GetAppCompatThemedContext ( ) ) ;
70
+ var context = this . Context . GetAppCompatThemedContext ( ) ;
71
+ var control = new AppCompatEntryEditText ( context ) ;
71
72
this . SetNativeControl ( control ) ;
72
73
73
74
this . Control . ImeOptions = ImeAction . Done ;
Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ protected override void OnElementChanged(ElementChangedEventArgs<Switch> e)
85
85
86
86
if ( this . Control == null )
87
87
{
88
- var control = new SwitchCompat ( this . Context . GetAppCompatThemedContext ( ) ) ;
88
+ var context = this . Context . GetAppCompatThemedContext ( ) ;
89
+ var control = new SwitchCompat ( context ) ;
89
90
control . SetOnCheckedChangeListener ( this ) ;
90
91
this . SetNativeControl ( control ) ;
91
92
}
Original file line number Diff line number Diff line change @@ -182,7 +182,10 @@ public override void RemoveTab(Tab tab)
182
182
[ Obsolete ( "Will be removed in a future version." , false ) ]
183
183
public override void SelectTab ( Tab tab )
184
184
{
185
- this . SupportActionBar . SelectTab ( ( ( TabAdapter ) tab ) . SupportTab ) ;
185
+ if ( tab != null )
186
+ {
187
+ this . SupportActionBar . SelectTab ( ( ( TabAdapter ) tab ) . SupportTab ) ;
188
+ }
186
189
}
187
190
188
191
[ Obsolete ( "Will be removed in a future version." , false ) ]
You can’t perform that action at this time.
0 commit comments