-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 3.1.0, fixes touch events when unloading/reloading
- Loading branch information
Showing
35 changed files
with
597 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
namespace Sharpnado.Tabs.Effects { | ||
using Microsoft.Maui.Controls; | ||
|
||
namespace Sharpnado.Tabs.Effects { | ||
Check warning on line 3 in Maui.Tabs/Effects/TouchEffect.cs GitHub Actions / winBuild
|
||
public static class TouchEffect { | ||
|
||
public static readonly BindableProperty ColorProperty = | ||
BindableProperty.CreateAttached( | ||
"Color", | ||
typeof(Color), | ||
typeof(TouchEffect), | ||
Colors.Transparent, | ||
KnownColor.Accent, | ||
propertyChanged: PropertyChanged | ||
); | ||
|
||
|
@@ -18,6 +20,17 @@ public static Color GetColor(BindableObject view) { | |
return (Color)view.GetValue(ColorProperty); | ||
} | ||
|
||
public static void UnregisterEffect(BindableObject bindable) | ||
{ | ||
if (!(bindable is View view)) | ||
return; | ||
|
||
var eff = view.Effects.FirstOrDefault(e => e is TouchRoutingEffect); | ||
|
||
if (eff == null) return; | ||
view.Effects.Remove(eff); | ||
} | ||
|
||
static void PropertyChanged(BindableObject bindable, object oldValue, object newValue) { | ||
if (!(bindable is View view)) | ||
return; | ||
|
@@ -34,7 +47,7 @@ static void PropertyChanged(BindableObject bindable, object oldValue, object new | |
} | ||
} | ||
else { | ||
if (eff == null || view.BindingContext == null) return; | ||
if (eff == null) return; | ||
view.Effects.Remove(eff); | ||
if (EffectsConfig.AutoChildrenInputTransparent && bindable is Layout && | ||
EffectsConfig.GetChildrenInputTransparent(view)) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.