本文整理了Java中android.widget.SeekBar.getPaddingLeft()
方法的一些代码示例,展示了SeekBar.getPaddingLeft()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SeekBar.getPaddingLeft()
方法的具体详情如下:
包路径:android.widget.SeekBar
类名称:SeekBar
方法名:getPaddingLeft
暂无
代码示例来源:origin: stackoverflow.com
return;
float contentWidth = this.getPaint().measureText(content);
int realWidth = width - seekBar.getPaddingLeft() - seekBar.getPaddingRight();
int maxLimit = (int) (width - contentWidth - seekBar.getPaddingRight());
int minLimit = seekBar.getPaddingLeft();
float percent = (float) (1.0 * seekBar.getProgress() / seekBar.getMax());
int left = minLimit + (int) (realWidth * percent - contentWidth / 2.0);
代码示例来源:origin: stackoverflow.com
int width = seekBar.getWidth() - seekBar.getPaddingLeft() - seekBar.getPaddingRight();
double progress = mProgress == 0 ? seekBar.getProgress() : mProgress;
int xPosition = (int) (seekBar.getPaddingLeft() + width * progress / seekBar.getMax());
float[] xy = getVisibleLeftTop(seekBar);
return new float[]{ xy[0] + xPosition, xy[1] + 10 };
代码示例来源:origin: techery/progresshint
@Override public boolean isWidgetFullyVisible(View container) {
int relativeTop = ViewUtil.getRelativeTop(mSeekBar, container);
int followPosition = getFollowPosition(getPopupStyle() == POPUP_FOLLOW ? mSeekBar.getProgress() : mSeekBar.getMax() / 2);
//
boolean fitsTop;
boolean fitsBottom;
switch (getOrientation()) {
case CW:
fitsTop =
relativeTop + followPosition + mSeekBar.getPaddingLeft() - mPopupView.getHeight() / 2 > container.getScrollY();
fitsBottom = container.getHeight() + container.getScrollY() >
relativeTop + followPosition + mSeekBar.getPaddingRight() + mPopupView.getHeight() / 2;
break;
case CCW:
fitsTop = relativeTop + (mSeekBar.getWidth() - followPosition) - mPopupView.getHeight() > container.getScrollY();
fitsBottom = container.getHeight() + container.getScrollY() + (followPosition + mSeekBar.getPaddingLeft()) >
relativeTop + mSeekBar.getWidth() + mPopupView.getHeight() / 2;
break;
default:
throw new IllegalStateException("This widget orientation is not supported");
}
//
return fitsTop && fitsBottom;
}
}
代码示例来源:origin: techery/progresshint
protected int getFollowPosition(int progress) {
return (int) (progress * (mSeekBar.getWidth() - mSeekBar.getPaddingLeft() - mSeekBar.getPaddingRight()) / (float) mSeekBar.getMax());
}
代码示例来源:origin: stackoverflow.com
final int padding = mMinText.getWidth() + mSeek.getPaddingLeft();
final int totalSeekWidth = mSeek.getWidth();
final RelativeLayout.LayoutParams lp = (LayoutParams) mCurrentText
代码示例来源:origin: PangHaHa12138/Loading
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void setIndicator() {
if (mTextProviderIndicator != null) {
mTextViewProgress.setText(mTextProviderIndicator
.provideText(getProgress()));
} else {
if (mIndicatorText != null) {
try {
mTextViewProgress.setText(String.valueOf(String.format(
mIndicatorText, getProgress())));
} catch (Exception e) {
mTextViewProgress.setText(String.valueOf(getProgress()));
}
} else {
mTextViewProgress.setText(String.valueOf(getProgress()));
}
}
Rect padding = new Rect();
mSeekBar.getThumb().getPadding(padding);
int thumbPos = mSeekBar.getPaddingLeft() + mMeasuredWidth
* mSeekBar.getProgress() / mSeekBar.getMax();
thumbPos = (int) Math.ceil(thumbPos);
mWrapperIndicator.setX(thumbPos
- (int) Math.ceil(mWrapperIndicator.getWidth() / 2));
}
代码示例来源:origin: stackoverflow.com
public int getSeekBarThumbPosX(SeekBar seekBar) {
int posX;
if (Build.VERSION.SDK_INT >= 16) {
posX = seekBar.getThumb().getBounds().centerX();
} else {
int left = seekBar.getLeft() + seekBar.getPaddingLeft();
int right = seekBar.getRight() - seekBar.getPaddingRight();
float width = (float) (seekBar.getProgress() * (right - left)) / seekBar.getMax();
posX = Math.round(width) + seekBar.getThumbOffset();
}
return posX;
}
代码示例来源:origin: PangHaHa12138/Loading
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onGlobalLayout() {
mMeasuredWidth = mSeekBar.getWidth()
- mSeekBar.getPaddingLeft()
- mSeekBar.getPaddingRight();
mSeekBar.setPadding(
mSeekBar.getPaddingLeft(),
mSeekBar.getPaddingTop()
+ mWrapperIndicator.getHeight(),
mSeekBar.getPaddingRight(),
mSeekBar.getPaddingBottom());
setIndicator();
getViewTreeObserver()
.removeOnGlobalLayoutListener(this);
}
});
代码示例来源:origin: fasteque/rgb-tool
seekBarBlue.setProgress(getMainActivity().getBlueColor());
seekBarOpacity.setProgress(getMainActivity().getOpacity());
seekBarLeft = seekBarRed.getPaddingLeft();
代码示例来源:origin: stackoverflow.com
int max = seekBar.getMax();
int available = seekBar.getWidth() - seekBar.getPaddingLeft() - seekBar.getPaddingRight();
float scale = max > 0 ? (float) seekBar.getProgress() / (float) max : 0;
代码示例来源:origin: PangHaHa12138/Loading
indicatorTextStyle);
mSeekBar.setPadding(mSeekBar.getPaddingLeft() + mSeekBarMarginLeft,
mSeekBar.getPaddingTop() + mSeekBarMarginTop,
mSeekBar.getPaddingRight() + mSeekBarMarginRight,
代码示例来源:origin: AntonioRedondo/AnotherMonitor
int paddingLeft = mSBWidth.getPaddingLeft();
int paddingRight = mSBWidth.getPaddingRight();
mSBWidth.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom + navigationBarHeight);
内容来源于网络,如有侵权,请联系作者删除!