public class PinLockView
extends RecyclerView
setPinLength(int), the default value being 4
It can also be used as dial pad for taking number inputs.
Optionally, IndicatorDots can be attached to this view to indicate the length of the input taken
Created by aritraroy on 31/05/16.| Constructor and Description |
|---|
PinLockView(android.content.Context context) |
PinLockView(android.content.Context context,
android.util.AttributeSet attrs) |
PinLockView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle) |
| Modifier and Type | Method and Description |
|---|---|
void |
attachIndicatorDots(IndicatorDots mIndicatorDots)
Attaches
IndicatorDots to PinLockView |
void |
enableLayoutShuffling() |
android.graphics.drawable.Drawable |
getButtonBackgroundDrawable()
Get the current background drawable of the buttons, can be null
|
int |
getButtonSize()
Get the size of the pin buttons
|
int[] |
getCustomKeySet() |
android.graphics.drawable.Drawable |
getDeleteButtonDrawable()
Get the drawable of the delete button
|
int |
getDeleteButtonPressedColor()
Get the delete button pressed/focused state color
|
int |
getDeleteButtonSize()
Get the delete button size in pixels
|
int |
getPinLength()
Get the length of the current pin length
|
int |
getTextColor()
Get the text color in the buttons
|
int |
getTextSize()
Get the size of the text in the buttons
|
boolean |
isIndicatorDotsAttached()
Returns true if
IndicatorDots are attached to PinLockView |
boolean |
isShowDeleteButton()
Is the delete button shown
|
void |
resetPinLockView()
Resets the
PinLockView, clearing the entered pin
and resetting the IndicatorDots if attached |
void |
setButtonBackgroundDrawable(android.graphics.drawable.Drawable buttonBackgroundDrawable)
Set the background drawable of the buttons dynamically
|
void |
setButtonSize(int buttonSize)
Set the size of the pin buttons dynamically
|
void |
setCustomKeySet(int[] customKeySet) |
void |
setDeleteButtonDrawable(android.graphics.drawable.Drawable deleteBackgroundDrawable)
Set the drawable of the delete button dynamically
|
void |
setDeleteButtonPressedColor(int deleteButtonPressedColor)
Set the pressed/focused state color of the delete button
|
void |
setDeleteButtonSize(int deleteButtonSize)
Set the size of the delete button in pixels
|
void |
setPinLength(int pinLength)
Sets the pin length dynamically
|
void |
setPinLockListener(PinLockListener pinLockListener)
Sets a
PinLockListener to the to listen to pin update events |
void |
setShowDeleteButton(boolean showDeleteButton)
Dynamically set if the delete button should be shown
|
void |
setTextColor(int textColor)
Set the text color of the buttons dynamically
|
void |
setTextSize(int textSize)
Set the size of text in pixels
|
public PinLockView(android.content.Context context)
public PinLockView(android.content.Context context,
android.util.AttributeSet attrs)
public PinLockView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
public void setPinLockListener(PinLockListener pinLockListener)
PinLockListener to the to listen to pin update eventspinLockListener - the listenerpublic int getPinLength()
public void setPinLength(int pinLength)
pinLength - the pin lengthpublic int getTextColor()
public void setTextColor(int textColor)
textColor - the text colorpublic int getTextSize()
public void setTextSize(int textSize)
textSize - the text size in pixelspublic int getButtonSize()
public void setButtonSize(int buttonSize)
buttonSize - the button sizepublic android.graphics.drawable.Drawable getButtonBackgroundDrawable()
public void setButtonBackgroundDrawable(android.graphics.drawable.Drawable buttonBackgroundDrawable)
buttonBackgroundDrawable - the background drawablepublic android.graphics.drawable.Drawable getDeleteButtonDrawable()
public void setDeleteButtonDrawable(android.graphics.drawable.Drawable deleteBackgroundDrawable)
deleteBackgroundDrawable - the delete button drawablepublic int getDeleteButtonSize()
public void setDeleteButtonSize(int deleteButtonSize)
deleteButtonSize - size in pixelspublic boolean isShowDeleteButton()
public void setShowDeleteButton(boolean showDeleteButton)
showDeleteButton - true if the delete button should be shown, false otherwisepublic int getDeleteButtonPressedColor()
public void setDeleteButtonPressedColor(int deleteButtonPressedColor)
deleteButtonPressedColor - the color of the delete buttonpublic int[] getCustomKeySet()
public void setCustomKeySet(int[] customKeySet)
public void enableLayoutShuffling()
public void resetPinLockView()
PinLockView, clearing the entered pin
and resetting the IndicatorDots if attachedpublic boolean isIndicatorDotsAttached()
IndicatorDots are attached to PinLockViewpublic void attachIndicatorDots(IndicatorDots mIndicatorDots)
IndicatorDots to PinLockViewmIndicatorDots - the view to attach