-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scroll animation to MaterialTopAppBar
- Loading branch information
1 parent
364e8eb
commit 328a52b
Showing
16 changed files
with
308 additions
and
80 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 |
---|---|---|
|
@@ -338,4 +338,6 @@ ASALocalRun/ | |
.localhistory/ | ||
|
||
# BeatPulse healthcheck temp database | ||
healthchecksdb | ||
healthchecksdb | ||
|
||
*.DS_Store |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using Xamarin.Forms; | ||
|
||
[assembly: ResolutionGroupName(Plugin.MaterialDesignControls.Effects.EffectIdPrefix)] |
2 changes: 0 additions & 2 deletions
2
src/MaterialDesignControls.Android/Effects/TouchAndPressEffect.cs
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
51 changes: 51 additions & 0 deletions
51
src/MaterialDesignControls.Android/Effects/TouchReleaseEffect.cs
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,51 @@ | ||
using System; | ||
using Android.Views; | ||
using Xamarin.Forms; | ||
using Xamarin.Forms.Platform.Android; | ||
using View = Android.Views.View; | ||
using TouchReleaseEffect = Plugin.MaterialDesignControls.Android.TouchReleaseEffect; | ||
using System.Linq; | ||
|
||
[assembly: ExportEffect(typeof(TouchReleaseEffect), nameof(TouchReleaseEffect))] | ||
|
||
namespace Plugin.MaterialDesignControls.Android | ||
{ | ||
public class TouchReleaseEffect : PlatformEffect | ||
{ | ||
private View _view; | ||
|
||
private Action _onRelease; | ||
|
||
protected override void OnAttached() | ||
{ | ||
_view = Control ?? Container; | ||
|
||
if (_view != null) | ||
{ | ||
var touchReleaseEffect = (MaterialDesignControls.TouchReleaseEffect)Element.Effects.FirstOrDefault(x => x is MaterialDesignControls.TouchReleaseEffect); | ||
if (touchReleaseEffect != null && touchReleaseEffect.OnRelease != null) | ||
{ | ||
_onRelease = touchReleaseEffect.OnRelease; | ||
_view.Touch += OnViewOnTouch; | ||
} | ||
} | ||
} | ||
|
||
protected override void OnDetached() | ||
{ | ||
if (_view != null) | ||
_view.Touch -= OnViewOnTouch; | ||
} | ||
|
||
private void OnViewOnTouch(object sender, View.TouchEventArgs e) | ||
{ | ||
e.Handled = false; | ||
|
||
if (e.Event.ActionMasked == MotionEventActions.Up) | ||
{ | ||
System.Diagnostics.Debug.WriteLine(e.Event.ActionMasked); | ||
_onRelease.Invoke(); | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using Xamarin.Forms; | ||
|
||
[assembly: ResolutionGroupName(Plugin.MaterialDesignControls.Effects.EffectIdPrefix)] |
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.