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 11 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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
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 com.andrognito.pinlockview.IndicatorDots;
import com.andrognito.pinlockview.PinLockListener;
Expand All @@ -17,6 +20,8 @@ public class SampleActivity extends AppCompatActivity {

private PinLockView mPinLockView;
private IndicatorDots mIndicatorDots;
private ImageView logo;
private boolean isShowing = true;

private PinLockListener mPinLockListener = new PinLockListener() {
@Override
Expand All @@ -42,7 +47,7 @@ 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);
mIndicatorDots = (IndicatorDots) findViewById(R.id.indicator_dots);

Expand All @@ -52,8 +57,22 @@ protected void onCreate(Bundle savedInstanceState) {
//mPinLockView.enableLayoutShuffling();

mPinLockView.setPinLength(4);
mPinLockView.setTextColor(ContextCompat.getColor(this, R.color.white));

mIndicatorDots.setIndicatorType(IndicatorDots.IndicatorType.FILL_WITH_ANIMATION);

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);
mIndicatorDots.setVisibility(View.VISIBLE);
isShowing = true;
}
}
});
}
}
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
app:keypadButtonSize="72dp"
app:keypadShowDeleteButton="true"
app:keypadTextColor="@color/white"
app:keypadTextSize="18dp" />
app:keypadUseDeprecatedColorOptions="true"
app:keypadDefaultDeleteColor="true"/>

</RelativeLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@
*/
public class CustomizationOptionsBundle {

private int numberTextColor;
private int lettersTextColor;
private int deleteButtonColor;
private int textColor;
private int textSize;
private int numberTextSize;
private int lettersTextSize;
private boolean showLetters;
private boolean isNumbersTextBold;
private boolean isLettersTextBold;
private boolean isDeleteDefaultColor;
private int buttonSize;
private Drawable buttonBackgroundDrawable;
private Drawable deleteButtonDrawable;
private int deleteButtonSize;
private boolean showDeleteButton;
private boolean useDeprecated;
private int deleteButtonPressesColor;

public CustomizationOptionsBundle() {
Expand All @@ -25,19 +35,100 @@ public CustomizationOptionsBundle() {
public int getTextColor() {
return textColor;
}

public void setTextColor(int textColor) {
this.textColor = textColor;
}

public int getTextSize() {
return textSize;
}

public void setTextSize(int textSize) {
this.textSize = textSize;
}

public int getNumbersTextColor() {
return numberTextColor;
}

public void setNumbersTextColor(int textColor) {
this.numberTextColor = textColor;
}

public int getLettersTextColor() {
return lettersTextColor;
}

public void setLettersTextColor(int textColor) {
this.lettersTextColor = textColor;
}

public int getNumbersTextSize() {
return numberTextSize;
}

public void setNumbersTextSize(int textSize) {
this.numberTextSize = textSize;
}

public int getLettersTextSize() {
return lettersTextSize;
}

public void setLettersTextSize(int textSize) {
this.lettersTextSize = textSize;
}

public boolean getShowLetters() {
return showLetters;
}

public void setShowLetters(boolean showLetters) {
this.showLetters = showLetters;
}

// Deprecated colour options
public boolean getUseDeprecated() {
return useDeprecated;
}

public void setUseDeprecated(boolean useDeprecated) {
this.useDeprecated = useDeprecated;
}

public int getDeleteButtonColor() {
return deleteButtonColor;
}

public void setDeleteButtonColor(int defaultColor) {
this.deleteButtonColor = defaultColor;
}

public boolean getDeleteButtonDefault() {
return isDeleteDefaultColor;
}

public void setDeleteButtonDefault(boolean isDefaultColor) {
this.isDeleteDefaultColor = isDefaultColor;
}

public boolean getIsNumbersTextBold() {
return isNumbersTextBold;
}

public void setIsNumbersTextBold(boolean isNumbersTextBold) {
this.isNumbersTextBold = isNumbersTextBold;
}

public boolean getIsLettersTextBold() {
return isLettersTextBold;
}

public void setIsLettersTextBold(boolean isLettersTextBold) {
this.isLettersTextBold = isLettersTextBold;
}

public int getButtonSize() {
return buttonSize;
}
Expand Down
Loading