All Projects → dhruvtaneja → Timer Button

dhruvtaneja / Timer Button

Timer button is a countdown enabled button which can be used to disable user interactions while showing a timer on top of it.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Timer Button

Slidetoact
A simple 'Slide to Unlock' Material widget for Android, written in Kotlin 📱🎨🦄
Stars: ✭ 783 (+2425.81%)
Mutual labels:  android-ui
Android Customtoast
Easy to use Custom Toast Library for Android
Stars: ✭ 24 (-22.58%)
Mutual labels:  android-ui
Multilinedivider
Multi divider in RecyclerView on Android.
Stars: ✭ 13 (-58.06%)
Mutual labels:  android-ui
Animatedbottombar
A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.
Stars: ✭ 797 (+2470.97%)
Mutual labels:  android-ui
Recyclerviewinjectoradapter
RecyclerView.Adapter on steroids
Stars: ✭ 16 (-48.39%)
Mutual labels:  android-ui
Droidviews
android view demos
Stars: ✭ 24 (-22.58%)
Mutual labels:  android-ui
Insetter
Insetter is a library to help apps handle WindowInsets more easily
Stars: ✭ 766 (+2370.97%)
Mutual labels:  android-ui
Cardviewlist
An elegant and responsive CardView like Android on iOS with Swift. Available horizontal and vertical scrolling with full animations and customizable.
Stars: ✭ 30 (-3.23%)
Mutual labels:  android-ui
Radiallayout
A scrollable-ish view that arranges images in circles extending from the center of the screen.
Stars: ✭ 17 (-45.16%)
Mutual labels:  android-ui
Dachshund Tab Layout
Extended Android Tab Layout with animated indicators that have continuous feedback.
Stars: ✭ 853 (+2651.61%)
Mutual labels:  android-ui
Polygondrawingutil
A compact Android utility for constructing and drawing rounded regular polygons.
Stars: ✭ 805 (+2496.77%)
Mutual labels:  android-ui
Swipeablecard
A simple implementation of swipe card like StreetView
Stars: ✭ 812 (+2519.35%)
Mutual labels:  android-ui
Similarloadingview
A stylish loading view for Android
Stars: ✭ 26 (-16.13%)
Mutual labels:  android-ui
Androidveil
🎭 An easy, flexible way to implement veil skeletons and shimmering effect for Android.
Stars: ✭ 792 (+2454.84%)
Mutual labels:  android-ui
Xcdanmuview
Android弹幕效果View-支持左右两个方向
Stars: ✭ 28 (-9.68%)
Mutual labels:  android-ui
Labelsview
Android的标签列表控件。可以设置标签的选中效果。 可以设置标签的选中类型:不可选中、单选、限数量多选和不限数量多选等, 并支持设置必选项、单行显示、最大显示行数等功能。
Stars: ✭ 777 (+2406.45%)
Mutual labels:  android-ui
Headercollapsiblelayout
A wrapper layout that can easily split your current layout into header and body, and provides smooth header collapsing action with related event callbacks.
Stars: ✭ 24 (-22.58%)
Mutual labels:  android-ui
Fillingbutton
🔥Replace typical onLongClickListener with this library!
Stars: ✭ 31 (+0%)
Mutual labels:  android-ui
Peppy Calendarview
Simple and fast Material Design calendar view for Android.
Stars: ✭ 30 (-3.23%)
Mutual labels:  android-ui
Adaptablebottomnavigation
A simpler way for implementing the Bottom Navigation View on Android
Stars: ✭ 844 (+2622.58%)
Mutual labels:  android-ui

Timer Button

Android Arsenal

Timer button is a countdown enabled button which can be used to disable user interactions while showing a timer on top of it.

Gradle

To include this library in your gradle project

dependencies {
	// ... other dependencies here
    implementation 'com.dt:timerbutton:0.1'
}

Maven

To include this library in your maven project

<dependency>
  <groupId>com.dt</groupId>
  <artifactId>timerbutton</artifactId>
  <version>0.1</version>
  <type>pom</type>
</dependency>

Usage

Put this button in your layout file like this

<com.dhruv.timerbutton.TimerButton
        android:id="@+id/timer_button"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        app:animationBackground="@color/colorAccentTrans"
        app:animationCompleteText="@string/resend_otp"
        app:buttonBackground="@drawable/selector_button"
        app:defaultText="@string/send_otp"
        app:dynamicString="@string/resend_otp_formatted"
        app:textColor="@color/colorPrimaryDark"/>

The various attributes that are available are

<declare-styleable name="TimerButton">
        <!--text to be displayed after animation is complete-->
        <attr name="animationCompleteText" format="string|reference"/>
        <!--text to be displayed in pre-animation state-->
        <attr name="defaultText" format="string|reference"/>
        <!--text to be displayed during animation-->
        <attr name="dynamicString" format="reference"/>
        <!--the overlay that animates over the button. Can be a drawable, a gradient, etc-->
        <attr name="animationBackground" format="reference"/>
        <!--the background of the button-->
        <attr name="buttonBackground" format="reference"/>
        <!--color of the text-->
        <attr name="textColor" format="reference|color"/>
        <!--size of the text-->
        <attr name="textSize" format="reference|dimension"/>
    </declare-styleable>

Now in your java code, start, stop or reset the animation with something like this

TimerButton timerButton = findViewById(R.id.timer_button);
timerButton.setDuration(6000L);

//  Start the animation
timerButton.start();

//  Stop the animation
timerButton.stop();

//  Reset the animation
timerButton.reset();

Issues and pull requests are most welcome

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].