Java Code Examples for android.text.TextPaint#ANTI_ALIAS_FLAG

The following examples show how to use android.text.TextPaint#ANTI_ALIAS_FLAG . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HeartRateWidget.java    From xDrip-Watchface with Apache License 2.0 6 votes vote down vote up
@Override
public void init(Service service) {
    this.textLeft = service.getResources().getDimension(R.dimen.heart_rate_text_left);
    this.textTop = service.getResources().getDimension(R.dimen.heart_rate_text_top);

    // Aling left true or false (false= align center)
    this.heartAlignLeftBool = service.getResources().getBoolean(R.bool.heart_rate_left_align);

    this.textPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.textPaint.setColor(service.getResources().getColor(R.color.heart_colour));
    this.textPaint.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.MULTI_SPACE));
    this.textPaint.setTextSize(service.getResources().getDimension(R.dimen.heart_rate_font_size));
    this.textPaint.setTextAlign( (this.heartAlignLeftBool) ? Paint.Align.LEFT : Paint.Align.CENTER );

    this.flashingIconBool = service.getResources().getBoolean(R.bool.flashing_heart_rate_icon);
    this.heartIcon = service.getResources().getDrawable(R.drawable.flashing_heart, null);
    this.setDrawableBounds(this.heartIcon, service.getResources().getDimension(R.dimen.heart_rate_icon_left), service.getResources().getDimension(R.dimen.heart_rate_icon_top));

    this.heartRateBool = service.getResources().getBoolean(R.bool.heart_rate);

    // Show units boolean
    this.showUnits = service.getResources().getBoolean(R.bool.heart_rate_units);
}
 
Example 2
Source File: HeartRateWidget.java    From GreatFit with MIT License 6 votes vote down vote up
@Override
public void init(Service service) {
    this.mService = service;

    this.textPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.textPaint.setColor(settings.heart_rateColor);
    this.textPaint.setTypeface(ResourceManager.getTypeFace(service.getResources(), settings.font));
    this.textPaint.setTextSize(settings.heart_rateFontSize);
    this.textPaint.setTextAlign( (settings.heart_rateAlignLeft) ? Paint.Align.LEFT : Paint.Align.CENTER );

    if(settings.heart_rateIcon){
        this.heart_rateIcon = Util.decodeImage(service.getResources(),"icons/"+settings.is_white_bg+"heart_rate.png");
        this.heart_rate_flashingIcon = Util.decodeImage(service.getResources(),"icons/"+settings.is_white_bg+"heart_rate_flashing.png");
    }
    
    // Progress Bar Circle
    if(settings.heart_rateProg>0 && settings.heart_rateProgType==0){
        this.ring = new Paint(Paint.ANTI_ALIAS_FLAG);
        this.ring.setStrokeCap(Paint.Cap.ROUND);
        this.ring.setStyle(Paint.Style.STROKE);
        this.ring.setStrokeWidth(settings.heart_rateProgThickness);
    }
}
 
Example 3
Source File: TextClock.java    From AmazfitAPKs with Apache License 2.0 6 votes vote down vote up
@Override
public void init(Service service) {

    this.background = service.getResources().getColor(R.color.malvarez_background);
    this.textColor = service.getResources().getColor(R.color.malvarez_time_colour_slpt);
    this.textAltColor = service.getResources().getColor(R.color.malvarez_hour_colour_slpt);

    this.leftFuzzyText = 160;

    this.textFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.textFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.textFont.setTextSize(service.getResources().getDimension(R.dimen.drbourbon_fuzzytext_font_size));
    this.textFont.setColor(service.getResources().getColor(R.color.malvarez_time_colour));
    this.textFont.setTextAlign(Paint.Align.CENTER);

    digits = service.getResources().getStringArray(R.array.digits);

    Rect bounds = new Rect();
    String sampleTime = "12:58";
    textFont.getTextBounds(sampleTime, 0, sampleTime.length(), bounds);

    this.fontHeight = bounds.height();
}
 
