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


Java SeekBar.setOnSeekBarChangeListener方法代码示例

本文整理汇总了Java中android.widget.SeekBar.setOnSeekBarChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java SeekBar.setOnSeekBarChangeListener方法的具体用法?Java SeekBar.setOnSeekBarChangeListener怎么用?Java SeekBar.setOnSeekBarChangeListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.SeekBar的用法示例。


在下文中一共展示了SeekBar.setOnSeekBarChangeListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateDialogView

import android.widget.SeekBar; //导入方法依赖的package包/类
@Override
   protected View onCreateDialogView() {
// Get current value from preferences
mCurrentValue = getPersistedInt(mDefaultValue);

// Inflate layout
LayoutInflater inflater = ((PreferenceActivity) context).getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_slider, null);

// Setup minimum and maximum text labels
((TextView) view.findViewById(R.id.min_value)).setText(Integer.toString(mMinValue));
((TextView) view.findViewById(R.id.max_value)).setText(Integer.toString(mMaxValue));

// Setup SeekBar
mSeekBar = (SeekBar) view.findViewById(R.id.seek_bar);
mSeekBar.setMax(mMaxValue - mMinValue);
mSeekBar.setProgress(mCurrentValue - mMinValue);
mSeekBar.setOnSeekBarChangeListener(this);

// Setup text label for current value
mValueText = (TextView) view.findViewById(R.id.current_value);
mValueText.setText(Integer.toString(mCurrentValue));

return view;
   }
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:26,代码来源:SeekBarPreference.java

示例2: getView

import android.widget.SeekBar; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	TGChannel channel = (TGChannel) this.getItem(position);
	
	View view = (convertView != null ? convertView : getLayoutInflater().inflate(R.layout.view_channel_list_item, parent, false));
	view.setTag(channel);
	view.setOnClickListener(this.channelList.getActionHandler().createEditChannelAction(channel));
	view.setOnLongClickListener(this.channelList.getActionHandler().createChannelItemMenuAction(channel));
	
	TextView textViewName = (TextView) view.findViewById(R.id.channel_item_name);
	textViewName.setText(channel.getName());
	
	SeekBar seekBarVolume = (SeekBar) view.findViewById(R.id.channel_item_volume_value);
	seekBarVolume.setTag(channel);
	seekBarVolume.setProgress(channel.getVolume());
	seekBarVolume.setOnSeekBarChangeListener(this.createVolumeChangeListener());
	
	return view;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:20,代码来源:TGChannelListAdapter.java

示例3: initSeekBar

