Search in sources :

Example 1 with PhoneNumberMatch

use of com.android.i18n.phonenumbers.PhoneNumberMatch in project platform_frameworks_base by android.

the class LinkSpec method gatherTelLinks.

private static final void gatherTelLinks(ArrayList<LinkSpec> links, Spannable s) {
    PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
    Iterable<PhoneNumberMatch> matches = phoneUtil.findNumbers(s.toString(), Locale.getDefault().getCountry(), Leniency.POSSIBLE, Long.MAX_VALUE);
    for (PhoneNumberMatch match : matches) {
        LinkSpec spec = new LinkSpec();
        spec.url = "tel:" + PhoneNumberUtils.normalizeNumber(match.rawString());
        spec.start = match.start();
        spec.end = match.end();
        links.add(spec);
    }
}
Also used : PhoneNumberUtil(com.android.i18n.phonenumbers.PhoneNumberUtil) PhoneNumberMatch(com.android.i18n.phonenumbers.PhoneNumberMatch)

Example 2 with PhoneNumberMatch

use of com.android.i18n.phonenumbers.PhoneNumberMatch in project android_frameworks_base by ResurrectionRemix.

the class LinkSpec method gatherTelLinks.

private static final void gatherTelLinks(ArrayList<LinkSpec> links, Spannable s) {
    PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
    Iterable<PhoneNumberMatch> matches = phoneUtil.findNumbers(s.toString(), Locale.getDefault().getCountry(), Leniency.POSSIBLE, Long.MAX_VALUE);
    for (PhoneNumberMatch match : matches) {
        LinkSpec spec = new LinkSpec();
        spec.url = "tel:" + PhoneNumberUtils.normalizeNumber(match.rawString());
        spec.start = match.start();
        spec.end = match.end();
        links.add(spec);
    }
}
Also used : PhoneNumberUtil(com.android.i18n.phonenumbers.PhoneNumberUtil) PhoneNumberMatch(com.android.i18n.phonenumbers.PhoneNumberMatch)

Example 3 with PhoneNumberMatch

use of com.android.i18n.phonenumbers.PhoneNumberMatch in project android_frameworks_base by ParanoidAndroid.

the class LinkSpec method gatherTelLinks.

private static final void gatherTelLinks(ArrayList<LinkSpec> links, Spannable s) {
    PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
    Iterable<PhoneNumberMatch> matches = phoneUtil.findNumbers(s.toString(), Locale.getDefault().getCountry(), Leniency.POSSIBLE, Long.MAX_VALUE);
    for (PhoneNumberMatch match : matches) {
        LinkSpec spec = new LinkSpec();
        spec.url = "tel:" + PhoneNumberUtils.normalizeNumber(match.rawString());
        spec.start = match.start();
        spec.end = match.end();
        links.add(spec);
    }
}
Also used : PhoneNumberUtil(com.android.i18n.phonenumbers.PhoneNumberUtil) PhoneNumberMatch(com.android.i18n.phonenumbers.PhoneNumberMatch)

Example 4 with PhoneNumberMatch

use of com.android.i18n.phonenumbers.PhoneNumberMatch in project android_frameworks_base by AOSPA.

the class LinkSpec method gatherTelLinks.

private static final void gatherTelLinks(ArrayList<LinkSpec> links, Spannable s) {
    PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
    Iterable<PhoneNumberMatch> matches = phoneUtil.findNumbers(s.toString(), Locale.getDefault().getCountry(), Leniency.POSSIBLE, Long.MAX_VALUE);
    for (PhoneNumberMatch match : matches) {
        LinkSpec spec = new LinkSpec();
        spec.url = "tel:" + PhoneNumberUtils.normalizeNumber(match.rawString());
        spec.start = match.start();
        spec.end = match.end();
        links.add(spec);
    }
}
Also used : PhoneNumberUtil(com.android.i18n.phonenumbers.PhoneNumberUtil) PhoneNumberMatch(com.android.i18n.phonenumbers.PhoneNumberMatch)

Example 5 with PhoneNumberMatch

use of com.android.i18n.phonenumbers.PhoneNumberMatch in project android_frameworks_base by DirtyUnicorns.

the class LinkSpec method gatherTelLinks.

private static final void gatherTelLinks(ArrayList<LinkSpec> links, Spannable s) {
    PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
    Iterable<PhoneNumberMatch> matches = phoneUtil.findNumbers(s.toString(), Locale.getDefault().getCountry(), Leniency.POSSIBLE, Long.MAX_VALUE);
    for (PhoneNumberMatch match : matches) {
        LinkSpec spec = new LinkSpec();
        spec.url = "tel:" + PhoneNumberUtils.normalizeNumber(match.rawString());
        spec.start = match.start();
        spec.end = match.end();
        links.add(spec);
    }
}
Also used : PhoneNumberUtil(com.android.i18n.phonenumbers.PhoneNumberUtil) PhoneNumberMatch(com.android.i18n.phonenumbers.PhoneNumberMatch)

Aggregations

PhoneNumberMatch (com.android.i18n.phonenumbers.PhoneNumberMatch)6 PhoneNumberUtil (com.android.i18n.phonenumbers.PhoneNumberUtil)6