Enhanced simple history
This commit is contained in:
parent
6d5f201d07
commit
9d0855d2f5
2 changed files with 9 additions and 5 deletions
|
@ -132,7 +132,7 @@ public class HistorySimpleFragment extends Fragment implements OnClickListener,
|
||||||
|
|
||||||
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
||||||
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
|
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
|
||||||
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext()));
|
historyList.setAdapter(new CallHistoryAdapter(getActivity()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ public class HistorySimpleFragment extends Fragment implements OnClickListener,
|
||||||
LinphoneManager.getLc().removeCallLog(log);
|
LinphoneManager.getLc().removeCallLog(log);
|
||||||
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
||||||
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
|
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
|
||||||
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext()));
|
historyList.setAdapter(new CallHistoryAdapter(getActivity()));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -314,7 +314,6 @@ public class HistorySimpleFragment extends Fragment implements OnClickListener,
|
||||||
ImageView delete = (ImageView) view.findViewById(R.id.delete);
|
ImageView delete = (ImageView) view.findViewById(R.id.delete);
|
||||||
ImageView callDirection = (ImageView) view.findViewById(R.id.icon);
|
ImageView callDirection = (ImageView) view.findViewById(R.id.icon);
|
||||||
|
|
||||||
|
|
||||||
if (log.getDirection() == CallDirection.Incoming) {
|
if (log.getDirection() == CallDirection.Incoming) {
|
||||||
address = log.getFrom();
|
address = log.getFrom();
|
||||||
if (log.getStatus() == CallStatus.Missed) {
|
if (log.getStatus() == CallStatus.Missed) {
|
||||||
|
|
|
@ -29,6 +29,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.linphone.core.LinphoneAddress;
|
import org.linphone.core.LinphoneAddress;
|
||||||
import org.linphone.core.LinphoneCall;
|
import org.linphone.core.LinphoneCall;
|
||||||
|
@ -63,13 +64,17 @@ public final class LinphoneUtils {
|
||||||
private LinphoneUtils(){}
|
private LinphoneUtils(){}
|
||||||
|
|
||||||
private static boolean preventVolumeBarToDisplay = false;
|
private static boolean preventVolumeBarToDisplay = false;
|
||||||
|
private static final String sipAddressRegExp = "^(sip:)?(\\+)?[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\\.-][a-z0-9]+)*)+\\.[a-z]{2,}(:[0-9]{2,5})?$";
|
||||||
|
private static final String strictSipAddressRegExp = "^sip:(\\+)?[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\\.-][a-z0-9]+)*)+\\.[a-z]{2,}$";
|
||||||
|
|
||||||
public static boolean isSipAddress(String numberOrAddress) {
|
public static boolean isSipAddress(String numberOrAddress) {
|
||||||
return numberOrAddress != null && numberOrAddress.matches("^(sip:)?(\\+)?[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\\.-][a-z0-9]+)*)+\\.[a-z]{2,}$");
|
Pattern p = Pattern.compile(sipAddressRegExp);
|
||||||
|
return p.matcher(numberOrAddress).matches();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isStrictSipAddress(String numberOrAddress) {
|
public static boolean isStrictSipAddress(String numberOrAddress) {
|
||||||
return numberOrAddress != null && numberOrAddress.matches("^sip:(\\+)?[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\\.-][a-z0-9]+)*)+\\.[a-z]{2,}$");
|
Pattern p = Pattern.compile(strictSipAddressRegExp);
|
||||||
|
return p.matcher(numberOrAddress).matches();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getUsernameFromAddress(String address) {
|
public static String getUsernameFromAddress(String address) {
|
||||||
|
|
Loading…
Reference in a new issue