Commit 52e19ec7 authored by Kainalu Hagiwara's avatar Kainalu Hagiwara
Browse files

For #12888 - Add highlight to current page in tab history.

parent 64072a12
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -5,10 +5,10 @@
package org.mozilla.fenix.tabhistory

import android.view.View
import androidx.core.text.bold
import androidx.core.text.buildSpannedString
import androidx.core.view.isVisible
import kotlinx.android.synthetic.main.tab_history_list_item.*
import mozilla.components.support.ktx.android.content.getColorFromAttr
import org.mozilla.fenix.R
import org.mozilla.fenix.library.LibrarySiteItemView
import org.mozilla.fenix.utils.view.ViewHolder

@@ -28,15 +28,14 @@ class TabHistoryViewHolder(

        history_layout.displayAs(LibrarySiteItemView.ItemType.SITE)
        history_layout.overflowView.isVisible = false
        history_layout.titleView.text = item.title
        history_layout.urlView.text = item.url
        history_layout.loadFavicon(item.url)

        history_layout.titleView.text = if (item.isSelected) {
            buildSpannedString {
                bold { append(item.title) }
            }
        if (item.isSelected) {
            history_layout.setBackgroundColor(history_layout.context.getColorFromAttr(R.attr.tabHistoryItemSelectedBackground))
        } else {
            item.title
            history_layout.background = null
        }
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -67,6 +67,9 @@
    <color name="tab_tray_item_thumbnail_icon_normal_theme">@color/tab_tray_item_thumbnail_icon_dark_theme</color>
    <color name="tab_tray_selected_mask_normal_theme">@color/tab_tray_selected_mask_dark_theme</color>

    <!-- Tab History -->
    <color name="tab_history_item_selected_background_normal_theme">@color/tab_tray_item_selected_background_dark_theme</color>

    <!--Top site colors -->
    <color name="top_site_title_text">@color/top_site_title_text_dark_theme</color>

+3 −0
Original line number Diff line number Diff line
@@ -66,6 +66,9 @@
    <attr name="tabTrayItemSelectedBackground" format="reference" />
    <attr name="tabTrayToolbarBackground" format="reference" />

    <!-- Tab History -->
    <attr name="tabHistoryItemSelectedBackground" format="reference" />

    <declare-styleable name="TrackingProtectionCategory">
        <attr name="categoryItemTitle" format="reference" />
        <attr name="categoryItemDescription" format="reference" />
+12 −0
Original line number Diff line number Diff line
@@ -77,6 +77,9 @@
    <color name="tab_tray_item_thumbnail_icon_light_theme">@color/photonLightGrey60</color>
    <color name="tab_tray_selected_mask_light_theme">@color/violet_70_12a</color>

    <!-- Tab History -->
    <color name="tab_history_item_selected_background_light_theme">@color/tab_tray_item_selected_background_light_theme</color>

    <!-- Dark theme color palette -->
    <color name="primary_text_dark_theme">#FBFBFE</color>
    <color name="secondary_text_dark_theme">#A7A2B7</color>
@@ -140,6 +143,9 @@
    <color name="tab_tray_item_thumbnail_icon_dark_theme">@color/photonDarkGrey05</color>
    <color name="tab_tray_selected_mask_dark_theme">@color/violet_50_32a</color>

    <!-- Tab History -->
    <color name="tab_history_item_selected_background_dark_theme">@color/tab_tray_item_selected_background_dark_theme</color>

    <!-- Private theme color palette -->
    <color name="primary_text_private_theme">#FBFBFE</color>
    <color name="secondary_text_private_theme">#A7A2B7</color>
@@ -195,6 +201,9 @@
    <color name="tab_tray_heading_icon_private_theme">@color/violet_50</color>
    <color name="tab_tray_heading_icon_inactive_private_theme">@color/violet_50_48a</color>

    <!-- Tab History -->
    <color name="tab_history_item_selected_background_private_theme">@color/tab_tray_item_selected_background_dark_theme</color>

    <!-- Normal theme colors for light mode -->
    <color name="primary_text_normal_theme">@color/primary_text_light_theme</color>
    <color name="secondary_text_normal_theme">@color/secondary_text_light_theme</color>
@@ -254,6 +263,9 @@
    <color name="tab_tray_item_thumbnail_icon_normal_theme">@color/tab_tray_item_thumbnail_icon_light_theme</color>
    <color name="tab_tray_selected_mask_normal_theme">@color/tab_tray_selected_mask_light_theme</color>

    <!-- Tab History -->
    <color name="tab_history_item_selected_background_normal_theme">@color/tab_history_item_selected_background_light_theme</color>

    <!-- Bookmark buttons -->
    <color name="bookmark_favicon_background">#DFDFE3</color>

+6 −0
Original line number Diff line number Diff line
@@ -93,6 +93,9 @@
        <item name="tabTrayThumbnailItemBackground">@color/tab_tray_item_thumbnail_background_normal_theme</item>
        <item name="tabTrayThumbnailIcon">@color/tab_tray_item_thumbnail_icon_normal_theme</item>

        <!-- Tab History -->
        <item name="tabHistoryItemSelectedBackground">@color/tab_history_item_selected_background_normal_theme</item>

        <!-- Drawables -->
        <item name="fenixLogo">@drawable/ic_logo_wordmark_normal</item>
        <item name="homeBackground">@color/foundation_normal_theme</item>
@@ -231,6 +234,9 @@
        <item name="tabTrayThumbnailItemBackground">@color/tab_tray_item_thumbnail_background_normal_theme</item>
        <item name="tabTrayThumbnailIcon">@color/tab_tray_item_thumbnail_icon_normal_theme</item>

        <!-- Tab History -->
        <item name="tabHistoryItemSelectedBackground">@color/tab_history_item_selected_background_private_theme</item>

        <!-- Drawables -->
        <item name="fenixLogo">@drawable/ic_logo_wordmark_private</item>
        <item name="homeBackground">@drawable/private_home_background_gradient</item>
Loading