Commit f2514d30 authored by Grigory Fedorov's avatar Grigory Fedorov

ContactViewerFragment: resources displaying changed.

parent 6f1f3ec8
......@@ -111,12 +111,19 @@ public class ContactViewerFragment extends Fragment {
}
}
String label = getString(R.string.account_priority) + ": " + resourceItem.getPriority();
String priority = getString(R.string.account_priority) + ": " + resourceItem.getPriority();
String label = "";
if (!client.isEmpty()) {
label = label + ", " + client;
label = getString(R.string.contact_viewer_client) + ": " + client + ", ";
}
label += " " + resourceItem.getVerbose();
label += priority;
String resource = getString(R.string.account_resource) + ": " + resourceItem.getVerbose();
String status = resourceItem.getStatusText().trim();
if (status.isEmpty()) {
......@@ -127,8 +134,11 @@ public class ContactViewerFragment extends Fragment {
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(status);
((TextView)contactInfoItem.findViewById(R.id.contact_info_item_secondary)).setText(label);
((TextView)contactInfoItem.findViewById(R.id.contact_info_item_main)).setText(status);
((TextView)contactInfoItem.findViewById(R.id.contact_info_item_secondary_second_line)).setText(resource);
contactInfoItem.findViewById(R.id.contact_info_item_secondary_second_line).setVisibility(View.VISIBLE);
ImageView statusIcon = (ImageView) contactInfoItem.findViewById(R.id.contact_info_right_icon);
statusIcon.setVisibility(View.VISIBLE);
......@@ -308,11 +318,11 @@ public class ContactViewerFragment extends Fragment {
View contactInfoItem = inflater.inflate(R.layout.contact_info_item, rootView, false);
if (label == null || label.trim().isEmpty()) {
contactInfoItem.findViewById(R.id.contact_info_item_name).setVisibility(View.GONE);
contactInfoItem.findViewById(R.id.contact_info_item_secondary).setVisibility(View.GONE);
} else {
((TextView) contactInfoItem.findViewById(R.id.contact_info_item_name)).setText(label);
((TextView) contactInfoItem.findViewById(R.id.contact_info_item_secondary)).setText(label);
}
((TextView)contactInfoItem.findViewById(R.id.contact_info_item_value)).setText(value);
((TextView)contactInfoItem.findViewById(R.id.contact_info_item_main)).setText(value);
if (iconResource != null) {
((ImageView) contactInfoItem.findViewById(R.id.contact_info_group_icon)).setImageResource(iconResource);
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="72dp"
android:paddingRight="16dp"
android:paddingEnd="16dp"
>
......@@ -14,18 +12,20 @@
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:layout_marginTop="24dp"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="72dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_marginStart="72dp">
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:layout_marginRight="16dp"
>
<TextView
......@@ -34,7 +34,7 @@
android:textColor="?android:attr/textColorPrimary"
android:text="(650) 555-1234"
android:id="@+id/contact_info_item_value"
android:id="@+id/contact_info_item_main"
android:textSize="@dimen/abc_text_size_medium_material" />
<TextView
......@@ -44,17 +44,24 @@
android:singleLine="true"
android:text="Mobile"
android:id="@+id/contact_info_item_name" />
android:id="@+id/contact_info_item_secondary" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:singleLine="true"
android:text="Mobile"
android:visibility="gone"
android:id="@+id/contact_info_item_secondary_second_line" />
</LinearLayout>
<ImageView
android:id="@+id/contact_info_right_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:visibility="gone"
android:layout_marginRight="16dp"
/>
</RelativeLayout>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
......@@ -14,6 +14,7 @@
<string name="contact_viewer_resources">Ресурсы</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<string name="contact_viewer_resource_summary">Ресурс: %1$s\nПриоритет: %2$d\nКлиент: %3$s</string>
<string name="contact_viewer_client">Клиент</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<string name="contact_viewer_client_info">%1$s, тип: %2$s</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_personal.png -->
......
......@@ -14,6 +14,7 @@
<string name="contact_viewer_resources">Resources</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<string name="contact_viewer_resource_summary">Resource: %1$s\nPriority: %2$d\nClient: %3$s</string>
<string name="contact_viewer_client">Client</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<string name="contact_viewer_client_info">%1$s, type: %2$s</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_personal.png -->
......
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