Class PdfPasswordView

  • All Implemented Interfaces:
    android.graphics.drawable.Drawable.Callback , android.view.KeyEvent.Callback , android.view.ViewManager , android.view.ViewParent , android.view.accessibility.AccessibilityEventSource , com.pspdfkit.ui.FloatingHintEditText.EditTextListener

    
    public class PdfPasswordView
    extends LinearLayoutCompat implements FloatingHintEditText.EditTextListener
                        

    Password view used when accessing password protected documents.

    • Method Detail

      • getColor

        @ColorInt() int getColor()

        Returns the password view color (input field, underline, icon tint).

        Returns:

        Primary password view color.

      • setColor

         void setColor(@ColorInt() int color)

        Sets the password view color (input field, underline, icon tint).

        Parameters:
        color - Primary password view color.
      • getHintColor

        @ColorInt() int getHintColor()

        Returns input field hint color.

        Returns:

        Input field hint text color.

      • setHintColor

         void setHintColor(@ColorInt() int hintColor)

        Sets input field hint color.

        Parameters:
        hintColor - Input field hint text color.
      • getFloatingHintColor

        @ColorInt() int getFloatingHintColor()

        Returns the text color for the password view's floating hint.

        Returns:

        Floating hint color.

      • setFloatingHintColor

         void setFloatingHintColor(@ColorInt() int floatingHintColor)

        Sets the text color for the password view's floating hint.

        Parameters:
        floatingHintColor - Floating hint color.
      • getErrorColor

        @ColorInt() int getErrorColor()

        Returns color used as primary one in case of incorrect password entry.

        Returns:

        Color used to tint text and iconResourceId on incorrect password.

      • setErrorColor

         void setErrorColor(@ColorInt() int errorColor)

        Sets color used as primary one in case of incorrect password entry.

        Parameters:
        errorColor - Color used to tint text and iconResourceId on incorrect password.
      • getIconResourceId

        @DrawableRes() int getIconResourceId()

        Returns icon displayed above the input field.

        Returns:

        Input field icon's resource drawable.

      • setIconResourceId

         void setIconResourceId(@DrawableRes() int iconResourceId)

        Sets icon displayed above the input field. Setting this to -1 is equivalent to setting it to @null in the theme.

        Parameters:
        iconResourceId - Input field icon's resource drawable.
      • isIconTintingEnabled

         boolean isIconTintingEnabled()

        Returns whether tinting of the password view icon is enabled or not.

        Returns:

        true if tinting is enabled, or false if the used icon won't be tinted. Defaults to true.

      • setIconTintingEnabled

         void setIconTintingEnabled(boolean iconTintingEnabled)

        Sets whether tinting of the password view icon is enabled or not.

        Parameters:
        iconTintingEnabled - true if tinting is enabled, or false if the used icon won't be tinted.
      • getPassword

        @NonNull() String getPassword()

        Returns currently entered password.

        Returns:

        Password string currently entered into the text box, or empty string if there's no input.

      • onKeyPress

         void onKeyPress(int keyCode, KeyEvent event)

        Called when there is a key press event

        Parameters:
        keyCode - code for a pressed key
        event - event for key press
      • onErrorDismissed

         void onErrorDismissed()

        Called when user proceeds typing in after there was an error shown.