android.widget.CheckBox.setEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(263)

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

CheckBox.setEnabled介绍

暂无

代码示例

代码示例来源:origin: card-io/card.io-Android-SDK

private void setScanExpiryEnabled() {
  mScanExpiryToggle.setEnabled(mEnableExpiryToggle.isChecked());
}

代码示例来源:origin: lingochamp/FileDownloader

@Override
public void addNotificationItem(BaseDownloadTask task) {
  super.addNotificationItem(task);
  if (wActivity.get() != null) {
    wActivity.get().showNotificationCb.setEnabled(false);
  }
}

代码示例来源:origin: lingochamp/FileDownloader

@Override
public void destroyNotification(BaseDownloadTask task) {
  super.destroyNotification(task);
  if (wActivity.get() != null) {
    wActivity.get().showNotificationCb.setEnabled(true);
    wActivity.get().downloadId = 0;
  }
}

代码示例来源:origin: smuyyh/BookReader

cb.setChecked(true);
cb.setEnabled(canEdit);
cb.setOnClickListener(new MyClickListener(i));

代码示例来源:origin: facebook/facebook-android-sdk

currentUserCheckBox.setEnabled(slot.getAccessToken() != null);

代码示例来源:origin: chrisk44/Hijacker

@Override
  public void onCheckedChanged(RadioGroup radioGroup, int i){
    titleView.setEnabled(true);
    startCmdView.setEnabled(true);
    stopCmdView.setEnabled(true);
    requirement_cb.setEnabled(true);
    has_process_name_cb.setEnabled(true);
    save_btn.setEnabled(true);
    requirement_cb.setText(i==R.id.st_rb ? R.string.requires_associated : R.string.requires_clients);
  }
});

代码示例来源:origin: chrisk44/Hijacker

lockedDelayView.setText(locked_delay);
pixie_dust_cb.setChecked(pixie_dust);
pixie_dust_cb.setEnabled(pixie_dust_enabled);
ignored_locked_cb.setChecked(ignore_locked);
eap_fail_cb.setChecked(eap_fail);

代码示例来源:origin: westnordost/StreetComplete

@Override public void onBind(final QuestVisibility item)
{
  this.item = item;
  int colorResId = item.isInteractionEnabled() ? android.R.color.white : R.color.greyed_out;
  itemView.setBackgroundResource(colorResId);
  iconView.setImageResource(item.questType.getIcon());
  textView.setText(textView.getResources().getString(item.questType.getTitle(),"…"));
  checkBox.setOnCheckedChangeListener(null);
  checkBox.setChecked(item.visible);
  checkBox.setEnabled(item.isInteractionEnabled());
  checkBox.setOnCheckedChangeListener(this);
  if(!isEnabledInCurrentCountry())
  {
    String cc = currentCountryCodes.isEmpty() ? "Atlantis" : currentCountryCodes.get(0);
    textCountryDisabled.setText(String.format(
      textCountryDisabled.getResources().getString(R.string.questList_disabled_in_country),
      new Locale("", cc).getDisplayCountry()
    ));
    textCountryDisabled.setVisibility(View.VISIBLE);
  }
  else
  {
    textCountryDisabled.setVisibility(View.GONE);
  }
  updateSelectionStatus();
}

代码示例来源:origin: chrisk44/Hijacker

