Java 类com.google.zxing.client.result.AddressBookParsedResult 实例源码

项目:keepass2android    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toIterable(contact.getNames()),
                                    contact.getOrg(),
                                    toIterable(contact.getAddresses()),
                                    toIterable(contact.getPhoneNumbers()),
                                    toIterable(contact.getEmails()),
                                    toIterable(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
项目:keepass2android    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
  super(activity, result);
  AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
  String[] addresses = addressResult.getAddresses();
  boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
  String[] phoneNumbers = addressResult.getPhoneNumbers();
  boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
  String[] emails = addressResult.getEmails();
  boolean hasEmailAddress = emails != null && emails.length > 0;

  fields = new boolean[MAX_BUTTON_COUNT];
  fields[0] = true; // Add contact is always available
  fields[1] = hasAddress;
  fields[2] = hasPhoneNumber;
  fields[3] = hasEmailAddress;

  buttonCount = 0;
  for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
    if (fields[x]) {
      buttonCount++;
    }
  }
}
项目:weex-3d-map    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toList(contact.getNames()),
                                    contact.getOrg(),
                                    toList(contact.getAddresses()),
                                    toList(contact.getPhoneNumbers()),
                                    null,
                                    toList(contact.getEmails()),
                                    toList(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
项目:weex-3d-map    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
  super(activity, result);
  AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
  String[] addresses = addressResult.getAddresses();
  boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
  String[] phoneNumbers = addressResult.getPhoneNumbers();
  boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
  String[] emails = addressResult.getEmails();
  boolean hasEmailAddress = emails != null && emails.length > 0;

  fields = new boolean[MAX_BUTTON_COUNT];
  fields[0] = true; // Add contact is always available
  fields[1] = hasAddress;
  fields[2] = hasPhoneNumber;
  fields[3] = hasEmailAddress;

  buttonCount = 0;
  for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
    if (fields[x]) {
      buttonCount++;
    }
  }
}
项目:ZXingAndroidExt    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
    ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
    String[] encoded = encoder.encode(toList(contact.getNames()),
            contact.getOrg(),
            toList(contact.getAddresses()),
            toList(contact.getPhoneNumbers()),
            null,
            toList(contact.getEmails()),
            toList(contact.getURLs()),
            null);
    // Make sure we've encoded at least one field.
    if (!encoded[1].isEmpty()) {
        contents = encoded[0];
        displayContents = encoded[1];
        title = activity.getString(R.string.contents_contact);
    }
}
项目:ZXingAndroidExt    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
    super(activity, result);
    AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
    String[] addresses = addressResult.getAddresses();
    String[] phoneNumbers = addressResult.getPhoneNumbers();
    String[] emails = addressResult.getEmails();

    fields = new boolean[MAX_BUTTON_COUNT];
    fields[0] = true; // Add contact is always available
    fields[1] = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
    fields[2] = phoneNumbers != null && phoneNumbers.length > 0;
    fields[3] = emails != null && emails.length > 0;

    buttonCount = 0;
    for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
        if (fields[x]) {
            buttonCount++;
        }
    }
}
项目:tvConnect_android    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
    super(activity, result);
    AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
    String[] addresses = addressResult.getAddresses();
    boolean hasAddress = addresses != null && addresses.length > 0
            && addresses[0] != null && !addresses[0].isEmpty();
    String[] phoneNumbers = addressResult.getPhoneNumbers();
    boolean hasPhoneNumber = phoneNumbers != null
            && phoneNumbers.length > 0;
    String[] emails = addressResult.getEmails();
    boolean hasEmailAddress = emails != null && emails.length > 0;

    fields = new boolean[MAX_BUTTON_COUNT];
    fields[0] = true; // Add contact is always available
    fields[1] = hasAddress;
    fields[2] = hasPhoneNumber;
    fields[3] = hasEmailAddress;

    buttonCount = 0;
    for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
        if (fields[x]) {
            buttonCount++;
        }
    }
}
项目:tvConnect_android    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
    super(activity, result);
    AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
    String[] addresses = addressResult.getAddresses();
    boolean hasAddress = addresses != null && addresses.length > 0
            && addresses[0] != null && !addresses[0].isEmpty();
    String[] phoneNumbers = addressResult.getPhoneNumbers();
    boolean hasPhoneNumber = phoneNumbers != null
            && phoneNumbers.length > 0;
    String[] emails = addressResult.getEmails();
    boolean hasEmailAddress = emails != null && emails.length > 0;

    fields = new boolean[MAX_BUTTON_COUNT];
    fields[0] = true; // Add contact is always available
    fields[1] = hasAddress;
    fields[2] = hasPhoneNumber;
    fields[3] = hasEmailAddress;

    buttonCount = 0;
    for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
        if (fields[x]) {
            buttonCount++;
        }
    }
}
项目:KeePass2Android    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toIterable(contact.getNames()),
                                    contact.getOrg(),
                                    toIterable(contact.getAddresses()),
                                    toIterable(contact.getPhoneNumbers()),
                                    toIterable(contact.getEmails()),
                                    toIterable(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
项目:KeePass2Android    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
  super(activity, result);
  AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
  String[] addresses = addressResult.getAddresses();
  boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
  String[] phoneNumbers = addressResult.getPhoneNumbers();
  boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
  String[] emails = addressResult.getEmails();
  boolean hasEmailAddress = emails != null && emails.length > 0;

  fields = new boolean[MAX_BUTTON_COUNT];
  fields[0] = true; // Add contact is always available
  fields[1] = hasAddress;
  fields[2] = hasPhoneNumber;
  fields[3] = hasEmailAddress;

  buttonCount = 0;
  for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
    if (fields[x]) {
      buttonCount++;
    }
  }
}
项目:PortraitZXing    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
    super(activity, result);
    AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
    String[] addresses = addressResult.getAddresses();
    boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null
            && !addresses[0].isEmpty();
    String[] phoneNumbers = addressResult.getPhoneNumbers();
    boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
    String[] emails = addressResult.getEmails();
    boolean hasEmailAddress = emails != null && emails.length > 0;

    fields = new boolean[MAX_BUTTON_COUNT];
    fields[0] = true; // Add contact is always available
    fields[1] = hasAddress;
    fields[2] = hasPhoneNumber;
    fields[3] = hasEmailAddress;

    buttonCount = 0;
    for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
        if (fields[x]) {
            buttonCount++;
        }
    }
}
项目:PortraitZXing    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
    super(activity, result);
    AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
    String[] addresses = addressResult.getAddresses();
    boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null
            && !addresses[0].isEmpty();
    String[] phoneNumbers = addressResult.getPhoneNumbers();
    boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
    String[] emails = addressResult.getEmails();
    boolean hasEmailAddress = emails != null && emails.length > 0;

    fields = new boolean[MAX_BUTTON_COUNT];
    fields[0] = true; // Add contact is always available
    fields[1] = hasAddress;
    fields[2] = hasPhoneNumber;
    fields[3] = hasEmailAddress;

    buttonCount = 0;
    for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
        if (fields[x]) {
            buttonCount++;
        }
    }
}
项目:PortraitZXing    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
    super(activity, result);
    AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
    String[] addresses = addressResult.getAddresses();
    boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null
            && !addresses[0].isEmpty();
    String[] phoneNumbers = addressResult.getPhoneNumbers();
    boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
    String[] emails = addressResult.getEmails();
    boolean hasEmailAddress = emails != null && emails.length > 0;

    fields = new boolean[MAX_BUTTON_COUNT];
    fields[0] = true; // Add contact is always available
    fields[1] = hasAddress;
    fields[2] = hasPhoneNumber;
    fields[3] = hasEmailAddress;

    buttonCount = 0;
    for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
        if (fields[x]) {
            buttonCount++;
        }
    }
}
项目:PortraitZXing    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
    super(activity, result);
    AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
    String[] addresses = addressResult.getAddresses();
    boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null
            && !addresses[0].isEmpty();
    String[] phoneNumbers = addressResult.getPhoneNumbers();
    boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
    String[] emails = addressResult.getEmails();
    boolean hasEmailAddress = emails != null && emails.length > 0;

    fields = new boolean[MAX_BUTTON_COUNT];
    fields[0] = true; // Add contact is always available
    fields[1] = hasAddress;
    fields[2] = hasPhoneNumber;
    fields[3] = hasEmailAddress;

    buttonCount = 0;
    for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
        if (fields[x]) {
            buttonCount++;
        }
    }
}
项目:ZXing-Orient    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toList(contact.getNames()),
                                    contact.getOrg(),
                                    toList(contact.getAddresses()),
                                    toList(contact.getPhoneNumbers()),
                                    null,
                                    toList(contact.getEmails()),
                                    toList(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
项目:QRCodeUtility    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
    super(activity, result);
    AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
    String[] addresses = addressResult.getAddresses();
    String[] phoneNumbers = addressResult.getPhoneNumbers();
    String[] emails = addressResult.getEmails();

    fields = new boolean[MAX_BUTTON_COUNT];
    fields[0] = true; // Add contact is always available
    fields[1] = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
    fields[2] = phoneNumbers != null && phoneNumbers.length > 0;
    fields[3] = emails != null && emails.length > 0;

    buttonCount = 0;
    for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
        if (fields[x]) {
            buttonCount++;
        }
    }
}
项目:weex-analyzer-android    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toList(contact.getNames()),
                                    contact.getOrg(),
                                    toList(contact.getAddresses()),
                                    toList(contact.getPhoneNumbers()),
                                    null,
                                    toList(contact.getEmails()),
                                    toList(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
项目:weex-analyzer-android    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
  super(activity, result);
  AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
  String[] addresses = addressResult.getAddresses();
  boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
  String[] phoneNumbers = addressResult.getPhoneNumbers();
  boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
  String[] emails = addressResult.getEmails();
  boolean hasEmailAddress = emails != null && emails.length > 0;

  fields = new boolean[MAX_BUTTON_COUNT];
  fields[0] = true; // Add contact is always available
  fields[1] = hasAddress;
  fields[2] = hasPhoneNumber;
  fields[3] = hasEmailAddress;

  buttonCount = 0;
  for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
    if (fields[x]) {
      buttonCount++;
    }
  }
}
项目:weex-3d-map    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toList(contact.getNames()),
                                    contact.getOrg(),
                                    toList(contact.getAddresses()),
                                    toList(contact.getPhoneNumbers()),
                                    null,
                                    toList(contact.getEmails()),
                                    toList(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
项目:weex-3d-map    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
  super(activity, result);
  AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
  String[] addresses = addressResult.getAddresses();
  boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
  String[] phoneNumbers = addressResult.getPhoneNumbers();
  boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
  String[] emails = addressResult.getEmails();
  boolean hasEmailAddress = emails != null && emails.length > 0;

  fields = new boolean[MAX_BUTTON_COUNT];
  fields[0] = true; // Add contact is always available
  fields[1] = hasAddress;
  fields[2] = hasPhoneNumber;
  fields[3] = hasEmailAddress;

  buttonCount = 0;
  for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
    if (fields[x]) {
      buttonCount++;
    }
  }
}
项目:Weex-TestDemo    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toList(contact.getNames()),
                                    contact.getOrg(),
                                    toList(contact.getAddresses()),
                                    toList(contact.getPhoneNumbers()),
                                    null,
                                    toList(contact.getEmails()),
                                    toList(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
项目:Weex-TestDemo    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
  super(activity, result);
  AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
  String[] addresses = addressResult.getAddresses();
  boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
  String[] phoneNumbers = addressResult.getPhoneNumbers();
  boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
  String[] emails = addressResult.getEmails();
  boolean hasEmailAddress = emails != null && emails.length > 0;

  fields = new boolean[MAX_BUTTON_COUNT];
  fields[0] = true; // Add contact is always available
  fields[1] = hasAddress;
  fields[2] = hasPhoneNumber;
  fields[3] = hasEmailAddress;

  buttonCount = 0;
  for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
    if (fields[x]) {
      buttonCount++;
    }
  }
}
项目:weex    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toList(contact.getNames()),
                                    contact.getOrg(),
                                    toList(contact.getAddresses()),
                                    toList(contact.getPhoneNumbers()),
                                    null,
                                    toList(contact.getEmails()),
                                    toList(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
项目:weex    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
  super(activity, result);
  AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
  String[] addresses = addressResult.getAddresses();
  boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
  String[] phoneNumbers = addressResult.getPhoneNumbers();
  boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
  String[] emails = addressResult.getEmails();
  boolean hasEmailAddress = emails != null && emails.length > 0;

  fields = new boolean[MAX_BUTTON_COUNT];
  fields[0] = true; // Add contact is always available
  fields[1] = hasAddress;
  fields[2] = hasPhoneNumber;
  fields[3] = hasEmailAddress;

  buttonCount = 0;
  for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
    if (fields[x]) {
      buttonCount++;
    }
  }
}
项目:sres-app    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toIterable(contact.getNames()),
                                    contact.getOrg(),
                                    toIterable(contact.getAddresses()),
                                    toIterable(contact.getPhoneNumbers()),
                                    toIterable(contact.getEmails()),
                                    contact.getURL(),
                                    null);
  // Make sure we've encoded at least one field.
  if (encoded[1].length() > 0) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(fakeR.getId("string", "contents_contact"));
  }
}
项目:faims-android    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toIterable(contact.getNames()),
                                    contact.getOrg(),
                                    toIterable(contact.getAddresses()),
                                    toIterable(contact.getPhoneNumbers()),
                                    toIterable(contact.getEmails()),
                                    toIterable(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
项目:faims-android    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
  super(activity, result);
  AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
  String[] addresses = addressResult.getAddresses();
  boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty();
  String[] phoneNumbers = addressResult.getPhoneNumbers();
  boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
  String[] emails = addressResult.getEmails();
  boolean hasEmailAddress = emails != null && emails.length > 0;

  fields = new boolean[MAX_BUTTON_COUNT];
  fields[0] = true; // Add contact is always available
  fields[1] = hasAddress;
  fields[2] = hasPhoneNumber;
  fields[3] = hasEmailAddress;

  buttonCount = 0;
  for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
    if (fields[x]) {
      buttonCount++;
    }
  }
}
项目:Discounty    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
    ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
    String[] encoded = encoder.encode(toIterable(contact.getNames()),
            contact.getOrg(),
            toIterable(contact.getAddresses()),
            toIterable(contact.getPhoneNumbers()),
            toIterable(contact.getEmails()),
            toIterable(contact.getURLs()),
            null);
    // Make sure we've encoded at least one field.
    if (encoded[1].length() > 0) {
        contents = encoded[0];
        displayContents = encoded[1];
        title = activity.getString(R.string.contents_contact);
    }
}
项目:Discounty    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
    super(activity, result);
    AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
    String[] addresses = addressResult.getAddresses();
    boolean hasAddress = addresses != null && addresses.length > 0 && addresses[0] != null && addresses[0].length() > 0;
    String[] phoneNumbers = addressResult.getPhoneNumbers();
    boolean hasPhoneNumber = phoneNumbers != null && phoneNumbers.length > 0;
    String[] emails = addressResult.getEmails();
    boolean hasEmailAddress = emails != null && emails.length > 0;

    fields = new boolean[MAX_BUTTON_COUNT];
    fields[0] = true; // Add contact is always available
    fields[1] = hasAddress;
    fields[2] = hasPhoneNumber;
    fields[3] = hasEmailAddress;

    buttonCount = 0;
    for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
        if (fields[x]) {
            buttonCount++;
        }
    }
}
项目:bushido-android-app    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toList(contact.getNames()),
                                    contact.getOrg(),
                                    toList(contact.getAddresses()),
                                    toList(contact.getPhoneNumbers()),
                                    null,
                                    toList(contact.getEmails()),
                                    toList(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
项目:reacteu-app    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toIterable(contact.getNames()),
                                    contact.getOrg(),
                                    toIterable(contact.getAddresses()),
                                    toIterable(contact.getPhoneNumbers()),
                                    toIterable(contact.getEmails()),
                                    contact.getURL(),
                                    null);
  // Make sure we've encoded at least one field.
  if (encoded[1].length() > 0) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(fakeR.getId("string", "contents_contact"));
  }
}
项目:CordovaDemo    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toIterable(contact.getNames()),
                                    contact.getOrg(),
                                    toIterable(contact.getAddresses()),
                                    toIterable(contact.getPhoneNumbers()),
                                    toIterable(contact.getEmails()),
                                    contact.getURL(),
                                    null);
  // Make sure we've encoded at least one field.
  if (encoded[1].length() > 0) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(fakeR.getId("string", "contents_contact"));
  }
}
项目:AIRShare    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
    ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
    String[] encoded = encoder.encode(toIterable(contact.getNames()),
            contact.getOrg(),
            toIterable(contact.getAddresses()),
            toIterable(contact.getPhoneNumbers()),
            toIterable(contact.getEmails()),
            toIterable(contact.getURLs()),
            null);
    // Make sure we've encoded at least one field.
    if (!encoded[1].isEmpty()) {
        contents = encoded[0];
        displayContents = encoded[1];
        title = activity.getString(R.string.contents_contact);
    }
}
项目:AIRShare    文件:ContactsUtils.java   
public static AddressBookParsedResult getContactDetailsFromUri(
        Context context, Uri contactUri) {
    try {
        byte[] vcard;
        String vcardString;
        InputStream stream;
        stream = context.getContentResolver().openInputStream(contactUri);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        byte[] buffer = new byte[2048];
        int bytesRead;
        while ((bytesRead = stream.read(buffer)) > 0) {
            baos.write(buffer, 0, bytesRead);
        }
        vcard = baos.toByteArray();
        vcardString = new String(vcard, 0, vcard.length, "UTF-8");
        Result result = new Result(vcardString, vcard, null,
                BarcodeFormat.QR_CODE);
        ParsedResult parsedResult = ResultParser.parseResult(result);
        return (AddressBookParsedResult) parsedResult;
    } catch (Exception e) {
        return null;
    }
}
项目:ng-cordova-demo    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toIterable(contact.getNames()),
                                    contact.getOrg(),
                                    toIterable(contact.getAddresses()),
                                    toIterable(contact.getPhoneNumbers()),
                                    toIterable(contact.getEmails()),
                                    contact.getURL(),
                                    null);
  // Make sure we've encoded at least one field.
  if (encoded[1].length() > 0) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(fakeR.getId("string", "contents_contact"));
  }
}
项目:zxing-bsplus    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toList(contact.getNames()),
                                    contact.getOrg(),
                                    toList(contact.getAddresses()),
                                    toList(contact.getPhoneNumbers()),
                                    null,
                                    toList(contact.getEmails()),
                                    toList(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}
