diff --git a/res/layout/frag_contact_list.xml b/res/layout/frag_contact_list.xml index fbcbded6641a915716c1879aabf1601aaa1b0f20..5c7ca1c5d83ba5a3ac4172c8c51f462c27672aa9 100644 --- a/res/layout/frag_contact_list.xml +++ b/res/layout/frag_contact_list.xml @@ -32,6 +32,7 @@ as that of the covered work. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:swipe="http://schemas.android.com/apk/res-auto" android:id="@+id/drag_view" android:layout_width="match_parent" android:layout_height="match_parent" @@ -101,4 +102,5 @@ as that of the covered work. android:textColor="@color/white" android:textSize="30sp" /> + </LinearLayout> \ No newline at end of file diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml index a383f01b08cf28866fccf034113fe9075f0faa07..3b1bc11b76398fdd63eed9da31f4f42bd262e0c7 100644 --- a/res/values-sw600dp/dimens.xml +++ b/res/values-sw600dp/dimens.xml @@ -40,6 +40,5 @@ as that of the covered work. <dimen name="bubble_size">100dp</dimen> - <dimen name="header_history_detail">400dp</dimen> </resources> \ No newline at end of file diff --git a/src/org/sflphone/client/HomeActivity.java b/src/org/sflphone/client/HomeActivity.java index 4fc6e9c72f743b335c59dcc6a88ccdfb00cb5a54..f03f80b232954ee255f4775bd32ace1407b37540 100644 --- a/src/org/sflphone/client/HomeActivity.java +++ b/src/org/sflphone/client/HomeActivity.java @@ -86,6 +86,7 @@ import android.util.Log; import android.view.Gravity; import android.view.MenuItem; import android.view.View; +import android.view.WindowManager; import android.widget.RelativeLayout; import android.widget.Toast; @@ -636,6 +637,14 @@ public class HomeActivity extends Activity implements DialingFragment.Callbacks, mContactDrawer.collapsePane(); } + @Override + public void toggleForSearchDrawer() { + if (mContactDrawer.isExpanded()) { + mContactDrawer.collapsePane(); + } else + mContactDrawer.expandPane(); + } + @Override public void confCreated(Intent intent) { // TODO Auto-generated method stub diff --git a/src/org/sflphone/fragments/ContactListFragment.java b/src/org/sflphone/fragments/ContactListFragment.java index f6f57a4a3867f03ea34304933a1e844c4e3811a2..5cb5838548ea11e1d42dcde7501f14014fa719da 100644 --- a/src/org/sflphone/fragments/ContactListFragment.java +++ b/src/org/sflphone/fragments/ContactListFragment.java @@ -127,6 +127,10 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener public void setDragView(RelativeLayout relativeLayout) { } + + @Override + public void toggleForSearchDrawer() { + } }; public interface Callbacks { @@ -144,6 +148,8 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener void setDragView(RelativeLayout relativeLayout); + void toggleForSearchDrawer(); + } @Override @@ -185,7 +191,7 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener mQuickReturnSearchView.setOnQueryTextListener(ContactListFragment.this); mQuickReturnSearchView.setIconified(false); mQuickReturnSearchView.setFocusable(true); - mCallbacks.toggleDrawer(); + mCallbacks.toggleForSearchDrawer(); } }); @@ -274,7 +280,7 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener @Override public void onItemClick(AdapterView<?> arg0, View view, int pos, long id) { - + Log.i(TAG, "Opening Item"); mSwipeLvTouchListener.openItem(view, pos, id); } }); diff --git a/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java b/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java index e697b7ed49744a0a8b0cfff4bbf3a268364bc374..4affba39db57436c6a36c4ee34af4acbd9992007 100644 --- a/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java +++ b/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java @@ -66,7 +66,6 @@ public class DetailsHistoryEntryFragment extends Fragment { View mheaderView; DetailHistoryAdapter mAdapter; HistoryEntry toDisplay; - @SuppressWarnings("unused") private static final String TAG = DetailsHistoryEntryFragment.class.getSimpleName(); ContactPictureTask tasker; @@ -120,6 +119,11 @@ public class DetailsHistoryEntryFragment extends Fragment { super.onCreate(savedInstanceState); toDisplay = (HistoryEntry) getArguments().get("entry"); + + Log.i(TAG, "Ok, we got " + toDisplay.getIncoming_sum() + " incoming calls"); + Log.i(TAG, "Ok, we got " + toDisplay.getMissed_sum() + " missed calls"); + Log.i(TAG, "Ok, we got " + toDisplay.getOutgoing_sum() + " outgoing calls"); + mAdapter = new DetailHistoryAdapter(toDisplay.getCalls(), getActivity()); } diff --git a/src/org/sflphone/fragments/HistoryFragment.java b/src/org/sflphone/fragments/HistoryFragment.java index 94bc3b9f56dda1fa52bb8d062801a23ff294505a..f6020203320cd08e84f5ed6225505ee385cd154d 100644 --- a/src/org/sflphone/fragments/HistoryFragment.java +++ b/src/org/sflphone/fragments/HistoryFragment.java @@ -220,7 +220,6 @@ public class HistoryFragment extends ListFragment implements LoaderCallbacks<Arr // SipCall call = (SipCall) mCallList.values().toArray()[position]; entryView.displayName.setText(dataset.get(pos).getContact().getmDisplayName()); - infos_fetcher.execute(new ContactPictureTask(mContext, entryView.photo, dataset.get(pos).getContact())); entryView.incoming.setText(getString(R.string.hist_in_calls, dataset.get(pos).getIncoming_sum())); diff --git a/src/org/sflphone/loaders/HistoryLoader.java b/src/org/sflphone/loaders/HistoryLoader.java index 94c01e51881c378c03af2b32602d02bdcbf3b9bb..c454cc81d348d0e2fbae3aa32ca27b1ae3d975a1 100644 --- a/src/org/sflphone/loaders/HistoryLoader.java +++ b/src/org/sflphone/loaders/HistoryLoader.java @@ -46,10 +46,15 @@ public class HistoryLoader extends AsyncTaskLoader<ArrayList<HistoryEntry>> { ArrayList<HashMap<String, String>> history = (ArrayList<HashMap<String, String>>) service.getHistory(); for (HashMap<String, String> entry : history) { + CallContact contact = null; + String contactName = entry.get(ServiceConstants.history.DISPLAY_NAME_KEY); String number_called = entry.get(ServiceConstants.history.PEER_NUMBER_KEY); + if (contactName.isEmpty()) { + contact = ContactBuilder.buildUnknownContact(number_called); + } else { + contact = ContactBuilder.getInstance().buildSimpleContact(contactName, number_called); + } -// Log.w(TAG, "----------------------Number" + number_called); - CallContact c = null; if (historyEntries.containsKey(number_called)) { // It's a direct match historyEntries.get(number_called).addHistoryCall(new HistoryCall(entry)); @@ -59,19 +64,17 @@ public class HistoryLoader extends AsyncTaskLoader<ArrayList<HistoryEntry>> { Matcher m = p.matcher(number_called); if (m.find()) { -// Log.i(TAG, "Pattern found:" + m.group(1)); if (historyEntries.containsKey(m.group(1) + "@" + m.group(2))) { historyEntries.get(m.group(1) + "@" + m.group(2)).addHistoryCall(new HistoryCall(entry)); } else { - c = ContactBuilder.buildUnknownContact(m.group(1) + "@" + m.group(2)); - HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), c); + HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), contact); e.addHistoryCall(new HistoryCall(entry)); historyEntries.put(m.group(1) + "@" + m.group(2), e); } } else { - c = ContactBuilder.buildUnknownContact(number_called); - HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), c); + + HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), contact); e.addHistoryCall(new HistoryCall(entry)); historyEntries.put(number_called, e); } diff --git a/src/org/sflphone/model/CallContact.java b/src/org/sflphone/model/CallContact.java index adb747480ea87e392aa8d5eb6e246923d2e8325d..fd703952fa267c8d3a8e22cbda2eb9760a271252 100644 --- a/src/org/sflphone/model/CallContact.java +++ b/src/org/sflphone/model/CallContact.java @@ -182,6 +182,13 @@ public class CallContact implements Parcelable { return result; } + public CallContact buildSimpleContact(String name, String number_called) { + ArrayList<Phone> phones = new ArrayList<Phone>(); + phones.add(new Phone(number_called, 0)); + + return new CallContact(-1, name, 0, phones, new ArrayList<CallContact.Phone>(), "", false); + } + } @Override diff --git a/src/org/sflphone/model/HistoryEntry.java b/src/org/sflphone/model/HistoryEntry.java index 578a0308ab043a41c644342538a093b968b1139c..278277b65cf3741b734af9f0b99ce284dcc24457 100644 --- a/src/org/sflphone/model/HistoryEntry.java +++ b/src/org/sflphone/model/HistoryEntry.java @@ -85,11 +85,13 @@ public class HistoryEntry implements Parcelable { public void addHistoryCall(HistoryCall historyCall) { calls.put(historyCall.call_start, historyCall); - if (historyCall.getDirection().contentEquals(ServiceConstants.history.OUTGOING_STRING)) { - ++outgoing_sum; - } else if (historyCall.isIncoming()) { + if (historyCall.isIncoming()) { ++incoming_sum; + } else { + ++outgoing_sum; } + if (historyCall.isMissed()) + missed_sum++; } public String getNumber() { @@ -134,7 +136,6 @@ public class HistoryEntry implements Parcelable { dest.writeList(new ArrayList<HistoryCall>(calls.values())); dest.writeList(new ArrayList<Long>(calls.keySet())); - dest.writeMap(calls); dest.writeString(accountID); dest.writeInt(missed_sum); dest.writeInt(outgoing_sum); @@ -242,7 +243,7 @@ public class HistoryEntry implements Parcelable { } public String getDisplayName() { - return displayName; + return displayName.substring(0, displayName.indexOf('@')); } @Override