зеркало из https://github.com/DeGsoft/maui-linux.git
Removed Privated + changed to _camelCase
This commit is contained in:
Родитель
2b4a589eed
Коммит
08ce17b4d2
|
@ -12,7 +12,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
||||||
public class SwitchRenderer : ViewRenderer<Switch, SwitchCompat>, CompoundButton.IOnCheckedChangeListener
|
public class SwitchRenderer : ViewRenderer<Switch, SwitchCompat>, CompoundButton.IOnCheckedChangeListener
|
||||||
{
|
{
|
||||||
bool _disposed;
|
bool _disposed;
|
||||||
Drawable defaultTrackDrawable;
|
Drawable _defaultTrackDrawable;
|
||||||
|
|
||||||
public SwitchRenderer(Context context) : base(context)
|
public SwitchRenderer(Context context) : base(context)
|
||||||
{
|
{
|
||||||
|
@ -81,7 +81,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
||||||
SwitchCompat aswitch = CreateNativeControl();
|
SwitchCompat aswitch = CreateNativeControl();
|
||||||
aswitch.SetOnCheckedChangeListener(this);
|
aswitch.SetOnCheckedChangeListener(this);
|
||||||
SetNativeControl(aswitch);
|
SetNativeControl(aswitch);
|
||||||
defaultTrackDrawable = aswitch.TrackDrawable;
|
_defaultTrackDrawable = aswitch.TrackDrawable;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
UpdateEnabled(); // Normally set by SetNativeControl, but not when the Control is reused.
|
UpdateEnabled(); // Normally set by SetNativeControl, but not when the Control is reused.
|
||||||
|
@ -98,7 +98,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
||||||
UpdateOnColor();
|
UpdateOnColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateOnColor()
|
void UpdateOnColor()
|
||||||
{
|
{
|
||||||
if (Element == null || Control == null)
|
if (Element == null || Control == null)
|
||||||
return;
|
return;
|
||||||
|
@ -107,7 +107,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
||||||
{
|
{
|
||||||
if (Element.OnColor == Color.Default)
|
if (Element.OnColor == Color.Default)
|
||||||
{
|
{
|
||||||
Control.TrackDrawable = defaultTrackDrawable;
|
Control.TrackDrawable = _defaultTrackDrawable;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace Xamarin.Forms.Platform.Android
|
||||||
{
|
{
|
||||||
public class SwitchRenderer : ViewRenderer<Switch, ASwitch>, CompoundButton.IOnCheckedChangeListener
|
public class SwitchRenderer : ViewRenderer<Switch, ASwitch>, CompoundButton.IOnCheckedChangeListener
|
||||||
{
|
{
|
||||||
Drawable defaultTrackDrawable;
|
Drawable _defaultTrackDrawable;
|
||||||
|
|
||||||
public SwitchRenderer(Context context) : base(context)
|
public SwitchRenderer(Context context) : base(context)
|
||||||
{
|
{
|
||||||
|
@ -84,7 +84,7 @@ namespace Xamarin.Forms.Platform.Android
|
||||||
|
|
||||||
e.NewElement.Toggled += HandleToggled;
|
e.NewElement.Toggled += HandleToggled;
|
||||||
Control.Checked = e.NewElement.IsToggled;
|
Control.Checked = e.NewElement.IsToggled;
|
||||||
defaultTrackDrawable = Control.TrackDrawable;
|
_defaultTrackDrawable = Control.TrackDrawable;
|
||||||
UpdateOnColor();
|
UpdateOnColor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ namespace Xamarin.Forms.Platform.Android
|
||||||
UpdateOnColor();
|
UpdateOnColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateOnColor()
|
void UpdateOnColor()
|
||||||
{
|
{
|
||||||
if (Element != null)
|
if (Element != null)
|
||||||
{
|
{
|
||||||
|
@ -105,7 +105,7 @@ namespace Xamarin.Forms.Platform.Android
|
||||||
{
|
{
|
||||||
if (Element.OnColor == Color.Default)
|
if (Element.OnColor == Color.Default)
|
||||||
{
|
{
|
||||||
Control.TrackDrawable = defaultTrackDrawable;
|
Control.TrackDrawable = _defaultTrackDrawable;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace Xamarin.Forms.Platform.iOS
|
||||||
{
|
{
|
||||||
public class SwitchRenderer : ViewRenderer<Switch, UISwitch>
|
public class SwitchRenderer : ViewRenderer<Switch, UISwitch>
|
||||||
{
|
{
|
||||||
UIColor defaultOnColor;
|
UIColor _defaultOnColor;
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (disposing)
|
if (disposing)
|
||||||
|
@ -29,7 +29,7 @@ namespace Xamarin.Forms.Platform.iOS
|
||||||
Control.ValueChanged += OnControlValueChanged;
|
Control.ValueChanged += OnControlValueChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultOnColor = Control.OnTintColor;
|
_defaultOnColor = Control.OnTintColor;
|
||||||
Control.On = Element.IsToggled;
|
Control.On = Element.IsToggled;
|
||||||
e.NewElement.Toggled += OnElementToggled;
|
e.NewElement.Toggled += OnElementToggled;
|
||||||
UpdateOnColor();
|
UpdateOnColor();
|
||||||
|
@ -38,12 +38,12 @@ namespace Xamarin.Forms.Platform.iOS
|
||||||
base.OnElementChanged(e);
|
base.OnElementChanged(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateOnColor()
|
void UpdateOnColor()
|
||||||
{
|
{
|
||||||
if (Element != null)
|
if (Element != null)
|
||||||
{
|
{
|
||||||
if (Element.OnColor == Color.Default)
|
if (Element.OnColor == Color.Default)
|
||||||
Control.OnTintColor = defaultOnColor;
|
Control.OnTintColor = _defaultOnColor;
|
||||||
else
|
else
|
||||||
Control.OnTintColor = Element.OnColor.ToUIColor();
|
Control.OnTintColor = Element.OnColor.ToUIColor();
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче