@Override public void onBindViewHolder(PreferenceViewHolder holder) { super.onBindViewHolder(holder); final Spinner spinner = (Spinner) holder.findViewById(R.id.spinner); holder.itemView.setOnClickListener(v -> spinner.performClick()); spinner.setAdapter(new SpinnerAdapter() {
@Override public void onBindViewHolder(PreferenceViewHolder holder) { super.onBindViewHolder(holder); holder.itemView.setClickable(false); for (int i = 0; i < BUTTONS.size(); i++) { final int buttonId = BUTTONS.keyAt(i); final String value = BUTTONS.valueAt(i); View button = holder.findViewById(buttonId); button.setClickable(true); button.setOnClickListener(v -> { mSelectedTheme = value; if (shouldDisableDependents()) { Preferences.Theme.disableAutoDayNight(getContext()); } setSummary(VALUES.get(value).summary); persistString(value); }); } }
@Override public void onBindViewHolder(PreferenceViewHolder holder) { super.onBindViewHolder(holder); backupButton = (Button) holder.findViewById(R.id.sync_button); backupButton.setOnClickListener(this); restoreButton = (Button) holder.findViewById(R.id.restore_button); restoreButton.setOnClickListener(this); statusIcon = (ImageView) holder.findViewById(R.id.status_icon); statusLabel = (TextView) holder.findViewById(R.id.status_label); View syncDetails = holder.findViewById(R.id.details_sync); syncDetailsLabel = (TextView) syncDetails.findViewById(R.id.details_sync_label); progressBar = (ProgressBar) syncDetails.findViewById(R.id.details_sync_progress); idle(); App.register(this); }
private void syncCheckboxView(final @NonNull PreferenceViewHolder holder) { View checkboxView = holder.findViewById(android.R.id.checkbox); if (checkboxView == null) { checkboxView = holder.findViewById(R.id.checkbox); } syncCheckboxView(checkboxView); }
@TargetApi(Build.VERSION_CODES.N) private void syncSwitchView(@NonNull final PreferenceViewHolder holder) { View switchView = holder.findViewById(android.R.id.switch_widget); if (switchView == null) { switchView = holder.findViewById(R.id.switchWidget); } this.syncSwitchView(switchView); }
@Override public void onBindViewHolder(@NonNull PreferenceViewHolder holder) { if (holder.findViewById(R.id.spinner) != null) { Log.w("DropDownPreference", "This version of DropDownPreference doesn't work with a Spinner in the layout." + "\na) Please remove the Spinner from your layout." + "\nb) Extend and use Android Support Library DropDownPreference."); } super.onBindViewHolder(holder); } }
/** * Sync a summary holder contained within holder's subhierarchy with the correct summary text. * * @param holder PreferenceViewHolder which holds a reference to the summary view */ protected void syncSummaryView(@NonNull PreferenceViewHolder holder) { // Sync the summary holder View view = holder.findViewById(android.R.id.summary); syncSummaryView(view); }
public void onBindViewHolder(PreferenceViewHolder holder) { super.onBindViewHolder(holder); View icon = holder.findViewById(R.id.icon_frame); ImageView banner = (ImageView) holder.findViewById(R.id.banner); if (this.mBanner != null) { banner.setImageDrawable(this.mBanner); banner.setVisibility(0); icon.setVisibility(8); return; } banner.setVisibility(8); icon.setVisibility(0); } }
@Override public void onBindViewHolder(final @NonNull PreferenceViewHolder holder) { super.onBindViewHolder(holder); if (mDrawable == null) { mDrawable = buildColorDrawable(mColor); } final ImageView imageView = (ImageView) holder.findViewById(R.id.image); imageView.setImageDrawable(mDrawable); }
public void onBindViewHolder(@NonNull PreferenceViewHolder holder) { TextView titleView = (TextView) holder.findViewById(android.R.id.title); if (titleView != null) { if (mHasTitleTextAppearance) { TextViewCompat.setTextAppearance(titleView, mTitleTextAppearance); } if (mHasTitleTextColor) { titleView.setTextColor(mTitleTextColor); } } TextView subtitleView = (TextView) holder.findViewById(android.R.id.summary); if (subtitleView != null) { if (mHasSubtitleTextAppearance) { TextViewCompat.setTextAppearance(subtitleView, mSubtitleTextAppearance); } if (mHasSubtitleTextColor) { subtitleView.setTextColor(mSubtitleTextColor); } } }
@Override public void onBindViewHolder(PreferenceViewHolder holder) { super.onBindViewHolder(holder); ImageView previewView = (ImageView) holder.findViewById(R.id.color_view); ColorUtils.setColorViewValue(previewView, value, false, colorShape); }
@Override public void onBindViewHolder(PreferenceViewHolder holder) { super.onBindViewHolder(holder); mColorView = holder.findViewById(com.thebluealliance.spectrum.R.id.color_preference_widget); updateColorView(); }
@Override public void onBindViewHolder(@NonNull final PreferenceViewHolder holder) { super.onBindViewHolder(holder); final SeekBar seekBar = (SeekBar) holder.findViewById(R.id.seekbar); //noinspection ConstantConditions if (seekBar == null) { Log.e(TAG, "SeekBar view is null in onBindViewHolder."); return; } holder.itemView.setOnKeyListener(buildSeekBarKeyListener(seekBar)); final TextView info = (TextView) holder.findViewById(R.id.seekbar_value); if (info != null) { replaceInfoView(info); bindInfo(info); bindInfoAnchor(info); } seekBar.setOnSeekBarChangeListener(mSeekBarChangeListener); seekBar.setMax(mMax - mMin); // If the increment is not zero, use that. Otherwise, use the default mKeyProgressIncrement // in AbsSeekBar when it's zero. This default increment value is set by AbsSeekBar // after calling setMax. That's why it's important to call setKeyProgressIncrement after // calling setMax() since setMax() can change the increment value. if (mSeekBarIncrement != 0) { seekBar.setKeyProgressIncrement(mSeekBarIncrement); } else { mSeekBarIncrement = seekBar.getKeyProgressIncrement(); } seekBar.setProgress(mSeekBarValue - mMin); seekBar.setEnabled(isEnabled()); }