Bug 999760 - Apply padding to entire article item view. r=liuche a=lsblakk
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 23 Apr 2014 18:01:34 -0700
changeset 192182 d9336eebf796
parent 192181 bd20a12260ea
child 192183 3c6892869d25
push id3513
push usermleibovic@mozilla.com
push date2014-04-30 22:52 +0000
treeherdermozilla-beta@d9336eebf796 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, lsblakk
bugs999760
milestone30.0
Bug 999760 - Apply padding to entire article item view. r=liuche a=lsblakk
mobile/android/base/home/PanelItemView.java
mobile/android/base/resources/layout/panel_article_item.xml
mobile/android/base/resources/values/dimens.xml
--- a/mobile/android/base/home/PanelItemView.java
+++ b/mobile/android/base/home/PanelItemView.java
@@ -69,16 +69,19 @@ class PanelItemView extends LinearLayout
                    .into(mImage);
         }
     }
 
     private static class ArticleItemView extends PanelItemView {
         private ArticleItemView(Context context) {
             super(context, R.layout.panel_article_item);
             setOrientation(LinearLayout.HORIZONTAL);
+
+            final int padding = getResources().getDimensionPixelSize(R.dimen.article_item_view_padding);
+            setPadding(0, padding, 0, padding);
         }
     }
 
     private static class ImageItemView extends PanelItemView {
         private ImageItemView(Context context) {
             super(context, R.layout.panel_image_item);
             setOrientation(LinearLayout.VERTICAL);
         }
--- a/mobile/android/base/resources/layout/panel_article_item.xml
+++ b/mobile/android/base/resources/layout/panel_article_item.xml
@@ -3,28 +3,23 @@
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <merge xmlns:android="http://schemas.android.com/apk/res/android">
 
     <ImageView android:id="@+id/image"
                android:layout_width="54dp"
                android:layout_height="44dp"
-               android:layout_marginTop="10dip"
-               android:layout_marginLeft="10dip"
                android:scaleType="centerCrop"/>
 
     <LinearLayout android:id="@+id/title_desc_container"
                   android:layout_width="fill_parent"
                   android:layout_height="wrap_content"
-                  android:paddingTop="15dip"
-                  android:paddingBottom="15dip"
                   android:paddingLeft="10dip"
                   android:paddingRight="10dip"
-                  android:minHeight="@dimen/page_row_height"
                   android:gravity="center_vertical"
                   android:orientation="vertical">
 
         <TextView android:id="@+id/title"
                   style="@style/Widget.PanelItemView.Title"
                   android:layout_width="fill_parent"
                   android:layout_height="wrap_content"/>
 
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -104,9 +104,12 @@
     <dimen name="home_banner_height">72dp</dimen>
 
     <!-- Icon Grid -->
     <dimen name="icongrid_columnwidth">128dp</dimen>
     <dimen name="icongrid_padding">16dp</dimen>
 
     <!-- PanelGridView dimensions -->
     <dimen name="panel_grid_view_column_width">150dp</dimen>
+
+    <!-- ArticleItemView dimensions -->
+    <dimen name="article_item_view_padding">15dp</dimen>
 </resources>