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

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

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

Spinner.invalidate介绍

暂无

代码示例

代码示例来源:origin: limboemu/limbo

private void populateSoundcardConfig() {
  String[] arraySpinner = {"None", "sb16", "ac97", "adlib", "cs4231a", "gus", "es1370", "hda", "pcspk", "all"};
  ArrayAdapter<String> sndAdapter = new ArrayAdapter<String>(this, R.layout.custom_spinner_item, arraySpinner);
  sndAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
  this.mSoundCard.setAdapter(sndAdapter);
  this.mSoundCard.invalidate();
}

代码示例来源:origin: limboemu/limbo

private void populateRAM() {
  String[] arraySpinner = new String[256];
  arraySpinner[0] = 4 + "";
  for (int i = 1; i < arraySpinner.length; i++) {
    arraySpinner[i] = i * 8 + "";
  }
  ;
  ArrayAdapter<String> ramAdapter = new ArrayAdapter<String>(this, R.layout.custom_spinner_item, arraySpinner);
  ramAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
  this.mRamSize.setAdapter(ramAdapter);
  this.mRamSize.invalidate();
}

代码示例来源:origin: limboemu/limbo

private void populateCPUNum() {
  String[] arraySpinner = new String[Config.MAX_CPU_NUM];
  for (int i = 0; i < arraySpinner.length; i++) {
    arraySpinner[i] = (i + 1) + "";
  }
  ArrayAdapter<String> cpuNumAdapter = new ArrayAdapter<String>(this, R.layout.custom_spinner_item, arraySpinner);
  cpuNumAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
  this.mCPUNum.setAdapter(cpuNumAdapter);
  this.mCPUNum.invalidate();
}

代码示例来源:origin: limboemu/limbo

private void populateNet() {
  String[] arraySpinner = {"None", "User", "TAP"};
  ArrayAdapter<String> netAdapter = new ArrayAdapter<String>(this, R.layout.custom_spinner_item, arraySpinner);
  netAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
  this.mNetConfig.setAdapter(netAdapter);
  this.mNetConfig.invalidate();
}

代码示例来源:origin: limboemu/limbo

private void populateHDCacheConfig() {
  String[] arraySpinner = {"default", "none", "writeback", "writethrough"};
  ArrayAdapter<String> hdCacheAdapter = new ArrayAdapter<String>(this, R.layout.custom_spinner_item, arraySpinner);
  hdCacheAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
  this.mHDCacheConfig.setAdapter(hdCacheAdapter);
  this.mHDCacheConfig.invalidate();
}

代码示例来源:origin: limboemu/limbo

private void populateUI() {
  ArrayList<String> arrList = new ArrayList<String>();
  arrList.add("VNC");
  if (Config.enable_SDL)
    arrList.add("SDL");
  if (Config.enable_SPICE)
    arrList.add("SPICE");
  ArrayAdapter<String> uiAdapter = new ArrayAdapter<String>(this, R.layout.custom_spinner_item, arrList);
  uiAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
  this.mUI.setAdapter(uiAdapter);
  this.mUI.invalidate();
}

代码示例来源:origin: limboemu/limbo

private void populateKeyboardLayout() {
  ArrayList<String> arrList = new ArrayList<String>();
  arrList.add("en-us");
  ArrayAdapter<String> keyboardAdapter = new ArrayAdapter<String>(this, R.layout.custom_spinner_item, arrList);
  keyboardAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
  this.mKeyboard.setAdapter(keyboardAdapter);
  this.mKeyboard.invalidate();
  //TODO: for now we use only English keyboard, add more layouts
  int pos = 0;
  if (pos >= 0) {
    this.mKeyboard.setSelection(pos);
  }
}

代码示例来源:origin: limboemu/limbo

private void populateBootDevices() {
  ArrayList<String> bootDevicesList = new ArrayList<String>();
  bootDevicesList.add("Default");
  bootDevicesList.add("CD Rom");
  bootDevicesList.add("Hard Disk");
  if(Config.enableEmulatedFloppy)
    bootDevicesList.add("Floppy");
  String[] arraySpinner = bootDevicesList.toArray(new String[bootDevicesList.size()]);
  ArrayAdapter<String> bootDevAdapter = new ArrayAdapter<String>(this, R.layout.custom_spinner_item, arraySpinner);
  bootDevAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
  this.mBootDevices.setAdapter(bootDevAdapter);
  this.mBootDevices.invalidate();
}

代码示例来源:origin: limboemu/limbo

