android.widget.Spinner.getSelectedItemPosition()方法的使用及代码示例

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

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

Spinner.getSelectedItemPosition介绍

暂无

代码示例

代码示例来源:origin: commonsguy/cw-omnibus

private long getPeriod() {
  return(PERIODS[period.getSelectedItemPosition()]);
 }
}

代码示例来源:origin: commonsguy/cw-omnibus

private long getPeriod() {
  return(PERIODS[period.getSelectedItemPosition()]);
 }
}

代码示例来源:origin: novoda/android-demos

int getSelected() {
  return mView.getSelectedItemPosition();
}

代码示例来源:origin: castorflex/SmoothProgressBar

@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
 mFactor = (progress + 1) / 10f;
 mTextViewFactor.setText("Factor: " + mFactor);
 setInterpolator(mSpinnerInterpolators.getSelectedItemPosition());
}

代码示例来源:origin: seven332/EhViewer

public int getMinRating() {
  int position = mMinRating.getSelectedItemPosition();
  if (mSr.isChecked() && position >= 0) {
    return position + 2;
  } else {
    return -1;
  }
}

代码示例来源:origin: TeamNewPipe/NewPipe

@Override
public View getView(int position, View convertView, ViewGroup parent) {
  return getCustomView(((Spinner) parent).getSelectedItemPosition(), convertView, parent, false);
}

代码示例来源:origin: commonsguy/cw-omnibus

public void notifyMe(View v) {
  Intent i=new Intent(this, AlarmReceiver.class)
    .putExtra(AlarmReceiver.EXTRA_TYPE, type.getSelectedItemPosition());
  PendingIntent pi=PendingIntent.getBroadcast(this, 0, i,
                        PendingIntent.FLAG_UPDATE_CURRENT);
  AlarmManager mgr=(AlarmManager)getSystemService(ALARM_SERVICE);

  mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
    SystemClock.elapsedRealtime()+(1000*delay.getProgress()),
    pi);
 }
}

代码示例来源:origin: pili-engineering/PLDroidPlayer

switch (mActivitySpinner.getSelectedItemPosition()) {
  case 0:
    cls = PLMediaPlayerActivity.class;

代码示例来源:origin: ankidroid/Anki-Android

private JSONObject getCurrentlySelectedModel() {
  return getCol().getModels().get(mAllModelIds.get(mNoteTypeSpinner.getSelectedItemPosition()));
}

代码示例来源:origin: greenrobot/EventBus

public void startClick(View v) {
  TestParams params = new TestParams();
  Spinner spinnerThread = findViewById(R.id.spinnerThread);
  String threadModeStr = spinnerThread.getSelectedItem().toString();
  ThreadMode threadMode = ThreadMode.valueOf(threadModeStr);
  params.setThreadMode(threadMode);
  params.setEventInheritance(((CheckBox) findViewById(R.id.checkBoxEventBusEventHierarchy)).isChecked());
  params.setIgnoreGeneratedIndex(((CheckBox) findViewById(R.id.checkBoxEventBusIgnoreGeneratedIndex)).isChecked());
  EditText editTextEvent = findViewById(R.id.editTextEvent);
  params.setEventCount(Integer.parseInt(editTextEvent.getText().toString()));
  EditText editTextSubscriber = findViewById(R.id.editTextSubscribe);
  params.setSubscriberCount(Integer.parseInt(editTextSubscriber.getText().toString()));
  Spinner spinnerTestToRun = findViewById(R.id.spinnerTestToRun);
  int testPos = spinnerTestToRun.getSelectedItemPosition();
  params.setTestNumber(testPos + 1);
  ArrayList<Class<? extends Test>> testClasses = initTestClasses(testPos);
  params.setTestClasses(testClasses);
  Intent intent = new Intent();
  intent.setClass(this, TestRunnerActivity.class);
  intent.putExtra("params", params);
  startActivity(intent);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
 toggleWidgets(!isChecked);
 switch(type.getSelectedItemPosition()) {
  case 0:
   manageExact(isChecked);
   break;
  case 1:
   manageInexact(isChecked);
   break;
  case 2:
   manageJobScheduler(isChecked);
   break;
 }
}

代码示例来源:origin: hitherejoe/animate

private Interpolator getSelectedInterpolator() {
    switch (mInterpolatorSpinner.getSelectedItemPosition()) {
      case 1:
        return new FastOutLinearInInterpolator();
      case 2:
        return new FastOutSlowInInterpolator();
      case 3:
        return new LinearOutSlowInInterpolator();
      case 4:
        return new AccelerateDecelerateInterpolator();
      case 5:
        return new AccelerateInterpolator();
      case 6:
        return new DecelerateInterpolator();
      case 7:
        return new AnticipateInterpolator();
      case 8:
        return new AnticipateOvershootInterpolator();
      case 9:
        return new BounceInterpolator();
      case 10:
        return new LinearInterpolator();
      case 11:
        return new OvershootInterpolator();
      default:
        return null;
    }
  }
}

代码示例来源:origin: hitherejoe/animate