import android.widget.SeekBar; //导入方法依赖的package包/类
private void initSeekBar(SeekBar seekBar, Uri defaultUri) {
    seekBar.setMax(mAudioManager.getStreamMaxVolume(mStreamType));
    mOriginalStreamVolume = mAudioManager.getStreamVolume(mStreamType);
    seekBar.setProgress(mOriginalStreamVolume);
    seekBar.setOnSeekBarChangeListener(this);
    // TODO: removed in MM, find different approach
    mContext.getContentResolver().registerContentObserver(
            System.getUriFor("volume_ring"),
            false, mVolumeObserver);
    if (defaultUri == null) {
        if (mStreamType == AudioManager.STREAM_RING) {
            defaultUri = Settings.System.DEFAULT_RINGTONE_URI;
        } else if (mStreamType == AudioManager.STREAM_NOTIFICATION) {
            defaultUri = Settings.System.DEFAULT_NOTIFICATION_URI;
        } else {
            defaultUri = Settings.System.DEFAULT_ALARM_ALERT_URI;
        }
    }
    mRingtone = RingtoneManager.getRingtone(mContext, defaultUri);
    if (mRingtone != null) {
        mRingtone.setStreamType(mStreamType);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:24,代码来源:VolumePreference.java

示例4: init

import android.widget.SeekBar; //导入方法依赖的package包/类
public void init(Context context) {
    View.inflate(context, getLayoutId(), this);
    startButton = (ImageView) findViewById(R.id.start);
    fullscreenButton = (ImageView) findViewById(R.id.fullscreen);
    progressBar = (SeekBar) findViewById(R.id.progress);
    currentTimeTextView = (TextView) findViewById(R.id.current);
    totalTimeTextView = (TextView) findViewById(R.id.total);
    bottomContainer = (ViewGroup) findViewById(R.id.layout_bottom);
    textureViewContainer = (ViewGroup) findViewById(R.id.surface_container);
    topContainer = (ViewGroup) findViewById(R.id.layout_top);
    titleTextView = (TextView) findViewById(R.id.title);
    backButton = (ImageView) findViewById(R.id.back);

    backButton.setVisibility(View.GONE);

    backButton.setOnClickListener(this);
    startButton.setOnClickListener(this);
    fullscreenButton.setOnClickListener(this);
    progressBar.setOnSeekBarChangeListener(this);
    bottomContainer.setOnClickListener(this);
    textureViewContainer.setOnClickListener(this);
    textureViewContainer.setOnTouchListener(this);

    mHandler = new Handler();
}
 
开发者ID:qq1210514049,项目名称:ListVideoPlayer,代码行数:26,代码来源:ListVideoPlayer.java

示例5: onBindView

import android.widget.SeekBar; //导入方法依赖的package包/类
@Override
protected void onBindView(View view) {
    super.onBindView(view);
    getPreferenceManager().registerOnActivityStopListener(this);

    initHandler();

    final SeekBar seekBar = (SeekBar) view.findViewById(R.id.start_volume);
    if (seekBar == mStartVolumeSeekBar) return;

    mStartVolumeSeekBar = seekBar;
    mRampUpTimeSeekBar = (SeekBar) view.findViewById(R.id.ramp_up_time);
    mRampUpTimeValue = (TextView) view.findViewById(R.id.ramp_up_time_value);

    final ContentResolver cr = getContext().getContentResolver();
    float startVolume = CMSettings.System.getFloat(cr,
            CMSettings.System.INCREASING_RING_START_VOLUME, 0.1f);
    int rampUpTime = CMSettings.System.getInt(cr,
            CMSettings.System.INCREASING_RING_RAMP_UP_TIME, 10);

    mStartVolumeSeekBar.setProgress(Math.round(startVolume * 1000F));
    mStartVolumeSeekBar.setOnSeekBarChangeListener(this);
    mRampUpTimeSeekBar.setOnSeekBarChangeListener(this);
    mRampUpTimeSeekBar.setProgress((rampUpTime / 5) - 1);
    mRampUpTimeValue.setText(
            Formatter.formatShortElapsedTime(getContext(), rampUpTime * 1000));
}
 
开发者ID:ric96,项目名称:lineagex86,代码行数:28,代码来源:IncreasingRingVolumePreference.java

示例6: onCreate

import android.widget.SeekBar; //导入方法依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.music_player);
		
		new Thread(this).start();
		mediaPlayer = new MediaPlayer();
		mediaPlayer.setOnCompletionListener(this);
		seekBar = (SeekBar) findViewById(R.id.SeekBar01);
		seekBar.setOnSeekBarChangeListener(this);
//		if (mediaPlayer==null){
//		mediaPlayer = new MediaPlayer();
//	} else {
//		mediaPlayer.reset();
//	}
	
		playableFiles = new ArrayList<EncFSFile>();
		
		int i = 0;
		for (EncFSFile file:EDVolumeBrowserActivity.childEncFSFiles){
			if (file.getName().endsWith(".mp3")){
				playableFiles.add(file);
			}
		}
		
		playedIndex=0;
		EncFSFile fileToPlay=playableFiles.get(playedIndex);
		play(fileToPlay);
		Button previous = (Button) findViewById(R.id.ButtonPrevious);
		Button next = (Button) findViewById(R.id.ButtonNext);
		Button playPause = (Button) findViewById(R.id.ButtonPlayStop);
		playPause.setOnClickListener(playPauseListener);
		previous.setOnClickListener(previousListener);
		next.setOnClickListener(nextListener);
	}
 
开发者ID:starn,项目名称:encdroidMC,代码行数:35,代码来源:MusicPlayer.java

示例7: onCreateDialogView

import android.widget.SeekBar; //导入方法依赖的package包/类
@Override
protected View onCreateDialogView() {
    final View view = super.onCreateDialogView();
    mSeekBar = (SeekBar)view.findViewById(R.id.seek_bar_dialog_bar);
    mSeekBar.setMax(mMaxValue - mMinValue);
    mSeekBar.setOnSeekBarChangeListener(this);
    mValueView = (TextView)view.findViewById(R.id.seek_bar_dialog_value);
    return view;
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:10,代码来源:SeekBarDialogPreference.java

示例8: textSizePicker

import android.widget.SeekBar; //导入方法依赖的package包/类
private void textSizePicker() {
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    LayoutInflater inflater = getActivity().getLayoutInflater();
    LinearLayout view = (LinearLayout) inflater.inflate(R.layout.dialog_seek_bar, null);
    final SeekBar bar = view.findViewById(R.id.text_size_seekbar);
    final TextView sample = new TextView(getActivity());
    sample.setText(R.string.untitled);
    sample.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT));
    sample.setGravity(Gravity.CENTER_HORIZONTAL);
    view.addView(sample);
    bar.setOnSeekBarChangeListener(new TextSeekBarListener(sample));
    final int MAX = 5;
    bar.setMax(MAX);
    bar.setProgress(MAX - mPreferenceManager.getTextSize());
    builder.setView(view);
    builder.setTitle(R.string.title_text_size);
    builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface arg0, int arg1) {
            mPreferenceManager.setTextSize(MAX - bar.getProgress());
        }

    });
    Dialog dialog = builder.show();
    BrowserDialog.setDialogSize(mActivity, dialog);
}
 
开发者ID:XndroidDev,项目名称:Xndroid,代码行数:28,代码来源:DisplaySettingsFragment.java

示例9: onCreate

import android.widget.SeekBar; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_canvas);

        colorSelectLayout1 = (LinearLayout)findViewById(R.id.colorSelectLayout1);
        colorSelectLayout2 = (LinearLayout)findViewById(R.id.colorSelectLayout2);

        clearButton = (FloatingActionButton)findViewById(R.id.clearButton);

        clearButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                drawView.clear();
            }
        });

