Remove magic paddings from bookmark view
Use calculated sizes to correctly center without the need for
"magic" padding values.
Change-Id: Ida64a80243df9bf05355dd1db1047fc16c10b726
diff --git a/src/com/android/browser/BrowserBookmarksAdapter.java b/src/com/android/browser/BrowserBookmarksAdapter.java
index 7543528..16bcda5 100644
--- a/src/com/android/browser/BrowserBookmarksAdapter.java
+++ b/src/com/android/browser/BrowserBookmarksAdapter.java
@@ -52,6 +52,12 @@
}
void bindGridView(View view, Context context, Cursor cursor) {
+ // We need to set this to handle rotation and other configuration change
+ // events. If the padding didn't change, this is a no op.
+ int padding = context.getResources()
+ .getDimensionPixelSize(R.dimen.combo_horizontalSpacing);
+ view.setPadding(padding, view.getPaddingTop(),
+ padding, view.getPaddingBottom());
ImageView thumb = (ImageView) view.findViewById(R.id.thumb);
TextView tv = (TextView) view.findViewById(R.id.label);