0
我可以使用哪種解決方案在將每個字母繪製到畫布之前製作動畫?四,搜索互聯網,我似乎沒有看到任何合理的...Android LiveWallpaper動畫製圖
private void draw() {
SurfaceHolder holder = getSurfaceHolder();
Canvas canvas = null;
try {
canvas = holder.lockCanvas();
if (canvas != null) {
// Draw background
canvas.drawColor(PrefService.getBgColor());
StaticLayout textLayout = new StaticLayout(TEXT_I_WOULD_LIKE_TO_ANIMATE, textPaint, screenWidth - screenWidth/8, Layout.Alignment.ALIGN_CENTER, 1.0F, 1.0F, true);
canvas.translate((screenWidth/2) - (textLayout.getWidth()/2), (screenHeight/2) - ((textLayout.getHeight()/2)));
textLayout.draw(canvas);
}
} finally {
if (canvas != null) {
holder.unlockCanvasAndPost(canvas);
}
}
}
handler.removeCallbacks(drawRunner);
handler.postDelayed(drawRunner, 20000);
}
注意TEXT_I_WOULD_LIKE_TO_ANIMATE變量上面StaticLayout
任何幫助,不勝感激