ImageView setAlpha - top ranked examples from Open Source projects

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

This code example shows how to use the following methods: setAlpha
    @SuppressWarnings("deprecation") 
    public static void setPosterBackground(ImageView background, String posterPath, Context context) {
        if (AndroidUtils.isJellyBeanOrHigher()) { 
            background.setImageAlpha(30);
        } else { 
            background.setAlpha(30);
        } 
        ImageProvider.getInstance(context).loadImage(background, posterPath, false);
    } 
 
    /** 
     * Sets the global app theme variable. Applied by all activities once they 
     * are created. 
     *  
     * @param themeIndex 
     */ 
    public static synchronized void updateTheme(String themeIndex) {
        int theme = Integer.valueOf((String) themeIndex);
        switch (theme) {
            case 1: 
Full Snippet Info
6
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: setAlpha
		return summary + " (currently " + value + "%)";
	} 
 
	public void onProgressChanged(SeekBar seek, int value, boolean fromTouch) {
		currentValue = value;
		img.setAlpha((int)(currentValue * 2.55f));
	} 
 
	@Override 
	public void onStartTrackingTouch(SeekBar arg0) {
		// TODO Auto-generated method stub 
	} 
 
	@Override 
	public void onStopTrackingTouch(SeekBar arg0) {
		// TODO Auto-generated method stub 
	} 
 
} 
Full Snippet Info
5
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: setAlpha
	 *  
	 * @param progress 
	 *            the progress 
	 */ 
	private void setOpacity(int progress) {
		imageView.setAlpha((int) (2.55 * progress));
	} 
 
	/** 
	 * Switches the opacity state of the image. This forces the 
	 * SquareProgressBar to redraw with the current progress. As bigger the 
	 * progress is, then more of the image comes to view. If the progress is 0, 
	 * then you can't see the image at all. If the progress is 100, the image is 
	 * shown full. 
	 *  
	 * @param opacity 
	 *            true if opacity should be enabled. 
	 */ 
	public void setOpacity(boolean opacity) {
		this.opacity = opacity;
Full Snippet Info
5
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: setClickable, setAlpha
 
	void playEnabledMonitor() { 
		if (mAudioFilename != null && ! mRecordingAudio && mPlayer == null) {
			long fileSize = new File(mAudioFilename).length();
			if (fileSize > 0 && fileSize == previousAudioFileSize) {
				mPlayButton.setClickable(true);
				mPlayButton.setAlpha(255);
				previousAudioFileSize = 0;
				return; 
			} 
			previousAudioFileSize = fileSize;
		} 
		if (! mRecordingAudio && mPlayer == null) {
			new Handler().postDelayed(new Runnable() {
				public void run() { 
					playEnabledMonitor(); 
				} 
			}, 200); 
		} 
	} 
Full Snippet Info
5
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: setEnabled, setAlpha
		setButtonEnabled(ivRedo, false);
		eraserMode = false;
	} 
	// Undo, Redoボタンのenable/disable処理 
	private void setButtonEnabled(ImageView v, boolean enable){
		v.setEnabled(enable);
		v.setAlpha(enable? 255 : 128);
	} 
	// スタンプ図形を描画する。 (m:mode, e:element, o:old position, n:new position) 
	private void drawStamp(int m, Element e, PointF o, PointF n) {
		float sq = (float)Math.sqrt((n.x - o.x)*(n.x - o.x)+(n.y - o.y)*(n.y - o.y));
		switch (m) {
		case MODE_STAMP_TRIANGLE:	e.path.reset(); // 敢てbreakしない。以下4か所も同様。
		case MODE_STAMP_TRIANGLE_DURATION:
			e.path.moveTo(o.x, o.y-sq);
			e.path.lineTo(o.x-sq, o.y+sq);
			e.path.lineTo(o.x+sq, o.y+sq);
			e.path.lineTo(o.x, o.y-sq);		
			break; 
		case MODE_STAMP_RECTANGLE:	e.path.reset();
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related ImageView setAlpha Questions & Answers:

setAlpha Method Overview
This method was deprecated in API level 16. use #setImageAlpha(int) instead
See Code Examples for other Android ImageView Methods: