OSDN Git Service

More closely match the intended design of the bookmark grid page.
authorLeon Scroggins <scroggo@google.com>
Tue, 7 Jul 2009 15:25:28 +0000 (11:25 -0400)
committerLeon Scroggins <scroggo@google.com>
Tue, 7 Jul 2009 15:34:54 +0000 (11:34 -0400)
Change the look of the text.  Use a blank white rectangle with
rounded corners for sites without a stored screenshot.  Also
begin work on using the favicon.

res/drawable/blank.xml [new file with mode: 0644]
res/layout/bookmark_thumbnail.xml
src/com/android/browser/BookmarkGridPage.java

diff --git a/res/drawable/blank.xml b/res/drawable/blank.xml
new file mode 100644 (file)
index 0000000..724f5e7
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape>
+            <corners android:radius="5dip"/>
+            <solid android:color="@color/white"/>
+        </shape>
+    </item>
+</layer-list>
index 57f59eb..5e7a27b 100644 (file)
     android:layout_width="fill_parent"
     android:orientation="vertical"
     android:padding="4dip"
-    android:background="@color/white">
+    >
 
     <ImageView android:id="@+id/thumb"
-        android:src="@drawable/app_web_browser_sm"
+        android:src="@drawable/blank"
         android:scaleType="center"
         android:layout_width="fill_parent"
-        android:layout_height="fill_parent" />
+        android:layout_height="fill_parent"
+        />
+
+<!--
+    <ImageView android:id="@+id/fav"
+        android:scaleType="center"
+        android:layout_width="20dip"
+        android:layout_height="20dip"
+        />
+-->
 
     <TextView android:id="@+id/label"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_gravity="bottom"
-        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textStyle="bold"
         android:textColor="@color/white"
         android:maxLines="1"
         android:paddingTop="3dip"
@@ -38,5 +48,6 @@
         android:paddingLeft="2dip"
         android:paddingRight="2dip"
         android:scrollHorizontally="true"
-        android:background="#CC000000"/>
+        android:ellipsize="marquee"
+        />
 </LinearLayout>
index ed51464..2e05183 100644 (file)
@@ -201,6 +201,8 @@ public class BookmarkGridPage extends Activity {
                 v = factory.inflate(R.layout.bookmark_thumbnail, null);
             }
             ImageView thumb = (ImageView) v.findViewById(R.id.thumb);
+            // Favicon disabled for now.
+            //ImageView fav = (ImageView) v.findViewById(R.id.fav);
             TextView tv = (TextView) v.findViewById(R.id.label);
 
             ViewGroup.LayoutParams lp = thumb.getLayoutParams();
@@ -223,20 +225,23 @@ public class BookmarkGridPage extends Activity {
             byte[] data = mCursor.getBlob(
                     Browser.HISTORY_PROJECTION_THUMBNAIL_INDEX);
             if (data == null) {
-                // Backup is to show the favicon
-                data = mCursor.getBlob(
-                        Browser.HISTORY_PROJECTION_FAVICON_INDEX);
-                thumb.setScaleType(ImageView.ScaleType.CENTER);
+                // Backup is to just show white
+                thumb.setImageResource(R.drawable.blank);
             } else {
-                thumb.setScaleType(ImageView.ScaleType.FIT_XY);
-            }
-            if (data != null) {
                 thumb.setImageBitmap(
                         BitmapFactory.decodeByteArray(data, 0, data.length));
+            }
+/*
+            // Now show the favicon
+            data = mCursor.getBlob(Browser.HISTORY_PROJECTION_FAVICON_INDEX);
+            if (data == null) {
+                fav.setVisibility(View.GONE);
             } else {
-                thumb.setImageResource(R.drawable.app_web_browser_sm);
-                thumb.setScaleType(ImageView.ScaleType.CENTER);
+                fav.setVisibility(View.VISIBLE);
+                fav.setImageBitmap(
+                        BitmapFactory.decodeByteArray(data, 0, data.length));
             }
+*/
             return v;
         }