android.widget.TextView.getY()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中android.widget.TextView.getY()方法的一些代码示例,展示了TextView.getY()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.getY()方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:getY

TextView.getY介绍

暂无

代码示例

代码示例来源:origin: google/santa-tracker-android

@Override
  public void run() {
    currentScoreX = currentScore.getX();
    currentScoreY = currentScore.getY();
  }
});

代码示例来源:origin: google/santa-tracker-android

"x", currentScore.getX(), centeredScorePlaceholder.getX()),
UIUtil.floatValue(
    "y", currentScore.getY(), centeredScorePlaceholder.getY()),
UIUtil.floatValue(
    "textSize",
    "x", centeredScorePlaceholder.getX(), finalScorePlaceholder.getX()),
UIUtil.floatValue(
    "y", centeredScorePlaceholder.getY(), finalScorePlaceholder.getY()),
UIUtil.floatValue(
    "textSize",

代码示例来源:origin: smuyyh/SprintNBA

@Override
  public void onSelection(int position, String indexTitle) {
    if (mStickView != null) {
      if (!mStickView.getText().toString().equals(indexTitle)) {
        mStickView.setText(indexTitle);
      }
      if (mStickView.getY() != 0) {
        mStickView.setY(0);
      }
    }
  }
});

代码示例来源: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);
 }
});

代码示例来源:origin: githubwing/WingUE

private void initLocation() {
 final float translateY = getTranslateY();
 //放到前一个页面的位置
 mSearchBGTxt.setY(mSearchBGTxt.getY() + translateY);
 mHintTxt.setY(mSearchBGTxt.getY() + (mSearchBGTxt.getHeight() - mHintTxt.getHeight()) / 2);
 mSearchTxt.setY(mSearchBGTxt.getY() + (mSearchBGTxt.getHeight() - mSearchTxt.getHeight()) / 2);
}

代码示例来源:origin: stackoverflow.com

if (position != GridView.INVALID_POSITION) {
   MyList.add(position);
   v.getParent().requestDisallowInterceptTouchEvent(true);
   TextView cellView = (TextView) gridView.getChildAt(position);
    centreX = cellView.getX() + cellView.getWidth()  / 2;
    centreY = cellView.getY() + cellView.getHeight() / 2;
 switch (event.getAction()) {
   case MotionEvent.ACTION_DOWN:
     newPaint.DrawLine.touch_start(x, y,centreX,centreY);

代码示例来源:origin: MZCretin/RelativeLayoutDemo

@Override
  public void onClick(View v) {
    String content = editText.getText().toString();
    if ( TextUtils.isEmpty(content) ) {
      Toast.makeText(context, "您没有任何输入!", Toast.LENGTH_SHORT).show();
    } else {
      if ( isNew ) {
        addTextView(null, currentX, currentY, content, colors[0], 0, 0);
      } else {
        addTextView(textView, textView.getX(), textView.getY(), content, colors[0], textView.getTextSize(), textView.getRotation());
      }
    }
    dialog.dismiss();
  }
});

代码示例来源:origin: stackoverflow.com

int[] tv01pos = {(int) tv01.getX(), (int) tv01.getY()};

代码示例来源:origin: githubwing/WingUE

private void performExitAnimation() {
 final float translateY = getTranslateY();
 final ValueAnimator translateVa = translateVa(mSearchBGTxt.getY(), mSearchBGTxt.getY() + translateY);
 final ValueAnimator scaleVa = scaleVa(0.8f, 1f);
 final ValueAnimator alphaVa = alphaVa(1f, 0f);
 exitListener(translateVa);
 final float currentX = mHintTxt.getX();
 ValueAnimator translateVaX = translateVax(currentX, originX);
 setDuration(translateVa, scaleVa, translateVaX, alphaVa);
 star(translateVa, scaleVa, translateVaX, alphaVa);
}

代码示例来源:origin: stackoverflow.com

