This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- A theme. --> | |
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | |
<item name="colorPrimary">@color/colorPrimary</item> | |
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | |
<item name="colorAccent">@color/randomRed</item> | |
<item name="alertDialogTheme">@style/MyDialog</item> | |
</style> | |
<style name="MyDialog" parent="ThemeOverlay.AppCompat.Dialog.Alert"> | |
<item name="colorAccent">@color/secondary</item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Description getDescriptionsFromJson(JsonElement jsonElement){ | |
Description description = new Description(); | |
for (Map.Entry<String, JsonElement> entry :jsonElement.getAsJsonObject().entrySet()){ | |
if(entry.getKey().equalsIgnoreCase("en") || entry.getKey().equalsIgnoreCase(getDefaultLangCode())) | |
description.descriptionMap.put(entry.getKey(), entry.getValue().getAsString()); | |
} | |
return description; | |
} | |
public static String getDefaultCode(Context context){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static @DrawableRes int getPlaceHolder(Context context, @DrawableRes int actualPlaceholder) { | |
if(isLowRamDevice(context)) | |
return R.drawable.low_ram_placeholder; | |
else | |
return actualPlaceholder; | |
} | |
public static boolean isLowRamDevice(Context context) { | |
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); | |
return activityManager != null && ActivityManagerCompat.isLowRamDevice(activityManager); |
NewerOlder