package com.motse.fengshui_compass.common;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;

public class RotateThread extends Thread {
    private final Handler handler;

    public RotateThread(Handler handler) {
        this.handler = handler;
    }

    @Override
    public void run() {
//        super.run();
        float rotate = 0;
        while (!Thread.currentThread().isInterrupted()) {
            Bundle bundle = new Bundle();
            bundle.putFloat("rotation", rotate);
            Message message = new Message();
            message.setData(bundle);
            message.what = 1;
            handler.sendMessage(message);
            rotate++;
            SystemClock.sleep(10);
        }
    }
}