private Region createRotatedRegion(TextView textView){
  Matrix matrix = new Matrix();
  matrix.setRotate(textView.getRotation(), textView.getX() + textView.getMeasuredWidth() / 2, textView.getY() + textView.getMeasuredHeight() / 2);

  Path path = new Path();
  Point LT = rotatePoint(matrix, textView.getX(), textView.getY());
  Point RT = rotatePoint(matrix, textView.getX() + textView.getMeasuredWidth(), textView.getY());
  Point RB = rotatePoint(matrix, textView.getX() + textView.getMeasuredWidth(), textView.getY() + textView.getMeasuredHeight());
  Point LB = rotatePoint(matrix, textView.getX(), textView.getY() + textView.getMeasuredHeight());

  path.moveTo(LT.x, LT.y);
  path.lineTo(RT.x, RT.y);
  path.lineTo(RB.x, RB.y);
  path.lineTo(LB.x, LB.y);

  Region region = new Region();
  region.setPath(path,  new Region(0, 0, textViewParent.getWidth(), textViewParent.getHeight()));
  return region;
}

private Point rotatePoint(Matrix matrix, float x, float y){
  float[] pts = new float[2];
  pts[0] = x;
  pts[1] = y;
  matrix.mapPoints(pts);
  return new Point((int)pts[0], (int)pts[1]);
}

代码示例来源:origin: MZCretin/RelativeLayoutDemo

height = textView.getHeight();
startX = textView.getX();
startY = textView.getY();
  textView = list.get(num);
  tv_widths = getMidPiont(( int ) fX, ( int ) fY, ( int ) sX, ( int ) sY).x - textView.getX();
  tv_heights = getMidPiont(( int ) fX, ( int ) fY, ( int ) sX, ( int ) sY).y - textView.getY();

代码示例来源:origin: MZCretin/RelativeLayoutDemo

if ( mEvent != null ) {
  mTv_width = mEvent.getX() - textView.getX();
  mTv_height = mEvent.getY() - textView.getY();
mTv_heights = getMidPiont(( int ) mfX, ( int ) mfY, ( int ) msX, ( int ) msY).y - textView.getY();

代码示例来源:origin: githubwing/WingUE

private void performEnterAnimation() {
 initLocation();
 final float top = getResources().getDisplayMetrics().density * 20;
 final ValueAnimator translateVa = translateVa(mSearchBGTxt.getY(), top);
 final ValueAnimator scaleVa = scaleVa(1, 0.8f);
 final ValueAnimator alphaVa = alphaVa(0, 1f);
 originX = mHintTxt.getX();
 final float leftSpace = mArrowImg.getRight() * 2;
 final ValueAnimator translateVaX = translateVax(originX, leftSpace);
 setDuration(translateVa, scaleVa, translateVaX, alphaVa);
 star(translateVa, scaleVa, translateVaX, alphaVa);
}

代码示例来源:origin: MZCretin/RelativeLayoutDemo

/**
 * 对控件进行参数的更新操作
 *
 * @param tv
 */
private void updateTextViewParams(TextView tv, float rotation, float scale) {
  for ( int i = 0; i < listTvParams.size(); i++ ) {
    TextViewParams param = new TextViewParams();
    if ( tv.getTag().toString().equals(listTvParams.get(i).getTag()) ) {
      param.setRotation(rotation);
      param.setTextSize(( float ) (tv.getTextSize() / scaleTimes));
      param.setMidPoint(getViewMidPoint(tv));
      param.setScale(scale);
      textSize = tv.getTextSize() / 2;
      param.setWidth(tv.getWidth());
      param.setHeight(tv.getHeight());
      param.setX(tv.getX());
      param.setY(tv.getY());
      param.setTag(listTvParams.get(i).getTag());
      param.setContent(tv.getText().toString());
      param.setTextColor(tv.getCurrentTextColor());
      listTvParams.set(i, param);
      return;
    }
  }
}

代码示例来源:origin: MZCretin/RelativeLayoutDemo

/**
 * //对状态进行保存操作
 *
 * @param textView
 * @return
 */
private void saveTextViewparams(TextView textView) {
  if ( textView != null ) {
    tvParams = new TextViewParams();
    tvParams.setRotation(0);
    tvParams.setTextSize(( float ) (textView.getTextSize() / scaleTimes));
    tvParams.setX(textView.getX());
    tvParams.setY(textView.getY());
    tvParams.setWidth(textView.getWidth());
    tvParams.setHeight(textView.getHeight());
    tvParams.setContent(textView.getText().toString());
    tvParams.setMidPoint(getViewMidPoint(textView));
    tvParams.setScale(1);
    tvParams.setTag(String.valueOf(( long ) textView.getTag()));
    tvParams.setRotation(mAngle);
    tvParams.setTextColor(textView.getCurrentTextColor());
    listTvParams.add(tvParams);
  }
}

相关文章

TextView类方法