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: 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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 
	} 
 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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;
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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); 
		} 
	} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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();
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setAlpha
			button.setOnTouchListener(new OnTouchListener() {
				 
				public boolean onTouch(View v, MotionEvent event) {
					ImageButton imageButton = (ImageButton) v;
					if(event.getAction() == MotionEvent.ACTION_DOWN){
						imageButton.setAlpha(255);
					} 
					if(event.getAction() == MotionEvent.ACTION_UP){
						imageButton.setAlpha(192);
					}					 
					return false; 
				} 
			}); 
		} 
		 
		return view;
	} 
	 
	/** 
	 * Sets onClickListener of buttons to activity. 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setAlpha
				 
				// @Override 
				public boolean onTouch(View v, MotionEvent event) { 
					ImageButton imageButton = (ImageButton) v; 
					if(event.getAction() == MotionEvent.ACTION_DOWN){ 
						imageButton.setAlpha(255); 
					} 
					if(event.getAction() == MotionEvent.ACTION_UP){ 
						imageButton.setAlpha(64); 
					} 
					return false; 
				} 
			}); 
		} 
 
		mUpdateGameBoard = new Runnable() { 
 
			// @Override 
			public void run() { 
				RelativeLayout gameBoard = (RelativeLayout) mView
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setEnabled, setAlpha
    return (int) Math.ceil(
        (double) words.length() / CandidateView.MAX_CANDIDATE_COUNT);
  } 
 
  private void enableArrow(ImageButton arrow, boolean enabled) {
    arrow.setEnabled(enabled);
    arrow.setAlpha(enabled ? ARROW_ALPHA_ENABLED : ARROW_ALPHA_DISABLED);
  } 
   
  /** 
   * A workaround to avoid the focused CandidateView handling onTouchEvent first. 
   * We let Container to handle first. 
   *  
   * @param event MotionEvent 
   * @return true if handled 
   */ 
  @Override 
  public boolean onTouchEvent(MotionEvent event){
	  if(gestureDetector.onTouchEvent(event)){
		  return true; 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setEnabled, setAlpha
        } 
    } 
 
    public void updateButtonStatus(int button, boolean enabled) {
        if (button == 0) {
            prevPost.setEnabled(enabled);
            if (enabled)
                prevPost.setAlpha(navButtonEnabled);
            else 
                prevPost.setAlpha(navButtonDisabled);
        } else if (button == 1) {
            nextPost.setEnabled(enabled);
            if (enabled)
                nextPost.setAlpha(navButtonEnabled);
            else 
                nextPost.setAlpha(navButtonDisabled);
        } 
 
    } 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setEnabled, setAlpha
    public void disableSave() { 
        enableButton(save, false);
    } 
 
    private void enableButton(ImageButton button, boolean enabled) {
        button.setEnabled(enabled);
        button.setAlpha(enabled ? ENABLED_ALPHA : DISABLED_ALPHA);
    } 
 
    @Override 
    public void onStackChanged(boolean canUndo, boolean canRedo) {
        // Listens to stack changes that may come from the worker thread; send messages to enable 
        // buttons only in the UI thread. 
        handler.sendMessage(handler.obtainMessage(ENABLE_BUTTON, canUndo ? 1 : 0, canRedo ? 1 : 0));
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

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: