Skip to content

jineshfrancs/CaptchaImageView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cd656a5 · Jan 23, 2018

History

28 Commits
Jan 4, 2017
Jul 26, 2017
Jan 23, 2018
Nov 25, 2016
Jan 4, 2017
Nov 25, 2016
Nov 25, 2016
Dec 5, 2016
May 12, 2017
Dec 29, 2016
Nov 25, 2016
Nov 25, 2016
Nov 25, 2016
Nov 25, 2016
Jan 4, 2017

Repository files navigation

CaptchaImageView

Github All Releases Android Arsenal

Custom ImageView to generate captcha image.

Output sample Output sample

Add CaptchaImageView to your layout

 <test.jinesh.captchaimageviewlib.CaptchaImageView
            android:layout_width="wrap_content"
            android:id="@+id/image"
            android:layout_weight="6"
            android:layout_margin="5dp"
            android:layout_height="50dp"
            />

Call regenerate() method on CaptchaImageView to regenerate your captcha

 captchaImageView= (CaptchaImageView) findViewById(R.id.image);
 refreshButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                captchaImageView.regenerate();
            }
 });

Call getCaptchaCode() method on CaptchaImageView to read last generated captcha code.

 captchaImageView.getCaptchaCode()

Use in your project

1.Add it in your root build.gradle at the end of repositories:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

2.Add the dependency in your app build.gradle file:

dependencies {
	        compile 'com.github.jineshfrancs:CaptchaImageView:1.0'
}