本文整理汇总了Java中android.support.v7.preference.PreferenceViewHolder.findViewById方法的典型用法代码示例。如果您正苦于以下问题:Java PreferenceViewHolder.findViewById方法的具体用法?Java PreferenceViewHolder.findViewById怎么用?Java PreferenceViewHolder.findViewById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.preference.PreferenceViewHolder
的用法示例。
在下文中一共展示了PreferenceViewHolder.findViewById方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
holder.itemView.setClickable(false); // disable parent click
//Loop through all the ThemeViews
for(WidgetTheme widgetTheme : WidgetTheme.values()) {
final String name = widgetTheme.name();
final int themeViewId = widgetTheme.getThemeViewId();
final int summaryRes = widgetTheme.getSummaryRes();
View button = holder.findViewById(themeViewId);
button.setClickable(true);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setSummary(summaryRes);
persistString(name);
}
});
}
}
示例2: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@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);
});
}
}
示例3: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
// We get the reference to the mSeekBar
mSeekBar = (SeekBar) holder.findViewById(R.id.size_seek_bar);
mSeekBar.setMax(mMaxValue);
mSeekBar.setOnSeekBarChangeListener(this);
mSeekBarValueTextView = (TextView) holder.findViewById(R.id.seek_bar_value);
mTitleView = (TextView) holder.findViewById(R.id.title);
mTitleView.setText(getTitle());
// This is called after the initial value is set
mSeekBar.setProgress(mProgressValue);
updateCurrentValue(mProgressValue);
}
示例4: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
colorWidget = (ImageView) holder.findViewById(R.id.color_picker_widget);
setColorOnWidget(color);
}
示例5: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
View colorView = holder.findViewById(R.id.color_view);
colorView.setBackgroundResource(R.drawable.shape_circle);
colorView.getBackground().setColorFilter(getSelectedColor(), PorterDuff.Mode.SRC_IN);
}
示例6: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder viewHolder) {
super.onBindViewHolder(viewHolder);
colorView = viewHolder.findViewById(R.id.color_preview);
((GradientDrawable)
((LayerDrawable) colorView.getBackground())
.findDrawableByLayerId(R.id.color))
.setColor(color);
}
示例7: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
App app = (App) getContext().getApplicationContext();
TextView user = (TextView) holder.findViewById(R.id.user_Name);
ImageView picture = (ImageView) holder.findViewById(R.id.user_Profile);
String name = app.account.getName();
if (name == null) {
name = "User";
}
user.setText(name);
Picasso.with(getContext()).load(app.account.getPictureURL()).placeholder(R.drawable.ic_placeholder).into(picture);
}
示例8: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
mColorView = holder.findViewById(com.thebluealliance.spectrum.R.id.color_preference_widget);
updateColorView();
}
示例9: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
LinearLayout container = (LinearLayout) holder.findViewById(R.id.pref_repeating_container);
container.removeAllViews();
for(int i = 0; i < mRepeatingDays.length; i++) {
DayView dayView = new DayView(getContext(), this, i);
dayView.setText(mDayNames[i]);
dayView.setRepeating(mRepeatingDays[i]);
container.addView(dayView);
}
super.onBindViewHolder(holder);
}
示例10: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM);
int currentVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_ALARM);
mVolumeLevel = (SeekBar) holder.findViewById(R.id.volume_level);
mVolumeLevel.setMax(maxVolume);
mVolumeLevel.setProgress(currentVolume);
mVolumeLevel.setOnSeekBarChangeListener(this);
}
示例11: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
mColorView = holder.findViewById(R.id.color_preference_widget);
updateColorView();
}
示例12: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder view) {
super.onBindViewHolder(view);
if (!TextUtils.isEmpty(mContentDescription)) {
final TextView titleView = (TextView) view.findViewById(android.R.id.title);
titleView.setContentDescription(mContentDescription);
}
ViewGroup.LayoutParams layoutParams = view.findViewById(R.id.icon_frame).getLayoutParams();
if (layoutParams instanceof LinearLayout.LayoutParams) {
if (((LinearLayout.LayoutParams) layoutParams).leftMargin < 0) {
((LinearLayout.LayoutParams) layoutParams).leftMargin = 0;
}
}
dimIcon(shouldDimIcon());
}
示例13: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
TextView view = (TextView) holder.findViewById(android.R.id.summary);
if (view != null) {
view.setMaxLines(Integer.MAX_VALUE);
}
}
示例14: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder)
{
super.onBindViewHolder(holder);
LightColorView color = (LightColorView) holder.findViewById(R.id.lightColor);
if (color != null) {
color.setColor(value);
}
}
示例15: onBindViewHolder
import android.support.v7.preference.PreferenceViewHolder; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
TextView textView = (TextView) holder.findViewById(android.R.id.title);
textView.setAllCaps(true);
textView.setTypeface(null, Typeface.BOLD);
textView.setTextColor(ThemeStore.accentColor(getContext()));
}