本文整理汇总了Java中android.widget.NumberPicker.setWrapSelectorWheel方法的典型用法代码示例。如果您正苦于以下问题:Java NumberPicker.setWrapSelectorWheel方法的具体用法?Java NumberPicker.setWrapSelectorWheel怎么用?Java NumberPicker.setWrapSelectorWheel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.NumberPicker
的用法示例。
在下文中一共展示了NumberPicker.setWrapSelectorWheel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onHeightClick
import android.widget.NumberPicker; //导入方法依赖的package包/类
@OnClick(R.id.custom_tile_height_size)
public void onHeightClick() {
final NumberPicker view = new NumberPicker(this);
view.setMinValue(24);
view.setMaxValue(64);
view.setWrapSelectorWheel(false);
view.setValue(currentTileHeight);
new AlertDialog.Builder(this)
.setView(view)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
currentTileHeight = view.getValue();
widget.setTileHeightDp(currentTileHeight);
}
})
.show();
}
示例2: onCreate
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_study_mode_settings_page);
biologyButton = (ToggleButton) findViewById(R.id.biologyButton);
chemistryButton = (ToggleButton) findViewById(R.id.chemistryButton);
earthAndSpaceButton = (ToggleButton) findViewById(R.id.earthAndSpaceButton);
energyButton = (ToggleButton) findViewById(R.id.energyButton);
mathButton = (ToggleButton) findViewById(R.id.mathButton);
physicsButton = (ToggleButton) findViewById(R.id.physicsButton);
randomButton = (ToggleButton) findViewById(R.id.randomButton);
roundNumPicker = (NumberPicker) findViewById(R.id.roundNumPicker);
roundNumPicker.setMinValue(0);
roundNumPicker.setMaxValue(roundOptions.length-1);
roundNumPicker.setWrapSelectorWheel(false);
roundNumPicker.setDisplayedValues(roundOptions);
menuButton = (Button) findViewById(R.id.menuButton);
}
开发者ID:jakepolatty,项目名称:HighSchoolScienceBowlPractice-Android,代码行数:22,代码来源:StudyModeSettingsPage.java
示例3: onWidthClick
import android.widget.NumberPicker; //导入方法依赖的package包/类
@OnClick(R.id.custom_tile_width_size)
public void onWidthClick() {
final NumberPicker view = new NumberPicker(this);
view.setMinValue(24);
view.setMaxValue(64);
view.setWrapSelectorWheel(false);
view.setValue(currentTileWidth);
new AlertDialog.Builder(this)
.setView(view)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
currentTileWidth = view.getValue();
widget.setTileWidthDp(currentTileWidth);
}
})
.show();
}
示例4: onTileSizeClicked
import android.widget.NumberPicker; //导入方法依赖的package包/类
@OnClick(R.id.button_set_tile_size)
void onTileSizeClicked() {
final NumberPicker view = new NumberPicker(this);
view.setMinValue(24);
view.setMaxValue(64);
view.setWrapSelectorWheel(false);
view.setValue(currentTileSize);
new AlertDialog.Builder(this)
.setView(view)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
currentTileSize = view.getValue();
widget.setTileSizeDp(currentTileSize);
}
})
.show();
}
示例5: initializeViews
import android.widget.NumberPicker; //导入方法依赖的package包/类
private void initializeViews(Dialog dialog) {
major = (ToggleButton) dialog.findViewById(R.id.major);
minor = (ToggleButton) dialog.findViewById(R.id.minor);
dialog.findViewById(R.id.major_parent).setOnClickListener(__ -> onMajorClicked());
dialog.findViewById(R.id.minor_parent).setOnClickListener(__ -> onMinorClicked());
keySigImage = (ImageView) dialog.findViewById(R.id.key_sig_image);
key = (NumberPicker) dialog.findViewById(R.id.key);
key.setWrapSelectorWheel(false);
key.setMinValue(0);
key.setMaxValue(KeySigHandler.FIFTHS.length - 1);
major.setChecked(false);
onMajorClicked();
key.setOnValueChangedListener(this);
key.setValue(6);
}
示例6: onCreate
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reader_mode_settings_page);
setNumPicker = (NumberPicker) findViewById(R.id.setNumPicker);
setNumPicker.setMinValue(0);
setNumPicker.setMaxValue(setOptions.length-1);
setNumPicker.setWrapSelectorWheel(false);
setNumPicker.setDisplayedValues(setOptions);
roundNumPicker = (NumberPicker) findViewById(R.id.roundNumPicker);
roundNumPicker.setMinValue(0);
roundNumPicker.setMaxValue(roundOptions.length-1);
roundNumPicker.setWrapSelectorWheel(false);
roundNumPicker.setDisplayedValues(roundOptions);
tossupTimeSpinner = (Spinner) findViewById(R.id.tossupTimeSelector);
bonusTimeSpinner = (Spinner) findViewById(R.id.bonusTimeSelector);
menuButton = (Button) findViewById(R.id.menuButton);
}
开发者ID:jakepolatty,项目名称:HighSchoolScienceBowlPractice-Android,代码行数:23,代码来源:ReaderModeSettingsPage.java
示例7: onViewCreated
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
//mConversationView = (ListView) view.findViewById(R.id.in);
mStartButton = (Button) view.findViewById(R.id.button_start);
mStopButton = (Button) view.findViewById(R.id.button_stop);
mDisconnectButton = (Button) view.findViewById(R.id.button_disconnect);
mLevel = (NumberPicker) view.findViewById(R.id.Level);
mLevel.setMaxValue(32);
mLevel.setMinValue(1);
mLevel.setValue(1);
mLevel.setWrapSelectorWheel(false);
mLevel.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
mSpeedText = (TextView) view.findViewById(R.id.Speed);
mPowerText = (TextView) view.findViewById(R.id.Power);
mRPMText = (TextView) view.findViewById(R.id.RPM);
mDistanceText = (TextView) view.findViewById(R.id.Distance);
mCaloriesText = (TextView) view.findViewById(R.id.Calories);
mHFText = (TextView) view.findViewById(R.id.Heart);
mTimeText = (TextView) view.findViewById(R.id.Time);
}
示例8: onCreate
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
controlToggle = (ToggleButton) findViewById(R.id.toggle_control);
mStatusTextView = (TextView) findViewById(R.id.tv_status);
mStatusTextView.setMovementMethod(new ScrollingMovementMethod());
mResultProgress = (ProgressBar) findViewById(R.id.progress);
mResultProgress.setMax(100);
NumberPicker picker = (NumberPicker) findViewById(R.id.number_picker);
picker.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
picker.setOnValueChangedListener(this);
picker.setDisplayedValues(mSampleSizes);
picker.setMinValue(0);
picker.setMaxValue(mSampleSizes.length - 1);
picker.setWrapSelectorWheel(true);
picker.setValue(0);
mSampleSize = 1;
Logger.i("Sample size initial value: %s", mSampleSize);
checkPermissions();
}
示例9: onCreateView
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_new_periodic_care, container, false);
goalPicker = (NumberPicker) view.findViewById(R.id.goal_picker);
punishmentPicker = (NumberPicker) view.findViewById(R.id.punishment_picker);
lengthPicker = (NumberPicker) view.findViewById(R.id.length_picker);
unitPicker = (NumberPicker) view.findViewById(R.id.unit_picker);
goalPicker.setMaxValue(Integer.MAX_VALUE);
goalPicker.setMinValue(1);
goalPicker.setWrapSelectorWheel(false);
punishmentPicker.setMaxValue(Integer.MAX_VALUE);
punishmentPicker.setMinValue(0);
punishmentPicker.setValue(1);
punishmentPicker.setWrapSelectorWheel(false);
lengthPicker.setMaxValue(Integer.MAX_VALUE);
lengthPicker.setMinValue(1);
lengthPicker.setWrapSelectorWheel(false);
unitPicker.setDisplayedValues(getResources().getStringArray(R.array.period_units));
unitPicker.setMaxValue(3);
unitPicker.setMinValue(0);
unitPicker.setValue(3);
unitPicker.setWrapSelectorWheel(true);
return view;
}
示例10: SetSnoozePickerValues
import android.widget.NumberPicker; //导入方法依赖的package包/类
static void SetSnoozePickerValues(NumberPicker picker, boolean above, int default_snooze) {
String[] values=new String[snoozeValues.length];
for(int i=0;i<values.length;i++){
values[i]=getNameFromTime(snoozeValues[i]);
}
picker.setMaxValue(values.length -1);
picker.setMinValue(0);
picker.setDisplayedValues(values);
picker.setWrapSelectorWheel(false);
if(default_snooze != 0) {
picker.setValue(getSnoozeLocatoin(default_snooze));
} else {
picker.setValue(getSnoozeLocatoin(getDefaultSnooze(above)));
}
}
示例11: bindView
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
public void bindView(Dialog dialog) {
textView = (TextView) dialog.findViewById(R.id.description);
numberPicker = (NumberPicker) dialog.findViewById(R.id.number_picker);
textView.setText(description);
numberPicker.setMaxValue(maxValue != null ? maxValue : 24);
numberPicker.setMinValue(minValue != null ? minValue : 1);
numberPicker.setOnLongPressUpdateInterval(100);
numberPicker.setWrapSelectorWheel(false);
if (currentValue != null) {
numberPicker.setValue(currentValue);
}
if (!canUseKeyBoard) {
numberPicker.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
}
}
示例12: onBindDialogView
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onBindDialogView(View view) {
NumberPickerPreference preference = getNumberPickerPreference();
numberPicker = (NumberPicker) view.findViewById(R.id.numberpicker);
numberPicker.setMinValue(preference.getMinValue());
numberPicker.setMaxValue(preference.getMaxValue());
numberPicker.setValue(restoredState ? restoredValue : preference.getValue());
if (preference.getDescendantFocusability() > 0) {
//noinspection ResourceType
numberPicker.setDescendantFocusability(preference.getDescendantFocusability());
}
numberPicker.setWrapSelectorWheel(preference.isWrapSelectorWheel());
TextView textView = (TextView) view.findViewById(R.id.subtitle);
textView.setText(preference.getSubtitleText());
}
示例13: onPrepareDialogBuilder
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onPrepareDialogBuilder(final Builder builder) {
super.onPrepareDialogBuilder(builder);
mNumberPicker = new NumberPicker(getContext());
mNumberPicker.setMinValue(mMinValue);
mNumberPicker.setMaxValue(mMaxValue);
mNumberPicker.setValue(mSelectedValue);
mNumberPicker.setWrapSelectorWheel(mWrapSelectorWheel);
mNumberPicker.setLayoutParams(new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
for (int i = 0; i < mNumberPicker.getChildCount(); i++) {
View v = mNumberPicker.getChildAt(i);
if (v instanceof EditText) {
v.setOnKeyListener(new KeyListener());
}
}
final LinearLayout linearLayout = new LinearLayout(this.getContext());
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
linearLayout.setGravity(Gravity.CENTER);
linearLayout.addView(mNumberPicker);
builder.setView(linearLayout);
}
示例14: onCreate
import android.widget.NumberPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
app = (MyApplication)getApplication();
// If the adapter is null, then Bluetooth is not supported
if (CommonStuff.getmBluetoothAdapter() == null) {
Toast.makeText(this, "Bluetooth is not available", Toast.LENGTH_LONG).show();
this.finish();
}
if (!CommonStuff.getmBluetoothAdapter().isEnabled()) {
Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
}
np = (NumberPicker) findViewById(R.id.numberPicker);
np.setMinValue(1);
np.setMaxValue(12);
np.setWrapSelectorWheel(false);
np.setValue(1);
}
示例15: changePairsCount
import android.widget.NumberPicker; //导入方法依赖的package包/类
@OnClick({R.id.pairs_count_value, R.id.pairs_count_description})
public void changePairsCount() {
View numberPickerLayout = getLayoutInflater().inflate(R.layout.dialog_number_picker, null);
final NumberPicker numberPicker = (NumberPicker) numberPickerLayout.findViewById(R.id.number_picker);
Timber.d("setting value to " + Integer.valueOf(pairsCountValue.getText().toString()));
numberPicker.setMinValue(2);
numberPicker.setMaxValue(totalCardImages);
numberPicker.setValue(Integer.valueOf(pairsCountValue.getText().toString()));
numberPicker.setWrapSelectorWheel(false);
numberPicker.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
final TextView pairsTextView = (TextView) numberPickerLayout.findViewById(R.id.number_picker_text);
pairsTextView.setText(R.string.activity_host_game_pairs_count_pairs);
new AlertDialog.Builder(this)
.setView(numberPickerLayout)
.setTitle(R.string.activity_host_game_pairs_count_title)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
pairsCountValue.setText(String.valueOf(numberPicker.getValue()));
}
})
.setNegativeButton(android.R.string.cancel, null)
.show();
}