BasicFieldNumberView

public class BasicFieldNumberView extends AppCompatEditText
implements FieldView

A basic UI for FieldNumber.

Field Summary

protected boolean mAllowExponent
protected DecimalFormatSymbols mLocalizedDecimalSymbols
protected String mLocalizedGroupingSeparator
protected NumberFormat mLocalizedNumberParser
protected FieldNumber mNumberField
protected boolean mTextIsValid

Public Constructor Summary

BasicFieldNumberView(Context context)
BasicFieldNumberView(Context context, AttributeSet attrs)
BasicFieldNumberView(Context context, AttributeSet attrs, int defStyleAttr)

Public Method Summary

Field
boolean
boolean
onDragEvent(DragEvent event)
Override onDragEvent to stop blocks from being dropped into text fields.
void
setField(Field field)
Sets the Field model for this view.
void
unlinkField()
Disconnect the model from this view.

Protected Method Summary

void
void
onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect)
void
setTextValid(boolean textIsValid)
void
void
void

Inherited Method Summary

Fields

protected boolean mAllowExponent

protected DecimalFormatSymbols mLocalizedDecimalSymbols

protected String mLocalizedGroupingSeparator

protected NumberFormat mLocalizedNumberParser

protected FieldNumber mNumberField

protected boolean mTextIsValid

Public Constructors

public BasicFieldNumberView (Context context)

Parameters
context

public BasicFieldNumberView (Context context, AttributeSet attrs)

Parameters
context
attrs

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

Parameters
context
attrs
defStyleAttr

Public Methods

public Field getField ()

public boolean isTextValid ()

public boolean onDragEvent (DragEvent event)

Override onDragEvent to stop blocks from being dropped into text fields. If the dragged information is anything but a block, let the standard EditText drag interface take care of it.

Parameters
event The DragEvent to respond to.
Returns
  • False if the dragged data is a block, whatever a normal EditText would return otherwise.

public void setField (Field field)

Sets the Field model for this view. If null the current field will be disconnected from the view if one is set. The field must be of the appropriate type for the specific view implementation or a ClassCastException may be thrown.

Parameters
field The field backing this view.

public void unlinkField ()

Disconnect the model from this view.

Protected Methods

protected void onFinishInflate ()

protected void onFocusChanged (boolean focused, int direction, Rect previouslyFocusedRect)

Parameters
focused
direction
previouslyFocusedRect

protected void setTextValid (boolean textIsValid)

Parameters
textIsValid

protected void updateInputMethod ()

protected void updateLocalizedNumberFormat ()

protected void updateLocalizedNumberFormatIfConstraintsChanged ()