Example 4
Source File: ThreeLinesStepsWidget.java    From AmazfitAPKs with Apache License 2.0 6 votes vote down vote up
@Override
public void init(Service service) {
    this.verticalOffset = service.getResources().getDimension(R.dimen.threelines_voffset);
    this.stepsFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.stepsFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.OPEN24));
    this.stepsFont.setTextSize(service.getResources().getDimension(R.dimen.threelines_font_size));
    this.stepsFont.setColor(service.getResources().getColor(R.color.threelines_steps_color));
    this.stepsFont.setTextAlign(Paint.Align.CENTER);

    Rect bounds = new Rect();
    String sampleTime = "12:58";
    stepsFont.getTextBounds(sampleTime, 0, sampleTime.length(), bounds);

    this.fontHeight = bounds.height() + verticalOffset;

}
 
Example 5
Source File: FuzzyTextClock.java    From AmazfitAPKs with Apache License 2.0 6 votes vote down vote up
@Override
public void init(Service service) {

    this.background = service.getResources().getColor(R.color.malvarez_background);
    this.leftFuzzyText = 160;

    this.textFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.textFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.textFont.setTextSize(service.getResources().getDimension(R.dimen.drbourbon_fuzzytext_font_size));
    this.textFont.setColor(service.getResources().getColor(R.color.malvarez_time_colour));
    this.textFont.setTextAlign(Paint.Align.CENTER);

    hours = service.getResources().getStringArray(R.array.hours);
    phrases = service.getResources().getStringArray(R.array.phrases);
    digits = service.getResources().getStringArray(R.array.digits);

    Rect bounds = new Rect();
    String sampleTime = "12:58";
    textFont.getTextBounds(sampleTime, 0, sampleTime.length(), bounds);

    this.fontHeight = bounds.height();

}
 
Example 6
Source File: HeartRateWidget.java    From AmazfitAPKs with Apache License 2.0 5 votes vote down vote up
@Override
public void init(Service service) {
    this.textLeft = service.getResources().getDimension(R.dimen.widget_text_left);
    this.textTop = service.getResources().getDimension(R.dimen.widget_text_top);

    this.textPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.textPaint.setColor(service.getResources().getColor(R.color.time_colour));
    this.textPaint.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.textPaint.setTextSize(service.getResources().getDimension(R.dimen.circles_font_size));
    this.textPaint.setTextAlign(Paint.Align.CENTER);
}
 
Example 7
Source File: HeartRateWidget.java    From AmazfitAPKs with Apache License 2.0 5 votes vote down vote up
@Override
public void init(Service service) {
    this.textLeft = service.getResources().getDimension(R.dimen.malvarez_heart_rate_text_left);
    this.textTop = service.getResources().getDimension(R.dimen.malvarez_heart_rate_text_top);

    this.textPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.textPaint.setColor(service.getResources().getColor(R.color.malvarez_time_colour));
    this.textPaint.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.textPaint.setTextSize(service.getResources().getDimension(R.dimen.malvarez_circles_font_size));
    this.textPaint.setTextAlign(Paint.Align.CENTER);

    this.heartIcon = service.getResources().getDrawable(R.drawable.heart, null);
    this.setDrawableBounds(this.heartIcon, service.getResources().getDimension(R.dimen.malvarez_heart_rate_icon_left), service.getResources().getDimension(R.dimen.malvarez_heart_rate_icon_top));
}
 
Example 8
Source File: MalvarezClock.java    From AmazfitAPKs with Apache License 2.0 5 votes vote down vote up
@Override
public void init(Service service) {

    this.background = service.getResources().getColor(R.color.malvarez_background);

    this.leftHour = service.getResources().getDimension(R.dimen.malvarez_time_hour_left);
    this.topHour = service.getResources().getDimension(R.dimen.malvarez_time_hour_top);
    this.leftMinute = service.getResources().getDimension(R.dimen.malvarez_time_minute_left);
    this.topMinute = service.getResources().getDimension(R.dimen.malvarez_time_minute_top);
    this.leftDate = service.getResources().getDimension(R.dimen.malvarez_date_left);
    this.topDate = service.getResources().getDimension(R.dimen.malvarez_date_top);

    this.hourFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.hourFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.hourFont.setTextSize(service.getResources().getDimension(R.dimen.malvarez_time_font_size));
    this.hourFont.setColor(service.getResources().getColor(R.color.malvarez_time_colour));
    this.hourFont.setTextAlign(Paint.Align.CENTER);

    this.timeFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.timeFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.timeFont.setTextSize(service.getResources().getDimension(R.dimen.malvarez_time_font_size));
    this.timeFont.setColor(service.getResources().getColor(R.color.malvarez_hour_colour));
    this.timeFont.setTextAlign(Paint.Align.CENTER);

    this.dateFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.dateFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.dateFont.setTextSize(service.getResources().getDimension(R.dimen.malvarez_date_font_size));
    this.dateFont.setColor(service.getResources().getColor(R.color.malvarez_time_colour));
    this.dateFont.setTextAlign(Paint.Align.CENTER);
}
 
