All Projects → magical-xu → CountDownTextView

magical-xu / CountDownTextView

Licence: Apache-2.0 license
A count down widget for verify code

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to CountDownTextView

Collapsibletextview
show or hide part of text only in a TextView
Stars: ✭ 135 (+513.64%)
Mutual labels:  textview
Supertextview
🎀 SuperTextView for Android 是一个在TextView的基础上扩展了几种动画效果的控件。
Stars: ✭ 165 (+650%)
Mutual labels:  textview
Stringformatter
Simple Text Formetter (Credit Card Number, Phone Number, Serial Number etc.) Can be used in all text inputs according to the format pattern. If desired, large minor character restrictions can be made in the format pattern.
Stars: ✭ 231 (+950%)
Mutual labels:  textview
Sharpview
安卓带有尖角气泡的控件(TextView,ImageView,EditText,Layout),支持渐变色,圆角等自定义属性
Stars: ✭ 137 (+522.73%)
Mutual labels:  textview
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (+618.18%)
Mutual labels:  textview
Rskplaceholdertextview
A light-weight UITextView subclass that adds support for placeholder.
Stars: ✭ 192 (+772.73%)
Mutual labels:  textview
Tytext
text asynchronous rendering by TextKit for iOS
Stars: ✭ 127 (+477.27%)
Mutual labels:  textview
ShapeView
打造万能shape,再也不用写很多xml了,可以当做TextView,Button,EditText等多种控件,方便实用
Stars: ✭ 34 (+54.55%)
Mutual labels:  textview
Android Lib Verticalmarqueetextview
A custom TextView with vertical marquee effect
Stars: ✭ 163 (+640.91%)
Mutual labels:  textview
Superxml
android布局能力增加,轻松实现圆角、边框、虚线、属性覆盖等功能。完全无侵入
Stars: ✭ 221 (+904.55%)
Mutual labels:  textview
Fstextview
继承于UITextView的自定义TextView, 带placeholder和可限制最大输入字符数, 已适配横竖屏切换.
Stars: ✭ 140 (+536.36%)
Mutual labels:  textview
Vectorcompattextview
One VectorCompatTextView suits for hundreds of CompoundDrawable style. 一个库,满足CompoundDrawable的百变风格。
Stars: ✭ 147 (+568.18%)
Mutual labels:  textview
Html Textview
TextView to display simple HTML
Stars: ✭ 2,445 (+11013.64%)
Mutual labels:  textview
Textview Rich Drawable
Android TextView with rich support of compound drawables
Stars: ✭ 136 (+518.18%)
Mutual labels:  textview
Compoundicontextview
An android library that is able to set a vector drawable at text view pre-Lollipop.
Stars: ✭ 241 (+995.45%)
Mutual labels:  textview
Fading Text View
A TextView that changes its content automatically every few seconds
Stars: ✭ 1,691 (+7586.36%)
Mutual labels:  textview
Slantedtextview
Android slanted TextView.
Stars: ✭ 2,197 (+9886.36%)
Mutual labels:  textview
TypedTextView
Custom implementation of Android's TextView simulating a keyboard/type-writer.
Stars: ✭ 57 (+159.09%)
Mutual labels:  textview
Alginproject
模仿微信读书左右对齐的文字效果
Stars: ✭ 251 (+1040.91%)
Mutual labels:  textview
Blitz
Android Library: Set self-updating string with relative time in TextView (e.g. 5 minutes ago)
Stars: ✭ 217 (+886.36%)
Mutual labels:  textview

CountDownTextView

中文版

A simple verify code countdown widget that using TextSwitcher and CountDownTimer.

Advantages

1.Simple to use
2.Good encapsulation and high cohesion

GIFS

 sample1 sample2

Attributes

name format description
text_size dimension set the text size
text_color color the text color can use a selector
tip_text string the tips string showing when countdown finish
init_text string the string showing by the first time
gap_string_format string the tips when countdown is processing (use string format)
enable_background reference the background when widget is enable and default is transparent
disable_background reference the background when widget is disable and default is transparent
total_time integer the total time that will be countdown
anim_in reference the anim when view switch in and default is android.R.anim.fade_in
anim_out reference the anim when view switch out and default is android.R.anim.fade_out
android:animateFirstView boolean if anim the view when first show

How to use

1.add JitPack in project's build.gradle

root build.gradle:  
allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}  
  
your project:  
dependencies {
	        implementation 'com.github.magical-xu:CountDownTextView:v1.0.4.1'
	     }

2.sample use in xml

<com.magicalxu.library.CountDownTextView
        android:id="@+id/id_button_orange"
        android:layout_width="120dp"
        android:layout_height="match_parent"
	android:animateFirstView="false"
        magical:anim_in="@android:anim/slide_in_left"
        magical:anim_out="@android:anim/slide_out_right"
        magical:disable_background="@drawable/shape_disable"
        magical:enable_background="@drawable/shape_enable"
        magical:text_color="@color/selector_verify_code_text_color"
        magical:text_size="14sp"
        magical:total_time="10" />

3.public method

[1] start() : start to countdown
[2] cancel(): cancel the internal timer
[3] reSet() : reset to the init state ( not the parent method "reset()" )
[4] textHint(): set true to show the dark color or false the light
[5] isProcessing(): if the widget is countdown at the time

4.set the click listener

mBtnNormal.setSendListener(new CountDownTextView.ISendListener() {
      @Override
      public void onSend(View view) {
        // the event when click widget  
      }
});

5.note

to avoid memory leak , u need to invoke #cancel() method in method like "onDestory"

change log

v1.0.4.1(2018.5.2)  

refactory the name
add some attribute

License

 Copyright 2017 magical_xu <[email protected]>
 
 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.  
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].