# EasyCountDownTextureView **Repository Path**: chinasoft4_ohos/EasyCountDownTextureView ## Basic Information - **Project Name**: EasyCountDownTextureView - **Description**: 实现可以开始/停止,并且可以自定义时间的定时器 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-08-11 - **Last Updated**: 2021-10-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # EasyCountDownTextureView #### 项目介绍 - 项目名称:EasyCountDownTextureView - 所属系列:openharmony的第三方组件适配移植 - 功能:实现可以开始/停止,并且可以自定义时间的定时器 - 项目移植状态:主功能完成 - 调用差异:无 - 开发版本:sdk6,DevEco Studio 2.2 Beta1 - 基线版本:Release v1.1 #### 效果演示 ![](img/demo.gif) #### 安装教程 1.在项目根目录下的build.gradle文件中, ``` allprojects { repositories { maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' } } } ``` 2.在entry模块的build.gradle文件中, ``` dependencies { implementation('com.gitee.chinasoft_ohos:easycountdowntextureview:1.0.0') ...... } ``` 在sdk6,DevEco Studio2.2 Beta1 下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 #### 使用说明 使用该库非常简单,只需直接调用自定义组件即可。 - 1,布局中直接引用自定义组件 ```xml ``` 里面直接可以设置自定义组件的属性:属性如下 ```java app:easyCountBackgroundColor="#ffFFFFFF" // 背景色 app:easyCountRectBorderColor="#ffE5E5E5"// 边框颜色 app:easyCountRectRadius="0"// 圆角大小 app:easyCountTimeColor="#ffFF4A3E"// 字体颜色 app:easyCountTimeSize="16"// 字体大小 app:easyCountrectSpacing="5"// 内边距 app:easyCountHour="0"// 时 app:easyCountMinute="0"// 分 app:easyCountSecond="7"// 秒 app:ifRectRadius="1"// 是否圆角 app:ifsetdivision="1"// 间隔颜色是否设置 ``` - 2,启动倒计时 ```java easyCountDownTextureView.start(); ``` - 3,停止倒计时 ```java easyCountDownTextureView.stop(); ``` - 4,倒计时完成回调 ```java /** * When count down start */ void onCountDownStart(); /** * When count down time error */ void onCountDownTimeError(); /** * When count down stop * * @param millisInFuture millisInFuture */ void onCountDownStop(long millisInFuture); /** * When count down completed */ void onCountDownCompleted(); ``` - 5,设置时间函数 ```java public void setTimeHour(final int timeHour) { this.timeHour = timeHour; } public void setTimeMinute(final int timeMinute) { this.timeMinute = timeMinute; } public void setTimeSecond(final int timeSecond) { this.timeSecond = timeSecond; } ``` #### 测试信息 CodeCheck代码测试无异常 CloudTest代码测试无异常 病毒安全检测通过 当前版本demo功能与原组件基本无差异 #### 版本迭代 - 1.0.0 #### 版权和许可信息 Copyright (C) 2016 CaMnter yuanyu.camnter@gmail.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.