OSDN Git Service

Scale the favicon by the density of the screen.
authorPatrick Scott <phanna@android.com>
Mon, 5 Oct 2009 13:32:46 +0000 (09:32 -0400)
committerPatrick Scott <phanna@android.com>
Mon, 5 Oct 2009 13:42:05 +0000 (09:42 -0400)
Scale the favicon but keep the padding the same. It looks a little better with
the current bookmark asset.

Bug: 2162987

src/com/android/browser/BrowserBookmarksPage.java

index a443090..535f0db 100644 (file)
@@ -440,9 +440,10 @@ public class BrowserBookmarksPage extends Activity implements
                 p.setStyle(Paint.Style.FILL_AND_STROKE);
                 p.setColor(Color.WHITE);
 
+                float density = getResources().getDisplayMetrics().density;
                 // Create a rectangle that is slightly wider than the favicon
-                final float iconSize = 16; // 16x16 favicon
-                final float padding = 2;   // white padding around icon
+                final float iconSize = 16 * density; // 16x16 favicon
+                final float padding = 2; // white padding around icon
                 final float rectSize = iconSize + 2 * padding;
                 final float y = icon.getHeight() - rectSize;
                 RectF r = new RectF(0, y, rectSize, y + rectSize);