Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This library is available in **jCenter** which is the default Maven repository u
dependencies {
// other dependencies here

compile 'com.andrognito.pinlockview:pinlockview:2.0.1'
implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'
}
```

Expand All @@ -31,7 +31,7 @@ dependencies {
<dependency>
<groupId>com.andrognito.pinlockview</groupId>
<artifactId>pinlockview</artifactId>
<version>2.0.1</version>
<version>2.1.0</version>
<type>pom</type>
</dependency>
```
Expand Down Expand Up @@ -164,7 +164,8 @@ Android & Backend Developer. Blogger. Designer. Fitness Enthusiast.

<a href="https://play.google.com/store/apps/details?id=com.codexapps.andrognito&hl=en" target="_blank"><img src="https://github.com/aritraroy/social-icons/blob/master/play-store-icon.png?raw=true" width="60"></a> <a href="https://blog.aritraroy.in/" target="_blank"><img src="https://github.com/aritraroy/social-icons/blob/master/medium-icon.png?raw=true" width="60"></a>
<a href="http://stackoverflow.com/users/2858654/aritra-roy" target="_blank"><img src="https://github.com/aritraroy/social-icons/blob/master/stackoverflow-icon.png?raw=true" width="60"></a>
<a href="https://twitter.com/aritraroy93" target="_blank"><img src="https://github.com/aritraroy/social-icons/blob/master/twitter-icon.png?raw=true" width="60"></a>
<a href="https://twitter.com/aritraroy" target="_blank"><img src="https://github.com/aritraroy/social-icons/blob/master/twitter-icon.png?raw=true" width="60"></a>
<a href="http://linkedin.com/in/aritra-roy"><img src="https://github.com/aritraroy/social-icons/blob/master/linkedin-icon.png?raw=true" width="60"></a>


# License
Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.3"

defaultConfig {
applicationId "com.andrognito.pinlockviewapp"
minSdkVersion 11
targetSdkVersion 24
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
Expand All @@ -22,6 +22,6 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile project(':pinlockview')
}
78 changes: 63 additions & 15 deletions app/src/main/java/com/andrognito/pinlockviewapp/SampleActivity.java
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
package com.andrognito.pinlockviewapp;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.view.View;
import android.view.View.*;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.andrognito.pinlockview.IndicatorDots;
import com.andrognito.pinlockview.InputField;
import com.andrognito.pinlockview.PinLockListener;
import com.andrognito.pinlockview.PinLockView;
import com.andrognito.pinlockview.SeparateDeleteButton;

