I want to make a countdown timer like the one below, but using the kotlin language I did not find a suitable article on the Internet for this subject.
timeCount=70000;
timer=new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
timeCount-=1000;
txtTimer.setText(getTimeStyle(timeCount));
if (timeCount==0){
timer.cancel();
txtTimer.setText("00:00");
txtResend.setVisibility(View.VISIBLE);
txtResend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
}
});
}
},0,1000);