diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-09 02:05:46 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-09 02:05:46 +0100 |
commit | 3eb73c4b9f6b620e15ed176dc94b364e8813aa8e (patch) | |
tree | 9824507d2c46c068cde07ac1de70f87277f2e0d3 /src/de/gultsch/chat | |
parent | 4a963d6f5047705cb635924cf35b523f6cd6ba6b (diff) |
made contact details a little bit more pretty. more colors
Diffstat (limited to 'src/de/gultsch/chat')
-rw-r--r-- | src/de/gultsch/chat/ui/DialogContactDetails.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/de/gultsch/chat/ui/DialogContactDetails.java b/src/de/gultsch/chat/ui/DialogContactDetails.java index 7af8db70e..51819399c 100644 --- a/src/de/gultsch/chat/ui/DialogContactDetails.java +++ b/src/de/gultsch/chat/ui/DialogContactDetails.java @@ -3,13 +3,16 @@ package de.gultsch.chat.ui; import de.gultsch.chat.R; import de.gultsch.chat.entities.Contact; import de.gultsch.chat.entities.Presences; +import de.gultsch.chat.utils.UIHelper; import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; +import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.CheckBox; +import android.widget.ImageView; import android.widget.TextView; public class DialogContactDetails extends DialogFragment { @@ -26,11 +29,12 @@ public class DialogContactDetails extends DialogFragment { final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.dialog_contact_details, null); - TextView contactJid = (TextView) view.findViewById(R.id.details_contact_jid); + TextView contactJid = (TextView) view.findViewById(R.id.details_contactjid); TextView accountJid = (TextView) view.findViewById(R.id.details_account); - TextView status = (TextView) view.findViewById(R.id.details_contact_status); + TextView status = (TextView) view.findViewById(R.id.details_contactstatus); CheckBox send = (CheckBox) view.findViewById(R.id.details_send_presence); CheckBox receive = (CheckBox) view.findViewById(R.id.details_receive_presence); + ImageView contactPhoto = (ImageView) view.findViewById(R.id.details_contact_picture); boolean subscriptionSend = false; boolean subscriptionReceive = false; @@ -46,24 +50,31 @@ public class DialogContactDetails extends DialogFragment { switch (contact.getMostAvailableStatus()) { case Presences.CHAT: status.setText("free to chat"); + status.setTextColor(0xFF83b600); break; case Presences.ONLINE: status.setText("online"); + status.setTextColor(0xFF83b600); break; case Presences.AWAY: status.setText("away"); + status.setTextColor(0xFFffa713); break; case Presences.XA: status.setText("extended away"); + status.setTextColor(0xFFffa713); break; case Presences.DND: status.setText("do not disturb"); + status.setTextColor(0xFFe92727); break; case Presences.OFFLINE: status.setText("offline"); + status.setTextColor(0xFFe92727); break; default: status.setText("offline"); + status.setTextColor(0xFFe92727); break; } @@ -72,6 +83,12 @@ public class DialogContactDetails extends DialogFragment { contactJid.setText(contact.getJid()); accountJid.setText(contact.getAccount().getJid()); + if (contact.getProfilePhoto()!=null) { + contactPhoto.setImageURI(Uri.parse(contact.getProfilePhoto())); + } else { + contactPhoto.setImageBitmap(UIHelper.getUnknownContactPicture(contact.getDisplayName(), 300)); + } + builder.setView(view); builder.setTitle(contact.getDisplayName()); |