本文整理了Java中android.widget.CheckBox.setVisibility()
方法的一些代码示例,展示了CheckBox.setVisibility()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CheckBox.setVisibility()
方法的具体详情如下:
包路径:android.widget.CheckBox
类名称:CheckBox
方法名:setVisibility
暂无
代码示例来源:origin: facebook/facebook-android-sdk
@Override
void updateCheckboxState(CheckBox checkBox, boolean graphObjectSelected) {
checkBox.setChecked(graphObjectSelected);
int visible = (graphObjectSelected || selectionStrategy.shouldShowCheckBoxIfUnselected())
? View.VISIBLE : View.GONE;
checkBox.setVisibility(visible);
}
}
代码示例来源:origin: k9mail/k-9
private void updateViewVisibility(boolean usingCertificates) {
if (usingCertificates) {
// hide password fields, show client certificate spinner
mPasswordView.setVisibility(View.GONE);
mShowPasswordCheckBox.setVisibility(View.GONE);
mClientCertificateSpinner.setVisibility(View.VISIBLE);
} else {
// show password fields, hide client certificate spinner
mPasswordView.setVisibility(View.VISIBLE);
mShowPasswordCheckBox.setVisibility(View.VISIBLE);
mClientCertificateSpinner.setVisibility(View.GONE);
}
}
代码示例来源:origin: commonsguy/cw-omnibus
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
CheckBox cb=(CheckBox)findViewById(R.id.showCalendar);
if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.HONEYCOMB) {
cb.setOnCheckedChangeListener(this);
}
else {
cb.setVisibility(View.GONE);
}
GregorianCalendar now=new GregorianCalendar();
picker=(DatePicker)findViewById(R.id.picker);
picker.init(now.get(Calendar.YEAR), now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH), this);
}
代码示例来源:origin: ankidroid/Anki-Android
checkBox.setVisibility(View.VISIBLE);
if (mCheckedCardPositions.contains(position)) {
checkBox.setChecked(true);
} else {
checkBox.setChecked(false);
checkBox.setVisibility(View.GONE);
代码示例来源:origin: k9mail/k-9
holder.flagged.setVisibility(fragment.stars ? View.VISIBLE : View.GONE);
holder.flagged.setOnClickListener(holder);
代码示例来源:origin: willowtreeapps/spruce-android
case INLINE_SORT:
linearRadioGroup.setVisibility(View.GONE);
linearReversed.setVisibility(View.VISIBLE);
positionalRadioGroup.setVisibility(View.GONE);
verticalWeightLayout.setVisibility(View.GONE);
case LINEAR_SORT:
linearRadioGroup.setVisibility(View.VISIBLE);
linearReversed.setVisibility(View.VISIBLE);
positionalRadioGroup.setVisibility(View.GONE);
verticalWeightLayout.setVisibility(View.GONE);
verticalWeightLayout.setVisibility(View.GONE);
horizontalWeightLayout.setVisibility(View.GONE);
linearReversed.setVisibility(View.VISIBLE);
linearRadioGroup.setVisibility(View.GONE);
corneredRadioGroup.setVisibility(View.GONE);
verticalWeightLayout.setVisibility(View.VISIBLE);
horizontalWeightLayout.setVisibility(View.VISIBLE);
linearReversed.setVisibility(View.VISIBLE);
linearRadioGroup.setVisibility(View.GONE);
corneredRadioGroup.setVisibility(View.GONE);
break;
default:
linearReversed.setVisibility(View.GONE);
positionalRadioGroup.setVisibility(View.GONE);
verticalWeightLayout.setVisibility(View.GONE);
代码示例来源:origin: k9mail/k-9
} else {
mUseIncomingView.setChecked(false);
mUseIncomingView.setVisibility(View.GONE);
mOutgoingPasswordView.setEnabled(true);
代码示例来源:origin: Rukey7/MvpApp
cbDelete.setVisibility(View.VISIBLE);
cbDelete.setChecked(mSparseItemChecked.get(holder.getAdapterPosition()));
} else {
cbDelete.setVisibility(View.GONE);
cbDelete.setChecked(false);
代码示例来源:origin: seven332/EhViewer
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_set_security);
setNavigationIcon(R.drawable.v_arrow_left_dark_x24);
mPatternView = (LockPatternView) ViewUtils.$$(this, R.id.pattern_view);
mCancel = ViewUtils.$$(this, R.id.cancel);
mSet = ViewUtils.$$(this, R.id.set);
mFingerprint = (CheckBox) ViewUtils.$$(this, R.id.fingerprint_checkbox);
String pattern = Settings.getSecurity();
if (!TextUtils.isEmpty(pattern)) {
mPatternView.setPattern(LockPatternView.DisplayMode.Correct,
LockPatternUtils.stringToPattern(pattern));
}
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
FingerprintManager fingerprintManager = getSystemService(FingerprintManager.class);
// The line below prevents the false positive inspection from Android Studio
// noinspection ResourceType
if (fingerprintManager != null && hasEnrolledFingerprints(fingerprintManager)) {
mFingerprint.setVisibility(View.VISIBLE);
mFingerprint.setChecked(Settings.getEnableFingerprint());
}
}
mCancel.setOnClickListener(this);
mSet.setOnClickListener(this);
}
代码示例来源:origin: Rukey7/MvpApp
cbDelete.setVisibility(View.VISIBLE);
cbDelete.setChecked(mSparseItemChecked.get(holder.getAdapterPosition()));
} else {
cbDelete.setVisibility(View.GONE);
cbDelete.setChecked(false);
代码示例来源:origin: k9mail/k-9
findViewById(R.id.compression_section).setVisibility(View.GONE);
findViewById(R.id.compression_label).setVisibility(View.GONE);
mSubscribedFoldersOnly.setVisibility(View.GONE);
} else if (settings.type.equals(Protocols.IMAP)) {
serverLabelView.setText(R.string.account_setup_incoming_imap_server_label);
findViewById(R.id.compression_section).setVisibility(View.GONE);
findViewById(R.id.compression_label).setVisibility(View.GONE);
mSubscribedFoldersOnly.setVisibility(View.GONE);
代码示例来源:origin: ukanth/afwall
private CheckBox removeSupport(View convertView, int id) {
CheckBox check = (CheckBox) convertView.findViewById(id);
check.setVisibility(View.GONE);
return check;
}
代码示例来源:origin: ukanth/afwall
private CheckBox addSupport(View convertView, boolean action, int id) {
CheckBox check = (CheckBox) convertView.findViewById(id);
check.setVisibility(View.VISIBLE);
/* if (action) {
check.setOnCheckedChangeListener(this);
}*/
return check;
}
代码示例来源:origin: k9mail/k-9
mPushEnable.setVisibility(View.GONE);
} else {
mPushEnable.setChecked(true);
代码示例来源:origin: googlesamples/android-FingerprintDialog
private void updateStage() {
switch (mStage) {
case FINGERPRINT:
mCancelButton.setText(R.string.cancel);
mSecondDialogButton.setText(R.string.use_password);
mFingerprintContent.setVisibility(View.VISIBLE);
mBackupContent.setVisibility(View.GONE);
break;
case NEW_FINGERPRINT_ENROLLED:
// Intentional fall through
case PASSWORD:
mCancelButton.setText(R.string.cancel);
mSecondDialogButton.setText(R.string.ok);
mFingerprintContent.setVisibility(View.GONE);
mBackupContent.setVisibility(View.VISIBLE);
if (mStage == Stage.NEW_FINGERPRINT_ENROLLED) {
mPasswordDescriptionTextView.setVisibility(View.GONE);
mNewFingerprintEnrolledTextView.setVisibility(View.VISIBLE);
mUseFingerprintFutureCheckBox.setVisibility(View.VISIBLE);
}
break;
}
}
代码示例来源:origin: chat-sdk/chat-sdk-android
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
int type = getItemViewType(position);
final Object item = items.get(position);
holder.itemView.setOnClickListener(view -> onClickSubject.onNext(item));
if(type == TYPE_HEADER) {
HeaderViewHolder hh = (HeaderViewHolder) holder;
String header = (String) item;
hh.textView.setText(header);
}
if(type == TYPE_USER) {
UserViewHolder uh = (UserViewHolder) holder;
UserListItem user = (UserListItem) item;
uh.nameTextView.setText(user.getName());
uh.availabilityImageView.setImageResource(AvailabilityHelper.imageResourceIdForAvailability(user.getAvailability()));
uh.statusTextView.setText(user.getStatus());
Timber.v("User: " + user.getName() + " Availability: " + user.getAvailability());
uh.avatarImageView.setImageURI(user.getAvatarURL());
if (isMultiSelect && user instanceof User) {
uh.checkBox.setVisibility(View.VISIBLE);
uh.checkBox.setChecked(selectedUsersPositions.get(position));
uh.availabilityImageView.setVisibility(View.INVISIBLE);
}
else {
uh.availabilityImageView.setVisibility(View.VISIBLE);
}
}
}
代码示例来源:origin: westnordost/StreetComplete
public void findSource(final long questId, final QuestGroup group, @Nullable final Location location,
final Listener listener)
{
if(dontShowAgain || isWithinSurveyDistance(questId, group, location))
{
listener.onFindQuestSourceResult(SURVEY);
}
else
{
View inner = LayoutInflater.from(activity).inflate(
R.layout.quest_source_dialog_layout, null, false);
final CheckBox checkBox = inner.findViewById(R.id.checkBoxDontShowAgain);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(activity);
alertDialogBuilder
.setTitle(R.string.quest_source_dialog_title)
.setView(inner)
.setPositiveButton(R.string.quest_generic_confirmation_yes, (dialog, which) ->
{
++timesShown;
dontShowAgain = checkBox.isChecked();
listener.onFindQuestSourceResult(SURVEY);
})
.setNegativeButton(android.R.string.cancel, null);
checkBox.setVisibility(timesShown < 2 ? View.GONE : View.VISIBLE);
alertDialogBuilder.show();
}
}
代码示例来源: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: konradrenner/kolabnotes-android
void showExtendedOptions(){
mPortView.setVisibility(View.VISIBLE);
mEnableSSLView.setVisibility(View.VISIBLE);
mSyncView.setVisibility(View.VISIBLE);
mKolabView.setVisibility(View.VISIBLE);
mSharedFoldersView.setVisibility(View.VISIBLE);
mRootFolderView.setVisibility(View.VISIBLE);
mIntervallType.setVisibility(View.VISIBLE);
}
代码示例来源:origin: konradrenner/kolabnotes-android
void hideExtendedOptions(){
mPortView.setVisibility(View.INVISIBLE);
mEnableSSLView.setVisibility(View.INVISIBLE);
mSyncView.setVisibility(View.INVISIBLE);
mKolabView.setVisibility(View.INVISIBLE);
mSharedFoldersView.setVisibility(View.INVISIBLE);
mRootFolderView.setVisibility(View.INVISIBLE);
mIntervallType.setVisibility(View.INVISIBLE);
}
内容来源于网络,如有侵权,请联系作者删除!