Example 9
Source File: PassCodeView.java    From android-passcodeview with Apache License 2.0 5 votes vote down vote up
private void preparePaint() {
  paint = new Paint(TextPaint.ANTI_ALIAS_FLAG);
  textPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
  circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
  circlePaint.setStyle(Paint.Style.FILL);
  paint.setStyle(Paint.Style.FILL);
  textPaint.setStyle(Paint.Style.FILL);
  textPaint.setColor(Color.argb(255, 0, 0, 0));
  textPaint.density = getResources().getDisplayMetrics().density;
  textPaint.setTextSize(keyTextSize);
  textPaint.setTextAlign(Paint.Align.CENTER);
}
 
Example 10
Source File: PopupAudioView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public PopupAudioView(Context context) {
    super(context);
    timePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    timePaint.setTextSize(AndroidUtilities.dp(16));

    TAG = DownloadController.getInstance(currentAccount).generateObserverTag();

    seekBar = new SeekBar(getContext());
    seekBar.setDelegate(this);
    progressView = new ProgressView();
}
 
Example 11
Source File: CaloriesWidget.java    From AmazfitAPKs with Apache License 2.0 5 votes vote down vote up
@Override
public void init(Service service) {
    this.textLeft = service.getResources().getDimension(R.dimen.widget_text_left);
    this.textTop = service.getResources().getDimension(R.dimen.widget_text_top);

    this.textPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.textPaint.setColor(service.getResources().getColor(R.color.time_colour));
    this.textPaint.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.textPaint.setTextSize(service.getResources().getDimension(R.dimen.circles_font_size));
    this.textPaint.setTextAlign(Paint.Align.CENTER);
}
 
Example 12
Source File: PopupAudioView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public PopupAudioView(Context context) {
    super(context);
    timePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    timePaint.setTextSize(AndroidUtilities.dp(16));

    TAG = DownloadController.getInstance(currentAccount).generateObserverTag();

    seekBar = new SeekBar(getContext());
    seekBar.setDelegate(this);
    progressView = new ProgressView();
}
 
Example 13
Source File: MainClock.java    From AmazfitAPKs with Apache License 2.0 5 votes vote down vote up
@Override
public void init(Service service) {
    this.background = service.getResources().getDrawable(R.drawable.background_heart);
    this.background.setBounds(0,0,320,320);

    this.leftHour = service.getResources().getDimension(R.dimen.time_hour_left);
    this.topHour = service.getResources().getDimension(R.dimen.time_hour_top);
    this.leftMinute = service.getResources().getDimension(R.dimen.time_minute_left);
    this.topMinute = service.getResources().getDimension(R.dimen.time_minute_top);
    this.leftDate = service.getResources().getDimension(R.dimen.date_left);
    this.topDate = service.getResources().getDimension(R.dimen.date_top);

    this.leftWeekday = service.getResources().getDimension(R.dimen.weekday_left);
    this.topWeekday = service.getResources().getDimension(R.dimen.weekday_top);

    this.hourFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.hourFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.hourFont.setTextSize(service.getResources().getDimension(R.dimen.time_font_size));
    this.hourFont.setColor(service.getResources().getColor(R.color.time_colour));
    this.hourFont.setTextAlign(Paint.Align.CENTER);

    this.timeFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.timeFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.timeFont.setTextSize(service.getResources().getDimension(R.dimen.time_font_size));
    this.timeFont.setColor(service.getResources().getColor(R.color.hour_colour));
    this.timeFont.setTextAlign(Paint.Align.CENTER);

    this.dateFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.dateFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.dateFont.setTextSize(service.getResources().getDimension(R.dimen.date_font_size));
    this.dateFont.setColor(service.getResources().getColor(R.color.time_colour));
    this.dateFont.setTextAlign(Paint.Align.CENTER);

    this.weekdayFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.weekdayFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.weekdayFont.setTextSize(service.getResources().getDimension(R.dimen.date_font_size));
    this.weekdayFont.setColor(service.getResources().getColor(R.color.time_colour));
    this.weekdayFont.setTextAlign(Paint.Align.CENTER);
}
 
