use data binder for contact details activity

This commit is contained in:
Daniel Gultsch 2018-02-17 18:58:56 +01:00
parent eb25643d94
commit 58ec5ced8a
3 changed files with 201 additions and 217 deletions

View File

@ -75,6 +75,10 @@ android {
applicationId "eu.siacs.conversations" applicationId "eu.siacs.conversations"
} }
dataBinding {
enabled true
}
dexOptions { dexOptions {
// Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false. // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
preDexLibraries = preDexEnabled && !travisBuild preDexLibraries = preDexEnabled && !travisBuild

View File

@ -1,5 +1,6 @@
package eu.siacs.conversations.ui; package eu.siacs.conversations.ui;
import android.databinding.DataBindingUtil;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
@ -12,19 +13,14 @@ import android.provider.ContactsContract.CommonDataKinds;
import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Intents; import android.provider.ContactsContract.Intents;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v7.widget.CardView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.QuickContactBadge;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -39,6 +35,7 @@ import eu.siacs.conversations.R;
import eu.siacs.conversations.crypto.axolotl.AxolotlService; import eu.siacs.conversations.crypto.axolotl.AxolotlService;
import eu.siacs.conversations.crypto.axolotl.FingerprintStatus; import eu.siacs.conversations.crypto.axolotl.FingerprintStatus;
import eu.siacs.conversations.crypto.axolotl.XmppAxolotlSession; import eu.siacs.conversations.crypto.axolotl.XmppAxolotlSession;
import eu.siacs.conversations.databinding.ActivityContactDetailsBinding;
import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Contact;
import eu.siacs.conversations.entities.ListItem; import eu.siacs.conversations.entities.ListItem;
@ -104,20 +101,11 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
} }
} }
}; };
ActivityContactDetailsBinding binding;
private Jid accountJid; private Jid accountJid;
private TextView lastseen;
private Jid contactJid; private Jid contactJid;
private TextView contactJidTv;
private TextView accountJidTv;
private TextView statusMessage;
private CheckBox send;
private CheckBox receive;
private Button addContactButton;
private Button mShowInactiveDevicesButton;
private QuickContactBadge badge;
private LinearLayout keys;
private CardView keysWrapper;
private FlowLayout tags;
private boolean showDynamicTags = false; private boolean showDynamicTags = false;
private boolean showLastSeen = false; private boolean showLastSeen = false;
private boolean showInactiveOmemo = false; private boolean showInactiveOmemo = false;
@ -205,26 +193,13 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
} }
} }
this.messageFingerprint = getIntent().getStringExtra("fingerprint"); this.messageFingerprint = getIntent().getStringExtra("fingerprint");
setContentView(R.layout.activity_contact_details); this.binding = DataBindingUtil.setContentView(this, R.layout.activity_contact_details);
contactJidTv = findViewById(R.id.details_contactjid);
accountJidTv = findViewById(R.id.details_account);
lastseen = findViewById(R.id.details_lastseen);
statusMessage = findViewById(R.id.status_message);
send = findViewById(R.id.details_send_presence);
receive = findViewById(R.id.details_receive_presence);
badge = findViewById(R.id.details_contact_badge);
addContactButton = findViewById(R.id.add_contact_button);
addContactButton.setOnClickListener(view -> showAddToRosterDialog(contact));
keys = findViewById(R.id.details_contact_keys);
keysWrapper = findViewById(R.id.keys_wrapper);
tags = findViewById(R.id.tags);
mShowInactiveDevicesButton = findViewById(R.id.show_inactive_devices);
if (getSupportActionBar() != null) { if (getSupportActionBar() != null) {
getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} }
mShowInactiveDevicesButton.setOnClickListener(v -> { binding.showInactiveDevices.setOnClickListener(v -> {
showInactiveOmemo = !showInactiveOmemo; showInactiveOmemo = !showInactiveOmemo;
populateView(); populateView();
}); });
@ -336,18 +311,18 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
invalidateOptionsMenu(); invalidateOptionsMenu();
setTitle(contact.getDisplayName()); setTitle(contact.getDisplayName());
if (contact.showInRoster()) { if (contact.showInRoster()) {
send.setVisibility(View.VISIBLE); binding.detailsSendPresence.setVisibility(View.VISIBLE);
receive.setVisibility(View.VISIBLE); binding.detailsReceivePresence.setVisibility(View.VISIBLE);
addContactButton.setVisibility(View.GONE); binding.addContactButton.setVisibility(View.GONE);
send.setOnCheckedChangeListener(null); binding.detailsSendPresence.setOnCheckedChangeListener(null);
receive.setOnCheckedChangeListener(null); binding.detailsReceivePresence.setOnCheckedChangeListener(null);
List<String> statusMessages = contact.getPresences().getStatusMessages(); List<String> statusMessages = contact.getPresences().getStatusMessages();
if (statusMessages.size() == 0) { if (statusMessages.size() == 0) {
statusMessage.setVisibility(View.GONE); binding.statusMessage.setVisibility(View.GONE);
} else { } else {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
statusMessage.setVisibility(View.VISIBLE); binding.statusMessage.setVisibility(View.VISIBLE);
int s = statusMessages.size(); int s = statusMessages.size();
for(int i = 0; i < s; ++i) { for(int i = 0; i < s; ++i) {
if (s > 1) { if (s > 1) {
@ -358,69 +333,69 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
builder.append("\n"); builder.append("\n");
} }
} }
statusMessage.setText(builder); binding.statusMessage.setText(builder);
} }
if (contact.getOption(Contact.Options.FROM)) { if (contact.getOption(Contact.Options.FROM)) {
send.setText(R.string.send_presence_updates); binding.detailsSendPresence.setText(R.string.send_presence_updates);
send.setChecked(true); binding.detailsSendPresence.setChecked(true);
} else if (contact.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) { } else if (contact.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) {
send.setChecked(false); binding.detailsSendPresence.setChecked(false);
send.setText(R.string.send_presence_updates); binding.detailsSendPresence.setText(R.string.send_presence_updates);
} else { } else {
send.setText(R.string.preemptively_grant); binding.detailsSendPresence.setText(R.string.preemptively_grant);
if (contact.getOption(Contact.Options.PREEMPTIVE_GRANT)) { if (contact.getOption(Contact.Options.PREEMPTIVE_GRANT)) {
send.setChecked(true); binding.detailsSendPresence.setChecked(true);
} else { } else {
send.setChecked(false); binding.detailsSendPresence.setChecked(false);
} }
} }
if (contact.getOption(Contact.Options.TO)) { if (contact.getOption(Contact.Options.TO)) {
receive.setText(R.string.receive_presence_updates); binding.detailsReceivePresence.setText(R.string.receive_presence_updates);
receive.setChecked(true); binding.detailsReceivePresence.setChecked(true);
} else { } else {
receive.setText(R.string.ask_for_presence_updates); binding.detailsReceivePresence.setText(R.string.ask_for_presence_updates);
if (contact.getOption(Contact.Options.ASKING)) { if (contact.getOption(Contact.Options.ASKING)) {
receive.setChecked(true); binding.detailsReceivePresence.setChecked(true);
} else { } else {
receive.setChecked(false); binding.detailsReceivePresence.setChecked(false);
} }
} }
if (contact.getAccount().isOnlineAndConnected()) { if (contact.getAccount().isOnlineAndConnected()) {
receive.setEnabled(true); binding.detailsReceivePresence.setEnabled(true);
send.setEnabled(true); binding.detailsSendPresence.setEnabled(true);
} else { } else {
receive.setEnabled(false); binding.detailsReceivePresence.setEnabled(false);
send.setEnabled(false); binding.detailsSendPresence.setEnabled(false);
} }
send.setOnCheckedChangeListener(this.mOnSendCheckedChange); binding.detailsSendPresence.setOnCheckedChangeListener(this.mOnSendCheckedChange);
receive.setOnCheckedChangeListener(this.mOnReceiveCheckedChange); binding.detailsReceivePresence.setOnCheckedChangeListener(this.mOnReceiveCheckedChange);
} else { } else {
addContactButton.setVisibility(View.VISIBLE); binding.addContactButton.setVisibility(View.VISIBLE);
send.setVisibility(View.GONE); binding.detailsSendPresence.setVisibility(View.GONE);
receive.setVisibility(View.GONE); binding.detailsReceivePresence.setVisibility(View.GONE);
statusMessage.setVisibility(View.GONE); binding.statusMessage.setVisibility(View.GONE);
} }
if (contact.isBlocked() && !this.showDynamicTags) { if (contact.isBlocked() && !this.showDynamicTags) {
lastseen.setVisibility(View.VISIBLE); binding.detailsLastseen.setVisibility(View.VISIBLE);
lastseen.setText(R.string.contact_blocked); binding.detailsLastseen.setText(R.string.contact_blocked);
} else { } else {
if (showLastSeen if (showLastSeen
&& contact.getLastseen() > 0 && contact.getLastseen() > 0
&& contact.getPresences().allOrNonSupport(Namespace.IDLE)) { && contact.getPresences().allOrNonSupport(Namespace.IDLE)) {
lastseen.setVisibility(View.VISIBLE); binding.detailsLastseen.setVisibility(View.VISIBLE);
lastseen.setText(UIHelper.lastseen(getApplicationContext(), contact.isActive(), contact.getLastseen())); binding.detailsLastseen.setText(UIHelper.lastseen(getApplicationContext(), contact.isActive(), contact.getLastseen()));
} else { } else {
lastseen.setVisibility(View.GONE); binding.detailsLastseen.setVisibility(View.GONE);
} }
} }
if (contact.getPresences().size() > 1) { if (contact.getPresences().size() > 1) {
contactJidTv.setText(contact.getDisplayJid() + " (" binding.detailsContactjid.setText(contact.getDisplayJid() + " ("
+ contact.getPresences().size() + ")"); + contact.getPresences().size() + ")");
} else { } else {
contactJidTv.setText(contact.getDisplayJid()); binding.detailsContactjid.setText(contact.getDisplayJid());
} }
String account; String account;
if (Config.DOMAIN_LOCK != null) { if (Config.DOMAIN_LOCK != null) {
@ -428,17 +403,17 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
} else { } else {
account = contact.getAccount().getJid().toBareJid().toString(); account = contact.getAccount().getJid().toBareJid().toString();
} }
accountJidTv.setText(getString(R.string.using_account, account)); binding.detailsAccount.setText(getString(R.string.using_account, account));
badge.setImageBitmap(avatarService().get(contact, getPixel(72))); binding.detailsContactBadge.setImageBitmap(avatarService().get(contact, getPixel(72)));
badge.setOnClickListener(this.onBadgeClick); binding.detailsContactBadge.setOnClickListener(this.onBadgeClick);
keys.removeAllViews(); binding.detailsContactKeys.removeAllViews();
boolean hasKeys = false; boolean hasKeys = false;
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (Config.supportOtr()) { if (Config.supportOtr()) {
for (final String otrFingerprint : contact.getOtrFingerprints()) { for (final String otrFingerprint : contact.getOtrFingerprints()) {
hasKeys = true; hasKeys = true;
View view = inflater.inflate(R.layout.contact_key, keys, false); View view = inflater.inflate(R.layout.contact_key, binding.detailsContactKeys, false);
TextView key = (TextView) view.findViewById(R.id.key); TextView key = (TextView) view.findViewById(R.id.key);
TextView keyType = (TextView) view.findViewById(R.id.key_type); TextView keyType = (TextView) view.findViewById(R.id.key_type);
ImageButton removeButton = (ImageButton) view ImageButton removeButton = (ImageButton) view
@ -451,7 +426,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
} else { } else {
keyType.setText(R.string.otr_fingerprint); keyType.setText(R.string.otr_fingerprint);
} }
keys.addView(view); binding.detailsContactKeys.addView(view);
removeButton.setOnClickListener(new OnClickListener() { removeButton.setOnClickListener(new OnClickListener() {
@Override @Override
@ -478,21 +453,21 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
} }
if (!trust.isCompromised()) { if (!trust.isCompromised()) {
boolean highlight = session.getFingerprint().equals(messageFingerprint); boolean highlight = session.getFingerprint().equals(messageFingerprint);
addFingerprintRow(keys, session, highlight); addFingerprintRow(binding.detailsContactKeys, session, highlight);
} }
} }
if (showsInactive || skippedInactive) { if (showsInactive || skippedInactive) {
mShowInactiveDevicesButton.setText(showsInactive ? R.string.hide_inactive_devices : R.string.show_inactive_devices); binding.showInactiveDevices.setText(showsInactive ? R.string.hide_inactive_devices : R.string.show_inactive_devices);
mShowInactiveDevicesButton.setVisibility(View.VISIBLE); binding.showInactiveDevices.setVisibility(View.VISIBLE);
} else { } else {
mShowInactiveDevicesButton.setVisibility(View.GONE); binding.showInactiveDevices.setVisibility(View.GONE);
} }
} else { } else {
mShowInactiveDevicesButton.setVisibility(View.GONE); binding.showInactiveDevices.setVisibility(View.GONE);
} }
if (Config.supportOpenPgp() && contact.getPgpKeyId() != 0) { if (Config.supportOpenPgp() && contact.getPgpKeyId() != 0) {
hasKeys = true; hasKeys = true;
View view = inflater.inflate(R.layout.contact_key, keys, false); View view = inflater.inflate(R.layout.contact_key, binding.detailsContactKeys, false);
TextView key = (TextView) view.findViewById(R.id.key); TextView key = (TextView) view.findViewById(R.id.key);
TextView keyType = (TextView) view.findViewById(R.id.key_type); TextView keyType = (TextView) view.findViewById(R.id.key_type);
keyType.setText(R.string.openpgp_key_id); keyType.setText(R.string.openpgp_key_id);
@ -510,21 +485,21 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
view.setOnClickListener(openKey); view.setOnClickListener(openKey);
key.setOnClickListener(openKey); key.setOnClickListener(openKey);
keyType.setOnClickListener(openKey); keyType.setOnClickListener(openKey);
keys.addView(view); binding.detailsContactKeys.addView(view);
} }
keysWrapper.setVisibility(hasKeys ? View.VISIBLE : View.GONE); binding.keysWrapper.setVisibility(hasKeys ? View.VISIBLE : View.GONE);
List<ListItem.Tag> tagList = contact.getTags(this); List<ListItem.Tag> tagList = contact.getTags(this);
if (tagList.size() == 0 || !this.showDynamicTags) { if (tagList.size() == 0 || !this.showDynamicTags) {
tags.setVisibility(View.GONE); binding.tags.setVisibility(View.GONE);
} else { } else {
tags.setVisibility(View.VISIBLE); binding.tags.setVisibility(View.VISIBLE);
tags.removeAllViewsInLayout(); binding.tags.removeAllViewsInLayout();
for(final ListItem.Tag tag : tagList) { for(final ListItem.Tag tag : tagList) {
final TextView tv = (TextView) inflater.inflate(R.layout.list_item_tag,tags,false); final TextView tv = (TextView) inflater.inflate(R.layout.list_item_tag,binding.tags,false);
tv.setText(tag.getName()); tv.setText(tag.getName());
tv.setBackgroundColor(tag.getColor()); tv.setBackgroundColor(tag.getColor());
tags.addView(tv); binding.tags.addView(tv);
} }
} }
} }

