android.widget.SeekBar.getHeight()方法的使用及代码示例

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

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

SeekBar.getHeight介绍

暂无

代码示例

代码示例来源:origin: techery/progresshint

private int getVerticalOffset() {
 return -(mSeekBar.getHeight() + mPopupView.getMeasuredHeight() + mPopupOffset);
}

代码示例来源:origin: techery/progresshint

private int getHorizontalOffset() {
 switch (getOrientation()) {
  case CW:
   return mPopupOffset;
  case CCW:
   return mSeekBar.getHeight() + mPopupOffset;
  default:
   throw new IllegalStateException("This widget orientation is not supported");
 }
}

代码示例来源:origin: techery/progresshint

@Override public boolean isWidgetFullyVisible(View container) {
  int relativeTop = ViewUtil.getRelativeTop(mSeekBar, container);
  return (container.getScrollY() < relativeTop - mPopupView.getHeight() - mPopupOffset) // top edge
    && (container.getHeight() + container.getScrollY() - mPopupView.getHeight() - mPopupOffset
    > relativeTop - mSeekBar.getHeight()); // bottom edge
 }
}

代码示例来源:origin: techery/progresshint

private int getVerticalOffset(int progress) {
 int followPosition = getFollowPosition(progress);
 int yOddOffset;
 switch (getOrientation()) {
  case CW:
   yOddOffset = mPopupView.getMeasuredHeight() / 2 + mSeekBar.getHeight() / 2 - 15;
   return followPosition - yOddOffset;
  case CCW:
   yOddOffset = mPopupView.getMeasuredHeight() / 2 + mSeekBar.getHeight() * 2;
   return -followPosition - yOddOffset;
  default:
   throw new IllegalStateException("This widget orientation is not supported");
 }
}

代码示例来源:origin: techery/progresshint

private int getHorizontalOffset(int progress) {
 return getFollowPosition(progress) - mPopupView.getMeasuredWidth() / 2 + mSeekBar.getHeight() / 2 + 15;
}

代码示例来源:origin: dwfox/DWRulerView

@Override
  public boolean onPreDraw() {
    if (seekBar.getHeight() > 0) {
      Drawable thumb = res.getDrawable(R.drawable.indicator);
      int h = seekBar.getMeasuredHeight();
      int w = h;
      Bitmap bmpOrg = ((BitmapDrawable) thumb).getBitmap();
      Bitmap bmpScaled = Bitmap.createScaledBitmap(bmpOrg, w, h, true);
      Drawable newThumb = new BitmapDrawable(res, bmpScaled);
      newThumb.setBounds(0, 0, newThumb.getIntrinsicWidth(), newThumb.getIntrinsicHeight());
      seekBar.setThumb(newThumb);
      seekBar.getViewTreeObserver().removeOnPreDrawListener(this);
    }
    return true;
  }
});

相关文章

SeekBar类方法