Created
December 29, 2017 16:10
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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