本文整理了Java中android.widget.SeekBar.setLayoutParams()
方法的一些代码示例,展示了SeekBar.setLayoutParams()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SeekBar.setLayoutParams()
方法的具体详情如下:
包路径:android.widget.SeekBar
类名称:SeekBar
方法名:setLayoutParams
暂无
代码示例来源:origin: google/android-ui-toolkit-demos
params = new LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT);
params.weight = .5f;
seek.setLayoutParams(params);
seek.setMax(100);
seek.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
代码示例来源:origin: stackoverflow.com
seekBar.setLayoutParams(lp);
seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
代码示例来源:origin: tgwizard/sls
@Override
protected void onPrepareDialogBuilder(Builder builder) {
// we "have" to create new views each time
LinearLayout layout = new LinearLayout(mContext);
layout.setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
// layout.setMinimumWidth(400);
layout.setPadding(20, 20, 20, 20);
mSeekBar = new SeekBar(mContext);
mSeekBar.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
mSeekBar.setMax(mStartMax);
mSeekBar.setProgress(mStartProgress);
layout.addView(mSeekBar);
builder.setView(layout);
super.onPrepareDialogBuilder(builder);
}
代码示例来源:origin: limboemu/limbo
public LinearLayout createVolumePanel() {
LinearLayout layout = new LinearLayout (this);
layout.setPadding(20, 20, 20, 20);
LinearLayout.LayoutParams volparams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
SeekBar vol = new SeekBar(this);
int volume = 0;
//TODO:
vol.setMax(maxVolume);
volume = getCurrentVolume();
vol.setProgress(volume);
vol.setLayoutParams(volparams);
((SeekBar) vol).setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
public void onProgressChanged(SeekBar s, int progress, boolean touch) {
//TODO:
setVolume(progress);
}
public void onStartTrackingTouch(SeekBar arg0) {
}
public void onStopTrackingTouch(SeekBar arg0) {
}
});
layout.addView(vol);
return layout;
}
代码示例来源:origin: limboemu/limbo
rate.setLayoutParams(params);
代码示例来源:origin: limboemu/limbo
rate.setLayoutParams(params);
代码示例来源:origin: stackoverflow.com
TableRow tr = new TableRow(this);
tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
/* Create a SeekBar to be the row-content. */
SeekBar seekBar = new SeekBar(this);
seekBar.setMax(15);
// seekBar.setIndeterminate(true);
ShapeDrawable thumb = new ShapeDrawable(new OvalShape());
thumb.setIntrinsicHeight(80);
thumb.setIntrinsicWidth(30);
seekBar.setThumb(thumb);
seekBar.setProgress(1);
seekBar.setVisibility(View.VISIBLE);
seekBar.setBackgroundColor(Color.BLUE);
LayoutParams lp = new LayoutParams(200, 50);
seekBar.setLayoutParams(lp);
seekBar.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
代码示例来源:origin: renyuneyun/Easer
@NonNull
@Override
public ViewGroup onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
LinearLayout view = new LinearLayout(getContext());
view.setOrientation(LinearLayout.VERTICAL);
LinearLayout auto_layout = new LinearLayout(getContext());
auto_layout.setOrientation(LinearLayout.HORIZONTAL);
TextView tv_auto = new TextView(getContext());
tv_auto.setText(getResources().getString(R.string.operation_brightness_desc_autobrightness));
mIsAuto = new Switch(getContext());
mIsAuto.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
mBrightnessLevel = new SeekBar(getContext());
mBrightnessLevel.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
mBrightnessLevel.setMax(255);
mBrightnessLevel.setEnabled(false);
mIsAuto.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked)
mBrightnessLevel.setEnabled(false);
else
mBrightnessLevel.setEnabled(true);
}
});
auto_layout.addView(mIsAuto);
auto_layout.addView(tv_auto);
view.addView(auto_layout);
view.addView(mBrightnessLevel);
return view;
}
代码示例来源:origin: qiubiteme/android_api_demos
layoutParams.weight = 1;
SeekBar bar = new SeekBar(this);
bar.setLayoutParams(layoutParams);
bar.setMax(maxEQLevel - minEQLevel);
bar.setProgress(mEqualizer.getBandLevel(band));
代码示例来源:origin: THEONE10211024/ApiDemos
layoutParams.weight = 1;
SeekBar bar = new SeekBar(this);
bar.setLayoutParams(layoutParams);
bar.setMax(maxEQLevel - minEQLevel);
bar.setProgress(mEqualizer.getBandLevel(band));
代码示例来源:origin: dwfox/DWRulerView
private void addCompoenet() {
removeAllViews();
LineRulerView lineRulerView = new LineRulerView(context);
LayoutParams rulerLayoutParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, getHeight() / 3 * 2);
rulerLayoutParams.addRule(ALIGN_PARENT_BOTTOM);
lineRulerView.setLayoutParams(rulerLayoutParams);
lineRulerView.setMinMaxValue(seekbarMinValue, seekbarMaxValue + 1);
lineRulerView.setBackgroundColor(Color.DKGRAY);
addView(lineRulerView);
seekBar = new SeekBar(context);
LayoutParams seekbarLayoutParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, getHeight() / 3);
seekbarLayoutParams.addRule(ALIGN_PARENT_TOP);
seekBar.setLayoutParams(seekbarLayoutParams);
seekBar.setBackgroundColor(Color.DKGRAY);
seekBar.setProgressDrawable(null);
seekBar.setPadding(0, 0, 0, 0);
seekBar.setOnSeekBarChangeListener(this);
seekBar.setMax(seekbarMaxValue - seekbarMinValue + 1);
setSeekberThumb(seekBar, context.getResources());
addView(seekBar);
}
代码示例来源:origin: yaozs/YzsLib
mTensionSeekBar.setLayoutParams(tableLayoutParams);
seekWrapper.addView(mTensionSeekBar);
mFrictionSeekBar.setLayoutParams(tableLayoutParams);
seekWrapper.addView(mFrictionSeekBar);
代码示例来源:origin: BeppiMenozzi/TriStateToggleButton
mTensionSeekBar.setLayoutParams(tableLayoutParams);
seekWrapper.addView(mTensionSeekBar);
mFrictionSeekBar.setLayoutParams(tableLayoutParams);
seekWrapper.addView(mFrictionSeekBar);
代码示例来源:origin: stackoverflow.com
seekbar.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams
.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
代码示例来源:origin: HemendraGangwar/VideoTrimmingLikeWhatsapp
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
private void setUpMargins() {
int marge = mRangeSeekBarView.getThumbs().get(0).getWidthBitmap();
int widthSeek = mHolderTopView.getThumb().getMinimumWidth() / 2;
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) mHolderTopView.getLayoutParams();
lp.setMargins(marge - widthSeek, 0, marge - widthSeek, 0);
mHolderTopView.setLayoutParams(lp);
lp = (RelativeLayout.LayoutParams) mTimeLineView.getLayoutParams();
lp.setMargins(marge, 0, marge, 0);
mTimeLineView.setLayoutParams(lp);
lp = (RelativeLayout.LayoutParams) mVideoProgressIndicator.getLayoutParams();
lp.setMargins(marge, 0, marge, 0);
mVideoProgressIndicator.setLayoutParams(lp);
}
内容来源于网络,如有侵权,请联系作者删除!