当前位置: 首页>>代码示例>>Java>>正文


Java PreferenceViewHolder.findViewById方法代码示例

本文整理汇总了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);
            }
        });
    }
}
 
开发者ID:abicelis,项目名称:PingWidget,代码行数:23,代码来源:ThemePreference.java

示例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);
        });
    }
}
 
开发者ID:hidroh,项目名称:materialistic,代码行数:20,代码来源:ThemePreference.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:SizePreferences.java

示例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);
}
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:8,代码来源:ColorPickerPreference.java

示例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);
}
 
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:8,代码来源:ColorChooserPreference.java

示例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);
}
 
开发者ID:ashutoshgngwr,项目名称:10-bitClockWidget,代码行数:11,代码来源:ColorPickerPreference.java

示例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);
}
 
开发者ID:Onelio,项目名称:ConnectU,代码行数:15,代码来源:ProfilePreference.java

示例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();
}
 
开发者ID:rohanoid5,项目名称:Muzesto,代码行数:8,代码来源:SpectrumPreferenceCompat.java

示例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);
}
 
开发者ID:Microsoft,项目名称:ProjectOxford-Apps-MimickerAlarm,代码行数:13,代码来源:RepeatingDaysPreference.java

示例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);
}
 
开发者ID:Microsoft,项目名称:ProjectOxford-Apps-MimickerAlarm,代码行数:14,代码来源:VolumeSliderPreference.java

示例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();
}
 
开发者ID:the-blue-alliance,项目名称:spectrum,代码行数:8,代码来源:SpectrumPreferenceCompat.java

示例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());
}
 
开发者ID:microg,项目名称:android_external_MicroGUiTools,代码行数:16,代码来源:DimmableIconPreference.java

示例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);
    }
}
 
开发者ID:microg,项目名称:android_external_MicroGUiTools,代码行数:9,代码来源:LongTextPreference.java

示例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);
    }
}
 
开发者ID:proninyaroslav,项目名称:libretorrent,代码行数:11,代码来源:ColorPreference.java

示例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()));
}
 
开发者ID:punchup,项目名称:Superuser-UI,代码行数:10,代码来源:PreferenceCategoryCustom.java


注:本文中的android.support.v7.preference.PreferenceViewHolder.findViewById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。