не могу понять, как повернуть текст, чтобы начальная позиция не была случайной. (Я не хочу его оживлять). я просто хочу указать начальную позицию.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new GraphicsView(this));
}
private static class GraphicsView extends View {
private static final String QUOTE = "Nobody uses Java anymore. It's this big heavyweight ball and chain.";
Path circle;
Paint tPaint;
public GraphicsView(Context context) {
super(context);
tPaint = new Paint();
tPaint.setColor(Color.BLUE);
tPaint.setTextSize(30);
tPaint.setAntiAlias(true);
//setBackgroundResource(R.drawable.background);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
circle = new Path();
int centerX = getWidth()/2;
int centerY = getHeight()/2;
circle.addCircle(centerX, centerY, Math.min(centerX, centerY), Direction.CW);
canvas.drawTextOnPath(QUOTE, circle, 0, 30, tPaint);
}
}