summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout/bookmark_thumbnail.xml33
-rw-r--r--res/values-xlarge/dimensions.xml16
-rw-r--r--res/values/dimensions.xml3
-rw-r--r--src/com/android/browser/BrowserActivity.java23
-rw-r--r--src/com/android/browser/BrowserBookmarksAdapter.java2
5 files changed, 26 insertions, 51 deletions
diff --git a/res/layout/bookmark_thumbnail.xml b/res/layout/bookmark_thumbnail.xml
index 363e632..91d8db7 100644
--- a/res/layout/bookmark_thumbnail.xml
+++ b/res/layout/bookmark_thumbnail.xml
@@ -23,39 +23,12 @@
<ImageView android:id="@+id/thumb"
android:src="@drawable/browser_thumbnail"
- android:scaleType="center"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
+ android:scaleType="centerCrop"
+ android:layout_height="@dimen/bookmarkThumbnailHeight"
+ android:layout_width="@dimen/bookmarkThumbnailWidth"
android:layout_gravity="center"
/>
- <!-- FIXME: Want to have a gradient over the thumb -->
-
- <!-- This holds the star for addbookmark -->
- <LinearLayout android:id="@+id/holder"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical"
- android:background="#99000000"
- android:gravity="center"
- android:layout_alignBottom="@+id/thumb"
- android:layout_alignTop="@+id/thumb"
- >
- <ImageView
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:src="@drawable/ic_list_bookmark"
- />
- <TextView
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textStyle="bold"
- android:textColor="@color/white"
- android:text="@string/add_bookmark_short"
- />
- </LinearLayout>
-
<TextView android:id="@+id/label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/res/values-xlarge/dimensions.xml b/res/values-xlarge/dimensions.xml
new file mode 100644
index 0000000..602da0e
--- /dev/null
+++ b/res/values-xlarge/dimensions.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2010 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <dimen name="bookmarkThumbnailWidth">160dip</dimen>
+ <dimen name="bookmarkThumbnailHeight">180dip</dimen>
+</resources> \ No newline at end of file
diff --git a/res/values/dimensions.xml b/res/values/dimensions.xml
index 2fc3233..4d19a9f 100644
--- a/res/values/dimensions.xml
+++ b/res/values/dimensions.xml
@@ -18,4 +18,7 @@
<!-- The width of an unselected tab -->
<dimen
name="tab_width_unselected">300dp</dimen>
+
+ <dimen name="bookmarkThumbnailWidth">90dip</dimen>
+ <dimen name="bookmarkThumbnailHeight">80dip</dimen>
</resources> \ No newline at end of file
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 3535725..06e0710 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -2480,38 +2480,23 @@ public class BrowserActivity extends Activity
}
/**
- * Values for the size of the thumbnail created when taking a screenshot.
- * Lazily initialized. Instead of using these directly, use
- * getDesiredThumbnailWidth() or getDesiredThumbnailHeight().
- */
- private static int THUMBNAIL_WIDTH = 0;
- private static int THUMBNAIL_HEIGHT = 0;
-
- /**
* Return the desired width for thumbnail screenshots, which are stored in
* the database, and used on the bookmarks screen.
* @param context Context for finding out the density of the screen.
- * @return int desired width for thumbnail screenshot.
+ * @return desired width for thumbnail screenshot.
*/
/* package */ static int getDesiredThumbnailWidth(Context context) {
- if (THUMBNAIL_WIDTH == 0) {
- float density = context.getResources().getDisplayMetrics().density;
- THUMBNAIL_WIDTH = (int) (90 * density);
- THUMBNAIL_HEIGHT = (int) (80 * density);
- }
- return THUMBNAIL_WIDTH;
+ return context.getResources().getDimensionPixelOffset(R.dimen.bookmarkThumbnailWidth);
}
/**
* Return the desired height for thumbnail screenshots, which are stored in
* the database, and used on the bookmarks screen.
* @param context Context for finding out the density of the screen.
- * @return int desired height for thumbnail screenshot.
+ * @return desired height for thumbnail screenshot.
*/
/* package */ static int getDesiredThumbnailHeight(Context context) {
- // To ensure that they are both initialized.
- getDesiredThumbnailWidth(context);
- return THUMBNAIL_HEIGHT;
+ return context.getResources().getDimensionPixelOffset(R.dimen.bookmarkThumbnailHeight);
}
private Bitmap createScreenshot(WebView view, int width, int height) {
diff --git a/src/com/android/browser/BrowserBookmarksAdapter.java b/src/com/android/browser/BrowserBookmarksAdapter.java
index e29ca18..6efb554 100644
--- a/src/com/android/browser/BrowserBookmarksAdapter.java
+++ b/src/com/android/browser/BrowserBookmarksAdapter.java
@@ -37,11 +37,9 @@ class BrowserBookmarksAdapter extends ResourceCursorAdapter {
@Override
public void bindView(View view, Context context, Cursor cursor) {
- View holder = view.findViewById(R.id.holder);
ImageView thumb = (ImageView) view.findViewById(R.id.thumb);
TextView tv = (TextView) view.findViewById(R.id.label);
- holder.setVisibility(View.GONE);
tv.setText(cursor.getString(BookmarksLoader.COLUMN_INDEX_TITLE));
Bitmap thumbnail = null;