nilupeng
2022-08-09 f7237e21b9752946ac65aa79ad2f9c7ee0f23744
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.runt.open.mvvm.ui.splash;
 
import android.os.Handler;
 
import androidx.lifecycle.MutableLiveData;
 
import com.runt.open.mvvm.base.model.BaseViewModel;
 
import java.util.Date;
 
/**
 * Created by Administrator on 2021/11/15 0015.
 */
public class SplashViewModel extends BaseViewModel {
 
    final String TAG = "SplashViewModel";
    long cTime = new Date().getTime(),limitTime = 2000;
 
    private MutableLiveData<Integer> timeOut = new MutableLiveData<>();
 
 
    public MutableLiveData<Integer> getTimeOut() {
        return timeOut;
    }
 
    public void countdown(){
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                timeOut.setValue(0);
            }
        },limitTime);
    }
 
 
}