Skip to content

Commit

Permalink
Use bigger resolution in case of high memory class >= 512
Browse files Browse the repository at this point in the history
  • Loading branch information
jeisfeld committed Apr 8, 2019
1 parent 8fca4fc commit a2f56e7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public static String getIndexedPreferenceKey(final int preferenceId, final int i
* @return The index.
*/
public static Integer getIndexFromPreferenceKey(@NonNull final String key) {
String[] parts = key.split("\\[|\\]");
String[] parts = key.split("[\\[]]");
if (parts.length < 2) {
return null;
}
Expand Down Expand Up @@ -425,7 +425,10 @@ public static void setDefaultResolutionSettings() {
if (maxBitmapSize == null || maxBitmapSize.length() == 0) {
// Only if 512 MB are accessible, then full resolution image should be stored.
int memoryClass = SystemUtil.getLargeMemoryClass();
if (memoryClass >= 256) { // MAGIC_NUMBER
if (memoryClass >= 512) { // MAGIC_NUMBER
maxBitmapSize = "4096";
}
else if (memoryClass >= 256) { // MAGIC_NUMBER
maxBitmapSize = "2048";
}
else {
Expand Down

0 comments on commit a2f56e7

Please sign in to comment.