RTEditor-Toolbar/src/main/java/com/onegravity/rteditor/toolbar/HorizontalRTToolbar.java
@Override
    public void setFontSize(int size) {
        if (mFontSize != null) {
            if (size <= 0) {
                mFontSizeAdapter.updateSpinnerTitle("");
                mFontSizeAdapter.setSelectedItem(0);
                mFontSize.setSelection(0);
            } else {
                size = Helper.convertSpToPx(size);
                mFontSizeAdapter.updateSpinnerTitle(Integer.toString(size));
                for (int pos = 0; pos < mFontSizeAdapter.getCount(); pos++) {
                    FontSizeSpinnerItem item = mFontSizeAdapter.getItem(pos);
                    if (size == item.getFontSize()) {
                        mFontSizeAdapter.setSelectedItem(pos);
                        mFontSize.setSelection(pos);
                        break;
                    }
                }
            }
        }
    }
@Override
    public void setFontSize(int size) {
        if (mFontSize != null) {
            if (size <= 0) {
                mFontSizeAdapter.updateSpinnerTitle("");
                mFontSizeAdapter.setSelectedItem(0);
                mFontSize.setSelection(0);
            } else {
                size = Helper.convertSpToPx(size);
                mFontSizeAdapter.updateSpinnerTitle(Integer.toString(size));
                for (int pos = 0; pos < mFontSizeAdapter.getCount(); pos++) {
                    FontSizeSpinnerItem item = mFontSizeAdapter.getItem(pos);
                    if (size == item.getFontSize()) {
                        mFontSizeAdapter.setSelectedItem(pos);
                        mFontSize.setSelection(pos);
                        break;
                    }
                }
            }
        }
    }
@ Override public void setFontSize ( int size ) { if ( mFontSize != null ) { if ( size <= 0 ) { mFontSizeAdapter . updateSpinnerTitle ( "" ) ; mFontSizeAdapter . setSelectedItem ( 0 ) ; mFontSize . setSelection ( 0 ) ; } else { size = Helper . convertSpToPx ( size ) ; mFontSizeAdapter . updateSpinnerTitle ( Integer . toString ( size ) ) ; for ( int pos = 0 ; pos < mFontSizeAdapter . getCount ( ) ; pos ++ ) { FontSizeSpinnerItem item = mFontSizeAdapter . getItem ( pos ) ; if ( size == item . getFontSize ( ) ) { mFontSizeAdapter . setSelectedItem ( pos ) ; mFontSize . setSelection ( pos ) ; break ; } } } } }
Set the text size.

@param size the text size, if -1 then no text size is set (e.g. when selection spans more than one text size)
Set the text size .