Bug 840871: about:home thumbnails are drawn twice. [r=mfinkle]

This commit is contained in:
Sriram Ramasubramanian 2013-02-19 12:00:28 -08:00
Родитель cf1ecde91e
Коммит 3e7a0586c7
3 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -111,6 +111,7 @@ public class AboutHomeContent extends ScrollView
private static Rect sIconBounds;
private static TextAppearanceSpan sSubTitleSpan;
private static Drawable sPinDrawable = null;
private int mThumbnailBackground;
public interface UriLoadCallback {
public void callback(String uriSpec);
@ -136,6 +137,7 @@ public class AboutHomeContent extends ScrollView
int iconSize = mContext.getResources().getDimensionPixelSize(R.dimen.abouthome_addon_icon_size);
sIconBounds = new Rect(0, 0, iconSize, iconSize);
sSubTitleSpan = new TextAppearanceSpan(mContext, R.style.AboutHome_TextAppearance_SubTitle);
mThumbnailBackground = mContext.getResources().getColor(R.color.abouthome_thumbnail_bg);
inflate();
@ -350,10 +352,12 @@ public class AboutHomeContent extends ScrollView
if (thumbnail == null) {
thumbnailView.setImageResource(R.drawable.abouthome_thumbnail_bg);
thumbnailView.setBackgroundColor(mThumbnailBackground);
thumbnailView.setScaleType(ImageView.ScaleType.FIT_CENTER);
} else {
try {
thumbnailView.setImageBitmap(thumbnail);
thumbnailView.setBackgroundColor(0x0);
thumbnailView.setScaleType(ImageView.ScaleType.CENTER_CROP);
} catch (OutOfMemoryError oom) {
Log.e(LOGTAG, "Unable to load thumbnail bitmap", oom);
@ -977,6 +981,7 @@ public class AboutHomeContent extends ScrollView
holder.setTitle("");
holder.setUrl("");
holder.thumbnailView.setImageResource(R.drawable.abouthome_thumbnail_add);
holder.thumbnailView.setBackgroundColor(mThumbnailBackground);
holder.thumbnailView.setScaleType(ImageView.ScaleType.FIT_CENTER);
holder.setPinned(false);
}

Просмотреть файл

@ -22,6 +22,7 @@
<color name="url_bar_text_highlight_pb">#FFD06BFF</color>
<color name="suggestion_primary">#dddddd</color>
<color name="suggestion_pressed">#bbbbbb</color>
<color name="abouthome_thumbnail_bg">#5FFF</color>
<color name="abouthome_topsite_shadow">#1000</color>
<color name="tab_indicator_unselected">@android:color/transparent</color>
<color name="tab_indicator_unselected_focused">#34FF9500</color>

Просмотреть файл

@ -245,7 +245,7 @@
<item name="android:layout_centerHorizontal">true</item>
<item name="android:layout_alignParentTop">true</item>
<item name="android:src">@drawable/abouthome_thumbnail_bg</item>
<item name="android:background">#5FFF</item>
<item name="android:background">@color/abouthome_thumbnail_bg</item>
<item name="android:paddingTop">0dip</item>
<item name="android:paddingBottom">@dimen/abouthome_icon_radius</item>
<item name="android:paddingLeft">0dip</item>