Code example for TextPaint

Methods: setAlpha, setAntiAlias, setColor, setFakeBoldText, setTextAlign

0
        monthPaint = new TextPaint();
        monthPaint.setColor(Color.WHITE);
        monthPaint.setAntiAlias(true);
        monthPaint.setTextAlign(Align.CENTER);
		 
        dayPaint = new TextPaint();
        dayPaint.setColor(Color.BLACK);
        dayPaint.setAntiAlias(true);
        dayPaint.setFakeBoldText(true);
        dayPaint.setTextAlign(Align.CENTER);
        dayPaint.setAlpha(200);
         
        mCalendar = Calendar.getInstance();        
         
        String monthColor = "#FFFFFFFF";
        String dateColor = "#FF000000"; 
        try { 
            FileInputStream fis = new FileInputStream("/opl/etc/calendar_color_config.xml");
            Properties mProp = new Properties();
            mProp.loadFromXML(fis);
            monthColor = mProp.getProperty("Month","#FFFFFFFF");
            dateColor = mProp.getProperty("Date","#FF000000");
          } catch (Exception e) {
              e.printStackTrace();
          }finally{ 
              monthPaint.setColor(Color.parseColor(monthColor));
              dayPaint.setColor(Color.parseColor(dateColor));    
              mCalendar = Calendar.getInstance();
          } 
	} 
 
	@Override