Skip to content

Instantly share code, notes, and snippets.

@gvr23
Created December 29, 2017 16:10
Show Gist options
  • Save gvr23/2979cf8bba6978a4937a4de6ce75efa9 to your computer and use it in GitHub Desktop.
Save gvr23/2979cf8bba6978a4937a4de6ce75efa9 to your computer and use it in GitHub Desktop.
part of a text being bold and clicked and edittext stay on to of keyboard and auto suggestions
ANDROID
=================================================================================================================================
SpannableString ss = new SpannableString(getResources().getString(R.string.politicaContrato));
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void onClick(View textView){
reiniciarTimer();
terminosCondicionesDialog = TerminosCondicionesDialog.newInstance(terminosCondicionesResponse);
terminosCondicionesDialog.show(getSupportFragmentManager(), "terminoCondiciones");
}
@Override
public void updateDrawState(TextPaint ds) {
super.updateDrawState(ds);
ds.setUnderlineText(false);
}
};
ss.setSpan(clickableSpan, 156, 163, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
ss.setSpan(new StyleSpan(Typeface.BOLD), 156, 163, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
ss.setSpan(new UnderlineSpan(), 156, 163, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
tvContrato.setText(ss);
tvContrato.setMovementMethod(LinkMovementMethod.getInstance());
tvContrato.setHighlightColor(Color.TRANSPARENT);
===============================================================================================================================
android:inputType="textFilter|textMultiLine"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment