Added a button to directly go to the contact from the history details view
This commit is contained in:
parent
bb74f21dfb
commit
a46002d16b
4 changed files with 26 additions and 12 deletions
BIN
res/drawable-xhdpi/contact.png
Normal file
BIN
res/drawable-xhdpi/contact.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
|
@ -72,8 +72,7 @@
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="100dp"
|
android:layout_height="100dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"/>
|
||||||
android:layout_marginLeft="5dp"/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/mask"
|
android:id="@+id/mask"
|
||||||
|
@ -81,8 +80,7 @@
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="100dp"
|
android:layout_height="100dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"/>
|
||||||
android:layout_marginLeft="5dp"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,17 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="0.2"
|
android:layout_weight="0.2"
|
||||||
android:padding="15dp"/>
|
android:padding="15dp"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/goto_contact"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:src="@drawable/contact"
|
||||||
|
android:background="@drawable/toolbar_button"
|
||||||
|
android:contentDescription="@string/content_description_contacts"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.2"
|
||||||
|
android:padding="15dp"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
@ -46,13 +57,11 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:padding="10dp"
|
android:padding="20dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/avatar_layout"
|
android:id="@+id/avatar_layout"
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
@ -88,7 +97,6 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="10dp"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,12 @@ import android.widget.TextView;
|
||||||
* @author Sylvain Berfini
|
* @author Sylvain Berfini
|
||||||
*/
|
*/
|
||||||
public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
||||||
private ImageView dialBack, chat, addToContacts, back;
|
private ImageView dialBack, chat, addToContacts, goToContact, back;
|
||||||
private View view;
|
private View view;
|
||||||
private ImageView contactPicture, callDirection;
|
private ImageView contactPicture, callDirection;
|
||||||
private TextView contactName, contactAddress, time, date;
|
private TextView contactName, contactAddress, time, date;
|
||||||
private String sipUri, displayName, pictureUri;
|
private String sipUri, displayName, pictureUri;
|
||||||
|
private LinphoneContact contact;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
@ -72,6 +73,9 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
||||||
addToContacts = (ImageView) view.findViewById(R.id.add_contact);
|
addToContacts = (ImageView) view.findViewById(R.id.add_contact);
|
||||||
addToContacts.setOnClickListener(this);
|
addToContacts.setOnClickListener(this);
|
||||||
|
|
||||||
|
goToContact = (ImageView) view.findViewById(R.id.goto_contact);
|
||||||
|
goToContact.setOnClickListener(this);
|
||||||
|
|
||||||
contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
|
contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
|
||||||
|
|
||||||
contactName = (TextView) view.findViewById(R.id.contact_name);
|
contactName = (TextView) view.findViewById(R.id.contact_name);
|
||||||
|
@ -107,17 +111,19 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
||||||
Log.e(e);
|
Log.e(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lAddress != null) {
|
if (lAddress != null) {
|
||||||
contactAddress.setText(lAddress.asStringUriOnly());
|
contactAddress.setText(lAddress.asStringUriOnly());
|
||||||
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
contact = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
||||||
if (contact != null) {
|
if (contact != null) {
|
||||||
contactName.setText(contact.getFullName());
|
contactName.setText(contact.getFullName());
|
||||||
LinphoneUtils.setImagePictureFromUri(view.getContext(),contactPicture,contact.getPhotoUri(),contact.getThumbnailUri());
|
LinphoneUtils.setImagePictureFromUri(view.getContext(),contactPicture,contact.getPhotoUri(),contact.getThumbnailUri());
|
||||||
addToContacts.setVisibility(View.INVISIBLE);
|
addToContacts.setVisibility(View.GONE);
|
||||||
|
goToContact.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
contactName.setText(displayName == null ? LinphoneUtils.getAddressDisplayName(sipUri) : displayName);
|
contactName.setText(displayName == null ? LinphoneUtils.getAddressDisplayName(sipUri) : displayName);
|
||||||
contactPicture.setImageResource(R.drawable.avatar);
|
contactPicture.setImageResource(R.drawable.avatar);
|
||||||
addToContacts.setVisibility(View.VISIBLE);
|
addToContacts.setVisibility(View.VISIBLE);
|
||||||
|
goToContact.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
contactAddress.setText(sipUri);
|
contactAddress.setText(sipUri);
|
||||||
|
@ -165,6 +171,8 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
||||||
Log.e(e);
|
Log.e(e);
|
||||||
}
|
}
|
||||||
LinphoneActivity.instance().displayContactsForEdition(uri);
|
LinphoneActivity.instance().displayContactsForEdition(uri);
|
||||||
|
} else if (id == R.id.goto_contact) {
|
||||||
|
LinphoneActivity.instance().displayContact(contact, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue