android.view.ViewGroup#offsetDescendantRectToMyCoords ( )源码实例Demo

下面列出了android.view.ViewGroup#offsetDescendantRectToMyCoords ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: SuntimesWidget   文件: MoonDialog.java
private void initPeekHeight(DialogInterface dialog)
{
    if (dialog == null) {
        return;
    }

    BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
    FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);  // for AndroidX, resource is renamed to com.google.android.material.R.id.design_bottom_sheet
    if (layout != null)
    {
        BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
        ViewGroup dialogLayout = (LinearLayout) bottomSheet.findViewById(R.id.moondialog_layout);
        View divider1 = bottomSheet.findViewById(R.id.divider1);
        if (dialogLayout != null && divider1 != null)
        {
            Rect headerBounds = new Rect();
            divider1.getDrawingRect(headerBounds);
            dialogLayout.offsetDescendantRectToMyCoords(divider1, headerBounds);
            behavior.setPeekHeight(headerBounds.top);

        } else {
            behavior.setPeekHeight(-1);
        }
    }
}
 
源代码2 项目: scene   文件: ViewOtherAnimationBuilder.java
@Override
public Rect get(View object) {
    ViewGroup viewGroup = (ViewGroup) object.getParent();
    Rect rect = new Rect();
    viewGroup.offsetDescendantRectToMyCoords(viewGroup, rect);
    return rect;
}
 
源代码3 项目: AndroidTvDemo   文件: BaseEffectBridgeWrapper.java
public Rect findLocationWithView(View view)
{
    ViewGroup root = (ViewGroup)getMainUpView().getParent();
    Rect rect = new Rect();
    root.offsetDescendantRectToMyCoords(view, rect);
    return rect;
}
 
源代码4 项目: UIWidget   文件: ViewGroupUtils.java
@Override
public void offsetDescendantRect(ViewGroup parent, View child, Rect rect) {
    parent.offsetDescendantRectToMyCoords(child, rect);
    // View#offsetDescendantRectToMyCoords includes scroll offsets of the last child.
    // We need to reverse it here so that we get the rect of the view itself rather
    // than its content.
    rect.offset(child.getScrollX(), child.getScrollY());
}
 
源代码5 项目: GpCollapsingToolbar   文件: ViewGroupUtils.java
@Override
public void offsetDescendantRect(ViewGroup parent, View child, Rect rect) {
    parent.offsetDescendantRectToMyCoords(child, rect);
    // View#offsetDescendantRectToMyCoords includes scroll offsets of the last child.
    // We need to reverse it here so that we get the rect of the view itself rather
    // than its content.
    rect.offset(child.getScrollX(), child.getScrollY());
}
 
源代码6 项目: scene   文件: ViewOtherAnimationBuilder.java
public T bounds(Rect toValue) {
    ViewGroup viewGroup = (ViewGroup) mView.getParent();
    Rect rect = new Rect();
    viewGroup.offsetDescendantRectToMyCoords(viewGroup, rect);
    return bounds(rect, toValue);
}
 
源代码7 项目: FireFiles   文件: ViewGroupUtils.java
@Override
public void offsetDescendantRect(ViewGroup parent, View child, Rect rect) {
    parent.offsetDescendantRectToMyCoords(child, rect);
}
 
源代码8 项目: FireFiles   文件: ViewGroupUtils.java
@Override
public void offsetDescendantRect(ViewGroup parent, View child, Rect rect) {
    parent.offsetDescendantRectToMyCoords(child, rect);
}
 
源代码9 项目: FireFiles   文件: ViewGroupUtils.java
@Override
public void offsetDescendantRect(ViewGroup parent, View child, Rect rect) {
    parent.offsetDescendantRectToMyCoords(child, rect);
}
 
源代码10 项目: magellan   文件: CircularRevealTransition.java
private int[] getCenterClickedView(ViewGroup from) {
  Rect clickedViewRect = new Rect();
  clickedView.getDrawingRect(clickedViewRect);
  from.offsetDescendantRectToMyCoords(clickedView, clickedViewRect);
  return new int[] {(int) clickedViewRect.exactCenterX(), (int) clickedViewRect.exactCenterY()};
}
 
