mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-06 17:25:01 -05:00
redesigned contact details a bit
This commit is contained in:
parent
0b05acc50c
commit
2ec021a426
@ -1,128 +1,110 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/primarybackground" >
|
android:background="@color/secondarybackground"
|
||||||
|
android:orientation="vertical" >
|
||||||
|
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical" >
|
android:layout_margin="8dp"
|
||||||
|
android:background="@drawable/infocard_border"
|
||||||
|
android:padding="8dp" >
|
||||||
|
|
||||||
<TextView
|
<QuickContactBadge
|
||||||
style="@style/sectionHeader"
|
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_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="8dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:text="@string/action_contact_details"
|
android:layout_toRightOf="@+id/details_contact_badge"
|
||||||
android:textColor="@color/primarytext" />
|
android:orientation="vertical" >
|
||||||
|
|
||||||
<RelativeLayout
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/details_contactjid"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:minHeight="88dp"
|
|
||||||
android:padding="8dp" >
|
|
||||||
|
|
||||||
<QuickContactBadge
|
|
||||||
android:id="@+id/details_contact_badge"
|
|
||||||
android:layout_width="72dp"
|
|
||||||
android:layout_height="72dp"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:scaleType="centerCrop" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/details_jidbox"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:singleLine="true"
|
||||||
android:layout_toRightOf="@+id/details_contact_badge"
|
android:text="@string/account_settings_example_jabber_id"
|
||||||
android:orientation="vertical"
|
android:textColor="@color/primarytext"
|
||||||
android:paddingLeft="8dp" >
|
android:textSize="?attr/TextSizeHeadline"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/details_contactjid"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:orientation="horizontal" >
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textColor="@color/primarytext"
|
|
||||||
android:textSize="?attr/TextSizeBody" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/details_contactstatus"
|
android:id="@+id/details_contactstatus"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="16dp"
|
android:textColor="@color/secondarytext"
|
||||||
android:textColor="@color/primarytext"
|
android:textSize="?attr/TextSizeBody" />
|
||||||
android:textSize="?attr/TextSizeHeadline"
|
|
||||||
android:textStyle="bold" />
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text=" · "
|
||||||
|
android:textColor="@color/secondarytext"
|
||||||
|
android:textSize="?attr/TextSizeBody" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/details_lastseen"
|
android:id="@+id/details_lastseen"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textColor="@color/primarytext"
|
android:textColor="@color/secondarytext"
|
||||||
android:textSize="?attr/TextSizeBody" />
|
android:textSize="?attr/TextSizeBody" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<TextView
|
<CheckBox
|
||||||
style="@style/sectionHeader"
|
android:id="@+id/details_send_presence"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="@string/your_account"
|
android:text="@string/send_presence_updates"
|
||||||
android:textColor="@color/primarytext" />
|
android:textColor="@color/primarytext"
|
||||||
|
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="@color/primarytext"
|
||||||
|
android:textSize="?attr/TextSizeBody" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/details_account"
|
android:id="@+id/details_account"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="8dp"
|
android:layout_alignParentRight="true"
|
||||||
android:textColor="@color/primarytext"
|
android:layout_below="@+id/details_jidbox"
|
||||||
android:textSize="?attr/TextSizeBody" />
|
android:layout_marginTop="32dp"
|
||||||
|
android:text="@string/using_account"
|
||||||
|
android:textColor="@color/secondarytext"
|
||||||
|
android:textSize="?attr/TextSizeInfo" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
style="@style/sectionHeader"
|
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:padding="8dp"
|
android:layout_margin="8dp"
|
||||||
android:text="@string/subscriptions"
|
android:background="@drawable/infocard_border"
|
||||||
android:textColor="@color/primarytext" />
|
android:divider="?android:dividerHorizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
<CheckBox
|
android:padding="8dp"
|
||||||
android:id="@+id/details_send_presence"
|
android:showDividers="middle" >
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/send_presence_updates"
|
|
||||||
android:textColor="@color/primarytext"
|
|
||||||
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="@color/primarytext"
|
|
||||||
android:textSize="?attr/TextSizeBody" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/sectionHeader"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:text="@string/keys" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/details_contact_keys"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:divider="?android:dividerHorizontal"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:showDividers="middle" >
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</LinearLayout>
|
@ -16,14 +16,15 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/primarytext"
|
android:textColor="@color/primarytext"
|
||||||
android:textSize="?attr/TextSizeHeadline"
|
android:textSize="?attr/TextSizeBody"
|
||||||
android:typeface="monospace" />
|
android:typeface="monospace" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/key_type"
|
android:id="@+id/key_type"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/secondarytext" />
|
android:textColor="@color/secondarytext"
|
||||||
|
android:textSize="?attr/TextSizeInfo"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
|
@ -265,5 +265,6 @@
|
|||||||
<string name="conference_banned">You are banned from this conference</string>
|
<string name="conference_banned">You are banned from this conference</string>
|
||||||
<string name="conference_members_only">This conference is members only</string>
|
<string name="conference_members_only">This conference is members only</string>
|
||||||
<string name="conference_kicked">You have been kicked from this conference</string>
|
<string name="conference_kicked">You have been kicked from this conference</string>
|
||||||
|
<string name="using_account">using account %s</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@ -309,7 +309,7 @@ public class ContactDetailsActivity extends XmppActivity {
|
|||||||
} else {
|
} else {
|
||||||
contactJidTv.setText(contact.getJid());
|
contactJidTv.setText(contact.getJid());
|
||||||
}
|
}
|
||||||
accountJidTv.setText(contact.getAccount().getJid());
|
accountJidTv.setText(getString(R.string.using_account,contact.getAccount().getJid()));
|
||||||
|
|
||||||
UIHelper.prepareContactBadge(this, badge, contact,
|
UIHelper.prepareContactBadge(this, badge, contact,
|
||||||
getApplicationContext());
|
getApplicationContext());
|
||||||
@ -319,9 +319,11 @@ public class ContactDetailsActivity extends XmppActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
keys.removeAllViews();
|
keys.removeAllViews();
|
||||||
|
boolean hasKeys = false;
|
||||||
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
for (Iterator<String> iterator = contact.getOtrFingerprints()
|
for (Iterator<String> iterator = contact.getOtrFingerprints()
|
||||||
.iterator(); iterator.hasNext();) {
|
.iterator(); iterator.hasNext();) {
|
||||||
|
hasKeys = true;
|
||||||
final String otrFingerprint = iterator.next();
|
final String otrFingerprint = iterator.next();
|
||||||
View view = (View) inflater.inflate(R.layout.contact_key, keys,
|
View view = (View) inflater.inflate(R.layout.contact_key, keys,
|
||||||
false);
|
false);
|
||||||
@ -342,6 +344,7 @@ public class ContactDetailsActivity extends XmppActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (contact.getPgpKeyId() != 0) {
|
if (contact.getPgpKeyId() != 0) {
|
||||||
|
hasKeys = true;
|
||||||
View view = (View) inflater.inflate(R.layout.contact_key, keys,
|
View view = (View) inflater.inflate(R.layout.contact_key, keys,
|
||||||
false);
|
false);
|
||||||
TextView key = (TextView) view.findViewById(R.id.key);
|
TextView key = (TextView) view.findViewById(R.id.key);
|
||||||
@ -370,6 +373,11 @@ public class ContactDetailsActivity extends XmppActivity {
|
|||||||
});
|
});
|
||||||
keys.addView(view);
|
keys.addView(view);
|
||||||
}
|
}
|
||||||
|
if (hasKeys) {
|
||||||
|
keys.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
keys.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void confirmToDeleteFingerprint(final String fingerprint) {
|
protected void confirmToDeleteFingerprint(final String fingerprint) {
|
||||||
|
Loading…
Reference in New Issue
Block a user