Example 14
Source File: CaloriesWidget.java    From AmazfitAPKs with Apache License 2.0 5 votes vote down vote up
@Override
public void init(Service service) {
    this.textLeft = service.getResources().getDimension(R.dimen.calories_text_left);
    this.textTop = service.getResources().getDimension(R.dimen.calories_text_top);

    this.textPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.textPaint.setColor(service.getResources().getColor(R.color.time_colour));
    this.textPaint.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.PROTOTYPE_SOURCE));
    this.textPaint.setTextSize(service.getResources().getDimension(R.dimen.circles_font_size));
    this.textPaint.setTextAlign(Paint.Align.CENTER);
}
 
Example 15
Source File: HeartRateWidget.java    From AmazfitAPKs with Apache License 2.0 5 votes vote down vote up
@Override
public void init(Service service) {
    this.textLeft = service.getResources().getDimension(R.dimen.heart_rate_text_left);
    this.textTop = service.getResources().getDimension(R.dimen.heart_rate_text_top);

    this.textPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.textPaint.setColor(service.getResources().getColor(R.color.time_colour));
    this.textPaint.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.PROTOTYPE_SOURCE));
    this.textPaint.setTextSize(service.getResources().getDimension(R.dimen.circles_font_size));
    this.textPaint.setTextAlign(Paint.Align.CENTER);

    this.heartIcon = service.getResources().getDrawable(R.drawable.heart, null);
    this.setDrawableBounds(this.heartIcon, service.getResources().getDimension(R.dimen.heart_rate_icon_left), service.getResources().getDimension(R.dimen.heart_rate_icon_top));
}
 
Example 16
Source File: MalvarezClock.java    From malvarez-watchface with Apache License 2.0 5 votes vote down vote up
@Override
public void init(Service service) {

    this.background = service.getResources().getColor(R.color.malvarez_background);

    this.leftHour = service.getResources().getDimension(R.dimen.malvarez_time_hour_left);
    this.topHour = service.getResources().getDimension(R.dimen.malvarez_time_hour_top);
    this.leftMinute = service.getResources().getDimension(R.dimen.malvarez_time_minute_left);
    this.topMinute = service.getResources().getDimension(R.dimen.malvarez_time_minute_top);
    this.leftDate = service.getResources().getDimension(R.dimen.malvarez_date_left);
    this.topDate = service.getResources().getDimension(R.dimen.malvarez_date_top);

    this.hourFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.hourFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.hourFont.setTextSize(service.getResources().getDimension(R.dimen.malvarez_time_font_size));
    this.hourFont.setColor(service.getResources().getColor(R.color.malvarez_time_colour));
    this.hourFont.setTextAlign(Paint.Align.CENTER);

    this.timeFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.timeFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.timeFont.setTextSize(service.getResources().getDimension(R.dimen.malvarez_time_font_size));
    this.timeFont.setColor(service.getResources().getColor(R.color.malvarez_hour_colour));
    this.timeFont.setTextAlign(Paint.Align.CENTER);

    this.dateFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.dateFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.BEBAS_NEUE));
    this.dateFont.setTextSize(service.getResources().getDimension(R.dimen.malvarez_date_font_size));
    this.dateFont.setColor(service.getResources().getColor(R.color.malvarez_time_colour));
    this.dateFont.setTextAlign(Paint.Align.CENTER);
}
 
