Skip to content

Commit aef5f54

Browse files
Removed switch condition
1 parent c022751 commit aef5f54

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

maui/src/TextInputLayout/SfTextInputLayout.Properties.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,13 +2197,12 @@ static void OnIsHintFloatedPropertyChanged(BindableObject bindable, object oldVa
21972197
{
21982198
if (bindable is SfTextInputLayout inputLayout && newValue is bool value)
21992199
{
2200-
double minOpacity = DeviceInfo.Platform.ToString() switch
2201-
{
2202-
nameof(DevicePlatform.MacCatalyst) => 0.011,
2203-
nameof(DevicePlatform.iOS) => 0.00001,
2204-
nameof(DevicePlatform.Android) => 0.00001,
2205-
_ => 0
2206-
};
2200+
double minOpacity = 0;
2201+
#if ANDROID || IOS
2202+
minOpacity = 0.00001;
2203+
#elif MACCATALYST
2204+
minOpacity = 0.011;
2205+
#endif
22072206

22082207
double targetOpacity = value ? 1 : minOpacity;
22092208

maui/src/TextInputLayout/SfTextInputLayout.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -842,13 +842,13 @@ protected override void OnContentChanged(object oldValue, object newValue)
842842
{
843843
UpdateContentMargin(view);
844844
}
845-
double minOpacity = DeviceInfo.Platform.ToString() switch
846-
{
847-
nameof(DevicePlatform.MacCatalyst) => 0.011,
848-
nameof(DevicePlatform.iOS) => 0.00001,
849-
nameof(DevicePlatform.Android) => 0.00001,
850-
_ => 0
851-
};
845+
846+
double minOpacity = 0;
847+
#if ANDROID || IOS
848+
minOpacity = 0.00001;
849+
#elif MACCATALYST
850+
minOpacity = 0.011;
851+
#endif
852852

853853
//For placeholder overlap issue here handled the opacity value for controls.
854854
if (newValue is InputView entryEditorContent)

0 commit comments

Comments
 (0)