private static String parseScreenshotUrl(String screenshotUrl, String orientation, WindowManager windowManager, Resources resources) { String sizeString = generateSizeStringScreenshotsdd(orientation, windowManager, resources); String[] splitUrl = splitUrlExtension(screenshotUrl); return splitUrl[0] + "_" + sizeString + "." + splitUrl[1]; }
private static String getUserAvatarIconSize(WindowManager windowManager) { if (ScreenU.getDensityDpi(windowManager) <= DisplayMetrics.DENSITY_HIGH) { return "50x50"; } else { return "150x150"; } }
public static int leastCommonMultiple(int[] input) { int result = input[0]; for (int i = 1; i < input.length; i++) result = leastCommonMultiple(result, input[i]); return result; }
private static String parseScreenshots(String orient, WindowManager windowManager) { if (orient == null) { return ""; } boolean isPortrait = orient != null && orient.equals("portrait"); int dpi = ScreenU.getDensityDpi(windowManager); String[] splittedUrl = splitUrlExtension(orient); return splittedUrl[0] + "_" + getThumbnailSize(dpi, isPortrait) + "." + splittedUrl[1]; }
public static String getScreenSize(Resources resources) { return Size.values()[getScreenSizeInt(resources)].name() .toLowerCase(Locale.ENGLISH); }
public static String generateStringAvatar(String url, Resources resources, WindowManager windowManager) { if (url == null) { return ""; } float densityMultiplier = densityMultiplier(resources); int size = Math.round(baseLineAvatar * densityMultiplier); //Logger.getInstance().d("Aptoide-IconSize", "Size is " + size); //return size + "x" + size; String[] splittedUrl = splitUrlExtension(url); return splittedUrl[0] + "_" + getUserAvatarIconSize(windowManager) + "." + splittedUrl[1]; }
private static String generateSizeStringScreenshotsdd(String orient, WindowManager windowManager, Resources resources) { float densityMultiplier = densityMultiplier(resources); int size; if (orient != null && orient.equals("portrait")) { size = baseLineScreenshotPort * ((int) densityMultiplier); } else { size = baseLineScreenshotLand * ((int) densityMultiplier); } return size + "x" + ScreenU.getDensityDpi(windowManager); }
public static boolean verifyInstallerForStore(final Context context, String packageName, @Store String store) { final String installer = getInstallerPackageName(context, packageName); return installer != null && installer.startsWith(store); }
public RealmInteger(Integer downloadId) { this.id = IdUtils.randomString(); this.integer = downloadId; }
public static Observable<EResponse> createGenericContinueMessage(Context context, String title, String message) { return createGenericContinueMessage(context, null, title, message, R.string.continue_option); }
public static int getNumericScreenSize(Resources resources) { int size = getScreenSizeInt(resources); return (size + 1) * 100; }
public String getTimeDiffString(long timedate, Context context, Resources resources) { return getTimeDiffString(context, timedate, resources); } }
private int computeMinSdk() { return SystemU.getSdkVer(); }
private String computeScreenSize() { return ScreenU.getScreenSize(resources); }
private String computeGlEs() { return SystemU.getGlEsVer(activityManager); }
private String computeCpuAbi() { return SystemU.getAbis(); }
public static boolean checkEmulator() { try { boolean goldfish = getSystemProperty("ro.hardware").contains("goldfish"); boolean emu = getSystemProperty("ro.kernel.qemu").length() > 0; boolean sdk = getSystemProperty("ro.product.model").equals("sdk"); if (emu || goldfish || sdk) { return true; } } catch (Exception e) { } return false; }
private int computeDensityDpi() { return ScreenU.getDensityDpi(windowManager); }
public RealmString(String string) { this.id = IdUtils.randomString(); this.string = string; }
/** * Show an AlertDialog with the {@code title} and the {@code message}. The Alert dialog has an * "ok" button. * * @param title Title to apply on AlertDialog * @param message Message to asSnack on AlertDialog * * @return A Observable that shows the dialog when subscribed and return the action made by * user. This action is represented by EResponse * * @see EResponse */ public static Observable<EResponse> createGenericOkMessage(Context context, String title, String message) { return createGenericContinueMessage(context, null, title, message, android.R.string.ok); }