源代码11 项目: CircularReveal   文件: MainActivity.java
@OnClick(R.id.reset) void resetUi(View resetCard) {
  cardsLine.setVisibility(View.INVISIBLE);

  final View target = ButterKnife.findById(this, R.id.activator);

  // Coordinates of circle initial point
  final ViewGroup parent = (ViewGroup) activatorMask.getParent();
  final Rect bounds = new Rect();
  final Rect maskBounds = new Rect();

  target.getDrawingRect(bounds);
  activatorMask.getDrawingRect(maskBounds);
  parent.offsetDescendantRectToMyCoords(target, bounds);
  parent.offsetDescendantRectToMyCoords(activatorMask, maskBounds);

  maskElevation = activatorMask.getCardElevation();
  activatorMask.setCardElevation(0);

  final int cX = maskBounds.centerX();
  final int cY = maskBounds.centerY();

  final Animator circularReveal = ViewAnimationUtils.createCircularReveal(activatorMask, cX, cY,
      (float) Math.hypot(maskBounds.width() * .5f, maskBounds.height() * .5f),
      target.getWidth() / 2f, View.LAYER_TYPE_HARDWARE);

  final float c0X = bounds.centerX() - maskBounds.centerX();
  final float c0Y = bounds.centerY() - maskBounds.centerY();

  AnimatorPath path = new AnimatorPath();
  path.moveTo(0, 0);
  path.curveTo(0, 0, 0, c0Y, c0X, c0Y);

  ObjectAnimator pathAnimator = ObjectAnimator.ofObject(this, "maskLocation", new PathEvaluator(),
      path.getPoints().toArray());

  AnimatorSet set = new AnimatorSet();
  set.playTogether(circularReveal, pathAnimator);
  set.setInterpolator(new FastOutSlowInInterpolator());
  set.setDuration(SLOW_DURATION);
  set.addListener(new AnimatorListenerAdapter() {
    @Override public void onAnimationEnd(Animator animation) {
      activatorMask.setCardElevation(maskElevation);
      activatorMask.setVisibility(View.INVISIBLE);

      circlesLine.setVisibility(View.VISIBLE);
      executeCirclesDropDown();
      target.setEnabled(true);
    }
  });
  set.start();
}
 
源代码12 项目: ticdesign   文件: ViewGroupUtils.java
@Override
public void offsetDescendantRect(ViewGroup parent, View child, Rect rect) {
    parent.offsetDescendantRectToMyCoords(child, rect);
}
 
源代码13 项目: fab-speed-dial   文件: ViewGroupUtils.java
@Override
public void offsetDescendantRect(ViewGroup parent, View child, Rect rect) {
    parent.offsetDescendantRectToMyCoords(child, rect);
}
 
源代码14 项目: AndroidTVWidget   文件: BaseEffectBridgeWrapper.java
public Rect findLocationWithView(View view) {
	ViewGroup root = (ViewGroup) getMainUpView().getParent();
	Rect rect = new Rect();
	root.offsetDescendantRectToMyCoords(view, rect);
	return rect;
}
 
源代码15 项目: AndroidTVWidget   文件: DemoViewflipperActivity.java
public Rect findLocationWithView(View view) {
    ViewGroup root = (ViewGroup) vf.getParent();
    Rect rect = new Rect();
    root.offsetDescendantRectToMyCoords(view, rect);
    return rect;
}
 
源代码16 项目: TvLauncher   文件: FlyBorderView.java
public Rect findLocationWithView(View view) {
    ViewGroup root = (ViewGroup) this.getParent();
    Rect rect = new Rect();
    root.offsetDescendantRectToMyCoords(view, rect);
    return rect;
}
 
源代码17 项目: TvRecyclerView   文件: BaseEffect.java
protected Rect findLocationWithView(View view) {
    ViewGroup root = (ViewGroup) view.getParent();
    Rect rect = new Rect();
    root.offsetDescendantRectToMyCoords(view, rect);
    return rect;
}
 
public Rect findLocationWithView(View view) {
	ViewGroup root = (ViewGroup) getMainUpView().getParent();
	Rect rect = new Rect();
	root.offsetDescendantRectToMyCoords(view, rect);
	return rect;
}
 
@Override
public void offsetDescendantRect(ViewGroup parent, View child, Rect rect) {
    parent.offsetDescendantRectToMyCoords(child, rect);
}
 
源代码20 项目: hipda   文件: UIUtils.java
public static int getRelativeTop(View myView, ViewGroup parentView) {
    Rect offsetViewBounds = new Rect();
    myView.getDrawingRect(offsetViewBounds);
    parentView.offsetDescendantRectToMyCoords(myView, offsetViewBounds);
    return offsetViewBounds.top;
}
 
 方法所在类