private void populateSpinner() {
  ArrayList<String> arraySpinner = new ArrayList<>();
  arraySpinner.add("Other");
  Iterator<String> iter = Config.osImages.keySet().iterator();
  while (iter.hasNext()) {
    arraySpinner.add(iter.next());
  }
  ArrayAdapter<String> osAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, arraySpinner);
  osAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  mOS.setAdapter(osAdapter);
  mOS.invalidate();
}

代码示例来源:origin: limboemu/limbo

private void populateMouse() {
    ArrayList<String> arrList = new ArrayList<String>();
    arrList.add("ps2");
    arrList.add("usb-mouse");
    arrList.add("usb-tablet" + fixMouseDescr);

    ArrayAdapter<String> mouseAdapter = new ArrayAdapter<String>(this, R.layout.custom_spinner_item, arrList);
    mouseAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
    this.mMouse.setAdapter(mouseAdapter);
    this.mMouse.invalidate();
//
//        int pos = LimboSettingsManager.getMouseSetting(activity);
//        if (pos >= 0) {
//            this.mMouse.setSelection(pos);
//        }
  }

代码示例来源:origin: limboemu/limbo

private void populateOrientation() {
  ArrayList<String> arrList = new ArrayList<String>();
  arrList.add("Auto");
  arrList.add("Landscape");
  arrList.add("Landscape Reverse");
  arrList.add("Portrait");
  arrList.add("Portrait Reverse");
  ArrayAdapter<String> orientationAdapter = new ArrayAdapter<String>(this, R.layout.custom_spinner_item, arrList);
  orientationAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
  this.mOrientation.setAdapter(orientationAdapter);
  this.mOrientation.invalidate();
  int pos = LimboSettingsManager.getOrientationSetting(activity);
  if (pos >= 0) {
    this.mOrientation.setSelection(pos);
  }
}

代码示例来源:origin: limboemu/limbo

public void run() {
    if (snapshot != null && !snapshot.equals("")) {
      int pos = ((ArrayAdapter<String>) mSnapshot.getAdapter()).getPosition(snapshot);
      if (pos >= 0) {
        mSnapshot.setSelection(pos);
        mSnapshot.invalidate();
      } else {
        mSnapshot.setSelection(0);
      }
    } else {
      mSnapshot.setSelection(0);
    }
  }
});

代码示例来源:origin: limboemu/limbo

vgaAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
this.mVGAConfig.setAdapter(vgaAdapter);
this.mVGAConfig.invalidate();

代码示例来源:origin: limboemu/limbo

private void populateArch() {
  ArrayList<String> arrList = new ArrayList<String>();
  if (Config.enable_X86)
    arrList.add("x86");
  if (Config.enable_X86_64)
    arrList.add("x64");
  if (Config.enable_ARM)
    arrList.add("ARM");
  if (Config.enable_ARM64)
    arrList.add("ARM64");
  if (Config.enable_MIPS)
    arrList.add("MIPS");
  if (Config.enable_PPC)
    arrList.add("PPC");
  if (Config.enable_PPC)
    arrList.add("PPC64");
  if (Config.enable_m68k)
    arrList.add("m68k");
  if (Config.enable_sparc)
    arrList.add("SPARC");
  if (Config.enable_sparc64)
    arrList.add("SPARC64");
  ArrayAdapter<String> archAdapter = new ArrayAdapter<String>(this, R.layout.custom_spinner_item, arrList);
  archAdapter.setDropDownViewResource(R.layout.custom_spinner_dropdown_item);
  this.mArch.setAdapter(archAdapter);
  this.mArch.invalidate();
}

代码示例来源:origin: GeoODK/collect

public void setGeoTraceMode(View view){
  boolean checked = ((RadioButton) view).isChecked();
  switch(view.getId()) {
    case R.id.trace_manual:
      if (checked){
        TRACE_MODE = 0;
        time_units.setVisibility(View.GONE);
        time_delay.setVisibility(View.GONE);
        time_delay.invalidate();
        time_units.invalidate();
      }
      break;
    case R.id.trace_automatic:
      if (checked){
        TRACE_MODE = 1;
        time_units.setVisibility(View.VISIBLE);
        time_delay.setVisibility(View.VISIBLE);
        time_delay.invalidate();
        time_units.invalidate();
      }
      break;
  }
}

代码示例来源:origin: limboemu/limbo

this.mNicCard.invalidate();

代码示例来源:origin: limboemu/limbo

this.mMachineType.setAdapter(machineTypeAdapter);
this.mMachineType.invalidate();
int pos = machineTypeAdapter.getPosition(machineType);
if (pos >= 0) {

代码示例来源:origin: limboemu/limbo

this.mCPU.setAdapter(cpuAdapter);
this.mCPU.invalidate();

相关文章