-
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.
Some optimizations for android and some code formatting
- Loading branch information
Showing
14 changed files
with
1,078 additions
and
540 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# NOTE: Requires **VS2019 16.3** or later | ||
|
||
# StyleCopRules | ||
# Description: StyleCopRules custom ruleset | ||
|
||
# Code files | ||
[*.{cs,vb}] | ||
|
||
|
||
# Default severity for analyzer diagnostics - Requires **VS2019 16.5** or later | ||
dotnet_analyzer_diagnostic.severity = warning | ||
|
||
dotnet_diagnostic.SA1101.severity = none | ||
|
||
dotnet_diagnostic.SA1200.severity = none | ||
|
||
dotnet_diagnostic.SA1305.severity = warning | ||
|
||
dotnet_diagnostic.SA1309.severity = none | ||
|
||
dotnet_diagnostic.SA1402.severity = none | ||
|
||
dotnet_diagnostic.SA1407.severity = none | ||
|
||
dotnet_diagnostic.SA1412.severity = warning | ||
|
||
dotnet_diagnostic.SA1600.severity = none | ||
|
||
dotnet_diagnostic.SA1601.severity = none | ||
|
||
dotnet_diagnostic.SA1602.severity = none | ||
|
||
dotnet_diagnostic.SA1604.severity = none | ||
|
||
dotnet_diagnostic.SA1605.severity = none | ||
|
||
dotnet_diagnostic.SA1606.severity = none | ||
|
||
dotnet_diagnostic.SA1607.severity = none | ||
|
||
dotnet_diagnostic.SA1608.severity = none | ||
|
||
dotnet_diagnostic.SA1610.severity = none | ||
|
||
dotnet_diagnostic.SA1611.severity = none | ||
|
||
dotnet_diagnostic.SA1612.severity = none | ||
|
||
dotnet_diagnostic.SA1613.severity = none | ||
|
||
dotnet_diagnostic.SA1614.severity = none | ||
|
||
dotnet_diagnostic.SA1615.severity = none | ||
|
||
dotnet_diagnostic.SA1616.severity = none | ||
|
||
dotnet_diagnostic.SA1617.severity = none | ||
|
||
dotnet_diagnostic.SA1618.severity = none | ||
|
||
dotnet_diagnostic.SA1619.severity = none | ||
|
||
dotnet_diagnostic.SA1620.severity = none | ||
|
||
dotnet_diagnostic.SA1621.severity = none | ||
|
||
dotnet_diagnostic.SA1622.severity = none | ||
|
||
dotnet_diagnostic.SA1623.severity = none | ||
|
||
dotnet_diagnostic.SA1624.severity = none | ||
|
||
dotnet_diagnostic.SA1625.severity = none | ||
|
||
dotnet_diagnostic.SA1626.severity = none | ||
|
||
dotnet_diagnostic.SA1627.severity = none | ||
|
||
dotnet_diagnostic.SA1633.severity = none | ||
|
||
dotnet_diagnostic.SA1634.severity = none | ||
|
||
dotnet_diagnostic.SA1635.severity = none | ||
|
||
dotnet_diagnostic.SA1636.severity = none | ||
|
||
dotnet_diagnostic.SA1637.severity = none | ||
|
||
dotnet_diagnostic.SA1638.severity = none | ||
|
||
dotnet_diagnostic.SA1640.severity = none | ||
|
||
dotnet_diagnostic.SA1641.severity = none | ||
|
||
dotnet_diagnostic.SA1642.severity = none | ||
|
||
dotnet_diagnostic.SA1643.severity = none | ||
|
||
dotnet_diagnostic.SA1648.severity = none | ||
|
||
dotnet_diagnostic.SA1649.severity = none | ||
|
||
dotnet_diagnostic.SA1651.severity = none | ||
|
||
dotnet_diagnostic.SA1652.severity = none | ||
|
||
dotnet_diagnostic.SX1101.severity = warning | ||
|
||
dotnet_diagnostic.SX1309.severity = warning |
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,63 +1,84 @@ | ||
using Microsoft.Maui.Controls; | ||
|
||
namespace Sharpnado.Tabs.Effects { | ||
public static class TouchEffect { | ||
|
||
public static readonly BindableProperty ColorProperty = | ||
BindableProperty.CreateAttached( | ||
"Color", | ||
typeof(Color), | ||
typeof(TouchEffect), | ||
KnownColor.Accent, | ||
propertyChanged: PropertyChanged | ||
); | ||
|
||
public static void SetColor(BindableObject view, Color value) { | ||
view.SetValue(ColorProperty, value); | ||
} | ||
namespace Sharpnado.Tabs.Effects; | ||
|
||
public static Color GetColor(BindableObject view) { | ||
return (Color)view.GetValue(ColorProperty); | ||
} | ||
public static class TouchEffect | ||
{ | ||
public static readonly BindableProperty ColorProperty = BindableProperty.CreateAttached( | ||
"Color", | ||
typeof(Color), | ||
typeof(TouchEffect), | ||
KnownColor.Accent, | ||
propertyChanged: PropertyChanged); | ||
|
||
public static void SetColor(BindableObject view, Color value) | ||
{ | ||
view.SetValue(ColorProperty, value); | ||
} | ||
|
||
public static Color GetColor(BindableObject view) | ||
{ | ||
return (Color)view.GetValue(ColorProperty); | ||
} | ||
|
||
public static void UnregisterEffect(BindableObject bindable) | ||
public static void UnregisterEffect(BindableObject bindable) | ||
{ | ||
if (!(bindable is View view)) | ||
{ | ||
if (!(bindable is View view)) | ||
return; | ||
return; | ||
} | ||
|
||
var eff = view.Effects.FirstOrDefault(e => e is TouchRoutingEffect); | ||
var eff = view.Effects.FirstOrDefault(e => e is TouchRoutingEffect); | ||
|
||
if (eff == null) return; | ||
view.Effects.Remove(eff); | ||
if (eff == null) | ||
{ | ||
return; | ||
} | ||
|
||
static void PropertyChanged(BindableObject bindable, object oldValue, object newValue) { | ||
if (!(bindable is View view)) | ||
return; | ||
view.Effects.Remove(eff); | ||
} | ||
|
||
var eff = view.Effects.FirstOrDefault(e => e is TouchRoutingEffect); | ||
if (GetColor(bindable) != Colors.Transparent) { | ||
view.InputTransparent = false; | ||
private static void PropertyChanged(BindableObject bindable, object oldValue, object newValue) | ||
{ | ||
if (!(bindable is View view)) | ||
{ | ||
return; | ||
} | ||
|
||
var eff = view.Effects.FirstOrDefault(e => e is TouchRoutingEffect); | ||
if (GetColor(bindable) != Colors.Transparent) | ||
{ | ||
view.InputTransparent = false; | ||
|
||
if (eff != null) return; | ||
view.Effects.Add(new TouchRoutingEffect()); | ||
if (EffectsConfig.AutoChildrenInputTransparent && bindable is Layout && | ||
!EffectsConfig.GetChildrenInputTransparent(view)) { | ||
EffectsConfig.SetChildrenInputTransparent(view, true); | ||
} | ||
if (eff != null) | ||
{ | ||
return; | ||
} | ||
else { | ||
if (eff == null) return; | ||
view.Effects.Remove(eff); | ||
if (EffectsConfig.AutoChildrenInputTransparent && bindable is Layout && | ||
EffectsConfig.GetChildrenInputTransparent(view)) { | ||
EffectsConfig.SetChildrenInputTransparent(view, false); | ||
} | ||
|
||
view.Effects.Add(new TouchRoutingEffect()); | ||
if (EffectsConfig.AutoChildrenInputTransparent | ||
&& bindable is Layout | ||
&& !EffectsConfig.GetChildrenInputTransparent(view)) | ||
{ | ||
EffectsConfig.SetChildrenInputTransparent(view, true); | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
if (eff == null) | ||
{ | ||
return; | ||
} | ||
|
||
public class TouchRoutingEffect : RoutingEffect | ||
{ | ||
view.Effects.Remove(eff); | ||
if (EffectsConfig.AutoChildrenInputTransparent | ||
&& bindable is Layout | ||
&& EffectsConfig.GetChildrenInputTransparent(view)) | ||
{ | ||
EffectsConfig.SetChildrenInputTransparent(view, false); | ||
} | ||
} | ||
} | ||
} | ||
|
||
public class TouchRoutingEffect : RoutingEffect | ||
{ | ||
} |
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.