本文整理了Java中android.widget.ImageView.setY()
方法的一些代码示例,展示了ImageView.setY()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.setY()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:setY
暂无
代码示例来源:origin: google/santa-tracker-android
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
float yOffset = (float) valueAnimator.getAnimatedValue("yOffset");
shareImage.setY(shareImageY + yOffset);
}
},
代码示例来源:origin: JasonQS/Anti-recall
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
difAdjuster = adjuster.getY() - event.getRawY();
downY = event.getRawY();
heightAll = recyclerViewAll.getLayoutParams().height;
heightRecalled = recyclerViewRecalled.getLayoutParams().height;
break;
case MotionEvent.ACTION_MOVE:
float dif = event.getRawY() - downY;
int v1 = (int) (heightAll + dif);
int v2 = (int) (heightRecalled - dif);
if (v1 < 0 || v1 > App.layoutHeight || v2 < 0 | v2 > App.layoutHeight)
break;
setRecyclerViewAllHeight(v1);
setRecyclerViewRecalledHeight(v2);
adjuster.setY(App.adjusterY = event.getRawY() + difAdjuster);
break;
}
return true;
}
});
代码示例来源:origin: westnordost/StreetComplete
private void showMarkerSolvedAnimation(@DrawableRes int iconResId, PointF startScreenPos, String source)
{
soundFx.play(getResources().getIdentifier("plop"+random.nextInt(4), "raw", getPackageName()));
ViewGroup root = (ViewGroup) getWindow().getDecorView();
ImageView img = (ImageView) getLayoutInflater().inflate(R.layout.effect_quest_plop, root, false);
img.setX(startScreenPos.x);
img.setY(startScreenPos.y);
img.setImageResource(iconResId);
root.addView(img);
flingQuestMarkerTo(img, answersCounter.getAnswerTarget(), () -> {
root.removeView(img);
answersCounter.addOneUnsynced(source);
});
}
代码示例来源:origin: JasonQS/Anti-recall
adjuster.setY(App.adjusterY - App.adjusterOriginalY);
代码示例来源:origin: yydcdut/SlideAndDragListView
@Override
public void onDragMoving(int x, int y, View view, SlideAndDragListView.OnDragDropListener listener) {
mDragView.setX(mLeftAndTopOffset[0]);
mDragView.setY(y - mDragDelta + mLeftAndTopOffset[1]);
}
代码示例来源:origin: stackoverflow.com
ImageView iv = new ImageView(super.getContext());
iv.setImageResource(R.drawable.image);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
this.addView(iv, params);
iv.setX(259);
iv.setY(100);
代码示例来源:origin: geniusgithub/AndroidDialer
@Override
public void onDragHovered(int x, int y, PhoneFavoriteSquareTileView tileView) {
// Update the drag shadow location.
mDragShadowParent.getLocationOnScreen(mLocationOnScreen);
mDragShadowLeft = x - mTouchOffsetToChildLeft - mLocationOnScreen[0];
mDragShadowTop = y - mTouchOffsetToChildTop - mLocationOnScreen[1];
// Draw the drag shadow at its last known location if the drag shadow exists.
if (mDragShadowOverlay != null) {
mDragShadowOverlay.setX(mDragShadowLeft);
mDragShadowOverlay.setY(mDragShadowTop);
}
}
代码示例来源:origin: luhaoaimama1/zone-sdk
@Override
public void onAnimationUpdate(ValueAnimator animation)
{
PointF point = (PointF) animation.getAnimatedValue();
button2.setX(point.x);
button2.setY(point.y);
}
});
代码示例来源:origin: Solartisan/DragDropListView
@Override
public void onDragHovered(int x, int y, View tileView) {
// Update the drag shadow location.
mDragShadowParent.getLocationOnScreen(mLocationOnScreen);
mDragShadowLeft = x - mTouchOffsetToChildLeft - mLocationOnScreen[0];
mDragShadowTop = y - mTouchOffsetToChildTop - mLocationOnScreen[1];
// Draw the drag shadow at its last known location if the drag shadow exists.
if (mDragShadowOverlay != null) {
mDragShadowOverlay.setX(mDragShadowLeft);
mDragShadowOverlay.setY(mDragShadowTop);
}
}
代码示例来源:origin: Lichenwei-Dev/BezierView
@Override
public void onAnimationUpdate(ValueAnimator animation) {
Point point = (Point) animation.getAnimatedValue();
imageView.setX(point.x);
imageView.setY(point.y);
}
});
代码示例来源:origin: google/santa-tracker-android
shareImage.setY(shareImageY + SHARE_Y_OFFSET_PX);
代码示例来源:origin: xuhongv/SmartHome
public BubbleView setGiftBoxImaeg(Drawable drawable, int positionX, int positionY) {
ImageView imageView = new ImageView(this.getContext());
imageView.setImageDrawable(drawable);
LayoutParams layoutParams = new LayoutParams(imageView.getWidth(), imageView.getHeight());
this.addView(imageView, layoutParams);
imageView.setX((float)positionX);
imageView.setY((float)positionY);
return this;
}
代码示例来源:origin: akshay2211/PixImagePicker
private void setViewPositions(float y) {
int handleY = Utility.getValueInRange(0, (int) (mViewHeight - mHandleView.getHeight()), (int) (y - mHandleView.getHeight() / 2));
mBubbleView.setY(handleY + Utility.convertDpToPixel((56), Pix.this));
mHandleView.setY(handleY);
}
代码示例来源:origin: githubliruiyuan/Animation
private void pageOneStop(){
page_one_center_tj.setVisibility(View.INVISIBLE);
page_one_planeline.setVisibility(View.INVISIBLE);
page_one_text.setVisibility(View.INVISIBLE);
animationTop.cancel();
animationLeftcloud.cancel();
animationRightcloud.cancel();
if (null != animationRocket)
animationRocket.cancel();
page_one_rocket.setX(rocketX);
page_one_rocket.setY(rocketY);
}
代码示例来源:origin: skydoves/ColorPickerView
/**
* changes selector's selected point without notifies.
*
* @param x coordinate x of the selector.
* @param y coordinate y of the selector.
*/
public void setCoordinate(int x, int y) {
selector.setX(x - (selector.getMeasuredWidth() / 2));
selector.setY(y - (selector.getMeasuredHeight() / 2));
}
代码示例来源:origin: andyb129/ClockScroller
public void setBubbleAndHandlePosition(float y) {
int bubbleHeight = bubbleLayout.getHeight();
int handleHeight = handle.getHeight();
handle.setY(getValueInRange(0, height - handleHeight, (int) (y - handleHeight / 2)));
bubbleLayout.setY(getValueInRange(0, height - bubbleHeight - handleHeight / 2, (int) (y - bubbleHeight)));
}
代码示例来源:origin: albert-lii/ImageViewer
@Override
public void onAnimationUpdate(ValueAnimator animation) {
final float currentValue = (float) animation.getAnimatedValue();
if (!isOutOfPreview) {
final float y = evaluator.evaluate(currentValue, fromY, toY);
imageView.setY(y);
}
final float alpha = evaluator.evaluate(currentValue, oldBgAlpha, 0);
changeBackgroundAlpha((int) alpha);
setDragStatus(DragStatus.STATUS_EXITTING);
}
});
代码示例来源:origin: skydoves/ColorPickerPreference
public void setSelectorPoint(int x, int y) {
selector.setX(x - getSelectorHalfWidth());
selector.setY(y - getSelectorHalfHeight());
selectedPoint = new Point(x, y);
lastSelectedColor = getColorFromBitmap(x, y);
fireColorListener();
handleFlagView(new Point(x - getSelectorHalfWidth(), y - getSelectorHalfHeight()));
}
代码示例来源:origin: L4Digital/FastScroll
private void setViewPositions(float y) {
bubbleHeight = bubbleView.getMeasuredHeight();
handleHeight = handleView.getMeasuredHeight();
int bubbleY = getValueInRange(0, viewHeight - bubbleHeight - handleHeight / 2, (int) (y - bubbleHeight));
int handleY = getValueInRange(0, viewHeight - handleHeight, (int) (y - handleHeight / 2));
if (showBubble) {
bubbleView.setY(bubbleY);
}
handleView.setY(handleY);
}
代码示例来源:origin: githubwing/WingUE
@Override public void onAnimationUpdate(ValueAnimator valueAnimator) {
mSearchBGTxt.setY((Float) valueAnimator.getAnimatedValue());
mArrowImg.setY(
mSearchBGTxt.getY() + (mSearchBGTxt.getHeight() - mArrowImg.getHeight()) / 2);
mHintTxt.setY(mSearchBGTxt.getY() + (mSearchBGTxt.getHeight() - mHintTxt.getHeight()) / 2);
mSearchTxt.setY(
mSearchBGTxt.getY() + (mSearchBGTxt.getHeight() - mSearchTxt.getHeight()) / 2);
}
});
内容来源于网络,如有侵权,请联系作者删除!