android.support.v7.preference.Preference.onBindViewHolder()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(285)

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

Preference.onBindViewHolder介绍

暂无

代码示例

代码示例来源:origin: hidroh/materialistic

@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
  super.onBindViewHolder(holder);
  final Spinner spinner = (Spinner) holder.findViewById(R.id.spinner);
  holder.itemView.setOnClickListener(v -> spinner.performClick());

代码示例来源:origin: hidroh/materialistic

@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);
    });
  }
}

代码示例来源:origin: jberkel/sms-backup-plus

@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);
}

代码示例来源:origin: yukuku/androidbible

@Override
public void onBindViewHolder(final PreferenceViewHolder holder) {
  super.onBindViewHolder(holder);
  // Set our custom views inside the layout
  final View box = holder.itemView.findViewById(R.id.ambilwarna_pref_widget_box);
  if (box != null) {
    box.setBackgroundColor(value);
  }
}

代码示例来源:origin: goodtime-productivity/Goodtime

@Override
public void onBindViewHolder(PreferenceViewHolder viewRoot) {
  super.onBindViewHolder(viewRoot);
  controllerDelegate.onBind(viewRoot.itemView);
}

代码示例来源:origin: kizitonwose/colorpreference

@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
  super.onBindViewHolder(holder);
  ImageView previewView = (ImageView) holder.findViewById(R.id.color_view);
  ColorUtils.setColorViewValue(previewView, value, false, colorShape);
}

代码示例来源:origin: consp1racy/android-support-preference

@Override
public void onBindViewHolder(@NonNull PreferenceViewHolder holder) {
  super.onBindViewHolder(holder);
  mPreferenceTextHelper.onBindViewHolder(holder);
  final boolean hasLongClickListener = hasOnPreferenceLongClickListener();
  if (hasLongClickListener) {
    holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
      @Override
      public boolean onLongClick(@NonNull View v) {
        return mOnPreferenceLongClickListener.onLongClick(Preference.this, v);
      }
    });
  } else {
    holder.itemView.setOnLongClickListener(null);
  }
  holder.itemView.setLongClickable(hasLongClickListener && isSelectable());
}

相关文章