Example 17
Source File: PopupAudioView.java    From Yahala-Messenger with MIT License 5 votes vote down vote up
public PopupAudioView(Context context) {
    super(context);
    if (backgroundMediaDrawableIn == null) {
        backgroundMediaDrawableIn = getResources().getDrawable(R.drawable.msg_in_photo);
        statesDrawable[0][0] = getResources().getDrawable(R.drawable.play1);
        statesDrawable[0][1] = getResources().getDrawable(R.drawable.play1_pressed);
        statesDrawable[1][0] = getResources().getDrawable(R.drawable.pause1);
        statesDrawable[1][1] = getResources().getDrawable(R.drawable.pause1_pressed);
        statesDrawable[2][0] = getResources().getDrawable(R.drawable.audioload1);
        statesDrawable[2][1] = getResources().getDrawable(R.drawable.audioload1_pressed);
        statesDrawable[3][0] = getResources().getDrawable(R.drawable.audiocancel1);
        statesDrawable[3][1] = getResources().getDrawable(R.drawable.audiocancel1_pressed);

        statesDrawable[4][0] = getResources().getDrawable(R.drawable.play2);
        statesDrawable[4][1] = getResources().getDrawable(R.drawable.play2_pressed);
        statesDrawable[5][0] = getResources().getDrawable(R.drawable.pause2);
        statesDrawable[5][1] = getResources().getDrawable(R.drawable.pause2_pressed);
        statesDrawable[6][0] = getResources().getDrawable(R.drawable.audioload2);
        statesDrawable[6][1] = getResources().getDrawable(R.drawable.audioload2_pressed);
        statesDrawable[7][0] = getResources().getDrawable(R.drawable.audiocancel2);
        statesDrawable[7][1] = getResources().getDrawable(R.drawable.audiocancel2_pressed);

        timePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
        timePaint.setTextSize(OSUtilities.dp(16));
    }

    TAG = MediaController.getInstance().generateObserverTag();

    seekBar = new SeekBar(getContext());
    seekBar.delegate = this;
    progressView = new ProgressView();
}
 
Example 18
Source File: FloorWidget.java    From GreatFit with MIT License 5 votes vote down vote up
@Override
public void init(Service service) {
    // Font
    this.textPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.textPaint.setColor(settings.floorsColor);
    this.textPaint.setTypeface(ResourceManager.getTypeFace(service.getResources(), settings.font));
    this.textPaint.setTextSize(settings.floorsFontSize);
    this.textPaint.setTextAlign( (settings.floorsAlignLeft) ? Paint.Align.LEFT : Paint.Align.CENTER );

    if(settings.floorsIcon){
        this.icon = Util.decodeImage(service.getResources(),"icons/"+settings.is_white_bg+"floors.png");
    }
}
 
Example 19
Source File: MainClock.java    From AmazfitAPKs with Apache License 2.0 4 votes vote down vote up
@Override
public void init(Service service) {

    this.background = service.getResources().getDrawable(R.drawable.background);
    this.background.setBounds(0, 0, 320, 320);

    this.leftHour = service.getResources().getDimension(R.dimen.time_hour_left);
    this.topHour = service.getResources().getDimension(R.dimen.time_hour_top);
    this.leftMinute = service.getResources().getDimension(R.dimen.time_minute_left);
    this.topMinute = service.getResources().getDimension(R.dimen.time_minute_top);
    this.leftDate = service.getResources().getDimension(R.dimen.date_left);
    this.topDate = service.getResources().getDimension(R.dimen.date_top);
    this.leftWeekday = service.getResources().getDimension(R.dimen.weekday_left);
    this.topWeekday = service.getResources().getDimension(R.dimen.weekday_top);


    this.hourFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.hourFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.PROTOTYPE_SOURCE));
    this.hourFont.setTextSize(service.getResources().getDimension(R.dimen.time_font_size));
    this.hourFont.setColor(service.getResources().getColor(R.color.time_colour));
    this.hourFont.setTextAlign(Paint.Align.CENTER);

    this.timeFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.timeFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.PROTOTYPE_SOURCE));
    this.timeFont.setTextSize(service.getResources().getDimension(R.dimen.time_font_size));
    this.timeFont.setColor(service.getResources().getColor(R.color.hour_colour));
    this.timeFont.setTextAlign(Paint.Align.CENTER);

    this.dateFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.dateFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.PROTOTYPE_SOURCE));
    this.dateFont.setTextSize(service.getResources().getDimension(R.dimen.date_font_size));
    this.dateFont.setColor(service.getResources().getColor(R.color.time_colour));
    this.dateFont.setTextAlign(Paint.Align.CENTER);

    this.weekdayFont = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    this.weekdayFont.setTypeface(ResourceManager.getTypeFace(service.getResources(), ResourceManager.Font.IRRESISTIBLE_HOLLYWOOD));
    this.weekdayFont.setTextSize(service.getResources().getDimension(R.dimen.weekday_font_size));
    this.weekdayFont.setColor(service.getResources().getColor(R.color.time_colour));
    this.weekdayFont.setTextAlign(Paint.Align.CENTER);

}
 
Example 20
Source File: JustifiedTextView.java    From MVPAndroidBootstrap with Apache License 2.0 4 votes vote down vote up
private void initTextPaint(){
    textPaint=new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    textPaint.setTextAlign(Align.RIGHT);
}