前言
大家好,我是 Vic,今天给大家带来AndroidStudio项目制作倒计时模块的概述,希望你们喜欢
项目难度
AndroidStudio项目制作倒计时模块的难度,不是很大,就是主要用了Timer和TimerTask这两个,接着就是现实界面的一些基础效果。
设计界面
做个倒计时的界面就比较好想了,就如下界面控件
填写倒计时时间
获取倒计时时间
显示倒计时
开始计时
停止计时
就在自动创建的activity_main.xml中写入代码:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="cn.edu.gdmec.android.counttime.MainActivity">
android:id="@+id/input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"