类android.widget.SeekBar.OnSeekBarChangeListener源码实例Demo

下面列出了怎么用android.widget.SeekBar.OnSeekBarChangeListener的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: 365browser   文件: ColorPickerAdvancedComponent.java
/**
 * Initializes the views.
 *
 * @param rootView View that contains all the content, such as the label, gradient view, etc.
 * @param textResourceId The resource ID of the text to show on the label.
 * @param seekBarMax The range of the seek bar.
 * @param seekBarListener The listener for when the seek bar value changes.
 */
ColorPickerAdvancedComponent(final View rootView,
        final int textResourceId,
        final int seekBarMax,
        final OnSeekBarChangeListener seekBarListener) {
    mGradientView = rootView.findViewById(R.id.gradient);
    mText = (TextView) rootView.findViewById(R.id.text);
    mText.setText(textResourceId);
    mGradientDrawable = new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT, null);
    mSeekBar = (SeekBar) rootView.findViewById(R.id.seek_bar);
    mSeekBar.setOnSeekBarChangeListener(seekBarListener);
    mSeekBar.setMax(seekBarMax);
    // Setting the thumb offset means the seek bar thumb can move all the way to each end
    // of the gradient view.
    Context context = rootView.getContext();
    int offset = ApiCompatibilityUtils.getDrawable(context.getResources(),
            R.drawable.color_picker_advanced_select_handle).getIntrinsicWidth();
    mSeekBar.setThumbOffset(offset / 2);
}
 
/**
 * Initializes the views.
 *
 * @param rootView View that contains all the content, such as the label, gradient view, etc.
 * @param textResourceId The resource ID of the text to show on the label.
 * @param seekBarMax The range of the seek bar.
 * @param seekBarListener The listener for when the seek bar value changes.
 */
ColorPickerAdvancedComponent(final View rootView,
        final int textResourceId,
        final int seekBarMax,
        final OnSeekBarChangeListener seekBarListener) {
    mGradientView = rootView.findViewById(R.id.gradient);
    mText = (TextView) rootView.findViewById(R.id.text);
    mText.setText(textResourceId);
    mGradientDrawable = new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT, null);
    mSeekBar = (SeekBar) rootView.findViewById(R.id.seek_bar);
    mSeekBar.setOnSeekBarChangeListener(seekBarListener);
    mSeekBar.setMax(seekBarMax);
    // Setting the thumb offset means the seek bar thumb can move all the way to each end
    // of the gradient view.
    Context context = rootView.getContext();
    int offset = context.getResources()
                        .getDrawable(R.drawable.color_picker_advanced_select_handle)
                        .getIntrinsicWidth();
    mSeekBar.setThumbOffset(offset / 2);
}
 
/**
 * Initializes the views.
 *
 * @param rootView View that contains all the content, such as the label, gradient view, etc.
 * @param textResourceId The resource ID of the text to show on the label.
 * @param seekBarMax The range of the seek bar.
 * @param seekBarListener The listener for when the seek bar value changes.
 */
ColorPickerAdvancedComponent(final View rootView,
        final int textResourceId,
        final int seekBarMax,
        final OnSeekBarChangeListener seekBarListener) {
    mGradientView = rootView.findViewById(R.id.gradient);
    mText = (TextView) rootView.findViewById(R.id.text);
    mText.setText(textResourceId);
    mGradientDrawable = new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT, null);
    mSeekBar = (SeekBar) rootView.findViewById(R.id.seek_bar);
    mSeekBar.setOnSeekBarChangeListener(seekBarListener);
    mSeekBar.setMax(seekBarMax);
    // Setting the thumb offset means the seek bar thumb can move all the way to each end
    // of the gradient view.
    Context context = rootView.getContext();
    int offset = context.getResources()
                        .getDrawable(R.drawable.color_picker_advanced_select_handle)
                        .getIntrinsicWidth();
    mSeekBar.setThumbOffset(offset / 2);
}
 
源代码4 项目: 365browser   文件: ColorPickerAdvanced.java
/**
 * Creates a new GradientDetails object from the parameters provided, initializes it,
 * and adds it to this advanced view.
 *
 * @param textResourceId The text to display for the label.
 * @param seekBarMax The maximum value of the seek bar for the gradient.
 * @param seekBarListener Object listening to when the user changes the seek bar.
 *
 * @return A new GradientDetails object initialized with the given parameters.
 */
public ColorPickerAdvancedComponent createAndAddNewGradient(int textResourceId,
        int seekBarMax,
        OnSeekBarChangeListener seekBarListener) {
    LayoutInflater inflater = (LayoutInflater) getContext()
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View newComponent = inflater.inflate(R.layout.color_picker_advanced_component, null);
    addView(newComponent);

    return new ColorPickerAdvancedComponent(newComponent,
            textResourceId,
            seekBarMax,
            seekBarListener);
}
 
