package test.pkg;
import android.app.Activity;
import android.graphics.Paint;
import android.widget.TextView;

public class WrongColor extends Activity {
    public void foo(TextView textView, int foo) {
        Paint paint2 = new Paint();
        paint2.setColor(R.color.blue);
        // Wrong
        textView.setTextColor(R.color.red);
        textView.setTextColor(android.R.color.black);
        textView.setTextColor(foo > 0 ? R.color.green : R.color.blue);
        // OK
        textView.setTextColor(getResources().getColor(R.color.red));
        // OK
        foo1(R.color.blue);
        foo2(0xffff0000);
        // Wrong
        foo1(0xffff0000);
        foo2(R.color.blue);
    }

    private void foo1(@android.support.annotation.ColorRes int c) {
    }

    private void foo2(@android.support.annotation.ColorInt int c) {
    }

    private static class R {
        private static class color {
            public static final int red=0x7f060000;
            public static final int green=0x7f060001;
            public static final int blue=0x7f060002;
        }
    }
}
