diff options
| author | John Reck <jreck@google.com> | 2011-03-21 16:30:12 -0700 |
|---|---|---|
| committer | John Reck <jreck@google.com> | 2011-03-21 16:32:41 -0700 |
| commit | 88a42b73f517d758fea872c01bbf456c602a3073 (patch) | |
| tree | 281a757e86fb12d48ebc416b1cfe0ba1135ba236 /src/com/android/browser/ActiveTabsPage.java | |
| parent | 7145171c3c7e11b1e778c07221dd9f0b41025bba (diff) | |
| download | packages_apps_Browser-88a42b73f517d758fea872c01bbf456c602a3073.tar.gz packages_apps_Browser-88a42b73f517d758fea872c01bbf456c602a3073.tar.bz2 packages_apps_Browser-88a42b73f517d758fea872c01bbf456c602a3073.zip | |
use thumbnails in tab switcher
Change-Id: I0c7bda38c4c12448822f575f6fe0670f87b3eb7b
Diffstat (limited to 'src/com/android/browser/ActiveTabsPage.java')
| -rw-r--r-- | src/com/android/browser/ActiveTabsPage.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/com/android/browser/ActiveTabsPage.java b/src/com/android/browser/ActiveTabsPage.java index 5e27eab02..52d943fc4 100644 --- a/src/com/android/browser/ActiveTabsPage.java +++ b/src/com/android/browser/ActiveTabsPage.java @@ -18,6 +18,7 @@ package com.android.browser; import android.content.Context; import android.graphics.Bitmap; +import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; @@ -141,23 +142,30 @@ public class ActiveTabsPage extends LinearLayout implements OnClickListener, view = mInflater.inflate(R.layout.tab_view, parent, false); } ImageView favicon = (ImageView) view.findViewById(R.id.favicon); - TextView title = (TextView) view.findViewById(R.id.title); - TextView url = (TextView) view.findViewById(R.id.url); + ImageView thumbnail = (ImageView) view.findViewById(R.id.thumb); + TextView title = (TextView) view.findViewById(R.id.label); Tab tab = getItem(position); - title.setText(tab.getTitle()); - url.setText(tab.getUrl()); + String label = tab.getTitle(); + if (TextUtils.isEmpty(label)) { + label = tab.getUrl(); + } + title.setText(label); + Bitmap thumbnailBitmap = tab.getScreenshot(); + if (thumbnailBitmap == null) { + thumbnail.setImageResource(R.drawable.browser_thumbnail); + } else { + thumbnail.setImageBitmap(thumbnailBitmap); + } Bitmap faviconBitmap = tab.getFavicon(); if (tab.isPrivateBrowsingEnabled()) { favicon.setImageResource(R.drawable.ic_incognito_holo_dark); - favicon.setBackgroundDrawable(null); } else { if (faviconBitmap == null) { favicon.setImageResource(R.drawable.app_web_browser_sm); } else { favicon.setImageBitmap(faviconBitmap); } - favicon.setBackgroundResource(R.drawable.bookmark_list_favicon_bg); } View close = view.findViewById(R.id.close); close.setTag(position); |