//        eraserButton.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                removeDot();
//                drawView.changeColor(Color.TRANSPARENT);
//            }
//        });

        seekLayout = (LinearLayout)findViewById(R.id.seekLayout);
        seekBar = (SeekBar)findViewById(R.id.seekBar);
        seekBar.setOnSeekBarChangeListener(this);

        drawView = (DrawView)findViewById(R.id.paper);

        Intent intent = getIntent();
        userID = intent.getStringExtra("userID");
        category = intent.getStringExtra("category");

        addColorButton();
    }
 
开发者ID:DSM-GRAM,项目名称:Artist,代码行数:38,代码来源:CanvasActivity.java

示例10: getView

import android.widget.SeekBar; //导入方法依赖的package包/类
public View getView(LayoutInflater inflater, Setting setting, View convertView, Context context) {
	
	// reuse if view already created
	if (mView != null) return mView;

	mInflater = inflater;
	mContext = context;
	RangeSetting set = (RangeSetting) setting;
	LinearLayout view = mView = (LinearLayout) inflater.inflate(R.layout.row_setting_minmax_slider, null);
	
	// re-initialize views
	SeekBar slider = mSlider = (SeekBar) view.findViewById(R.id.slider_view);
	mDescr = (TextView) view.findViewById(R.id.descr_view);
	ImageButton minButton = (ImageButton) view.findViewById(R.id.min_button);
	ImageButton maxButton = (ImageButton) view.findViewById(R.id.max_button);
	
	// set listeners
	slider.setOnSeekBarChangeListener(this);
	slider.setOnClickListener(this);
	maxButton.setOnClickListener(this);
	minButton.setOnClickListener(this);
	
	// set values
	minButton.setImageResource(set.minIconId);
	maxButton.setImageResource(set.maxIconId);
	
	mMinButton = minButton;
	mMaxButton = maxButton;
	mSetting =  set;
	
	// update view
	updateView();

	return view;
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:36,代码来源:MinMaxSliderSettingRenderer.java

示例11: initViews

import android.widget.SeekBar; //导入方法依赖的package包/类
protected void initViews() {
    rootView = LayoutInflater.from(context).inflate(R.layout.video_controller_abs, null);
    playButton = (ImageButton) rootView.findViewById(R.id.btn_play);
    positionView = (TextView) rootView.findViewById(R.id.tv_position);
    durationView = (TextView) rootView.findViewById(R.id.tv_duration);
    progressBar = (SeekBar) rootView.findViewById(R.id.seek_bar);
    progressBar.setMax(PROGRESS_BAR_MAX);
    progressBar.setOnSeekBarChangeListener(this);
    playButton.setOnClickListener(this);
}
 
开发者ID:SethWen,项目名称:GestureVideoView,代码行数:11,代码来源:AbsControllerView.java

示例12: onCreate

import android.widget.SeekBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_image_pixelization);

    mImageView = (ImageView) findViewById(R.id.pixelView);
    mSeekBar = (SeekBar)findViewById(R.id.seekbar);

    mImageBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.image);
    mImageView.setImageBitmap(mImageBitmap);

    mSeekBar.setOnSeekBarChangeListener(mOnSeekBarChangeListener);
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:14,代码来源:ImagePixelization.java

示例13: onBindView

import android.widget.SeekBar; //导入方法依赖的package包/类
@Override
protected void onBindView(View view) {
    super.onBindView(view);
    seekBar = (SeekBar) view.findViewById(R.id.seekbar);
    seekBar.setMax(maxSeekBarValue);
    seekBar.setProgress(progress);
    seekBar.setOnSeekBarChangeListener(this);
}
 
开发者ID:mobilemaster128,项目名称:quickblox-android,代码行数:9,代码来源:SeekBarPreference.java

示例14: initView

import android.widget.SeekBar; //导入方法依赖的package包/类
@Override
public void initView(Bundle savedInstanceState, View view) {
    findViewById(R.id.btn_set_transparent).setOnClickListener(this);
    mTvStatusAlpha = (TextView) findViewById(R.id.tv_status_alpha);
    sbChangeAlpha = (SeekBar) findViewById(R.id.sb_change_alpha);
    sbChangeAlpha.setOnSeekBarChangeListener(translucentListener);
    mTvStatusAlpha.setText(String.valueOf(mAlpha));

    updateStatusBar();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:BarStatusImageViewActivity.java

示例15: SliderDialogBuilder

import android.widget.SeekBar; //导入方法依赖的package包/类
public SliderDialogBuilder(@NonNull Context context) {
    super(context);

    sliderView = (LinearLayout) View.inflate(context, R.layout.dialog_slider, null);
    setView(sliderView);

    seekBar = (SeekBar) sliderView.findViewById(R.id.dialog_slider_seek);
    progressText = (TextView) sliderView.findViewById(R.id.dialog_slider_text);

    seekBar.setOnSeekBarChangeListener(this);
    seekBar.setMax(100);
}
 
开发者ID:lucasax,项目名称:Zero,代码行数:13,代码来源:SliderDialogBuilder.java


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