Add construtor that accepts color. (#88)

This commit is contained in:
Hristo Hristov
2017-03-09 16:23:16 +02:00
committed by GitHub
parent ad11e397fe
commit aa14ce8b80

View File

@@ -2,12 +2,17 @@ package org.nativescript.widgets;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.support.annotation.ColorInt;
/** /**
* Created by hhristov on 2/23/17. * Created by hhristov on 2/23/17.
*/ */
public class SegmentedBarColorDrawable extends ColorDrawable { public class SegmentedBarColorDrawable extends ColorDrawable {
public SegmentedBarColorDrawable(@ColorInt int color) {
super(color);
}
public void draw(android.graphics.Canvas canvas) { public void draw(android.graphics.Canvas canvas) {
Paint p = new Paint(); Paint p = new Paint();
p.setColor(this.getColor()); p.setColor(this.getColor());