本文整理汇总了C#中Android.Views.View.GetHitRect方法的典型用法代码示例。如果您正苦于以下问题:C# View.GetHitRect方法的具体用法?C# View.GetHitRect怎么用?C# View.GetHitRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Views.View
的用法示例。
在下文中一共展示了View.GetHitRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: isPinnedViewTouched
private Boolean isPinnedViewTouched(View view, float x, float y) {
view.GetHitRect(mTouchRect);
// by taping top or bottom padding, the list performs on click on a border item.
// we don't add top padding here to keep behavior consistent.
mTouchRect.Top += mTranslateY;
mTouchRect.Bottom += mTranslateY + PaddingTop;
mTouchRect.Left += PaddingLeft;
mTouchRect.Right -= PaddingRight;
return mTouchRect.Contains((int)x, (int)y);
}
示例2: CreateCircularReveal
public static Animator CreateCircularReveal(View view, int centreX, int centreY, float startRadius,
float endRadius)
{
var api = (int)Build.VERSION.SdkInt;
// if (api >= 21)
// {
// return ViewAnimationUtils.CreateCircularReveal(view, centreX, centreY, startRadius, endRadius);
// }
var animator = view.Parent as IRevealAnimator;
animator.CentreX = centreX;
animator.CentreY = centreY;
animator.Target = view;
animator.ClipOutlines = true;
var bounds = new Rect();
view.GetHitRect(bounds);
var reveal = ObjectAnimator.OfFloat((Object)animator, "Radius", startRadius, endRadius);
reveal.SetDuration(300);
reveal.SetInterpolator(new AccelerateDecelerateInterpolator());
reveal.AddListener(CreateRevealFinishedListener(animator, bounds, api));
return reveal;
}