use of im.actor.sdk.view.CustomClicableSpan in project actor-platform by actorapp.
the class BaseAuthFragment method findAndHilightTos.
private void findAndHilightTos(SpannableStringBuilder builder, String text, boolean urlAvailable) {
String tosIndex = getString(R.string.auth_tos_index);
int index = text.indexOf(tosIndex);
ClickableSpan span;
if (urlAvailable) {
span = new BaseUrlSpan(ActorSDK.sharedActor().getTosUrl(), false);
} else {
span = new CustomClicableSpan(new CustomClicableSpan.SpanClickListener() {
@Override
public void onClick() {
new AlertDialog.Builder(getContext()).setTitle(R.string.auth_tos_index).setMessage(ActorSDK.sharedActor().getTosText()).setPositiveButton(R.string.dialog_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}).show();
}
});
}
builder.setSpan(span, index, index + tosIndex.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
use of im.actor.sdk.view.CustomClicableSpan in project actor-platform by actorapp.
the class BaseAuthFragment method findAndHilightPrivacy.
private void findAndHilightPrivacy(SpannableStringBuilder builder, String text, boolean urlAvailable) {
String ppIndex = getString(R.string.auth_privacy_index);
int index = text.indexOf(ppIndex);
ClickableSpan span;
if (urlAvailable) {
span = new BaseUrlSpan(ActorSDK.sharedActor().getPrivacyUrl(), false);
} else {
span = new CustomClicableSpan(new CustomClicableSpan.SpanClickListener() {
@Override
public void onClick() {
new AlertDialog.Builder(getContext()).setTitle(R.string.auth_privacy_index).setMessage(ActorSDK.sharedActor().getPrivacyText()).setPositiveButton(R.string.dialog_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}).show();
}
});
}
builder.setSpan(span, index, index + ppIndex.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
Aggregations