An open API service indexing awesome lists of open source software.

https://github.com/jsaman19/easycountdowntimer

A simple android library to countdown timer textview for api 14+
https://github.com/jsaman19/easycountdowntimer

android countdown-timer custom-view java

Last synced: 13 days ago
JSON representation

A simple android library to countdown timer textview for api 14+

Awesome Lists containing this project

README

          

# easyCountDownTimer
A simple android library to countdown timer textview for api 14+

## Screan shot

![screan_shot](https://user-images.githubusercontent.com/6823491/30234511-0261af9c-9513-11e7-964b-b0f6c45f6261.gif)

![screan_shot](screenshots/Screenshot_20191230-190735.png)

## Setup

The simplest way to use easyCountDownTimer is to add the library as aar dependency to your build.

#### Maven

```

ir.samanjafari.easycountdowntimer
easycountdowntimer
2.5.0
aar

```

#### Gradle

```
buildscript {
repositories {
google()
jcenter()
mavenCentral() // Add this Line
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral() // Add this line
}
}

dependencies {
implementation 'ir.samanjafari.easycountdowntimer:easycountdowntimer:2.5.0'
}
```

#### Usage

Add the following code to your view

```xml

```

whit the following code you can listen to onFinish or onTick timer

```java
EasyCountDownTextview countDownTextview = (EasyCountDownTextview) findViewById(R.id.easyCountDownTextview);
easyCountDownTextview.setTime(1, 1, 1, 1);
easyCountDownTextview.setOnTick(new CountDownInterface() {
@Override
public void onTick(long time) {

}

@Override
public void onFinish() {

}
});
```
how to set time programmatically ?

```java
EasyCountDownTextview easyCountDownTextview = (EasyCountDownTextview) findViewById(R.id.easyCountDownTextview);
easyCountDownTextview.setTime(1,1, 30, 15);// setTime(days, hours, minute, second)
```

how to set custom font

```java
Typeface typeface = ResourcesCompat.getFont(this, R.font.my_font);
easyCountDownTextview.setTypeFace(typeface);
```

how to pause and resume timer

```java
easyCountDownTextview.pause();

easyCountDownTextview.resume();
```

## Licence

Copyright 2017 Saman Jafari

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.

## Author

Saman Jafari

email: saman.jafari69@gmail.com

github: https://github.com/jsaman19

site : http://samanjafari.ir