0
請幫我解決這個奇怪的問題。我嘗試實現EditText,用戶可以在其中添加指向用戶配置文件,主題標籤等的鏈接。我有OnTextChanged方法,我從EditText獲取當前文本,處理它並將其放到EditText後面。空間按鈕點擊放置自動建議到EditText Android
@OnTextChanged(R.id.share_article_say_something)
public void onTextChanged() {
if (mIsTextChangedManually) {
mIsTextChangedManually = false;
return;
}
mIsTextChangedManually = true;
SpannableStringBuilder builder = mCommentsSpannable.format(mSaySomethingTv.getText().toString());
mSaySomethingTv.setTextKeepState(builder);
}
EditText上看起來像
<com.slangwho.views.SWEditText
android:id="@+id/share_article_say_something"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="left"
android:textColor="@color/black"
android:textColorHint="@color/my_friend_pressed_color"
android:background="@android:color/transparent"
android:textSize="@dimen/splash_screen_button_text_sp"
android:hint="@string/say_something"
android:layout_margin="10dp"
android:imeOptions="actionDone"
android:textCursorDrawable="@drawable/ed_cursor_drawable_black"
app:fontName="ProximaNova-Regular"/>
此擴展的EditText定期的EditText只需添加1個額外的參數,它的fontName。