public static float centerY(View view){ return ViewHelper.getY(view) + view.getHeight()/2; }
@Override public boolean shouldInterceptTouchEvent(MotionEvent ev, boolean moving, float diffX, float diffY) { final int minInterceptionLayoutY = -mIntersectionHeight; return minInterceptionLayoutY < (int) ViewHelper.getY(mInterceptionLayout) || (moving && mScrollable.getCurrentScrollY() - diffY < 0); }
@Override public boolean shouldInterceptTouchEvent(MotionEvent ev, boolean moving, float diffX, float diffY) { final int minInterceptionLayoutY = -mIntersectionHeight; return minInterceptionLayoutY < (int) ViewHelper.getY(mInterceptionLayout) || (moving && mScrollable.getCurrentScrollY() - diffY < 0); }
@Override public boolean shouldInterceptTouchEvent(MotionEvent ev, boolean moving, float diffX, float diffY) { final int minInterceptionLayoutY = -mIntersectionHeight; return minInterceptionLayoutY < (int) ViewHelper.getY(mInterceptionLayout) || (moving && mScrollable.getCurrentScrollY() - diffY < 0); }
@Override public boolean shouldInterceptTouchEvent(MotionEvent ev, boolean moving, float diffX, float diffY) { final int minInterceptionLayoutY = -mIntersectionHeight; return minInterceptionLayoutY < (int) ViewHelper.getY(mInterceptionLayout) || (moving && mScrollable.getCurrentScrollY() - diffY < 0); }
@Override public boolean shouldInterceptTouchEvent(MotionEvent ev, boolean moving, float diffX, float diffY) { final int minInterceptionLayoutY = -mIntersectionHeight; return minInterceptionLayoutY < (int) ViewHelper.getY(mInterceptionLayout) || (moving && mScrollable.getCurrentScrollY() - diffY < 0); }
@Override public void run() { View v = layoutRipple.getChildAt(0); layoutRipple.setxRippleOrigin(ViewHelper.getX(v)+v.getWidth()/2); layoutRipple.setyRippleOrigin(ViewHelper.getY(v)+v.getHeight()/2); layoutRipple.setRippleColor(Color.parseColor("#1E88E5")); layoutRipple.setRippleSpeed(30); } });
PorterDuff.Mode.CLEAR)); temp.drawCircle(ViewHelper.getX(ball) + ball.getWidth() / 2, ViewHelper.getY(ball) + ball.getHeight() / 2, ball.getWidth() / 2, transparentPaint);
PorterDuff.Mode.CLEAR)); temp.drawCircle(ViewHelper.getX(ball) + ball.getWidth() / 2, ViewHelper.getY(ball) + ball.getHeight() / 2, ball.getWidth() / 2, transparentPaint);
public static float centerY(View view){ return ViewHelper.getY(view) + view.getHeight()/2; }
public Property(View view) { y=ViewHelper.getY(view); tY=ViewHelper.getTranslationY(view); top=view.getTop(); topMargin=((ViewGroup.MarginLayoutParams)view.getLayoutParams()).topMargin; } }
@Override public void run() { float origin = ViewHelper.getY(containerLeft); ViewHelper.setY(containerLeft, origin-containerLeft.getHeight()); } });
/** * When next item show in ViewPagerEx, let's make an animation to show the * description layout. * @param view */ @Override public void onNextItemAppear(View view) { View descriptionLayout = view.findViewById(R.id.description_layout); if(descriptionLayout!=null){ float layoutY = ViewHelper.getY(descriptionLayout); view.findViewById(R.id.description_layout).setVisibility(View.VISIBLE); ValueAnimator animator = ObjectAnimator.ofFloat( descriptionLayout,"y",layoutY + descriptionLayout.getHeight(), layoutY).setDuration(500); animator.start(); } } }
.setDuration(ANIMATIONDURATION).start(); origin = ViewHelper.getY(containerLeft); ObjectAnimator.ofFloat(containerLeft, "y", -containerLeft.getHeight()) .setDuration(ANIMATIONDURATION).start();
origin = ViewHelper.getY(containerLeft); ObjectAnimator.ofFloat(containerLeft, "y", 0) .setDuration(ANIMATIONDURATION).start();