]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/views/NestedScrollWebView.kt
Implement selecting bookmark favorite icons from the file system. https://redmine...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / views / NestedScrollWebView.kt
index 45133be52c016316c0cfb8bfae9d21775f2d4c26..6076950291c304e74fa75d0326913973da8c1984 100644 (file)
@@ -156,13 +156,11 @@ class NestedScrollWebView @JvmOverloads constructor(context: Context, attributeS
         // Store the current favorite icon height.
         favoriteIconHeight = icon.height
 
-        // Scale the favorite icon bitmap down if it is larger than 256 x 256.  Filtering uses bilinear interpolation.
-        favoriteIcon = if (icon.height > 256 || icon.width > 256) {
-            Bitmap.createScaledBitmap(icon, 256, 256, true)
-        } else {
-            // Store the icon as presented.
+        // Scale the favorite icon bitmap down if it is larger than 128 in either direction.  Filtering uses bilinear interpolation.
+        favoriteIcon = if (icon.height > 128 || icon.width > 128)  // Scale the icon before storing it.
+            Bitmap.createScaledBitmap(icon, 128, 128, true)
+        else  // Store the icon as presented.
             icon
-        }
     }
 
     fun getFavoriteIcon(): Bitmap {