View File

@ -1,150 +1,155 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="fill_parent" xmlns:tools="http://schemas.android.com/tools">
android:background="?attr/color_background_secondary">
<LinearLayout <ScrollView
android:id="@+id/details_main_layout"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="fill_parent"
android:orientation="vertical"> android:background="?attr/color_background_secondary">
<android.support.v7.widget.CardView <LinearLayout
android:layout_width="match_parent" android:id="@+id/details_main_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_vertical_margin" android:orientation="vertical">
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin">
<RelativeLayout <android.support.v7.widget.CardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/infocard_padding"> android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin">
<QuickContactBadge <RelativeLayout
android:id="@+id/details_contact_badge" android:layout_width="match_parent"
android:layout_width="72dp" android:layout_height="wrap_content"
android:layout_height="72dp" android:padding="@dimen/infocard_padding">
android:layout_alignParentTop="true"
android:scaleType="centerCrop"/> <QuickContactBadge
android:id="@+id/details_contact_badge"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_alignParentTop="true"
android:scaleType="centerCrop"/>
<LinearLayout
android:id="@+id/details_jidbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_toRightOf="@+id/details_contact_badge"
android:orientation="vertical">
<TextView
android:id="@+id/details_contactjid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/account_settings_example_jabber_id"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeHeadline"
android:textStyle="bold"/>
<com.wefika.flowlayout.FlowLayout
android:id="@+id/tags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginLeft="-2dp"
android:layout_marginTop="4dp"
android:orientation="horizontal">
</com.wefika.flowlayout.FlowLayout>
<TextView
android:id="@+id/details_lastseen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"/>
<TextView
android:id="@+id/status_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="?attr/color_text_secondary"
android:textSize="?attr/TextSizeBody"
android:textStyle="italic"/>
<Button
android:id="@+id/add_contact_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/add_contact"/>
<CheckBox
android:id="@+id/details_send_presence"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/send_presence_updates"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"/>
<CheckBox
android:id="@+id/details_receive_presence"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/receive_presence_updates"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"/>
</LinearLayout>
<TextView
android:id="@+id/details_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/details_jidbox"
android:layout_marginTop="32dp"
android:text="@string/using_account"
android:textColor="?attr/color_text_secondary"
android:textSize="?attr/TextSizeInfo"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/keys_wrapper"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin">
<LinearLayout <LinearLayout
android:id="@+id/details_jidbox" android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp" android:orientation="vertical"
android:layout_toRightOf="@+id/details_contact_badge" android:padding="@dimen/infocard_padding">
android:orientation="vertical">
<TextView <LinearLayout
android:id="@+id/details_contactjid" android:id="@+id/details_contact_keys"
android:layout_width="wrap_content" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/account_settings_example_jabber_id" android:orientation="vertical">
android:textColor="?attr/color_text_primary" </LinearLayout>
android:textSize="?attr/TextSizeHeadline"
android:textStyle="bold"/>
<com.wefika.flowlayout.FlowLayout
android:id="@+id/tags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginLeft="-2dp"
android:layout_marginTop="4dp"
android:orientation="horizontal">
</com.wefika.flowlayout.FlowLayout>
<TextView
android:id="@+id/details_lastseen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"/>
<TextView
android:id="@+id/status_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="?attr/color_text_secondary"
android:textSize="?attr/TextSizeBody"
android:textStyle="italic"/>
<Button <Button
android:id="@+id/add_contact_button" android:id="@+id/show_inactive_devices"
style="?android:attr/borderlessButtonStyle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:text="@string/add_contact"/> android:text="@string/show_inactive_devices"
android:textColor="@color/accent"/>
<CheckBox
android:id="@+id/details_send_presence"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/send_presence_updates"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"/>
<CheckBox
android:id="@+id/details_receive_presence"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/receive_presence_updates"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"/>
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<TextView </ScrollView>
android:id="@+id/details_account" </layout>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/details_jidbox"
android:layout_marginTop="32dp"
android:text="@string/using_account"
android:textColor="?attr/color_text_secondary"
android:textSize="?attr/TextSizeInfo"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/keys_wrapper"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/infocard_padding">
<LinearLayout
android:id="@+id/details_contact_keys"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
<Button
android:id="@+id/show_inactive_devices"
style="?android:attr/borderlessButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:text="@string/show_inactive_devices"
android:textColor="@color/accent"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>