Commit 07aa56b8 authored by Grigory Fedorov's avatar Grigory Fedorov

ContactViewerFragment: status and resource displaying changed, layout corrected.

parent fbc4513c
......@@ -105,17 +105,24 @@ public class ContactViewerFragment extends Fragment {
}
}
String label = String.valueOf(resourceItem.getPriority());
String label = getString(R.string.account_priority) + ": " + resourceItem.getPriority();
if (!client.isEmpty()) {
label = label + ", " + client;
}
label += " " + resourceItem.getVerbose();
String status = resourceItem.getStatusText().trim();
if (status.isEmpty()) {
status = getString(resourceItem.getStatusMode().getStringID());
}
LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
View contactInfoItem = inflater.inflate(R.layout.contact_info_item, xmppItems, false);
((TextView)contactInfoItem.findViewById(R.id.contact_info_item_name)).setText(label);
((TextView)contactInfoItem.findViewById(R.id.contact_info_item_value)).setText(resourceItem.getVerbose());
((TextView)contactInfoItem.findViewById(R.id.contact_info_item_value)).setText(status);
((ImageView) contactInfoItem.findViewById(R.id.contact_info_group_icon)).setImageResource(R.drawable.ic_xmpp_24dp);
......@@ -235,7 +242,11 @@ public class ContactViewerFragment extends Fragment {
View contactInfoItem = inflater.inflate(R.layout.contact_info_item, rootView, false);
((TextView)contactInfoItem.findViewById(R.id.contact_info_item_name)).setText(label);
if (label == null || label.trim().isEmpty()) {
contactInfoItem.findViewById(R.id.contact_info_item_name).setVisibility(View.GONE);
} else {
((TextView) contactInfoItem.findViewById(R.id.contact_info_item_name)).setText(label);
}
((TextView)contactInfoItem.findViewById(R.id.contact_info_item_value)).setText(value);
if (iconResource != null) {
......
......@@ -4,6 +4,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="72dp"
android:paddingRight="16dp"
android:paddingEnd="16dp"
>
......@@ -40,6 +42,7 @@
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:singleLine="true"
android:text="Mobile"
android:id="@+id/contact_info_item_name" />
</LinearLayout>
......@@ -51,7 +54,6 @@
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginRight="16dp"
android:visibility="gone"
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment