Android ClipDrawable - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ClipDrawable class.

This code example shows how to use the following methods: setLevel
	 * Permette di visualizzare il contenuto della barra data la x selezionata 
	 */ 
	private void manageXValue(float xValue) {
		// Facciamo la proporzione per calcolare il livello associato 
		int level = (int) (10000 * xValue) / getWidth();
		barDrawable.setLevel(level);
		// Calcoliamo il nuovo valore selezionato 
		int oldValue = selectedValue;
		selectedValue = (int) ((maxValue - minValue) * xValue) / getWidth();
		// Notifichiamo l'evento se il valore è cambiato 
		if (selectedValue != oldValue) {
			dispatchOnInputTouchEvent(); 
		} 
	} 
 
} 
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setLevel
		 
		ClipDrawable drawable = (ClipDrawable) progressDrawableImageView.getBackground();
		double percent = (double) progress / (double) max;
		int level = (int) Math.floor(percent * 10000);
		 
		drawable.setLevel(level);
	} 
	 
	private void init(Context context, AttributeSet attrs) {
		LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(R.layout.round_progress, this);
		 
		setup(context, attrs);
	} 
	 
	private void setup(Context context, AttributeSet attrs) {
		TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RoundProgress);
		 
		final String xmlns = "http://schemas.android.com/apk/res/com.nhn.android.band";
		int bgResource = attrs.getAttributeResourceValue(xmlns, "progressDrawable", 0);
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setLevel
This code example shows how to use the following methods: setLevel
This code example shows how to use the following methods: getLevel, setLevel
		mHandler.removeCallbacks(mUpdateTimeTask);  //Remove old timer
	    mHandler.postDelayed(mUpdateTimeTask, 100); //How fast thread updated
	} 
    
   public void buttonPressed(View view){
	   drawable.setLevel(drawable.getLevel() + 1);
	   Toast.makeText(this, "button pressed", Toast.LENGTH_SHORT).show();
   } 
    
	protected void onResume(){ 
		super.onResume(); 
	} 
	 
	public void slide(View view, float fromX, float toX, float fromY, float toY, int duration){
        TranslateAnimation slide = new TranslateAnimation(
        		Animation.RELATIVE_TO_PARENT, fromX/100,
        		Animation.RELATIVE_TO_PARENT, toX/100,
        		Animation.RELATIVE_TO_PARENT, fromY/100,
        		Animation.RELATIVE_TO_PARENT, toY/100);
        slide.setDuration(duration);
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android ClipDrawable Questions & Answers:

See Code Examples for Android ClipDrawable Methods: