I want to create an android project. Which there is a layout that I want it to move smoothly on another layout. I have tried to use thread in order to do this. But in the result of my code, the layout jumps to its final position and do not move smoothly from the offset to its destination.

```
    abs1 = (AbsoluteLayout) findViewById(R.id.absoluteLayout2);
    ImageButton ib1 = (ImageButton) findViewById(R.id.imageButton1);
    ib1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {

            Runnable r = new Runnable() {

                @Override
                public void run() {
                    // TODO Auto-generated method stub
                        try {
                            display(100);
                            display(100);
                            display(100);
                            display(100);
                            display(100);
                            display(100);
                            display(100);
                        } catch (InterruptedException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        }

                }

                private void display(int i) throws InterruptedException {
                    AbsoluteLayout.LayoutParams param = (AbsoluteLayout.LayoutParams) abs1
                            .getLayoutParams();
                    param.x = param.x + 10;
                    // param.y=param.x+20;
                    abs1.setLayoutParams(param);

                    if (Thread.interrupted()) {
                        throw (new InterruptedException());
                    }
                        Thread.sleep(i);

                }
            };
                r.run();

```

main file:

```
    <AbsoluteLayout
        android:id="@+id/absoluteLayout2"
        android:layout_width="107dp"
        android:layout_height="308dp"
        android:layout_x="10dp"
        android:layout_y="12dp"
        android:background="@color/red" >

        <ImageButton
            android:id="@+id/imageButton1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_x="0dp"
            android:layout_y="0dp"
            android:background="@null"
            android:src="@drawable/calendar" />

```