源代码5 项目: progresshint   文件: ProgressHintDelegate.java
public OnSeekBarChangeListener setOnSeekBarChangeListener(@NonNull OnSeekBarChangeListener l) {
  if (l instanceof ProxyChangeListener) {
    listener = (ProxyChangeListener) l;
  } else {
    listener.setExternalListener(l);
  }
  return listener;
}
 
源代码6 项目: android-chromium   文件: ColorPickerAdvanced.java
/**
 * Creates a new GradientDetails object from the parameters provided, initializes it,
 * and adds it to this advanced view.
 *
 * @param textResourceId The text to display for the label.
 * @param seekBarMax The maximum value of the seek bar for the gradient.
 * @param seekBarListener Object listening to when the user changes the seek bar.
 *
 * @return A new GradientDetails object initialized with the given parameters.
 */
public ColorPickerAdvancedComponent createAndAddNewGradient(int textResourceId,
        int seekBarMax,
        OnSeekBarChangeListener seekBarListener) {
    LayoutInflater inflater = (LayoutInflater) getContext()
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View newComponent = inflater.inflate(R.layout.color_picker_advanced_component, null);
    addView(newComponent);

    return new ColorPickerAdvancedComponent(newComponent,
            textResourceId,
            seekBarMax,
            seekBarListener);
}
 
源代码7 项目: android-chromium   文件: ColorPickerAdvanced.java
/**
 * Creates a new GradientDetails object from the parameters provided, initializes it,
 * and adds it to this advanced view.
 *
 * @param textResourceId The text to display for the label.
 * @param seekBarMax The maximum value of the seek bar for the gradient.
 * @param seekBarListener Object listening to when the user changes the seek bar.
 *
 * @return A new GradientDetails object initialized with the given parameters.
 */
public ColorPickerAdvancedComponent createAndAddNewGradient(int textResourceId,
        int seekBarMax,
        OnSeekBarChangeListener seekBarListener) {
    LayoutInflater inflater = (LayoutInflater) getContext()
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View newComponent = inflater.inflate(R.layout.color_picker_advanced_component, null);
    addView(newComponent);

    return new ColorPickerAdvancedComponent(newComponent,
            textResourceId,
            seekBarMax,
            seekBarListener);
}
 
源代码8 项目: tuxguitar   文件: TGChannelEditDialog.java
private OnSeekBarChangeListener createVolumeChangeListener() {
	return createShortLevelChangeListener(TGUpdateChannelAction.ATTRIBUTE_VOLUME);
}
 
源代码9 项目: tuxguitar   文件: TGChannelEditDialog.java
private OnSeekBarChangeListener createBalanceChangeListener() {
	return createShortLevelChangeListener(TGUpdateChannelAction.ATTRIBUTE_BALANCE);
}
 
源代码10 项目: tuxguitar   文件: TGChannelEditDialog.java
private OnSeekBarChangeListener createReverbChangeListener() {
	return createShortLevelChangeListener(TGUpdateChannelAction.ATTRIBUTE_REVERB);
}
 
源代码11 项目: tuxguitar   文件: TGChannelEditDialog.java
private OnSeekBarChangeListener createChorusChangeListener() {
	return createShortLevelChangeListener(TGUpdateChannelAction.ATTRIBUTE_CHORUS);
}
 
源代码12 项目: tuxguitar   文件: TGChannelEditDialog.java
private OnSeekBarChangeListener createPhaserChangeListener() {
	return createShortLevelChangeListener(TGUpdateChannelAction.ATTRIBUTE_PHASER);
}
 
源代码13 项目: tuxguitar   文件: TGChannelEditDialog.java
private OnSeekBarChangeListener createTremoloChangeListener() {
	return createShortLevelChangeListener(TGUpdateChannelAction.ATTRIBUTE_TREMOLO);
}
 
源代码14 项目: Jockey   文件: NowPlayingControllerViewModel.java
@BindingAdapter("onSeekListener")
public static void bindOnSeekListener(SeekBar seekBar, OnSeekBarChangeListener listener) {
    seekBar.setOnSeekBarChangeListener(listener);
}
 
源代码15 项目: progresshint   文件: ProgressHintDelegate.java
void setInternalListener(OnSeekBarChangeListener l) {
  mInternalListener = l;
}
 
源代码16 项目: progresshint   文件: ProgressHintDelegate.java
void setExternalListener(OnSeekBarChangeListener l) {
  mExternalListener = l;
}
 
 类所在包
 同包方法