.intValue(); return diffDays == 1 ? mTimestampLabelYesterday : AptoideUtils.StringU.getFormattedString(R.string.WidgetProvider_timestamp_days_ago, resources, diffDays); } else if (diffTime < DateUtils.WEEK_IN_MILLIS * 4) { .intValue(); return diffDays == 1 ? mTimestampLabelWeekAgo : AptoideUtils.StringU.getFormattedString(R.string.WidgetProvider_timestamp_weeks_ago, resources, diffDays); } else if (diffTime < DateUtils.WEEK_IN_MILLIS * 4 * 12) { int diffDays = Double.valueOf(Math.ceil(diffTime / (WEEK_IN_MILLIS * 4))) .intValue(); return diffDays == 1 ? mTimestampLabelMonthAgo : AptoideUtils.StringU.getFormattedString( R.string.WidgetProvider_timestamp_months_ago, resources, diffDays); } else { .intValue(); return diffDays == 1 ? mTimestampLabelYearAgo : AptoideUtils.StringU.getFormattedString(R.string.WidgetProvider_timestamp_years_ago, resources, diffDays);
public static String getString(@StringRes int stringRes, Resources resources) { return StringU.getResString(stringRes, resources); } }
/** * <p>Joins the elements of the provided {@code Iterable} into a single String containing the * provided elements.</p> <p> <p>No delimiter is added * before * or after the list. A {@code null} separator is the same as an empty String ("").</p> * * @param iterable the {@code Iterable} providing the values to join together, may be null * @param separator the separator character to use, null treated as "" * * @return the joined String, {@code null} if null iterator input * * @since 2.3 */ public static String join(final Iterable<?> iterable, final String separator) { if (iterable == null) { return null; } return join(iterable.iterator(), separator); }
if (!iterator.hasNext()) { @SuppressWarnings("deprecation") // ObjectUtils.toString(Object) has been deprecated in 3.2 final String result = toString(first); return result;
return hours == 1 ? AptoideUtils.StringU.getFormattedString( R.string.WidgetProvider_timestamp_hour_ago, resources, hours) : AptoideUtils.StringU.getFormattedString(R.string.WidgetProvider_timestamp_hours_ago, resources, hours); } else if (hours <= 0) { if (minutes > 0) { return AptoideUtils.StringU.getFormattedString( R.string.WidgetProvider_timestamp_minutes_ago, resources, minutes); } else {
synchronized void startNextDownload() { if (!isDownloading && !isPausing) { isDownloading = true; getNextDownload().first() .subscribe(download -> { if (download != null) { new DownloadTask(downloadAccessor, download, fileUtils, analytics, this, apkPath, obbPath, downloadsStoragePath, fileDownloader).startDownload(); Logger.getInstance() .d(TAG, "Download with md5 " + download.getMd5() + " started"); } else { isDownloading = false; cacheHelper.cleanCache() .subscribe(cleanedSize -> Logger.getInstance() .d(TAG, "cleaned size: " + AptoideUtils.StringU.formatBytes(cleanedSize, false)), throwable -> { CrashReport.getInstance() .log(throwable); }); } }, throwable -> throwable.printStackTrace()); } }