Android Editable - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Editable class.

This code example shows how to use the following methods: append
		public void handleTag(boolean opening, String tag, Editable output, XMLReader xmlReader) {
			 
			if("li".equals(tag)){
				 
				if(opening){
					output.append("  ");
					output.append(BULLET);
					output.append("  ");
				}else{ 
					output.append("\n");
				} 
				 
				 
			} 
		} 
		 
    } 
	 
	 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: removeSpan, setSpan, getSpanStart, length
        int length = output.length();
        output.setSpan(span, length, length, SPAN_MARK_MARK);
    } 
 
    private static void endSpan(Class<?> type, Editable output) {
        int length = output.length();
        Object span = getLast(output, type);
        int start = output.getSpanStart(span);
        output.removeSpan(span);
        if (start != length)
            output.setSpan(span, start, length, SPAN_EXCLUSIVE_EXCLUSIVE);
    } 
 
    /** 
     * Encode HTML 
     * 
     * @param html 
     * @return html 
     */ 
    public static CharSequence encode(final String html) {
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: replace, equals, length
	// IMPLEMENTATION 
	////////////////////////////////////////////////////////////////////////////////////// 
 
	@Override 
	public void afterTextChanged(Editable s) {
		String filtered = mMaskFormatter.valueToString(s);
		Log.t("original: %s - filtered: %s", s, filtered);
 
		if (!TextUtils.equals(s, filtered)) {
			s.replace(0, s.length(), filtered);
		} 
	} 
 
	@Override 
	public void beforeTextChanged(CharSequence s, int start, int count, int after) {
	} 
 
	@Override 
	public void onTextChanged(CharSequence s, int start, int before, int count) {
	} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: append, clear
		public void afterTextChanged(final Editable s) {
			// workaround for German keyboards 
			final String original = s.toString();
			final String replaced = original.replace(',', '.');
			if (!replaced.equals(original)) {
				s.clear();
				s.append(replaced);
			} 
 
			updateSpans(s);
		} 
 
		public void beforeTextChanged(final CharSequence s, final int start,
				final int count, final int after) {
		} 
 
		public void onTextChanged(final CharSequence s, final int start,
				final int before, final int count) {
			updateAppearance(); 
			if (listener != null)
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: insert
  @Override 
  public boolean onKey(View v, int keyCode, KeyEvent event) {
    Editable text=editor.getText();
 
    if (keyCode == KeyEvent.KEYCODE_TAB) {
      text.insert(editor.getSelectionStart(), "\t");
    } 
    else if (event.isCtrlPressed()) {
      int rawStart=editor.getSelectionStart();
      int rawEnd=editor.getSelectionEnd();
      int selStart=(rawStart>rawEnd ? rawEnd : rawStart);
      int selEnd=(rawStart>rawEnd ? rawStart : rawEnd);
       
      switch (keyCode) {
        case KeyEvent.KEYCODE_T:
          Toast.makeText(this,
                         TextUtils.substring(text, selStart, selEnd),
                         Toast.LENGTH_LONG).show();
 
          return(true); 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android Editable Questions & Answers:

Other Android Editable Examples

62:				
63:				@Override
64:				public void afterTextChanged(Editable arg0) {
65:					// TODO Auto-generated method stub							
66:				}

Read More

See Code Examples for Android Editable Methods: