Gallery2: Make icon display completely.
The icon size is to big for the device screen.
Adjust the icon size to the right width.
CRs-fixed: 639562
Change-Id: Ibde082d48d4f12009f5293de049798cf221adda4
diff --git a/res/layout/filtershow_control_style_chooser.xml b/res/layout/filtershow_control_style_chooser.xml
index 9588ea2..d0004ff 100644
--- a/res/layout/filtershow_control_style_chooser.xml
+++ b/res/layout/filtershow_control_style_chooser.xml
@@ -18,7 +18,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.example.imagefilterharness"
android:layout_width="match_parent"
- android:layout_height="32dp"
+ android:layout_height="wrap_content"
android:orientation="horizontal" >
<HorizontalScrollView
android:id="@+id/scrollList"
diff --git a/src/com/android/gallery3d/filtershow/controller/StyleChooser.java b/src/com/android/gallery3d/filtershow/controller/StyleChooser.java
index f5afec9..dc31401 100644
--- a/src/com/android/gallery3d/filtershow/controller/StyleChooser.java
+++ b/src/com/android/gallery3d/filtershow/controller/StyleChooser.java
@@ -41,7 +41,7 @@
int n = mParameter.getNumberOfStyles();
mIconButton.clear();
Resources res = context.getResources();
- int dim = res.getDimensionPixelSize(R.dimen.draw_style_icon_dim);
+ int dim = mTopView.getMeasuredWidth() / n;
LayoutParams lp = new LayoutParams(dim, dim);
for (int i = 0; i < n; i++) {
final ImageButton button = new ImageButton(context);