Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added configurations for the addition of letters under buttons, as well as other relevant configurations. Merging does not affect previous builds #26

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
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
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ You **MUST** attach it to the PinLockView, otherwise it will be simply ignored.
There are several theming options available through XML attributes which you can use to completely change the look-and-feel of this view to match the theme of your app.

```xml

// In <com.andrognito.pinlockview.PinLockView></>

app:pinLength="6" // Change the pin length
app:keypadTextColor="#E6E6E6" // Change the color of the keypad text
app:keypadTextSize="16dp" // Change the text size in the keypad
app:keypadTextColor="#E6E6E6" // Change the color of the keypad text and numbers
app:keypadTextSize="16dp" // Change the text and numbers size in the keypad
app:keypadButtonSize="72dp" // Change the size of individual keys/buttons
app:keypadVerticalSpacing="24dp" // Alters the vertical spacing between the keypad buttons
app:keypadHorizontalSpacing="36dp" // Alters the horizontal spacing between the keypad buttons
Expand All @@ -125,6 +128,23 @@ There are several theming options available through XML attributes which you can
app:keypadShowDeleteButton="false" // Should show the delete button, default is true
app:keypadDeleteButtonPressedColor="#C8C8C8" // Change the pressed/focused state color of the delete button

// New properties for <com.andrognito.pinlockview.PinLockView></>, added for Okta
// Purpose is to add letters under numbers, along with some other small configurations

app:keypadUseDeprecatedColorOptions // Set to true if you’d like to use keypadTextColor and keypadTextSize, otherwise it will use the new settings
app:keypadNumbersTextColor="#C8C8C8" // Sets the color of the numbers
app:keypadNumbersTextSize // Sets the font size of the numbers
app:keypadLettersTextColor="#C8C8C8" // Sets the color of the letters
app:keypadLettersTextSize // Sets the font size of the letters
app:keypadDeleteButtonColor="#C8C8C8" // Sets the color of the delete button
app:keypadShowLetters="true" // Changes visibility of the letters
app:keypadNumbersBold="true" // Sets the boldness of number text
app:keypadLettersBold="false" // Sets the boldness of letter text
app:keypadDefaultDeleteColor="false" // Set to false if you want a differently coloured delete button


// In <com.andrognito.pinlockview.IndicatorDots></>

app:dotEmptyBackground="@drawable/empty" // Customize the empty state of the dots
app:dotFilledBackground"@drawable/filled" // Customize the filled state of the dots
app:dotDiameter="12dp" // Change the diameter of the dots
Expand Down
10 changes: 5 additions & 5 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 25
buildToolsVersion "25.0.3"
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig {
applicationId "com.andrognito.pinlockviewapp"
minSdkVersion 11
targetSdkVersion 25
minSdkVersion 14
targetSdkVersion 26
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:25.3.1'
compile 'com.android.support:appcompat-v7:26.1.0'
compile project(':pinlockview')
}
Original file line number Diff line number Diff line change
@@ -1,27 +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 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 @@ -42,18 +54,73 @@ protected void onCreate(Bundle savedInstanceState) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
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.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));

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

logo.setOnClickListener(new OnClickListener() {
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);
((RelativeLayout.LayoutParams) mPinLockView.getLayoutParams()).addRule(RelativeLayout.BELOW, R.id.indicator_dots);
mPinLockView.resetPinLockView();

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

mPinLockView.setPinLength(4);
mPinLockView.setTextColor(ContextCompat.getColor(this, R.color.white));
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();

mIndicatorDots.setIndicatorType(IndicatorDots.IndicatorType.FILL_WITH_ANIMATION);
mPinLockView.attachInputField(mInputField);
mPinLockView.attachSeparateDeleteButton(mSeparateDeleteButton);
mPinLockView.detachIndicatorDots();
}
}
});
}
}
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.
43 changes: 39 additions & 4 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,10 +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:keypadTextSize="18dp" />
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>
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

buildscript {
repositories {
google()
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 All @@ -15,6 +16,7 @@ buildscript {

allprojects {
repositories {
google()
jcenter()
}
}
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 @@ -26,12 +26,12 @@ ext {


android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig {
minSdkVersion 11
targetSdkVersion 25
minSdkVersion 14
targetSdkVersion 26
versionCode 5
versionName "2.1.0"
}
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.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
}

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