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 { ...@@ -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()) { if (!client.isEmpty()) {
label = label + ", " + client; 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); LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
View contactInfoItem = inflater.inflate(R.layout.contact_info_item, xmppItems, false); 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_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); ((ImageView) contactInfoItem.findViewById(R.id.contact_info_group_icon)).setImageResource(R.drawable.ic_xmpp_24dp);
...@@ -235,7 +242,11 @@ public class ContactViewerFragment extends Fragment { ...@@ -235,7 +242,11 @@ public class ContactViewerFragment extends Fragment {
View contactInfoItem = inflater.inflate(R.layout.contact_info_item, rootView, false); 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); ((TextView)contactInfoItem.findViewById(R.id.contact_info_item_value)).setText(value);
if (iconResource != null) { if (iconResource != null) {
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="72dp" android:minHeight="72dp"
android:paddingRight="16dp"
android:paddingEnd="16dp"
> >
...@@ -40,6 +42,7 @@ ...@@ -40,6 +42,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorSecondary"
android:singleLine="true"
android:text="Mobile" android:text="Mobile"
android:id="@+id/contact_info_item_name" /> android:id="@+id/contact_info_item_name" />
</LinearLayout> </LinearLayout>
...@@ -51,7 +54,6 @@ ...@@ -51,7 +54,6 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginRight="16dp"
android:visibility="gone" 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