Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #12002: Show default tab background when thumbnail not available (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonalmeida authored Jun 27, 2020
1 parent 4b9cc95 commit f89b157
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/src/main/res/layout/tab_tray_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,20 @@
android:layout_height="69dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:backgroundTint="?tabTrayThumbnailItemBackground"
app:cardBackgroundColor="@color/photonWhite"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:id="@+id/default_tab_thumbnail"
android:src="@drawable/mozac_ic_globe"
android:tint="?tabTrayThumbnailIcon"
android:padding="22dp"
android:importantForAccessibility="no"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

<mozilla.components.browser.tabstray.thumbnail.TabThumbnailView
android:id="@+id/mozac_browser_tabstray_thumbnail"
android:layout_width="match_parent"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
<color name="tab_tray_item_media_background_normal_theme">@color/tab_tray_item_media_background_dark_theme</color>
<color name="tab_tray_heading_icon_normal_theme">@color/tab_tray_heading_icon_dark_theme</color>
<color name="tab_tray_heading_icon_inactive_normal_theme">@color/tab_tray_heading_icon_inactive_dark_theme</color>
<color name="tab_tray_item_thumbnail_background_normal_theme">@color/tab_tray_item_thumbnail_background_dark_theme</color>
<color name="tab_tray_item_thumbnail_icon_normal_theme">@color/tab_tray_item_thumbnail_icon_dark_theme</color>

<!--Top site colors -->
<color name="top_site_background">@color/top_site_background_dark_theme</color>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
<attr name="tabTrayItemMediaBackground" format="reference" />
<attr name="tabTrayHeadingIcon" format="reference" />
<attr name="tabTrayHeadingIconInactive" format="reference" />
<attr name="tabTrayThumbnailItemBackground" format="reference" />
<attr name="tabTrayThumbnailIcon" format="reference" />

<declare-styleable name="TrackingProtectionCategory">
<attr name="categoryItemTitle" format="reference" />
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
<color name="tab_tray_item_media_background_light_theme">#312A65</color>
<color name="tab_tray_heading_icon_light_theme">@color/ink_20</color>
<color name="tab_tray_heading_icon_inactive_light_theme">@color/ink_20_48a</color>
<color name="tab_tray_item_thumbnail_background_light_theme">@color/light_grey_10</color>
<color name="tab_tray_item_thumbnail_icon_light_theme">@color/light_grey_60</color>

<!-- Dark theme color palette -->
<color name="primary_text_dark_theme">#FBFBFE</color>
Expand Down Expand Up @@ -140,6 +142,8 @@
<color name="tab_tray_item_media_background_dark_theme">#9059FF</color>
<color name="tab_tray_heading_icon_dark_theme">@color/violet_50</color>
<color name="tab_tray_heading_icon_inactive_dark_theme">@color/violet_50_48a</color>
<color name="tab_tray_item_thumbnail_background_dark_theme">@color/dark_grey_50</color>
<color name="tab_tray_item_thumbnail_icon_dark_theme">@color/dark_grey_05</color>

<!-- Private theme color palette -->
<color name="primary_text_private_theme">#FBFBFE</color>
Expand Down Expand Up @@ -243,6 +247,8 @@
<color name="tab_tray_item_media_background_normal_theme">@color/tab_tray_item_media_background_light_theme</color>
<color name="tab_tray_heading_icon_normal_theme">@color/tab_tray_heading_icon_light_theme</color>
<color name="tab_tray_heading_icon_inactive_normal_theme">@color/tab_tray_heading_icon_inactive_light_theme</color>
<color name="tab_tray_item_thumbnail_background_normal_theme">@color/tab_tray_item_thumbnail_background_light_theme</color>
<color name="tab_tray_item_thumbnail_icon_normal_theme">@color/tab_tray_item_thumbnail_icon_light_theme</color>

<!-- Bookmark buttons -->
<color name="bookmark_favicon_background">#DFDFE3</color>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
<item name="tabTrayItemMediaBackground">@color/tab_tray_item_media_background_normal_theme</item>
<item name="tabTrayHeadingIcon">@color/tab_tray_heading_icon_normal_theme</item>
<item name="tabTrayHeadingIconInactive">@color/tab_tray_heading_icon_inactive_normal_theme</item>
<item name="tabTrayThumbnailItemBackground">@color/tab_tray_item_thumbnail_background_normal_theme</item>
<item name="tabTrayThumbnailIcon">@color/tab_tray_item_thumbnail_icon_normal_theme</item>

<!-- Drawables -->
<item name="fenixLogo">@drawable/ic_logo_wordmark_normal</item>
Expand Down Expand Up @@ -209,6 +211,8 @@
<item name="tabTrayItemMediaBackground">@color/tab_tray_item_media_background_private_theme</item>
<item name="tabTrayHeadingIcon">@color/tab_tray_heading_icon_dark_theme</item>
<item name="tabTrayHeadingIconInactive">@color/tab_tray_heading_icon_inactive_dark_theme</item>
<item name="tabTrayThumbnailItemBackground">@color/tab_tray_item_thumbnail_background_normal_theme</item>
<item name="tabTrayThumbnailIcon">@color/tab_tray_item_thumbnail_icon_normal_theme</item>

<!-- Drawables -->
<item name="fenixLogo">@drawable/ic_logo_wordmark_private</item>
Expand Down

0 comments on commit f89b157

Please sign in to comment.