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

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

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

Spinner.setVisibility介绍

暂无

代码示例

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

SpinnerDisplay setVisible(boolean visible) {
  mView.setVisibility(visible ? View.VISIBLE : View.GONE);
  return this;
}

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

public void checkEventBus(View v) {
  Spinner spinnerThread = findViewById(R.id.spinnerThread);
  CheckBox checkBoxEventBus = findViewById(R.id.checkBoxEventBus);
  int visibility = checkBoxEventBus.isChecked() ? View.VISIBLE : View.GONE;
  spinnerThread.setVisibility(visibility);
}

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

/**
 * Turn on Multi-Select Mode so that the user can select multiple cards at once.
 */
private void loadMultiSelectMode() {
  if (mInMultiSelectMode) {
    return;
  }
  // set in multi-select mode
  mInMultiSelectMode = true;
  // show title and hide spinner
  mActionBarTitle.setVisibility(View.VISIBLE);
  mActionBarTitle.setText(String.valueOf(mCheckedCardPositions.size()));
  mActionBarSpinner.setVisibility(View.GONE);
  // reload the actionbar using the multi-select mode actionbar
  supportInvalidateOptionsMenu();
}

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

/**
   * Turn off Multi-Select Mode and return to normal state
   */
  private void endMultiSelectMode() {
    mCheckedCardPositions.clear();
    mInMultiSelectMode = false;
    // If view which was originally selected when entering multi-select is visible then maintain its position
    View view = mCardsListView.getChildAt(mLastSelectedPosition - mCardsListView.getFirstVisiblePosition());
    if (view != null) {
      recenterListView(view);
    }
    // update adapter to remove check boxes
    mCardsAdapter.notifyDataSetChanged();
    // update action bar
    supportInvalidateOptionsMenu();
    mActionBarSpinner.setVisibility(View.VISIBLE);
    mActionBarTitle.setVisibility(View.GONE);
  }
}

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

case AUDIO_LIVE_STREAM:
  detailControlsDownload.setVisibility(View.GONE);
  spinnerToolbar.setVisibility(View.GONE);
  break;
default:
  spinnerToolbar.setVisibility(View.GONE);
  thumbnailPlayButton.setImageResource(R.drawable.ic_headset_white_24dp);
  break;

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

mActionBarSpinner.setVisibility(View.VISIBLE);

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

mActionBarSpinner.setVisibility(View.VISIBLE);

代码示例来源:origin: DaxiaK/MyDiary

SP_diary_mood.setVisibility(View.VISIBLE);
SP_diary_weather = (Spinner) rootView.findViewById(R.id.SP_diary_weather);
SP_diary_weather.setVisibility(View.VISIBLE);

代码示例来源:origin: DaxiaK/MyDiary

SP_diary_weather.setVisibility(View.VISIBLE);
SP_diary_mood = (Spinner) rootView.findViewById(R.id.SP_diary_mood);
SP_diary_mood.setVisibility(View.VISIBLE);

代码示例来源:origin: DaxiaK/MyDiary

} else {
  SP_topic_detail_type = (Spinner) rootView.findViewById(R.id.SP_topic_detail_type);
  SP_topic_detail_type.setVisibility(View.VISIBLE);
  initTopicTypeSpinner();

代码示例来源:origin: stackoverflow.com

android:visibility="invisible"
android:visibility="visible"

 Spinner spinner = (Spinner) findViewById(R.id.mySpinner);
 spinner.setVisibility(View.INVISIBLE);

代码示例来源:origin: MicrosoftTranslator/Local-Feature-Android

private void showSpinners(boolean show) {
  fromSpinner.setVisibility(show ? View.VISIBLE : View.GONE);
  toSpinner.setVisibility(show ? View.VISIBLE : View.GONE);
}

代码示例来源:origin: stackoverflow.com

Spinner spinner = (Spinner)findViweById(R.id.spinnerInvisible);
ArrayAdapter spinnerArrayAdapter = new ArrayAdapter(this,
  android.R.layout.simple_spinner_dropdown_item,
    spinnerArray);
spinner.setAdapter(spinnerArrayAdapter);
spinner.setVisibility(View.VISIBLE);

代码示例来源:origin: PrivacyApps/calendar-import-export

public void run() {
    ArrayAdapter<E> adaptor = new ArrayAdapter<>(ctx, id, list);
    adaptor.setDropDownViewResource(dropId);
    spinner.setAdapter(adaptor);
    if (list.size() != 0)
      spinner.setVisibility(View.VISIBLE);
    button.setVisibility(View.VISIBLE);
  }
});

代码示例来源:origin: stackoverflow.com

private SpinnerAdapter spinnerAdapter;
private Spinner spinner;
private List<DataObject> spinnerData = new ArrayList<DataObject>();

private static final GsonBuilder GSON_BUILDER = new GsonBuilder();
private final Gson mGson = GSON_BUILDER.create();

public void onCreate(Bundle b) {
  ...

  //display first question to the user
  spinner = (Spinner) findViewById(R.id.spinner);
  assert spinner != null;
  spinner.setVisibility(View.VISIBLE);

  spinnerAdapter = new SpinnerAdapter(MainActivity.this, spinnerData);
  spinner.setAdapter(spinnerAdapter);

代码示例来源:origin: stackoverflow.com

case(R.id.buttonRem):
 final LayoutInflater spnInflater = (LayoutInflater) Context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 Spinner spinnerNew = (Spinner)spnInflater.inflater(R.layout.extra_spinner);
 spinnerNew.setVisibility(View.GONE);
 v.setVisibility(View.GONE);
 ViewGroup layout = (ViewGroup) spinnerNew.getParent();
 if(layout != null)
   layout.removeView(spinnerNew);
 break;

代码示例来源:origin: openmrs/openmrs-contrib-android-client

@Override
public void setLocationErrorOccurred(boolean errorOccurred) {
  this.loginValidatorWatcher.setLocationErrorOccurred(errorOccurred);
  mDropdownLocation.setVisibility(View.GONE);
  mLoginButton.setEnabled(!errorOccurred);
}

代码示例来源:origin: dimtion/Shaarlier

private void initAccountSpinner() {
  final Spinner accountSpinnerView = (Spinner) a_dialogView.findViewById(R.id.chooseAccount);
  ArrayAdapter adapter = new ArrayAdapter<>(this, R.layout.tags_list, this.allAccounts);
  accountSpinnerView.setAdapter(adapter);
  if (accountSpinnerView.getCount() <= 1) {
    accountSpinnerView.setVisibility(View.GONE);
  }
}

代码示例来源:origin: AppLozic/Applozic-Android-SDK

@Override
  public void onClick(View view) {
    touchCount += 1;
    if (touchCount == 5) {
      mSpinnerView.setVisibility(View.VISIBLE);
      touchCount = 0;
    } else {
      Toast.makeText(getApplicationContext(), getBaseContext().getString(R.string.click_more) + Integer.toString(5 - touchCount), Toast.LENGTH_SHORT).show();
    }
  }
});

代码示例来源:origin: casific/murmur

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(R.string.drawer_menu_contact);
  searchView = (EditText) ((MainActivity)getActivity()).getToolbar().findViewById(R.id.searchView);
  leftText = (TextView) ((MainActivity) getActivity()).getToolbar().findViewById(R.id.leftText);
  initSortSpinner();
  sortSpinner.setVisibility(View.GONE);
  View v = inflater.inflate(R.layout.contact_fragment, container, false);
  contactListView = (ListView) v.findViewById(R.id.listView);
  setListView();
  return v;
}

相关文章