diff --git a/res/animator/slidein_up.xml b/res/animator/slidein_up.xml index 220ba5327b165868ce7b9ecec6574414d68853bd..b61cd72d1e2963ab46c660a7ed449c2ec5a4367e 100644 --- a/res/animator/slidein_up.xml +++ b/res/animator/slidein_up.xml @@ -4,5 +4,5 @@ android:propertyName="y" android:valueFrom="2000" android:valueTo="0" - android:interpolator="@android:anim/overshoot_interpolator" + android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:valueType="floatType" /> \ No newline at end of file diff --git a/res/animator/slideout_down.xml b/res/animator/slideout_down.xml index 0d957fb69acf27c76f4d7191b700d15619485461..be50687fd41d97b589bef3c2334620929893a265 100644 --- a/res/animator/slideout_down.xml +++ b/res/animator/slideout_down.xml @@ -4,5 +4,5 @@ android:propertyName="y" android:valueFrom="0" android:valueTo="2000" - android:interpolator="@android:anim/overshoot_interpolator" + android:interpolator="@android:anim/accelerate_interpolator" android:valueType="floatType" /> \ No newline at end of file diff --git a/src/org/sflphone/loaders/HistoryLoader.java b/src/org/sflphone/loaders/HistoryLoader.java index c454cc81d348d0e2fbae3aa32ca27b1ae3d975a1..b1654a0b7754d96456783b75465e43417d54a556 100644 --- a/src/org/sflphone/loaders/HistoryLoader.java +++ b/src/org/sflphone/loaders/HistoryLoader.java @@ -57,7 +57,7 @@ public class HistoryLoader extends AsyncTaskLoader<ArrayList<HistoryEntry>> { if (historyEntries.containsKey(number_called)) { // It's a direct match - historyEntries.get(number_called).addHistoryCall(new HistoryCall(entry)); + historyEntries.get(number_called).addHistoryCall(new HistoryCall(entry), contact); } else { // Maybe we can extract the extension @ account pattern Pattern p = Pattern.compile("<sip:([^@]+)@([^>]+)>"); @@ -65,17 +65,17 @@ public class HistoryLoader extends AsyncTaskLoader<ArrayList<HistoryEntry>> { if (m.find()) { if (historyEntries.containsKey(m.group(1) + "@" + m.group(2))) { - historyEntries.get(m.group(1) + "@" + m.group(2)).addHistoryCall(new HistoryCall(entry)); + historyEntries.get(m.group(1) + "@" + m.group(2)).addHistoryCall(new HistoryCall(entry), contact); } else { HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), contact); - e.addHistoryCall(new HistoryCall(entry)); + e.addHistoryCall(new HistoryCall(entry), contact); historyEntries.put(m.group(1) + "@" + m.group(2), e); } } else { HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), contact); - e.addHistoryCall(new HistoryCall(entry)); + e.addHistoryCall(new HistoryCall(entry), contact); historyEntries.put(number_called, e); } diff --git a/src/org/sflphone/model/CallContact.java b/src/org/sflphone/model/CallContact.java index fd703952fa267c8d3a8e22cbda2eb9760a271252..74632191320fbb60e04d6637860dcd96ce146b7b 100644 --- a/src/org/sflphone/model/CallContact.java +++ b/src/org/sflphone/model/CallContact.java @@ -323,4 +323,12 @@ public class CallContact implements Parcelable { contact_photo = new WeakReference<Bitmap>(externalBMP); } + /** + * A contact is Unknown when his name == his phone number + * @return true when Name == Number + */ + public boolean isUnknown() { + return mDisplayName.contentEquals(phones.get(0).getNumber()); + } + } diff --git a/src/org/sflphone/model/HistoryEntry.java b/src/org/sflphone/model/HistoryEntry.java index 278277b65cf3741b734af9f0b99ce284dcc24457..141690e5e443ca476fd0e6c98987fd88e50346d5 100644 --- a/src/org/sflphone/model/HistoryEntry.java +++ b/src/org/sflphone/model/HistoryEntry.java @@ -83,7 +83,14 @@ public class HistoryEntry implements Parcelable { this.contact = contact; } - public void addHistoryCall(HistoryCall historyCall) { + /** + * Each call is associated with a contact. + * When adding a call to an HIstoryEntry, this methods also verifies if we can update + * the contact (if contact is Unknown, replace it) + * @param historyCall The call to put in this HistoryEntry + * @param linkedTo The associated CallContact + */ + public void addHistoryCall(HistoryCall historyCall, CallContact linkedTo) { calls.put(historyCall.call_start, historyCall); if (historyCall.isIncoming()) { ++incoming_sum; @@ -92,6 +99,9 @@ public class HistoryEntry implements Parcelable { } if (historyCall.isMissed()) missed_sum++; + + if(contact.isUnknown() && !linkedTo.isUnknown()) + setContact(linkedTo); } public String getNumber() {