Fields Summary |
---|
private static final String | LOG_TAG |
private static final boolean | DBG |
public static final int | MODE_NOTHINGThe mode that no editing action is done. |
public static final int | MODE_COPYThe mode of copy. |
public static final int | MODE_PASTEThe mode of paste. |
public static final int | MODE_SIZEThe mode of changing size. |
public static final int | MODE_COLORThe mode of changing color. |
public static final int | MODE_SELECTThe mode of selection. |
public static final int | MODE_ALIGNThe mode of changing alignment. |
public static final int | MODE_CUTThe mode of changing cut. |
public static final int | STATE_SELECT_OFFThe state that selection isn't started. |
public static final int | STATE_SELECT_ONThe state that selection is started. |
public static final int | STATE_SELECTEDThe state that selection is done, but not fixed. |
public static final int | STATE_SELECT_FIXThe state that selection is done and not fixed. |
public static final int | HINT_MSG_NULLThe help message strings. |
public static final int | HINT_MSG_COPY_BUF_BLANK |
public static final int | HINT_MSG_SELECT_START |
public static final int | HINT_MSG_SELECT_END |
public static final int | HINT_MSG_PUSH_COMPETE |
public static final int | DEFAULT_BACKGROUND_COLORThe help message strings. |
private EditStyledTextNotifier | mESTInterface |
private EditorManager | mManagerEditStyledTextEditorManager manages the flow and status of each
function for editing styled text. |
private StyledTextConverter | mConverter |
private StyledTextDialog | mDialog |
private android.graphics.drawable.Drawable | mDefaultBackground |
private int | mBackgroundColor |
Methods Summary |
---|
public int | getBackgroundColor()Get Background color of View.
return mBackgroundColor;
|
public int | getEditMode()Get the mode of the action.
return mManager.getEditMode();
|
public int | getForeGroundColor(int pos)Get Foreground color of View.
if (DBG) {
Log.d(LOG_TAG, "---getForeGroundColor: " + pos);
}
if (pos < 0 || pos > getText().length()) {
Log.e(LOG_TAG, "---getForeGroundColor: Illigal position.");
return DEFAULT_BACKGROUND_COLOR;
} else {
ForegroundColorSpan[] spans =
getText().getSpans(pos, pos, ForegroundColorSpan.class);
if (spans.length > 0) {
return spans[0].getForegroundColor();
} else {
return DEFAULT_BACKGROUND_COLOR;
}
}
|
public java.lang.String | getHtml()Get the state of the selection.
return mConverter.getHtml();
|
public java.lang.String | getHtml(java.util.ArrayList uris)Get the state of the selection.
mConverter.getUriArray(uris, getText());
return mConverter.getHtml();
|
public android.os.Bundle | getInputExtras(boolean create)
if (DBG) {
Log.d(LOG_TAG, "---getInputExtras");
}
Bundle bundle = super.getInputExtras(create);
if (bundle != null) {
bundle = new Bundle();
}
bundle.putBoolean("allowEmoji", true);
return bundle;
|
public int | getSelectState()Get the state of the selection.
return mManager.getSelectState();
|
private void | init()Initialize members.
if (DBG) {
Log.d(LOG_TAG, "--- init");
}
requestFocus();
mDefaultBackground = getBackground();
mBackgroundColor = DEFAULT_BACKGROUND_COLOR;
mManager = new EditorManager(this);
mConverter = new StyledTextConverter(this);
mDialog = new StyledTextDialog(this);
setMovementMethod(new StyledTextArrowKeyMethod(mManager));
mManager.blockSoftKey();
mManager.unblockSoftKey();
|
public boolean | isEditting()Check whether editing is started or not.
return mManager.isEditting();
|
public boolean | isSoftKeyBlocked()Check whether SoftKey is Blocked or not.
return mManager.isSoftKeyBlocked();
|
public boolean | isStyledText()Check whether styled text or not.
return mManager.isStyledText();
|
private void | notifyStateChanged(int mode, int state)Notify the event that the mode and state are changed.
if (mESTInterface != null) {
mESTInterface.notifyStateChanged(mode, state);
}
|
public void | onClearStyles()
mManager.onClearStyles();
|
public void | onEndEdit()End editing.
mManager.onEndEdit();
|
public void | onFixSelectedItem()Fix Selected Item.
mManager.onFixSelectedItem();
|
public void | onInsertHorizontalLine()
mManager.onInsertHorizontalLine();
|
public void | onInsertImage(android.net.Uri uri)InsertImage to TextView by using URI
mManager.onInsertImage(uri);
|
public void | onInsertImage(int resId)InsertImage to TextView by using resource ID
mManager.onInsertImage(resId);
|
private void | onShowAlignAlert()Show Alignment Selecting Dialog.
mDialog.onShowAlignAlertDialog();
|
private void | onShowBackgroundColorAlert()Show Background Color Selecting Dialog.
mDialog.onShowBackgroundColorAlertDialog();
|
private void | onShowForegroundColorAlert()Show Foreground Color Selecting Dialog.
mDialog.onShowForegroundColorAlertDialog();
|
private void | onShowSizeAlert()Show Size Selecting Dialog.
mDialog.onShowSizeAlertDialog();
|
public void | onStartAlign()Start changing "Alignment" action.
mManager.onStartAlign();
|
public void | onStartBackgroundColor()Start changing "BackgroundColor" action.
mManager.onStartBackgroundColor();
|
public void | onStartColor()Start changing "Color" action.
mManager.onStartColor();
|
public void | onStartCopy()Start "Copy" action.
mManager.onStartCopy();
|
public void | onStartCut()Start "Cut" action.
mManager.onStartCut();
|
public void | onStartEdit()Start editing. This function have to be called before other editing
actions.
mManager.onStartEdit();
|
public void | onStartPaste()Start "Paste" action.
mManager.onStartPaste();
|
public void | onStartSelect()Start "Select" action.
mManager.onStartSelect();
|
public void | onStartSelectAll()Start "SelectAll" action.
mManager.onStartSelectAll();
|
public void | onStartSize()Start changing "Size" action.
mManager.onStartSize();
|
public boolean | onTouchEvent(android.view.MotionEvent event)
if (mManager.isSoftKeyBlocked() &&
event.getAction() == MotionEvent.ACTION_UP) {
cancelLongPress();
}
final boolean superResult = super.onTouchEvent(event);
if (event.getAction() == MotionEvent.ACTION_UP) {
if (DBG) {
Log.d(LOG_TAG, "--- onTouchEvent");
}
mManager.onCursorMoved();
}
return superResult;
|
public void | setAlignAlertParams(java.lang.CharSequence aligntitle, java.lang.CharSequence[] alignnames)
mDialog.setAlignAlertParams(aligntitle, alignnames);
|
public void | setAlignment(Layout.Alignment align)Set Alignment of the Item.
mManager.setAlignment(align);
|
public void | setBackgroundColor(int color)Set Background color of View.
super.setBackgroundColor(color);
mBackgroundColor = color;
|
public void | setBuilder(android.app.AlertDialog.Builder builder)Set Builder for AlertDialog.
mDialog.setBuilder(builder);
|
public void | setColorAlertParams(java.lang.CharSequence colortitle, java.lang.CharSequence[] colornames, java.lang.CharSequence[] colorints)Set Parameters for ColorAlertDialog.
mDialog.setColorAlertParams(colortitle, colornames, colorints);
|
private void | setHintMessage(int msgId)Notify hint messages what action is expected to calling class.
if (mESTInterface != null) {
mESTInterface.notifyHintMsg(msgId);
}
|
public void | setHtml(java.lang.String html)Set html to EditStyledText.
mConverter.SetHtml(html);
|
public void | setItemColor(int color)Set Color of the Item.
mManager.setItemColor(color);
|
public void | setItemSize(int size)Set Size of the Item.
mManager.setItemSize(size);
|
public void | setNotifier(com.android.internal.widget.EditStyledText$EditStyledTextNotifier estInterface)Set Notifier.
mESTInterface = estInterface;
|
public void | setSizeAlertParams(java.lang.CharSequence sizetitle, java.lang.CharSequence[] sizenames, java.lang.CharSequence[] sizedisplayints, java.lang.CharSequence[] sizesendints)Set Parameters for SizeAlertDialog.
mDialog.setSizeAlertParams(sizetitle, sizenames, sizedisplayints,
sizesendints);
|