public static void doImport(Context context, int resId, AccountWithDataSet account, int subscriptionId) { if (resId == R.string.import_from_sim) { doImportFromSim(context, account, subscriptionId); } else if (resId == R.string.import_from_vcf_file) { doImportFromVcfFile(context, account); } }
/** * Same as {@link #formatDate(Context context, String string, boolean longForm)}, with * longForm set to {@code true} by default. * * @param context Valid context * @param string String representation of a date to parse * @return Returns the same date in a cleaned up format. If the supplied string does not look * like a date, return it unchanged. */ public static String formatDate(Context context, String string) { return formatDate(context, string, true); }
@Override protected int getTypeLabelResource(Integer type) { return ContactDisplayUtils.getSmsLabelResourceId(type); } }
private void fromCursor(Cursor cursor) { mPresence = getInt(cursor, Data.PRESENCE, -1); mStatus = getString(cursor, Data.STATUS); mTimestamp = getLong(cursor, Data.STATUS_TIMESTAMP, -1); mResPackage = getString(cursor, Data.STATUS_RES_PACKAGE); mIconRes = getInt(cursor, Data.STATUS_ICON, -1); mLabelRes = getInt(cursor, Data.STATUS_LABEL, -1); }
public static boolean hasPermissions(Context context, final String... permissions) { for (final String permission : permissions) { if (!hasPermission(context, permission)) { return false; } } return true; }
/** * Delay-set {@link PhoneNumberFormattingTextWatcher} to a {@link TextView}. */ public static final void setPhoneNumberFormattingTextWatcher(Context context, TextView textView) { setPhoneNumberFormattingTextWatcher(context, textView, /* formatAfterWatcherSet =*/ false); }
private StopWatch(String label) { mLabel = label; lap(""); }
/** * Find TextView with the id "account_filter_header" and set correct text for the account * filter header. * * @param filterContainer View containing TextView with id "account_filter_header" * @return true when header text is set in the call. You may use this for conditionally * showing or hiding this entire view. */ public static boolean updateAccountFilterTitleForPeople(View filterContainer, ContactListFilter filter, boolean showTitleForAllAccounts) { return updateAccountFilterTitle(filterContainer, filter, showTitleForAllAccounts, false); }
public static Dialog getSelectAccountDialog(Context context, int resId, DialogInterface.OnClickListener onClickListener) { return getSelectAccountDialog(context, resId, onClickListener, null); }
@Override protected boolean isCustom(Integer type) { return ContactDisplayUtils.isCustomPhoneType(type); }
/** * Create a new instance and start it. */ public static StopWatch start(String label) { return new StopWatch(label); }
@Override protected int getTypeLabelResource(Integer type) { return ContactDisplayUtils.getPhoneLabelResourceId(type); } }
@Override public void onClick(View view) { AccountFilterUtil.startAccountFilterActivityForResult( PhoneNumberPickerFragment.this, REQUEST_CODE_ACCOUNT_FILTER, mFilter); } }
@Override public MaterialPalette createFromParcel(Parcel in) { return new MaterialPalette(in); }
public DataStatus(Cursor cursor) { // When creating from cursor row, fill normally fromCursor(cursor); }
public static boolean hasNecessaryRequiredPermissions(Context context) { return hasPermissions(context, sRequiredPermissions); }
public static boolean hasPhonePermissions(Context context) { return hasPermission(context, PHONE); }
/** * Similar to {@link #updateAccountFilterTitleForPeople(View, ContactListFilter, boolean, * boolean)}, but for Phone UI. */ public static boolean updateAccountFilterTitleForPhone(View filterContainer, ContactListFilter filter, boolean showTitleForAllAccounts) { return updateAccountFilterTitle( filterContainer, filter, showTitleForAllAccounts, true); }
public static Dialog getSelectAccountDialog(Context context, int resId) { return getSelectAccountDialog(context, resId, null, null); }
@Override protected boolean isCustom(Integer type) { return ContactDisplayUtils.isCustomPhoneType(type); }