ListenableEditText

public class ListenableEditText extends EditText

This is a custom EditText that allows us to listen for changes in cursor position. CreatePostActivity uses this view so that the format toggle buttons can update their settings when a new near_region in the edit text is selected.

Fields

mListener

onSelectionChangedListener mListener

Constructors

ListenableEditText

public ListenableEditText(Context context)

{@inheritDoc}

Parameters:

ListenableEditText

public ListenableEditText(Context context, AttributeSet attrs)

{@inheritDoc}

Parameters:

ListenableEditText

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

{@inheritDoc}

Parameters:

Methods

onSelectionChanged

protected void onSelectionChanged(int selStart, int selEnd)

When the selection changes, if it is due to the user typing a character, ListenableEditText.mListener.onSelectionChanged(int,int) is called with the provided parameters. Otherwise, the superclass method EditText.onSelectionChanged(int,int) is called with the parameters.

Parameters:
  • selStart – TODO: What is this?
  • selEnd – TODO: What is this?

setOnSelectionChangedListener

public void setOnSelectionChangedListener(onSelectionChangedListener listener)

Set the listener to the provided parameter

Parameters:
  • listener – Listener to use when text selection changes