Skip to content

Commit

Permalink
Merge pull request #13 from dodikk/sample/test-lock-states-2
Browse files Browse the repository at this point in the history
[lock state] reuse previously calculated ExpandedPercentage
  • Loading branch information
galadril authored Apr 6, 2022
2 parents ee4927c + 15da381 commit 0186b69
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Xam.Plugin.SimpleBottomDrawer/BottomDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,10 @@ object sender
, easing: Easing.SpringOut);
}

// Note: [alex-d] this.TranslationY might change due to this.TranslateTo()
// Note: [alex-d] |this.TranslationY| seems to not change due to |this.TranslateTo()|
// so it is ok to reuse the |tmpLockState| value
// -
double dragDistanceY2 = e.TotalY + this.TranslationY;

#if DEBUG
System.Console.WriteLine($"[BottomDrawer] OnPanChanged() - call#2 GetClosestLockState({dragDistanceY2})");
#endif
this.ExpandedPercentage = GetClosestLockStateAbsolute(dragDistanceY2);
this.ExpandedPercentage = tmpLockState;
this.isDragging = false;

#if DEBUG
Expand Down

0 comments on commit 0186b69

Please sign in to comment.