Merge pull request #89 from NativeScript/segmented-bar-color-thickness

Segmented bar indicatior thickness based on API lvl
This commit is contained in:
Alexander Vakrilov
2017-03-13 11:34:07 +02:00
committed by GitHub

View File

@@ -9,6 +9,8 @@ import android.support.annotation.ColorInt;
*/
public class SegmentedBarColorDrawable extends ColorDrawable {
static final int indicatorThickness = android.os.Build.VERSION.SDK_INT >= 21 ? 6 : 15;
public SegmentedBarColorDrawable(@ColorInt int color) {
super(color);
}
@@ -17,6 +19,6 @@ public class SegmentedBarColorDrawable extends ColorDrawable {
Paint p = new Paint();
p.setColor(this.getColor());
p.setStyle(android.graphics.Paint.Style.FILL);
canvas.drawRect(0, this.getBounds().height() - 15, this.getBounds().width(), this.getBounds().height(), p);
canvas.drawRect(0, this.getBounds().height() - indicatorThickness, this.getBounds().width(), this.getBounds().height(), p);
}
}