diff --git a/res/drawable-xhdpi/avatar.png b/res/drawable-xhdpi/avatar.png index 19d79f738..d3a0bf331 100644 Binary files a/res/drawable-xhdpi/avatar.png and b/res/drawable-xhdpi/avatar.png differ diff --git a/res/drawable-xhdpi/avatar_mask.png b/res/drawable-xhdpi/avatar_mask.png new file mode 100644 index 000000000..0ab25721f Binary files /dev/null and b/res/drawable-xhdpi/avatar_mask.png differ diff --git a/res/drawable-xhdpi/avatar_mask_border.png b/res/drawable-xhdpi/avatar_mask_border.png new file mode 100644 index 000000000..e1abe1712 Binary files /dev/null and b/res/drawable-xhdpi/avatar_mask_border.png differ diff --git a/res/drawable-xhdpi/list_details_default.png b/res/drawable-xhdpi/list_details_default.png index 660043029..8689a7e20 100644 Binary files a/res/drawable-xhdpi/list_details_default.png and b/res/drawable-xhdpi/list_details_default.png differ diff --git a/res/drawable-xhdpi/list_details_over.png b/res/drawable-xhdpi/list_details_over.png index abd1f90dd..0d6bedeee 100644 Binary files a/res/drawable-xhdpi/list_details_over.png and b/res/drawable-xhdpi/list_details_over.png differ diff --git a/res/drawable/list_detail.xml b/res/drawable/list_detail.xml index e088af629..90a37d7ef 100644 --- a/res/drawable/list_detail.xml +++ b/res/drawable/list_detail.xml @@ -1,7 +1,7 @@ + android:drawable="@drawable/list_details_over" /> diff --git a/res/layout/history.xml b/res/layout/history.xml index 8227099d5..eecff4a44 100644 --- a/res/layout/history.xml +++ b/res/layout/history.xml @@ -19,19 +19,19 @@ + android:gravity="center"/> + android:gravity="center"/> diff --git a/res/layout/history_cell.xml b/res/layout/history_cell.xml index f842f7762..a3aa9a771 100644 --- a/res/layout/history_cell.xml +++ b/res/layout/history_cell.xml @@ -2,21 +2,30 @@ - + android:layout_height="wrap_content" + android:orientation="vertical"> + + + + + + + - + android:layout_height="wrap_content"> + + + + + + + diff --git a/res/layout/history_detail.xml b/res/layout/history_detail.xml index 76d3bc98b..825b5ae75 100644 --- a/res/layout/history_detail.xml +++ b/res/layout/history_detail.xml @@ -6,18 +6,17 @@ android:orientation="vertical" > - + android:background="@color/colorF"> @@ -48,34 +47,46 @@ android:orientation="vertical"> - + android:adjustViewBounds="true" + android:layout_alignParentLeft="true" + android:layout_marginLeft="5dp"/> + + + - + android:layout_height="wrap_content"/> + android:layout_height="wrap_content"/> - + android:layout_centerInParent="true"/> - - + android:layout_marginRight="10dp"/> + android:layout_height="wrap_content"/> - - + android:layout_height="wrap_content"/> + android:layout_height="wrap_content" /> - - - \ No newline at end of file diff --git a/res/layout/history_group.xml b/res/layout/history_group.xml deleted file mode 100644 index 65f4018e9..000000000 --- a/res/layout/history_group.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/res/values/color.xml b/res/values/color.xml index 101816be1..5a3a49cab 100644 --- a/res/values/color.xml +++ b/res/values/color.xml @@ -36,7 +36,7 @@ #ffe4edf2 #ffd8d8d8 #ffb1bdc3 - + #ffcf4c29 #00000000 diff --git a/src/org/linphone/HistoryDetailFragment.java b/src/org/linphone/HistoryDetailFragment.java index 34e405d6e..afc7e606e 100644 --- a/src/org/linphone/HistoryDetailFragment.java +++ b/src/org/linphone/HistoryDetailFragment.java @@ -54,10 +54,10 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener { String status = getArguments().getString("CallStatus"); String callTime = getArguments().getString("CallTime"); String callDate = getArguments().getString("CallDate"); - + view = inflater.inflate(R.layout.history_detail, container, false); - dialBack = (ImageView) view.findViewById(R.id.dialBack); + dialBack = (ImageView) view.findViewById(R.id.call); dialBack.setOnClickListener(this); back = (ImageView) view.findViewById(R.id.back); @@ -71,16 +71,16 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener { addToContacts = (ImageView) view.findViewById(R.id.add_contact); addToContacts.setOnClickListener(this); - contactPicture = (ImageView) view.findViewById(R.id.contactPicture); + contactPicture = (ImageView) view.findViewById(R.id.contact_picture); - contactName = (TextView) view.findViewById(R.id.contactName); + contactName = (TextView) view.findViewById(R.id.contact_name); if (displayName == null && getResources().getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) { displayName = LinphoneUtils.getUsernameFromAddress(sipUri); } - contactAddress = (TextView) view.findViewById(R.id.contactAddress); + contactAddress = (TextView) view.findViewById(R.id.contact_address); - callDirection = (TextView) view.findViewById(R.id.callDirection); + callDirection = (TextView) view.findViewById(R.id.call_direction); time = (TextView) view.findViewById(R.id.time); date = (TextView) view.findViewById(R.id.date); @@ -99,11 +99,11 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener { } if (status.equals("Missed")) { - callDirection.setText(getString(R.string.call_state_missed)); + callDirection.setText(getString(R.string.call_state_missed) + " call"); } else if (status.equals("Incoming")) { - callDirection.setText(getString(R.string.call_state_incoming)); + callDirection.setText(getString(R.string.call_state_incoming) + " call"); } else if (status.equals("Outgoing")) { - callDirection.setText(getString(R.string.call_state_outgoing)); + callDirection.setText(getString(R.string.call_state_outgoing) + " call"); } else { callDirection.setText(status); } @@ -116,10 +116,10 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener { lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri); Contact contact = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), lAddress); if (contact != null) { - //LinphoneUtils.setImagePictureFromUri(view.getContext(), contactPicture.getView(),contact.getPhotoUri(), contact.getThumbnailUri(), R.drawable.unknown_small); + LinphoneUtils.setImagePictureFromUri(view.getContext(),contactPicture,contact.getPhotoUri(),contact.getThumbnailUri()); view.findViewById(R.id.add_contact).setVisibility(View.GONE); } else { - //LinphoneUtils.setImagePictureFromUri(view.getContext(), contactPicture.getView(),null, null ,R.drawable.unknown_small); + contactPicture.setImageResource(R.drawable.avatar); } } catch (LinphoneCoreException e) { e.printStackTrace(); @@ -157,7 +157,7 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener { if (id == R.id.back) { getFragmentManager().popBackStackImmediate(); - } if (id == R.id.dialBack) { + } if (id == R.id.call) { LinphoneActivity.instance().setAddresGoToDialerAndCall(sipUri, displayName, pictureUri == null ? null : Uri.parse(pictureUri)); } else if (id == R.id.chat) { LinphoneActivity.instance().displayChat(sipUri); diff --git a/src/org/linphone/HistoryFragment.java b/src/org/linphone/HistoryFragment.java index 48a043d71..bc86a3bf2 100644 --- a/src/org/linphone/HistoryFragment.java +++ b/src/org/linphone/HistoryFragment.java @@ -27,7 +27,6 @@ import org.linphone.core.CallDirection; import org.linphone.core.LinphoneAddress; import org.linphone.core.LinphoneCallLog; import org.linphone.core.LinphoneCallLog.CallStatus; -import org.linphone.mediastream.Log; import android.annotation.SuppressLint; import android.app.Dialog; @@ -53,6 +52,7 @@ import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; @@ -66,7 +66,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem private TextView noCallHistory, noMissedCallHistory; private ImageView missedCalls, allCalls, edit, selectAll, deselectAll, deleteAll; private RelativeLayout allCallsSelected, missedCallsSelected; - private boolean onlyDisplayMissedCalls, isEditMode, isSelectAll, isDeselectAll; + private boolean onlyDisplayMissedCalls, isEditMode; private List mLogs; @Override @@ -110,10 +110,6 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem edit = (ImageView) view.findViewById(R.id.edit); edit.setOnClickListener(this); - isSelectAll = false; - isDeselectAll = false; - - return view; } @@ -190,42 +186,6 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem public void onClick(View v) { int id = v.getId(); - if (id == R.id.delete) { - final Dialog dialog = LinphoneActivity.instance().displayDialog(getString(R.string.delete_text)); - Button delete = (Button) dialog.findViewById(R.id.delete); - Button cancel = (Button) dialog.findViewById(R.id.cancel); - - isEditMode = false; - delete.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - int size = historyList.getAdapter().getCount(); - for(int i=0; i 0) { LinphoneCallLog previousLog = mLogs.get(position-1); @@ -463,11 +464,14 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem holder.callDirection.setImageResource(R.drawable.call_status_outgoing); } - Contact c = ContactsManager.getInstance().findContactWithAddress(address); + Contact c = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), address); String displayName = null; final String sipUri = address.asStringUriOnly(); if(c != null){ displayName = c.getName(); + LinphoneUtils.setImagePictureFromUri(view.getContext(),holder.contactPicture,c.getPhotoUri(),c.getThumbnailUri()); + } else { + holder.contactPicture.setImageResource(R.drawable.avatar); } if (displayName == null) { @@ -511,6 +515,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem } }); } + view.setTag(holder); return view; } } @@ -520,6 +525,6 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnItem ImageView detail; CheckBox delete; ImageView callDirection; - int position; + ImageView contactPicture; } } \ No newline at end of file