直播带货源码,简单实现商品倒计时开卖功能
public class ChronometerActivity extends AppCompatActivity {
private static final String TAG = "ChronometerActivity";
private Chronometer chronometer;
int count = 60;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chronometer);
chronometer = (Chronometer) findViewById(R.id.chronometer);
chronometer.start();
//停止计时
//chronometer.stop();
chronometer.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() {
@Override
public void onChronometerTick(Chronometer chronometer) {
count--;
chronometer.setText(count + "");
if (count == 0) {
chronometer.stop();
}
}
});
}
}
以上就是直播带货源码,简单实现商品倒计时开卖功能, 更多内容欢迎关注之后的文章
标签:count,chronometer,倒计时,直播,开卖,Chronometer From: https://www.cnblogs.com/yunbaomengnan/p/16649715.html