项目:zxing-bsplus    文件:AddressBookResultHandler.java   
public AddressBookResultHandler(Activity activity, ParsedResult result) {
  super(activity, result);
  AddressBookParsedResult addressResult = (AddressBookParsedResult) result;
  String[] addresses = addressResult.getAddresses();
  String[] phoneNumbers = addressResult.getPhoneNumbers();
  String[] emails = addressResult.getEmails();

  buttonIDsToShow = new HashSet<>();
  buttonIDsToShow.add(R.id.button_add_contact);
  if (addresses != null && addresses.length > 0 && addresses[0] != null && !addresses[0].isEmpty()) {
    buttonIDsToShow.add(R.id.button_show_map);
  }
  if (phoneNumbers != null && phoneNumbers.length > 0) {
    buttonIDsToShow.add(R.id.button_dial);
  }
  if (emails != null && emails.length > 0) {
    buttonIDsToShow.add(R.id.button_email);
  }
}
项目:ngCordova-demo    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toIterable(contact.getNames()),
                                    contact.getOrg(),
                                    toIterable(contact.getAddresses()),
                                    toIterable(contact.getPhoneNumbers()),
                                    toIterable(contact.getEmails()),
                                    contact.getURL(),
                                    null);
  // Make sure we've encoded at least one field.
  if (encoded[1].length() > 0) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(fakeR.getId("string", "contents_contact"));
  }
}
项目:CordovaW8BarcodeDemo    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toIterable(contact.getNames()),
                                    contact.getOrg(),
                                    toIterable(contact.getAddresses()),
                                    toIterable(contact.getPhoneNumbers()),
                                    toIterable(contact.getEmails()),
                                    contact.getURL(),
                                    null);
  // Make sure we've encoded at least one field.
  if (encoded[1].length() > 0) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(fakeR.getId("string", "contents_contact"));
  }
}
项目:zxing-android-portrait    文件:QRCodeEncoder.java   
private void encodeQRCodeContents(AddressBookParsedResult contact) {
  ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
  String[] encoded = encoder.encode(toList(contact.getNames()),
                                    contact.getOrg(),
                                    toList(contact.getAddresses()),
                                    toList(contact.getPhoneNumbers()),
                                    null,
                                    toList(contact.getEmails()),
                                    toList(contact.getURLs()),
                                    null);
  // Make sure we've encoded at least one field.
  if (!encoded[1].isEmpty()) {
    contents = encoded[0];
    displayContents = encoded[1];
    title = activity.getString(R.string.contents_contact);
  }
}