pixie_dust_cb.setEnabled(false);
  pixie_dust_enabled = false;
  if(chroot_check==CHROOT_DIR_MISSING) Toast.makeText(getActivity(), getString(R.string.chroot_notfound), LENGTH_SHORT).show();
  else Toast.makeText(getActivity(), getString(R.string.chroot_both_notfound), LENGTH_SHORT).show();
}else{
  pixie_dust_cb.setEnabled(true);
  pixie_dust_enabled = true;

代码示例来源:origin: chrisk44/Hijacker

startCmdView.setEnabled(true);
stopCmdView.setEnabled(true);
requirement_cb.setEnabled(true);
has_process_name_cb.setEnabled(true);
processNameView.setEnabled(action.hasProcessName());
save_btn.setEnabled(true);

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

private void unlockRemovableDevices(boolean flag) {
  mCDenable.setEnabled(flag);
  mFDAenable.setEnabled(flag);
  mFDBenable.setEnabled(flag);
  mSDenable.setEnabled(flag);
}

代码示例来源:origin: NightscoutFoundation/xDrip

private void maskAlternatingCheckbox(boolean state, CheckBox alternatingCheck) {
  if (state) {
    alternatingCheck.setEnabled(true);
  } else {
    alternatingCheck.setEnabled(false);
    alternatingCheck.setChecked(false);
  }
}

代码示例来源:origin: halfhp/androidplot

private void onS2CheckBoxClicked() {
  if (nickCB.isChecked()) {
    plot.addSeries(nickSeries, nickFormatter);
    r3CheckBox.setEnabled(true);
    r4CheckBox.setEnabled(true);
  } else {
    plot.removeSeries(nickSeries);
    r3CheckBox.setEnabled(false);
    r4CheckBox.setEnabled(false);
  }
  plot.redraw();
}

代码示例来源:origin: amapapi/Android_Location_Demo

/**
 * 设置控件的可用状态
 */
private void setViewEnable(boolean isEnable) {
  etInterval.setEnabled(isEnable);
  etAlarm.setEnabled(isEnable);
  cbAddress.setEnabled(isEnable);
  cbGpsFirst.setEnabled(isEnable);
}

代码示例来源:origin: AriesHoo/UIWidget

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  if (delegate != null) {
    delegate.init();
  }
}

代码示例来源:origin: wiglenet/wigle-wifi-wardriving

private void eraseDonate() {
  final View view = getView();
  if (view != null) {
    final CheckBox donate = (CheckBox) view.findViewById(R.id.donate);
    donate.setEnabled(false);
    donate.setVisibility(View.GONE);
  }
}

代码示例来源:origin: sevar83/indeterminate-checkbox

@Override
  public void onClick(View v) {
    checkBox.setEnabled(false);
    appCompatCheckBox.setEnabled(false);
    indetermCheckBox.setEnabled(false);
    radio.setEnabled(false);
  }
});

代码示例来源:origin: derry/delion

/**
 * Sets the enabled state of the main contents, and hides or shows the verification overlay.
 * @param enabled True if the inputs should be useable, false if the verification overlay
 *        obscures them.
 */
private void setInputsEnabled(boolean enabled) {
  mCardUnmaskInput.setEnabled(enabled);
  mMonthInput.setEnabled(enabled);
  mYearInput.setEnabled(enabled);
  mStoreLocallyCheckbox.setEnabled(enabled);
  mDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(enabled);
}

代码示例来源:origin: andstatus/andstatus

private void onSearchContextChanged() {
  isInternetSearchEnabled = parentActivity.getMyContext()
      .origins().isSearchSupported(
          getSearchObjects(), getOrigin(), isCombined());
  internetSearch.setEnabled(isInternetSearchEnabled);
  if (!isInternetSearchEnabled && internetSearch.isChecked()) {
    internetSearch.setChecked(false);
  }
}

代码示例来源:origin: kollerlukas/Camera-Roll-Android-App

@Override
public void setFile(File_POJO file) {
  super.setFile(file);
  CheckBox checkBox = itemView.findViewById(R.id.checkbox);
  checkBox.setTag(file.getPath());
  setOnCheckedChangeListener(null);
  checkBox.setChecked(file.excluded);
  ArrayList<String> excludedPaths = Provider.getExcludedPaths();
  boolean enabled = !Provider.isDirExcludedBecauseParentDirIsExcluded(
      file.getPath(), excludedPaths);
  checkBox.setEnabled(enabled);
}

相关文章