diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-09-23 21:59:53 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-09-23 21:59:53 +0200 |
commit | 4ff29db8b1d4273cf8e44c411a7362be1673bbde (patch) | |
tree | 1a907b880e05c5d41ceb6ba5aad5185dd907c097 /src | |
parent | 029756947294e3d81e272659cf0bf84915db2bde (diff) |
fixed styling in blocking dialog
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/BlockContactDialog.java | 19 | ||||
-rw-r--r-- | src/main/res/layout/dialog_block_contact.xml | 2 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/BlockContactDialog.java b/src/main/java/de/pixart/messenger/ui/BlockContactDialog.java index 7f175e615..f72a365b9 100644 --- a/src/main/java/de/pixart/messenger/ui/BlockContactDialog.java +++ b/src/main/java/de/pixart/messenger/ui/BlockContactDialog.java @@ -3,6 +3,9 @@ package de.pixart.messenger.ui; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; +import android.text.SpannableString; +import android.text.Spanned; +import android.text.style.TypefaceSpan; import android.view.LayoutInflater; import android.view.View; import android.widget.CheckBox; @@ -28,15 +31,23 @@ public final class BlockContactDialog { report.setVisibility(!isBlocked && reporting ? View.VISIBLE : View.GONE); builder.setView(view); + String value; + SpannableString spannable; if (blockable.getJid().isDomainJid() || blockable.getAccount().isBlocked(blockable.getJid().toDomainJid())) { builder.setTitle(isBlocked ? R.string.action_unblock_domain : R.string.action_block_domain); - message.setText(context.getResources().getString(isBlocked ? R.string.unblock_domain_text : R.string.block_domain_text, - blockable.getJid().toDomainJid())); + value = blockable.getJid().toDomainJid().toString(); + spannable = new SpannableString(context.getString(isBlocked ? R.string.unblock_domain_text : R.string.block_domain_text, value)); + message.setText(spannable); } else { builder.setTitle(isBlocked ? R.string.action_unblock_contact : R.string.action_block_contact); - message.setText(context.getResources().getString(isBlocked ? R.string.unblock_contact_text : R.string.block_contact_text, - blockable.getJid().toBareJid())); + value = blockable.getJid().toBareJid().toString(); + spannable = new SpannableString(context.getString(isBlocked ? R.string.unblock_contact_text : R.string.block_contact_text, value)); } + int start = spannable.toString().indexOf(value); + if (start >= 0) { + spannable.setSpan(new TypefaceSpan("monospace"),start,start + value.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } + message.setText(spannable); builder.setPositiveButton(isBlocked ? R.string.unblock : R.string.block, new DialogInterface.OnClickListener() { @Override diff --git a/src/main/res/layout/dialog_block_contact.xml b/src/main/res/layout/dialog_block_contact.xml index b3615533c..661af7d56 100644 --- a/src/main/res/layout/dialog_block_contact.xml +++ b/src/main/res/layout/dialog_block_contact.xml @@ -13,7 +13,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="?attr/TextSizeBody" - android:textColor="@color/black87"/> + android:textColor="?attr/color_text_primary"/> <CheckBox android:layout_marginTop="8dp" android:id="@+id/report_spam" |