Browse Source

Merge pull request #516 from nextcloud/thumbnailRound

round thumbnail size to power of 2: 384 => 256
Andy Scherzinger 8 năm trước cách đây
mục cha
commit
f067df2bd5

+ 2 - 1
src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java

@@ -286,7 +286,8 @@ public class ThumbnailsCacheManager {
         private int getThumbnailDimension(){
             // Converts dp to pixel
             Resources r = MainApp.getAppContext().getResources();
-            return Math.round(r.getDimension(R.dimen.file_icon_size_grid));
+            Double d = Math.pow(2,Math.floor(Math.log(r.getDimension(R.dimen.file_icon_size_grid))/Math.log(2)));
+            return d.intValue();
         }
 
         private Bitmap doOCFileInBackground() {