public class

TextView

extends TextView
implements SosMaskedField
java.lang.Object
   ↳ android.view.View
     ↳ android.widget.TextView
       ↳ com.salesforce.android.sos.maskview.TextView

Class Overview

An extension of the native Android android.widget.TextView that can be masked.

Summary

[Expand]
Inherited Constants
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
TextView(Context context)
TextView(Context context, AttributeSet attrs)
TextView(Context context, AttributeSet attrs, int defStyleAttr)
TextView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
boolean isMasked()
Returns the current masking state of the View.
boolean isUsingFocusMasking()
Returns whether the focused state of the View is being used to automatically determine the masking state.
void setMask(Drawable drawable)
Sets the Drawable that will be used to draw the field mask to the input value.
void showMask(boolean show)
Forces the View to be unmasked (shown).
void useFocusMasking(boolean useFocusMasking)
Set whether the focused state of the View should be used to automatically determine when the View should be masked.
Protected Methods
void onAttachedToWindow()
void onDetachedFromWindow()
void onDraw(Canvas canvas)
[Expand]
Inherited Methods
From class android.widget.TextView
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewTreeObserver.OnPreDrawListener
From interface android.view.accessibility.AccessibilityEventSource
From interface com.salesforce.android.sos.maskview.SosMaskedField

Public Constructors

public TextView (Context context)

public TextView (Context context, AttributeSet attrs)

public TextView (Context context, AttributeSet attrs, int defStyleAttr)

public TextView (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public Methods

public boolean isMasked ()

Returns the current masking state of the View.

Returns
  • whether the View is currently masked.

public boolean isUsingFocusMasking ()

Returns whether the focused state of the View is being used to automatically determine the masking state.

Returns
  • whether focus is being used to determine when the View is masked.

public void setMask (Drawable drawable)

Sets the Drawable that will be used to draw the field mask to the input value. If the input is null, the default Drawable will be used.

Parameters
drawable the Drawable used to draw the field mask or null to use the default.

public void showMask (boolean show)

Forces the View to be unmasked (shown).

When TRUE is passed in, the View is drawn without a mask. When FALSE is passed in, the View is NOT forced to be unmasked.

It is still possible that the encapsulating View will be drawn without a mask even if FALSE is passed in. This can happen if focus masking is being used useFocusMasking(boolean) and the View has focus. Passing FALSE only ensures that the View is not forced into being unmasked.

Parameters
show flag indicating that the View should be forced unmasked.

public void useFocusMasking (boolean useFocusMasking)

Set whether the focused state of the View should be used to automatically determine when the View should be masked. The default behaviour is to have a view visible when it has focus and be masked when it does not.

Parameters
useFocusMasking whether to use focus to automatically mask the View.

Protected Methods

protected void onAttachedToWindow ()

protected void onDetachedFromWindow ()

protected void onDraw (Canvas canvas)