private Interpolator getSelectedInterpolator() {
  switch (mAnimationInterpolatorSpinner.getSelectedItemPosition()) {
    case 1:
      return new FastOutLinearInInterpolator();
    case 2:
      return new FastOutSlowInInterpolator();
    case 3:
      return new LinearOutSlowInInterpolator();
    case 4:
      return new AccelerateDecelerateInterpolator();
    case 5:
      return new AccelerateInterpolator();
    case 6:
      return new DecelerateInterpolator();
    case 7:
      return new AnticipateInterpolator();
    case 8:
      return new AnticipateOvershootInterpolator();
    case 9:
      return new BounceInterpolator();
    case 10:
      return new LinearInterpolator();
    case 11:
      return new OvershootInterpolator();
    default:
      return null;
  }
}

代码示例来源:origin: seven332/EhViewer

@Override
  public void onClick(View v) {
    if (null == mFilterList || null == mDialog || null == mSpinner ||
        null == mInputLayout || null == mEditText) {
      return;
    }
    String text = mEditText.getText().toString().trim();
    if (TextUtils.isEmpty(text)) {
      mInputLayout.setError(getString(R.string.text_is_empty));
      return;
    } else {
      mInputLayout.setError(null);
    }
    int mode = mSpinner.getSelectedItemPosition();
    Filter filter = new Filter();
    filter.mode = mode;
    filter.text = text;
    mFilterList.add(filter);
    if (null != mAdapter) {
      mAdapter.notifyDataSetChanged();
    }
    updateView(true);
    mDialog.dismiss();
    mDialog = null;
    mSpinner = null;
    mInputLayout = null;
    mEditText = null;
  }
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
 toggleWidgets(!isChecked);
 switch(type.getSelectedItemPosition()) {
  case 0:
   manageExact(isChecked);
   break;
  case 1:
   manageInexact(isChecked);
   break;
  case 2:
   manageUnified(isChecked);
   break;
  case 3:
   manageJobScheduler(isChecked);
   break;
 }
}

代码示例来源:origin: k9mail/k-9

hasConnectionSecurity = (connectionSecurity != ConnectionSecurity.NONE);
} else {
  mCurrentAuthTypeViewPosition = mAuthTypeView.getSelectedItemPosition();
  mCurrentSecurityTypeViewPosition = mSecurityTypeView.getSelectedItemPosition();
  mCurrentPortViewSetting = mPortView.getText().toString();

代码示例来源:origin: k9mail/k-9

hasConnectionSecurity = (connectionSecurity != ConnectionSecurity.NONE);
} else {
  mCurrentAuthTypeViewPosition = mAuthTypeView.getSelectedItemPosition();
  mCurrentSecurityTypeViewPosition = mSecurityTypeView.getSelectedItemPosition();
  mCurrentPortViewSetting = mPortView.getText().toString();

代码示例来源:origin: cSploit/android

private void setStartedState() {
 int min = Integer.parseInt((String) mMinSpinner.getSelectedItem()), max = Integer
     .parseInt((String) mMaxSpinner.getSelectedItem());
 if (min > max)
  max = min + 1;
 mAccountFound = false;
 try {
  mStartButton.setImageDrawable(ContextCompat.getDrawable(getBaseContext(), R.drawable.ic_stop_24dp));
  mProcess =
      System.getTools().hydra
          .crack(System.getCurrentTarget(),
              Integer.parseInt((String) mPortSpinner
                  .getSelectedItem()),
              (String) mProtocolSpinner.getSelectedItem(),
              mCustomCharset == null ? CHARSETS_MAPPING[mCharsetSpinner
                  .getSelectedItemPosition()] : mCustomCharset,
              min, max, (String) mUserSpinner.getSelectedItem(),
              mUserWordlist, mPassWordlist, mReceiver);
  mActivity.setVisibility(View.VISIBLE);
  mStatusText.setTextColor(Color.DKGRAY);
  mStatusText.setText(getString(R.string.starting_dots));
  mRunning = true;
 } catch (ChildManager.ChildNotStartedException e) {
  setStoppedState();
 }
}

代码示例来源:origin: evernote/android-job

private void testPeriodic() {
  mLastJobId = new JobRequest.Builder(DemoSyncJob.TAG)
      .setPeriodic(JobRequest.MIN_INTERVAL, JobRequest.MIN_FLEX)
      .setRequiresCharging(mRequiresCharging.isChecked())
      .setRequiresDeviceIdle(mRequiresDeviceIdle.isChecked())
      .setRequiredNetworkType(JobRequest.NetworkType.values()[mNetworkTypeSpinner.getSelectedItemPosition()])
      .build()
      .schedule();
}

代码示例来源:origin: firebase/firebase-jobdispatcher-android

int selectedTriggerPosition = triggerSpinner.getSelectedItemPosition();
switch (TriggerType.getByPosition(selectedTriggerPosition)) {
 case NOW_TRIGGER:
  break;
 case CONTENT_URI_TRIGGER:
  Uri uri = uris[uriSpinner.getSelectedItemPosition()];
  CheckBox notifyForDescendants = (CheckBox) findViewById(R.id.notify_for_descendants);
  int flags =

相关文章