diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..7de7aac
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/markdown-navigator.xml b/.idea/markdown-navigator.xml
new file mode 100644
index 0000000..d819570
--- /dev/null
+++ b/.idea/markdown-navigator.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..8306744
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 77ea57e..e52ed0a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.1.0-rc1'
+ classpath 'com.android.tools.build:gradle:2.3.3'
}
}
diff --git a/demo/demo.iml b/demo/demo.iml
new file mode 100644
index 0000000..11c0161
--- /dev/null
+++ b/demo/demo.iml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateDebugSources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/src/main/java/me/philio/pinentry/demo/MainActivity.java b/demo/src/main/java/me/philio/pinentry/demo/MainActivity.java
index f0d53a6..a9e6531 100644
--- a/demo/src/main/java/me/philio/pinentry/demo/MainActivity.java
+++ b/demo/src/main/java/me/philio/pinentry/demo/MainActivity.java
@@ -1,12 +1,12 @@
package me.philio.pinentry.demo;
import android.os.Bundle;
-import android.support.v7.app.ActionBarActivity;
-import android.widget.Toast;
+import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
import me.philio.pinentry.PinEntryView;
-public class MainActivity extends ActionBarActivity {
+public class MainActivity extends AppCompatActivity {
private PinEntryView pinEntryView;
@@ -15,10 +15,11 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
pinEntryView = (PinEntryView) findViewById(R.id.pin_entry_simple);
+ pinEntryView.setDigits(3);
pinEntryView.setOnPinEnteredListener(new PinEntryView.OnPinEnteredListener() {
@Override
public void onPinEntered(String pin) {
- Toast.makeText(MainActivity.this, "Pin entered: " + pin, Toast.LENGTH_LONG).show();
+ Log.d("PIN",pin);
}
});
}
diff --git a/gradle.properties b/gradle.properties
index c6cdcb5..9372a3b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -32,6 +32,6 @@ POM_DEVELOPER_ID=philio
POM_DEVELOPER_NAME=Phil Bayfield
ANDROID_BUILD_MIN_SDK_VERSION=7
-ANDROID_BUILD_TARGET_SDK_VERSION=23
-ANDROID_BUILD_TOOLS_VERSION=23.0.2
-ANDROID_BUILD_SDK_VERSION=23
\ No newline at end of file
+ANDROID_BUILD_TARGET_SDK_VERSION=26
+ANDROID_BUILD_TOOLS_VERSION=26.0.1
+ANDROID_BUILD_SDK_VERSION=26
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index e2c2898..7ff18ac 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Apr 25 23:18:24 BST 2016
+#Mon Aug 07 21:18:58 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
diff --git a/pinentry/pinentry.iml b/pinentry/pinentry.iml
new file mode 100644
index 0000000..7b72090
--- /dev/null
+++ b/pinentry/pinentry.iml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateDebugSources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pinentry/src/main/java/me/philio/pinentry/PinEntryView.java b/pinentry/src/main/java/me/philio/pinentry/PinEntryView.java
index 8ff5e1d..b697a1f 100644
--- a/pinentry/src/main/java/me/philio/pinentry/PinEntryView.java
+++ b/pinentry/src/main/java/me/philio/pinentry/PinEntryView.java
@@ -55,7 +55,7 @@ public class PinEntryView extends ViewGroup {
/**
* Number of digits
*/
- private int digits;
+ private int digits = 4;
/**
* Input type
@@ -119,7 +119,7 @@ public PinEntryView(Context context, AttributeSet attrs, int defStyle) {
// Get style information
TypedArray array = getContext().obtainStyledAttributes(attrs, R.styleable.PinEntryView);
- digits = array.getInt(R.styleable.PinEntryView_numDigits, 4);
+ digits = array.getInt(R.styleable.PinEntryView_numDigits, digits);
inputType = array.getInt(R.styleable.PinEntryView_pinInputType, InputType.TYPE_CLASS_NUMBER);
accentType = array.getInt(R.styleable.PinEntryView_accentType, ACCENT_NONE);
@@ -317,6 +317,11 @@ public int getDigits() {
return digits;
}
+ public void setDigits(int digits) {
+ this.digits = digits;
+ this.removeAllViews();
+ addViews();
+ }
public int getInputType() {
return inputType;
}