ProgressBar setProgressDrawable - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ProgressBar setProgressDrawable method.

This code example shows how to use the following methods:setMax, setProgress, setProgressDrawable, setOnSeekBarChangeListener
This code example shows how to use the following methods:invalidate, getProgressDrawable, setProgress, setProgressDrawable, setSecondaryProgress
    progressLayerDrawable.setId(2, android.R.id.progress);
 
    //Copy the existing ProgressDrawable bounds to the new one. 
    Rect bounds = progressBar.getProgressDrawable().getBounds();
    progressBar.setProgressDrawable(progressLayerDrawable);     
    progressBar.getProgressDrawable().setBounds(bounds);
 
    // setProgress() ignores a change to the same value, so: 
    if (value1 == 0)
        progressBar.setProgress(1);
    else 
        progressBar.setProgress(0);
    progressBar.setProgress(value1);
 
    // setSecondaryProgress() ignores a change to the same value, so: 
    if (value2 == 0)
        progressBar.setSecondaryProgress(1);
    else 
        progressBar.setSecondaryProgress(0);
    progressBar.setSecondaryProgress(value2);

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getMax, setProgress, setProgressDrawable, setOnSeekBarChangeListener
 
		updatePreview(color);
	} 
 
	private void setupSeekBar(SeekBar seekBar, int id, int value, Resources res) {
		seekBar.setProgressDrawable(new TextSeekBarDrawable(res, id, value < seekBar.getMax() / 2));
		seekBar.setProgress(value);
		seekBar.setOnSeekBarChangeListener(this);
	} 
 
	private void update() { 
		float[] hsv = {
			360 * mHue.getProgress() / (float) mHue.getMax(),
			mSaturation.getProgress() / (float) mSaturation.getMax(),
			mValue.getProgress() / (float) mValue.getMax(),
		}; 
		mColor = Color.HSVToColor(hsv);
		updatePreview(mColor);
	} 
 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getMax, setProgress, setProgressDrawable, setOnSeekBarChangeListener
		 
		updatePreview(color);
	} 
	 
	private void setupSeekBar(SeekBar seekBar, int id, int value, Resources res) {
		seekBar.setProgressDrawable(new TextSeekBarDrawable(res, id, value < seekBar.getMax() / 2));
		seekBar.setProgress(value);
		seekBar.setOnSeekBarChangeListener(this);
	} 
 
	private void update() { 
		float[] hsv = {
			360 * mHue.getProgress() / (float) mHue.getMax(),
			mSaturation.getProgress() / (float) mSaturation.getMax(),
			mValue.getProgress() / (float) mValue.getMax(),
		}; 
		mColor = Color.HSVToColor(hsv);
		updatePreview(mColor);
	} 
	 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setProgress, setProgressDrawable, setOnSeekBarChangeListener
    @Override 
    public void onCheckedChanged( CompoundButton buttonView, boolean isChecked ) {
        atRight = isChecked;
        if( width_seek != null ) {
            layout.removeView( width_seek );
            width_seek = new SeekBar( context );
            Drawable sbd = createSeekBarDrawable( sel_color );
            width_seek.setProgressDrawable( sbd );
            width_seek.setOnSeekBarChangeListener( this );
            width_seek.setProgress( width );
            layout.addView( width_seek );
        } 
    } 
 
    // SeekBar.OnSeekBarChangeListener methods 
    @Override  
    public void onProgressChanged( SeekBar seekBar, int progress, boolean fromUser ) {
        if( !fromUser ) return;
        width = progress;
    } 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setMax, setProgress, setProgressDrawable, setOnSeekBarChangeListener
This code example shows how to use the following methods:setLayoutParams, setProgressDrawable
import android.widget.FrameLayout; 
import android.widget.ProgressBar; 
 
public class StylizedProgressBarFactory{ 
	public static ProgressBar build(Context context){
		ProgressBar progressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal);
		 
		setColor(progressBar, Color.argb(200, 30, 144, 255));
		 
		setLayout(progressBar);
		 
		return progressBar;
	} 
	 
	private static void setColor(ProgressBar progressBar, int color){
		ShapeDrawable progressDrawable = new ShapeDrawable(new RectShape());
		progressDrawable.getPaint().setColor(color);
		ClipDrawable progressClip = new ClipDrawable(progressDrawable, Gravity.LEFT, ClipDrawable.HORIZONTAL);
		progressBar.setProgressDrawable(progressClip);  
	} 

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setLayoutParams, setPadding, setMax, setProgressDrawable, setOnSeekBarChangeListener
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setMax, setProgress, setProgressDrawable, setOnSeekBarChangeListener
This code example shows how to use the following methods:setProgressDrawable
        } 
    } 
 
    public void setProgressDrawable(Drawable d) {
        if (mProgress != null) {
            mProgress.setProgressDrawable(d);
        } else { 
            mProgressDrawable = d;
        } 
    } 
 
    public void setIndeterminateDrawable(Drawable d) {
        if (mProgress != null) {
            mProgress.setIndeterminateDrawable(d);
        } else { 
            mIndeterminateDrawable = d;
        } 
    } 
 
    public void setIndeterminate(boolean indeterminate) {
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related ProgressBar setProgressDrawable Questions & Answers:

setProgressDrawable Method Overview
Define the drawable used to draw the progress bar in progress mode.
See Code Examples for other Android ProgressBar Methods: