Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove Rendering Problems message window in Intellij IDEA 13 layout preview

So how to completely remove this "Rendering Problems" message which appears above Android Layout Preview area in Intellij IDEA 13 each time you change something in your layout?

like image 853
Evos Avatar asked Jan 14 '14 05:01

Evos


1 Answers

You can use isInEditMode method.

Check Example:

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.widget.ProgressBar;

public class ColoredProgressBar extends ProgressBar {
   public ColoredProgressBar(Context context) {
      super(context);
      if (!isInEditMode())
         init();
   }

   public ColoredProgressBar(Context context, AttributeSet attrs) {
      super(context, attrs);
      if (!isInEditMode())
         init();
   }

   public ColoredProgressBar(Context context, AttributeSet attrs, int defStyle) {
      super(context, attrs, defStyle);
      if (!isInEditMode())
         init();
   }

   /**
    * Changes color.
    */
   private void init() {
      getIndeterminateDrawable().setColorFilter(Color.BLUE, android.graphics.PorterDuff.Mode.MULTIPLY);
   }
}

Example link: https://gist.github.com/emreaktrk/9524973

like image 112
Emre Aktürk Avatar answered Nov 17 '22 07:11

Emre Aktürk