2
我正在做動畫,一些翻譯動畫使用,但這不是我想要的,我給了一個應用程序的參考前屏幕與動畫...有三個氣泡。最初他們將所有在一起後onTouch(),它只是打開了翻譯成其x,y座標通過位圖像Goibibo翻譯動畫
這是我使用翻譯的類,但我知道很多工作都要做
我繪製圖講座
public class DrawView extends View {
Paint paint = new Paint();
private int height;
Bitmap circlegreen ,circlered,circleyellow;
public DrawView(Context context, int height) {
super(context);
this.height = height;
circlegreen=BitmapFactory.decodeResource(getResources(), R.drawable.circlegreen);
circlered=BitmapFactory.decodeResource(getResources(), R.drawable.circlered);
circleyellow=BitmapFactory.decodeResource(getResources(), R.drawable.circleyellow);
this.height= this.height+circleyellow.getHeight();
}
@Override
public void onDraw(Canvas canvas) {
paint.setColor(Color.RED);
canvas.drawBitmap(circlegreen, 30, height, paint);
canvas.drawBitmap(circlered, 30, height, paint);
canvas.drawBitmap(circleyellow, 30, height, paint);
// canvas.drawRect(30, height, 60, 300, paint);
}
And in the fragment i am adding this DrawView to container..
@SuppressLint("NewApi")
@Override
public View onCreateView(LayoutInflater inflater, final ViewGroup container,
Bundle savedInstanceState) {
//View view = inflater.inflate(R.layout.fragment_home, container, false);
//dineInBtn=(Button) view.findViewById(R.id.dinein);
Display display = getActivity().getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
height = size.y;
Log.v("width=", width+"");
Log.v("height=", height+"");
final CountDownTimer timer = new CountDownTimer(2000, 50) {
@Override
public void onTick(long millisUntilFinished) {
height = height - 10;
drawView = new DrawView(getActivity(), height);
drawView.setBackgroundColor(Color.WHITE);
container.addView(drawView);
}
@Override
public void onFinish() {
}
};
Runnable run=new Runnable() {
@Override
public void run() {
timer.start();
}
};
new Thread(run).start();
還附加im年齡..