public class SampleActivity extends AppCompatActivity {

public static final String TAG = "PinLockView";

private PinLockView mPinLockView;
private IndicatorDots mIndicatorDots;
private InputField mInputField;
private SeparateDeleteButton mSeparateDeleteButton;
private ImageView logo;
private boolean isShowing = true;
private boolean isEnterButtonEnabled = true;

private PinLockListener mPinLockListener = new PinLockListener() {
@Override
public void onComplete(String pin) {
Log.d(TAG, "Pin complete: " + pin);
Toast.makeText(SampleActivity.this, "Pin complete: " + pin, Toast.LENGTH_SHORT).show();
}

@Override
Expand All @@ -49,28 +56,69 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_sample);
logo = (ImageView) findViewById(R.id.profile_image);
mPinLockView = (PinLockView) findViewById(R.id.pin_lock_view);
mInputField = (InputField) findViewById(R.id.input_field);
mIndicatorDots = (IndicatorDots) findViewById(R.id.indicator_dots);
mSeparateDeleteButton = (SeparateDeleteButton) findViewById(R.id.separate_delete_button);

mPinLockView.attachInputField(mInputField);
mPinLockView.attachIndicatorDots(mIndicatorDots);
mPinLockView.attachSeparateDeleteButton(mSeparateDeleteButton);

mPinLockView.setPinLockListener(mPinLockListener);
//mPinLockView.setCustomKeySet(new int[]{2, 3, 1, 5, 9, 6, 7, 0, 8, 4});
//mPinLockView.enableLayoutShuffling();
mPinLockView.setPinLength(6);
mPinLockView.setShowDeleteButton(false);
((RelativeLayout.LayoutParams) mPinLockView.getLayoutParams()).addRule(RelativeLayout.BELOW, R.id.input_field);
mInputField.setVisibility(View.VISIBLE);
mInputField.requestFocus();

mSeparateDeleteButton.setShowSeparateDeleteButton(true);
mSeparateDeleteButton.setSeparateDeleteButtonColor(Color.TRANSPARENT);
mSeparateDeleteButton.setSeparateDeleteButtonPressedColor(Color.GRAY);
mSeparateDeleteButton.setImageResource(R.drawable.ic_keyboard_backspace);

mPinLockView.setPinLength(4);
mPinLockView.setUseCustomEnterButtonImages(true);
mPinLockView.setEnterButtonEnabledDrawableId(R.drawable.ic_check_box);
mPinLockView.setEnterButtonDisabledDrawableId(R.drawable.ic_check_box_outline);
mPinLockView.setEnterButtonPressedDrawableId(R.drawable.ic_check_box);
mPinLockView.setDeleteButtonDrawable(getResources().getDrawable(R.drawable.ic_cheveron_left));

mIndicatorDots.setIndicatorType(IndicatorDots.IndicatorType.FILL_WITH_ANIMATION);
mPinLockView.detachIndicatorDots();
mIndicatorDots.setVisibility(View.GONE);
mIndicatorDots.setIndicatorType(IndicatorDots.IndicatorType.FIXED);

logo.setOnClickListener(new OnClickListener() {
public void onClick(View v)
{
if(isShowing) {
mPinLockView.setVisibility(View.GONE);
mIndicatorDots.setVisibility(View.GONE);
isShowing = false;
} else {
mPinLockView.setVisibility(View.VISIBLE);
public void onClick(View v) {
if (isEnterButtonEnabled) {

isEnterButtonEnabled = false;
mPinLockView.setShowEnterButton(false);
mPinLockView.setSwapEnterDeleteButtons(false);
mPinLockView.setShowDeleteButton(true);
mSeparateDeleteButton.setShowSeparateDeleteButton(false);
mInputField.setVisibility(View.GONE);
mIndicatorDots.setVisibility(View.VISIBLE);
isShowing = true;
((RelativeLayout.LayoutParams) mPinLockView.getLayoutParams()).addRule(RelativeLayout.BELOW, R.id.indicator_dots);
mPinLockView.resetPinLockView();

mPinLockView.detachInputField();
mPinLockView.detachSeparateDeleteButton();
mPinLockView.attachIndicatorDots(mIndicatorDots);
} else{

isEnterButtonEnabled = true;
mPinLockView.setShowEnterButton(true);
mPinLockView.setSwapEnterDeleteButtons(true);
mPinLockView.setShowDeleteButton(false);
mSeparateDeleteButton.setShowSeparateDeleteButton(true);
mInputField.setVisibility(View.VISIBLE);
mIndicatorDots.setVisibility(View.GONE);
((RelativeLayout.LayoutParams) mPinLockView.getLayoutParams()).addRule(RelativeLayout.BELOW, R.id.input_field);
mInputField.requestFocus();
mPinLockView.resetPinLockView();

mPinLockView.attachInputField(mInputField);
mPinLockView.attachSeparateDeleteButton(mSeparateDeleteButton);
mPinLockView.detachIndicatorDots();
}
}
});
Expand Down
Binary file added app/src/main/res/drawable-hdpi/ic_check_box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/ic_cheveron_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/ic_check_box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/ic_cheveron_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/ic_check_box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/ic_cheveron_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxhdpi/ic_check_box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 39 additions & 5 deletions app/src/main/res/layout/activity_sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
android:layout_marginTop="104dp"
android:src="@drawable/img_no_avatar" />



<TextView
android:id="@+id/profile_name"
android:layout_width="256dp"
Expand All @@ -29,6 +31,29 @@
android:textColor="@color/white"
android:textSize="34sp" />

<com.andrognito.pinlockview.InputField
android:id="@+id/input_field"
android:layout_width="100dp"
android:layout_height="64dp"
android:layout_below="@+id/profile_name"
android:gravity="center_horizontal"
android:fontFamily="monospace"
android:typeface="monospace"
android:backgroundTint="#E1BEE7"
android:textCursorDrawable="@null"
android:textSize="27sp"
android:layout_centerHorizontal="true" />

<com.andrognito.pinlockview.SeparateDeleteButton
android:id="@+id/separate_delete_button"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_alignBottom="@+id/input_field"
android:layout_gravity="center_vertical"
android:layout_toRightOf="@+id/input_field"
android:layout_toEndOf="@+id/input_field"
android:padding="24dp" />

<com.andrognito.pinlockview.IndicatorDots
android:id="@+id/indicator_dots"
android:layout_width="wrap_content"
Expand All @@ -43,11 +68,20 @@
android:layout_height="wrap_content"
android:layout_below="@id/indicator_dots"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
app:keypadButtonSize="72dp"
app:keypadUseDeprecatedColorOptions="false"
app:keypadNumbersTextColor="#E1BEE7"
app:keypadLettersTextColor="#E1BEE7"
app:keypadShowDeleteButton="true"
app:keypadTextColor="@color/white"
app:keypadUseDeprecatedColorOptions="true"
app:keypadDefaultDeleteColor="true"/>
app:keypadShowLetters="true"
app:keypadDeleteButtonColor="#E1BEE7"
app:keypadDefaultDeleteColor="false"
app:keypadDeleteButtonPressedColor="@color/white"
app:keypadShowEnterButton="true"
app:keypadSwapEnterDeleteButtons="true"
app:keypadEnterButtonColor="@android:color/transparent"
app:keypadEnterButtonDisabledColor="@android:color/transparent"
app:keypadEnterButtonPressedColor="@color/greyish"
app:indicatorType="fixed"
/>

</RelativeLayout>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
// NOTE: Do not place your application dependencies here; they belong
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Mar 10 00:08:20 IST 2017
#Tue Dec 12 09:32:28 EET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
12 changes: 6 additions & 6 deletions pinlockview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext {
siteUrl = 'https://github.com/aritraroy/PinLockView'
gitUrl = 'https://github.com/aritraroy/PinLockView.git'

libraryVersion = '2.0.1'
libraryVersion = '2.1.0'

developerId = 'aritraroy'
developerName = 'Aritra Roy'
Expand All @@ -27,13 +27,13 @@ ext {

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
buildToolsVersion "25.0.3"

defaultConfig {
minSdkVersion 11
targetSdkVersion 25
versionCode 4
versionName "2.0.1"
versionCode 5
versionName "2.1.0"
}
buildTypes {
release {
Expand All @@ -46,8 +46,8 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
}

apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
Expand Down
Loading