# circleTimer **Repository Path**: baijuncheng-open-source/circle-timer ## Basic Information - **Project Name**: circleTimer - **Description**: 一个简单的带动画效果的钟表样式的倒计时器 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-05-31 - **Last Updated**: 2021-09-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CircleTimer A CirclerTimer with Animation and Timer ## Design sketch ![](screenshots/circleTimer.gif) ## Setup Solution 1: 1. Copy the circlerTimer/library folder to the project directory 2. Modify settings.gradle under the project and add the dependency on this module as follows: ``` include ':entry', ':library' ``` 3. Introduce the dependency of the module under the project. Taking the entry module as an example, you need to modify the build.gradle file under the entry module to add the dependency: ``` compile project(path: ':library') ``` or ``` implementation project(':library') ``` Solution 2: local use of har package integration 1. Compile this project, copy the har package generated in the build directory of the circlerTimer/library folder to the project lib folder: directory:\circlerTimer\library\build\outputs\har\debug\library-debug.har 2. Add the following code in the entry's gradle ``` implementation fileTree(dir:'libs', include: ['*.jar','*.har']) ``` Solution 3: 1. Add this in your root `build.gradle` file (**not** your module `build.gradle` file): ```xml allprojects { repositories { ... mavenCentral() } } ``` 2. The lib is available on Maven Central, you can find it with [Gradle, please] ```xml dependencies { implementation ‘com.gitee.baijuncheng-open-source:circleTimer:1.0.0' } ``` ### From the layout ```xml ``` ### From the code ```java CircleTimer timer = (CircleTimer)findComponentById(ResourceTable.Id_main_timer); timer.setMaximumTime(3600) // 60 minute timer.setInitPosition(2000); //default max 3600 ``` ### Start Timer ```java timer.start() // Stop and Reset() have to call after Start() timer.stop() timer.reset() ``` ### End Timer Linstener ```java rectTimer.setBaseTimerEndedListener(new RectTimer.baseTimerEndedListener() { //timer @Override public void OnEnded() { } }); ``` ## License Copyright 2020 jaeryo2357 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.