s a h a r70
پنج شنبه 07 خرداد 1394, 11:21 صبح
سلام....راهنمایی کنید که چجوری میتونم بین دو قطعه کد زیر وقفه پنج ثانیه ای ایجاد کنم
@Override
protected void onDraw(Canvas canvas) {
canvas.drawBitmap(backgrand,0,0, null);
paint.setColor(Color.WHITE);
paint.setTextSize(scale*30);
String str2rotate = "Com";
x = (float)(screenW*(0.8));
y = (float)(screenH*(0.5));
paint.getTextBounds(str2rotate, 0, str2rotate.length(), rect);
canvas.translate(x, y);
canvas.translate(-x, -y);
canvas.rotate(-90, x + rect.exactCenterX(), y + rect.exactCenterY());
paint.setStyle(Paint.Style.FILL);
canvas.drawText(str2rotate, x, y, paint);
canvas.rotate(90, x + rect.exactCenterX(), y + rect.exactCenterY());
paint.setColor(Color.WHITE);
paint.setTextSize(scale*30);
x = (float)(screenW*(0.1));
y = (float)(screenH*(0.5));
paint.getTextBounds(str2rotate, 0, str2rotate.length(), rect);
canvas.translate(x, y);
canvas.translate(-x, -y);
canvas.rotate(90, x + rect.exactCenterX(), y + rect.exactCenterY());
paint.setStyle(Paint.Style.FILL);
canvas.drawText(str2rotate, x, y, paint);
canvas.rotate(-90, x + rect.exactCenterX(), y + rect.exactCenterY());
paint.setColor(Color.WHITE);
paint.setStyle(Paint.Style.FILL);
paint.setTextSize(scale*30);
canvas.drawText("Me",(float)(screenW*(0.45)),(float)(screenH*(0.9)), paint);
canvas.drawText("Friend",(float)(screenW*(0.40)),(float)(screenH*(0.1)), paint);
canvas.drawBitmap(backcard,(float)(screenW*(0.41)) ,(float)(screenH/2.9), null);
//اینجا
for (int i = 0; i < myHand.size(); i++) {
canvas.drawBitmap(myHand.get(i).getBitmap(),(float )((i+1)*(scaledCardW/3.8)),
screenH-(scaledCardH+(scaledCardH/3)),
null);
}
}
@Override
protected void onDraw(Canvas canvas) {
canvas.drawBitmap(backgrand,0,0, null);
paint.setColor(Color.WHITE);
paint.setTextSize(scale*30);
String str2rotate = "Com";
x = (float)(screenW*(0.8));
y = (float)(screenH*(0.5));
paint.getTextBounds(str2rotate, 0, str2rotate.length(), rect);
canvas.translate(x, y);
canvas.translate(-x, -y);
canvas.rotate(-90, x + rect.exactCenterX(), y + rect.exactCenterY());
paint.setStyle(Paint.Style.FILL);
canvas.drawText(str2rotate, x, y, paint);
canvas.rotate(90, x + rect.exactCenterX(), y + rect.exactCenterY());
paint.setColor(Color.WHITE);
paint.setTextSize(scale*30);
x = (float)(screenW*(0.1));
y = (float)(screenH*(0.5));
paint.getTextBounds(str2rotate, 0, str2rotate.length(), rect);
canvas.translate(x, y);
canvas.translate(-x, -y);
canvas.rotate(90, x + rect.exactCenterX(), y + rect.exactCenterY());
paint.setStyle(Paint.Style.FILL);
canvas.drawText(str2rotate, x, y, paint);
canvas.rotate(-90, x + rect.exactCenterX(), y + rect.exactCenterY());
paint.setColor(Color.WHITE);
paint.setStyle(Paint.Style.FILL);
paint.setTextSize(scale*30);
canvas.drawText("Me",(float)(screenW*(0.45)),(float)(screenH*(0.9)), paint);
canvas.drawText("Friend",(float)(screenW*(0.40)),(float)(screenH*(0.1)), paint);
canvas.drawBitmap(backcard,(float)(screenW*(0.41)) ,(float)(screenH/2.9), null);
//اینجا
for (int i = 0; i < myHand.size(); i++) {
canvas.drawBitmap(myHand.get(i).getBitmap(),(float )((i+1)*(scaledCardW/3.8)),
screenH-(scaledCardH+(scaledCardH/3)),
null);
}
}