From 73be65ad4611c2494fc2fda256777af72741256c Mon Sep 17 00:00:00 2001 From: Martyn Haigh Date: Thu, 30 Oct 2014 13:27:08 +0000 Subject: [PATCH] Bug 1064415 - Tabs tray/grid/panel interactions and visual design (r=lucasr) --- .../new_tablet_tab_item_title.xml | 12 ++++++++ .../new_tablet_tab_close_active.png | Bin 0 -> 353 bytes .../new_tablet_tab_close_active.png | Bin 0 -> 272 bytes .../new_tablet_tab_item_close_button.xml | 18 ++++++++++++ .../new_tablet_tab_close_active.png | Bin 0 -> 417 bytes .../new_tablet_tab_close_active.png | Bin 0 -> 606 bytes .../layout/new_tablet_tabs_item_cell.xml | 26 +++++++++--------- .../android/base/resources/values/colors.xml | 4 +++ .../android/base/resources/values/dimens.xml | 10 +++++-- mobile/android/base/tabs/TabsGridLayout.java | 5 ++-- .../android/base/tabs/TabsLayoutItemView.java | 3 +- 11 files changed, 59 insertions(+), 19 deletions(-) create mode 100644 mobile/android/base/newtablet/res/color-large-v11/new_tablet_tab_item_title.xml create mode 100644 mobile/android/base/newtablet/res/drawable-large-hdpi-v11/new_tablet_tab_close_active.png create mode 100644 mobile/android/base/newtablet/res/drawable-large-mdpi-v11/new_tablet_tab_close_active.png create mode 100644 mobile/android/base/newtablet/res/drawable-large-v11/new_tablet_tab_item_close_button.xml create mode 100644 mobile/android/base/newtablet/res/drawable-large-xhdpi-v11/new_tablet_tab_close_active.png create mode 100644 mobile/android/base/newtablet/res/drawable-large-xxhdpi-v11/new_tablet_tab_close_active.png diff --git a/mobile/android/base/newtablet/res/color-large-v11/new_tablet_tab_item_title.xml b/mobile/android/base/newtablet/res/color-large-v11/new_tablet_tab_item_title.xml new file mode 100644 index 000000000000..f3efa00e01f3 --- /dev/null +++ b/mobile/android/base/newtablet/res/color-large-v11/new_tablet_tab_item_title.xml @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/mobile/android/base/newtablet/res/drawable-large-hdpi-v11/new_tablet_tab_close_active.png b/mobile/android/base/newtablet/res/drawable-large-hdpi-v11/new_tablet_tab_close_active.png new file mode 100644 index 0000000000000000000000000000000000000000..ca09ae09adbd7242fd2489cdc31205b9f2bdfe42 GIT binary patch literal 353 zcmV-n0iOPeP)Px$8%ab#R45g7lEI3DFc5}KKq=Oo1)+U_rMEss@7-q*AIO6TU!gZ2qt~9xA_~%i zLUgIhcJsGP36lJWgqh5jnM{V|d434P@H9=6Y?@{t$MKJ2P@1NjD2mRW=ZU(mkE|$) zU*Gpvh?P?IRaJd0VL(b3Aw+<ZN>KK9$42Xg$ z^E}T_JrmAxR+iGmh1se5`LHH^OM1)3lP0yK3SFtb5uIm)wr6~`FaT8^7BNtB%`P$PQgm_2%nse2~a zbzQ+Ru$aBJZSN?L{)sNbPH@+Cw_z9_iuwKr#WwOu!#h6=00000NkvXXu0mjfmeiB+ literal 0 HcmV?d00001 diff --git a/mobile/android/base/newtablet/res/drawable-large-mdpi-v11/new_tablet_tab_close_active.png b/mobile/android/base/newtablet/res/drawable-large-mdpi-v11/new_tablet_tab_close_active.png new file mode 100644 index 0000000000000000000000000000000000000000..e24adb4995993aa353b02b52322471f1aec57c98 GIT binary patch literal 272 zcmV+r0q_2aP)Px#%1J~)R2Ug`kUa{6KoEuF5{L*|i|8RdK$;-QIV|)9X_5n^$q{TUy+b4rQl!lp z{6TCjM1w{Az=1T`W|(uZEGO^;OiaU7>v-)p}&5ti3h7>c3@Ku`>$D0;SSdlCb+ zX_~Vz{!Id*s;V6Unm`Hz3ASxt=*6g5Qw%VKVR$XeGLU6vJy-lg-}fJZga;Ok%+bFO W^oJsPr}$m~0000 + + + + + + + + + + + + + diff --git a/mobile/android/base/newtablet/res/drawable-large-xhdpi-v11/new_tablet_tab_close_active.png b/mobile/android/base/newtablet/res/drawable-large-xhdpi-v11/new_tablet_tab_close_active.png new file mode 100644 index 0000000000000000000000000000000000000000..cb997070af278fbd6cfd1b207227bac8d46f59c8 GIT binary patch literal 417 zcmV;S0bc%zP)Px$TS-JgR5%fhl+9{`KoG~f+Xqk(RD6d*p_I_(8Yt~q5Bh$hK0pp7&{Jti$)PQM z2SxA$k3vfK9~jwec2oD@%+ANpnROi&MbTv#hFibO$M>|?$vn?rJHGd&mSu0UP1aQie70?0 zakL``LN~#55X3i4^TME@0whD1m)xcaB4R$oQ7jH1B%gyZ#(w29p_dT^`w4`N2?n3K zWC(mmAQPx%7)eAyR7ee_mfuPOQ4q%4Qy{o);GYN)@nQ*j0Uw}$>aCt_O77IcMhQob&BrlpQ(h^}3qR=id{F z#L09zwZ`M|O}Sit!(5cnYPC+&>GV@P9zU2&CZCpN6-uR&r2wSsx*#xNkKyg4_GQ#1;ilWaEI345v1`EY@Q!QfJ$3yKN?5HCJwOH--Tqd>bw|I%$a zR}dGds_MQ#U+0G4nG2%Wpb91DOQ3;7Uq?YvKosi-G)?ozFpR=djZ!4Ct + android:orientation="vertical" + android:paddingBottom="@dimen/new_tablet_tab_panel_grid_padding"> - + android:duplicateParentState="true" + android:paddingLeft="@dimen/new_tablet_tab_highlight_stroke_width" + android:paddingRight="@dimen/new_tablet_tab_highlight_stroke_width" + android:paddingBottom="@dimen/new_tablet_tab_highlight_stroke_width"> @@ -36,16 +35,17 @@ style="@style/TabsItemClose" android:layout_width="wrap_content" android:layout_height="match_parent" - android:background="@drawable/action_bar_button_inverse" android:scaleType="center" + android:background="@android:color/transparent" android:contentDescription="@string/close_tab" - android:src="@drawable/new_tablet_tab_close"/> + android:src="@drawable/new_tablet_tab_item_close_button" + android:duplicateParentState="true"/> diff --git a/mobile/android/base/resources/values/colors.xml b/mobile/android/base/resources/values/colors.xml index 52ad0d07a91e..06843b7315b8 100644 --- a/mobile/android/base/resources/values/colors.xml +++ b/mobile/android/base/resources/values/colors.xml @@ -152,4 +152,8 @@ #FFECF0F3 #FFCFD9E1 + + #FFAFB1B3 + + diff --git a/mobile/android/base/resources/values/dimens.xml b/mobile/android/base/resources/values/dimens.xml index aac5136983dd..45daa8317afb 100644 --- a/mobile/android/base/resources/values/dimens.xml +++ b/mobile/android/base/resources/values/dimens.xml @@ -128,9 +128,13 @@ 50dp - 180dp - 180dp - 24dp + 168dp + 140dp + 178dp + 19dp + 24dp + + 5dp 32dp diff --git a/mobile/android/base/tabs/TabsGridLayout.java b/mobile/android/base/tabs/TabsGridLayout.java index a35405f2ecc4..505d00637dca 100644 --- a/mobile/android/base/tabs/TabsGridLayout.java +++ b/mobile/android/base/tabs/TabsGridLayout.java @@ -68,11 +68,12 @@ class TabsGridLayout extends GridView setNumColumns(GridView.AUTO_FIT); final Resources resources = getResources(); - final int columnWidth = resources.getDimensionPixelSize(R.dimen.new_tablet_tab_thumbnail_width); + final int columnWidth = resources.getDimensionPixelSize(R.dimen.new_tablet_tab_panel_column_width); setColumnWidth(columnWidth); final int padding = resources.getDimensionPixelSize(R.dimen.new_tablet_tab_panel_grid_padding); - setPadding(padding, 0, padding, 0); + final int paddingTop = resources.getDimensionPixelSize(R.dimen.new_tablet_tab_panel_grid_padding_top); + setPadding(padding, paddingTop, padding, padding); } private class TabsGridLayoutAdapter extends TabsLayoutAdapter { diff --git a/mobile/android/base/tabs/TabsLayoutItemView.java b/mobile/android/base/tabs/TabsLayoutItemView.java index 427f40e15949..104cca9c31b0 100644 --- a/mobile/android/base/tabs/TabsLayoutItemView.java +++ b/mobile/android/base/tabs/TabsLayoutItemView.java @@ -15,6 +15,7 @@ import android.view.View; import android.widget.Checkable; import android.widget.ImageButton; import android.widget.ImageView; +import android.widget.ImageView.ScaleType; import android.widget.LinearLayout; import android.widget.TextView; @@ -95,7 +96,7 @@ public class TabsLayoutItemView extends LinearLayout Drawable thumbnailImage = tab.getThumbnail(); if (thumbnailImage != null) { - mThumbnail.setImageDrawable(thumbnailImage); + setThumbnail(thumbnailImage); } else { mThumbnail.setImageResource(R.drawable.tab_thumbnail_default); }