Java Code Examples for android.graphics.drawable.shapes.Shape#resize()

The following examples show how to use android.graphics.drawable.shapes.Shape#resize() . 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: PositionMarker.java    From mappwidget with Apache License 2.0 5 votes vote down vote up
public PositionMarker(MapWidget context, Object id, Drawable roundPointerDrawable, Drawable arrowPointerDrawable)
{
    super(id, null, new Point(0, 0), false, false);
    this.context = context;
    
    accuracy = 500;
    pixelsInMeter = 0;
    
    hasBearing = false;
    arrowPointerPivotPoint = null;
    roundPointerPivotPoint= null;
    
    this.context = context;
    
    Shape accuracyShape = new OvalShape();
    accuracyShape.resize(getAccuracyDiameter(), getAccuracyDiameter());
    
    accuracyDrawable = new ShapeDrawable(accuracyShape);     
    this.roundPointerDrawable = roundPointerDrawable;
    this.arrowPointerDrawable = arrowPointerDrawable;
    
    Paint accuracyAreaPaint = accuracyDrawable.getPaint();
    accuracyAreaPaint.setStyle(Style.FILL);

    accuracyBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    accuracyBorderPaint.setStyle(Style.STROKE);
    
    setDrawable(roundPointerDrawable);
}
 
Example 2
Source File: PinputView.java    From android-pin with MIT License 5 votes vote down vote up
protected Drawable makeCharShape(float size, int color, Rect bounds) {
    Shape shape = new OvalShape();
    shape.resize(size, size);
    ShapeDrawable drawable = new ShapeDrawable(shape);
    drawable.getPaint().setColor(color);
    drawable.getPaint().setFlags(Paint.ANTI_ALIAS_FLAG);
    drawable.setBounds(bounds);
    return drawable;
}
 
Example 3
Source File: VMIndicatorHolder.java    From VMLibrary with Apache License 2.0 4 votes vote down vote up
public void setWidth(float width) {
    Shape s = shape.getShape();
    s.resize(width, s.getHeight());
}
 
Example 4
Source File: VMIndicatorHolder.java    From VMLibrary with Apache License 2.0 4 votes vote down vote up
public void setHeight(float height) {
    Shape s = shape.getShape();
    s.resize(s.getWidth(), height);
}
 
Example 5
Source File: ShapeHolder.java    From uPods-android with Apache License 2.0 4 votes vote down vote up
public void setWidth(float width) {
    Shape s = shape.getShape();
    s.resize(width, s.getHeight());
}
 
Example 6
Source File: ShapeHolder.java    From uPods-android with Apache License 2.0 4 votes vote down vote up
public void setHeight(float height) {
    Shape s = shape.getShape();
    s.resize(s.getWidth(), height);
}
 
Example 7
Source File: ShapeHolder.java    From KJFrameForAndroid with Apache License 2.0 4 votes vote down vote up
public void setWidth(float width) {
    Shape s = shape.getShape();
    s.resize(width, s.getHeight());
}
 
Example 8
Source File: ShapeHolder.java    From KJFrameForAndroid with Apache License 2.0 4 votes vote down vote up
public void setHeight(float height) {
    Shape s = shape.getShape();
    s.resize(s.getWidth(), height);
}
 
Example 9
Source File: ShapeHolder.java    From codeexamples-android with Eclipse Public License 1.0 4 votes vote down vote up
public void setWidth(float width) {
    Shape s = shape.getShape();
    s.resize(width, s.getHeight());
}
 
Example 10
Source File: ShapeHolder.java    From codeexamples-android with Eclipse Public License 1.0 4 votes vote down vote up
public void setHeight(float height) {
    Shape s = shape.getShape();
    s.resize(s.getWidth(), height);
}
 
Example 11
Source File: ShapeHolder.java    From AnimationApiDemos with Apache License 2.0 4 votes vote down vote up
public void setWidth(float width) {
    Shape s = shape.getShape();
    s.resize(width, s.getHeight());
}
 
Example 12
Source File: ShapeHolder.java    From AnimationApiDemos with Apache License 2.0 4 votes vote down vote up
public void setHeight(float height) {
    Shape s = shape.getShape();
    s.resize(s.getWidth(), height);
}