diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d38e807c7..61f33539d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:name=".FenixApplication" - android:theme="@style/LightAppTheme" + android:theme="@style/LightTheme" android:usesCleartextTraffic="true" tools:ignore="UnusedAttribute"> + android:theme="@style/SettingsTheme"/> diff --git a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt index 291237143..f186d1ca2 100644 --- a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt +++ b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt @@ -17,10 +17,20 @@ import org.mozilla.fenix.browser.BrowserFragment import org.mozilla.fenix.ext.components open class HomeActivity : AppCompatActivity() { + val themeManager = DefaultThemeManager().also { + it.onThemeChange = { theme -> + setTheme(theme) + recreate() + } + } + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_home) + setTheme(themeManager.currentTheme) + DefaultThemeManager.applyStatusBarTheme(window, themeManager, this) + if (intent?.extras?.getBoolean(OPEN_TO_BROWSER) == true) { openToBrowser() } diff --git a/app/src/main/java/org/mozilla/fenix/ThemeManager.kt b/app/src/main/java/org/mozilla/fenix/ThemeManager.kt new file mode 100644 index 000000000..b94d6c565 --- /dev/null +++ b/app/src/main/java/org/mozilla/fenix/ThemeManager.kt @@ -0,0 +1,79 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + 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/. */ + +package org.mozilla.fenix + +import android.app.Activity +import android.content.Context +import android.util.TypedValue +import android.view.View +import android.view.Window +import androidx.core.content.ContextCompat + +interface ThemeManager { + enum class Theme { + Light, Private + } + + val currentTheme: Theme + fun setTheme(theme: Theme) +} + +fun Activity.setTheme(theme: ThemeManager.Theme) { + val themeCode = when (theme) { + ThemeManager.Theme.Light -> R.style.LightTheme + ThemeManager.Theme.Private -> R.style.PrivateTheme + } + + setTheme(themeCode) +} + +fun ThemeManager.Theme.isPrivate(): Boolean = this == ThemeManager.Theme.Private + +private var temporaryThemeManagerStorage = ThemeManager.Theme.Light +class DefaultThemeManager : ThemeManager { + var onThemeChange: ((ThemeManager.Theme) -> Unit)? = null + + override val currentTheme: ThemeManager.Theme + get() = temporaryThemeManagerStorage + + override fun setTheme(theme: ThemeManager.Theme) { + temporaryThemeManagerStorage = theme + + onThemeChange?.invoke(currentTheme) + } + + companion object { + fun resolveAttribute(attribute: Int, context: Context): Int { + val typedValue = TypedValue() + val theme = context.theme + theme.resolveAttribute(attribute, typedValue, true) + + return typedValue.resourceId + } + + // Handles status bar theme change since the window does not dynamically recreate + fun applyStatusBarTheme(window: Window, themeManager: ThemeManager, context: Context) { + window.statusBarColor = ContextCompat + .getColor(context, DefaultThemeManager + .resolveAttribute(android.R.attr.statusBarColor, context)) + + window.navigationBarColor = ContextCompat + .getColor(context, DefaultThemeManager + .resolveAttribute(android.R.attr.navigationBarColor, context)) + + when (themeManager.currentTheme) { + ThemeManager.Theme.Light -> { + window.decorView.systemUiVisibility = window.decorView.systemUiVisibility or + View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR + } + ThemeManager.Theme.Private -> { + window.decorView.systemUiVisibility = window.decorView.systemUiVisibility and + View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv() and + View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv() + } + } + } + } +} diff --git a/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt index 671cc9e01..91bed695b 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt @@ -8,6 +8,7 @@ import android.annotation.SuppressLint import android.content.Context import android.content.Intent import android.os.Bundle +import android.preference.PreferenceManager import android.view.Gravity import android.view.LayoutInflater import android.view.View @@ -29,6 +30,7 @@ import mozilla.components.feature.session.SessionFeature import mozilla.components.feature.session.SessionUseCases import mozilla.components.support.ktx.android.arch.lifecycle.addObservers import org.mozilla.fenix.BackHandler +import org.mozilla.fenix.DefaultThemeManager import org.mozilla.fenix.R import org.mozilla.fenix.components.FindInPageIntegration import org.mozilla.fenix.ext.requireComponents @@ -57,6 +59,7 @@ class BrowserFragment : Fragment(), BackHandler { savedInstanceState: Bundle? ): View? { val view = inflater.inflate(R.layout.fragment_browser, container, false) + toolbarComponent = ToolbarComponent( view.browserLayout, ActionBusFactory.get(this), @@ -64,7 +67,8 @@ class BrowserFragment : Fragment(), BackHandler { ) toolbarComponent.uiView.view.apply { - setBackgroundColor(ContextCompat.getColor(view.context, R.color.offwhite)) + setBackgroundColor(ContextCompat.getColor(view.context, + DefaultThemeManager.resolveAttribute(R.attr.browserToolbarBackground, context))) (layoutParams as CoordinatorLayout.LayoutParams).apply { // Stop toolbar from collapsing if TalkBack is enabled @@ -200,6 +204,11 @@ class BrowserFragment : Fragment(), BackHandler { is ToolbarMenu.Item.RequestDesktop -> sessionUseCases.requestDesktopSite.invoke(action.item.isChecked) is ToolbarMenu.Item.Share -> requireComponents.core.sessionManager .selectedSession?.url?.apply { requireContext().share(this) } + is ToolbarMenu.Item.NewPrivateTab -> { + PreferenceManager.getDefaultSharedPreferences(context) + .edit().putBoolean(context!!.getString(R.string.pref_key_private_mode), + !PreferenceManager.getDefaultSharedPreferences(context) + .getBoolean(context!!.getString(R.string.pref_key_private_mode), false)).apply() } is ToolbarMenu.Item.ReportIssue -> requireComponents.core.sessionManager .selectedSession?.url?.apply { val reportUrl = String.format(REPORT_SITE_ISSUE_URL, this) diff --git a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt index 67b5369ce..fb5b575a9 100644 --- a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt @@ -13,11 +13,15 @@ import android.view.ViewGroup import androidx.constraintlayout.motion.widget.MotionLayout import androidx.fragment.app.Fragment import androidx.navigation.Navigation +import kotlinx.android.synthetic.main.fragment_home.* import kotlinx.android.synthetic.main.fragment_home.view.* +import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.R +import org.mozilla.fenix.ThemeManager import org.mozilla.fenix.ext.requireComponents import org.mozilla.fenix.home.sessions.SessionsComponent import org.mozilla.fenix.home.sessions.layoutComponents +import org.mozilla.fenix.isPrivate import org.mozilla.fenix.mvi.ActionBusFactory import kotlin.math.roundToInt @@ -80,6 +84,23 @@ class HomeFragment : Fragment() { } override fun onTransitionCompleted(p0: MotionLayout?, p1: Int) { } }) + + view.toolbar_wrapper.isPrivateModeEnabled = (requireActivity() as HomeActivity) + .themeManager + .currentTheme + .isPrivate() + + privateBrowsingButton.setOnClickListener { + // When we build out private mode we will want to handle this logic elsewhere. + (requireActivity() as HomeActivity).themeManager.apply { + val newTheme = when (this.currentTheme) { + ThemeManager.Theme.Light -> ThemeManager.Theme.Private + ThemeManager.Theme.Private -> ThemeManager.Theme.Light + } + + setTheme(newTheme) + } + } } @SuppressWarnings("MagicNumber") diff --git a/app/src/main/java/org/mozilla/fenix/home/SearchView.kt b/app/src/main/java/org/mozilla/fenix/home/SearchView.kt index b348d78c5..5f96eef2a 100644 --- a/app/src/main/java/org/mozilla/fenix/home/SearchView.kt +++ b/app/src/main/java/org/mozilla/fenix/home/SearchView.kt @@ -11,31 +11,60 @@ import android.widget.FrameLayout import org.mozilla.fenix.R class SearchView(context: Context, attrs: AttributeSet) : FrameLayout(context, attrs) { + + var isPrivateModeEnabled = false + private val lightDrawable = resources.getDrawable(R.drawable.home_search_background_light) + private val privateLightDrawable = resources.getDrawable(R.drawable.home_search_background_private) private val darkDrawable = resources.getDrawable(R.drawable.home_search_background_dark) + private val privateDarkDrawable = resources.getDrawable(R.drawable.home_search_background_private_dark) private val darkNoBorderDrawable = resources.getDrawable(R.drawable.home_search_background_dark_no_border) + private val privateDarkNoBorderDrawable = + resources.getDrawable(R.drawable.home_search_background_private_dark_no_border) private val lightToDark = TransitionDrawable(arrayOf(lightDrawable, darkDrawable)) private val darkToNoBorder = TransitionDrawable(arrayOf(darkDrawable, darkNoBorderDrawable)) + private val privateLightToDark = TransitionDrawable(arrayOf(privateLightDrawable, privateDarkDrawable)) + private val privateDarkToNoBorder = TransitionDrawable(arrayOf(privateDarkDrawable, privateDarkNoBorderDrawable)) fun transitionToLight() { - background = lightToDark - lightToDark.reverseTransition(transitionDurationMs) + if (isPrivateModeEnabled) { + background = privateLightToDark + privateLightToDark.reverseTransition(transitionDurationMs) + } else { + background = lightToDark + lightToDark.reverseTransition(transitionDurationMs) + } } fun transitionToDark() { - background = lightToDark - lightToDark.startTransition(transitionDurationMs) + if (isPrivateModeEnabled) { + background = privateLightToDark + privateLightToDark.startTransition(transitionDurationMs) + } else { + background = lightToDark + lightToDark.startTransition(transitionDurationMs) + } } fun transitionToDarkFromNoBorder() { - background = darkToNoBorder - darkToNoBorder.reverseTransition(transitionDurationMs) + if (isPrivateModeEnabled) { + background = privateDarkToNoBorder + privateDarkToNoBorder.reverseTransition(transitionDurationMs) + } else { + background = darkToNoBorder + darkToNoBorder.reverseTransition(transitionDurationMs) + } } fun transitionToDarkNoBorder() { - background = darkToNoBorder - darkToNoBorder.startTransition(transitionDurationMs) + if (isPrivateModeEnabled) { + background = privateDarkToNoBorder + privateDarkToNoBorder.startTransition(transitionDurationMs) + } else { + background = darkToNoBorder + darkToNoBorder.startTransition(transitionDurationMs) + } } companion object { diff --git a/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarComponent.kt b/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarComponent.kt index ff3fbc63d..7a2baa1ce 100644 --- a/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarComponent.kt +++ b/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarComponent.kt @@ -5,6 +5,11 @@ package org.mozilla.fenix.search.toolbar import android.view.ViewGroup +import androidx.core.content.ContextCompat +import kotlinx.android.synthetic.main.component_search.* +import mozilla.components.browser.toolbar.BrowserToolbar +import org.mozilla.fenix.DefaultThemeManager +import org.mozilla.fenix.R import org.mozilla.fenix.mvi.Action import org.mozilla.fenix.mvi.ActionBusFactory import org.mozilla.fenix.mvi.Change @@ -31,6 +36,16 @@ class ToolbarComponent( override fun initView() = ToolbarUIView(container, actionEmitter, changesObservable) init { render(reducer) + applyTheme() + } + + fun getView(): BrowserToolbar = uiView.toolbar + + private fun applyTheme() { + getView().textColor = ContextCompat.getColor(container.context, + DefaultThemeManager.resolveAttribute(R.attr.awesomeBarTitleTextColor, container.context)) + getView().hintColor = ContextCompat.getColor(container.context, + DefaultThemeManager.resolveAttribute(R.attr.awesomeBarDescriptionTextColor, container.context)) } } diff --git a/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarIntegration.kt b/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarIntegration.kt index c2f74bbc1..4b80ff08b 100644 --- a/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarIntegration.kt +++ b/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarIntegration.kt @@ -16,6 +16,7 @@ import mozilla.components.browser.toolbar.BrowserToolbar import mozilla.components.concept.storage.HistoryStorage import mozilla.components.feature.toolbar.ToolbarAutocompleteFeature import mozilla.components.feature.toolbar.ToolbarFeature +import org.mozilla.fenix.DefaultThemeManager import org.mozilla.fenix.R import org.mozilla.fenix.ext.application import org.mozilla.fenix.ext.components @@ -33,7 +34,9 @@ class ToolbarIntegration( toolbar.setMenuBuilder(toolbarMenu.menuBuilder) val home = BrowserToolbar.Button( - context.resources.getDrawable(R.drawable.ic_home, context.application.theme), + context.resources + .getDrawable(DefaultThemeManager.resolveAttribute(R.attr.browserToolbarHomeIcon, context), + context.application.theme), context.getString(R.string.browser_home_button), visible = { sessionManager.runWithSession(sessionId) { it.isCustomTabSession().not() } } ) { diff --git a/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarMenu.kt b/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarMenu.kt index 133e41436..085224445 100644 --- a/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarMenu.kt +++ b/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarMenu.kt @@ -10,6 +10,7 @@ import mozilla.components.browser.menu.item.BrowserMenuDivider import mozilla.components.browser.menu.item.BrowserMenuImageText import mozilla.components.browser.menu.item.BrowserMenuItemToolbar import mozilla.components.browser.menu.item.BrowserMenuSwitch +import org.mozilla.fenix.DefaultThemeManager import org.mozilla.fenix.R class ToolbarMenu( @@ -37,7 +38,7 @@ class ToolbarMenu( val menuToolbar by lazy { val back = BrowserMenuItemToolbar.Button( mozilla.components.ui.icons.R.drawable.mozac_ic_back, - iconTintColorResource = R.color.icons, + iconTintColorResource = DefaultThemeManager.resolveAttribute(R.attr.browserToolbarIcons, context), contentDescription = context.getString(R.string.browser_menu_back) ) { onItemTapped.invoke(Item.Back) @@ -45,7 +46,7 @@ class ToolbarMenu( val forward = BrowserMenuItemToolbar.Button( mozilla.components.ui.icons.R.drawable.mozac_ic_forward, - iconTintColorResource = R.color.icons, + iconTintColorResource = DefaultThemeManager.resolveAttribute(R.attr.browserToolbarIcons, context), contentDescription = context.getString(R.string.browser_menu_forward) ) { onItemTapped.invoke(Item.Forward) @@ -53,7 +54,7 @@ class ToolbarMenu( val refresh = BrowserMenuItemToolbar.Button( mozilla.components.ui.icons.R.drawable.mozac_ic_refresh, - iconTintColorResource = R.color.icons, + iconTintColorResource = DefaultThemeManager.resolveAttribute(R.attr.browserToolbarIcons, context), contentDescription = context.getString(R.string.browser_menu_refresh) ) { onItemTapped.invoke(Item.Reload) @@ -68,7 +69,7 @@ class ToolbarMenu( context.getString(R.string.browser_menu_help), R.drawable.ic_help, context.getString(R.string.browser_menu_help), - R.color.icons + DefaultThemeManager.resolveAttribute(R.attr.browserToolbarIcons, context) ) { onItemTapped.invoke(Item.Help) }, @@ -77,7 +78,7 @@ class ToolbarMenu( context.getString(R.string.browser_menu_settings), R.drawable.ic_settings, context.getString(R.string.browser_menu_settings), - R.color.icons + DefaultThemeManager.resolveAttribute(R.attr.browserToolbarIcons, context) ) { onItemTapped.invoke(Item.Settings) }, @@ -86,7 +87,7 @@ class ToolbarMenu( context.getString(R.string.browser_menu_library), R.drawable.ic_library, context.getString(R.string.browser_menu_library), - R.color.icons + DefaultThemeManager.resolveAttribute(R.attr.browserToolbarIcons, context) ) { onItemTapped.invoke(Item.Library) }, @@ -102,7 +103,7 @@ class ToolbarMenu( context.getString(R.string.browser_menu_find_in_page), R.drawable.mozac_ic_search, context.getString(R.string.browser_menu_find_in_page), - R.color.icons + DefaultThemeManager.resolveAttribute(R.attr.browserToolbarIcons, context) ) { onItemTapped.invoke(Item.FindInPage) }, @@ -111,7 +112,7 @@ class ToolbarMenu( context.getString(R.string.browser_menu_private_tab), R.drawable.ic_private_browsing, context.getString(R.string.browser_menu_private_tab), - R.color.icons + DefaultThemeManager.resolveAttribute(R.attr.browserToolbarIcons, context) ) { onItemTapped.invoke(Item.NewPrivateTab) }, @@ -120,7 +121,7 @@ class ToolbarMenu( context.getString(R.string.browser_menu_new_tab), R.drawable.ic_new, context.getString(R.string.browser_menu_new_tab), - R.color.icons + DefaultThemeManager.resolveAttribute(R.attr.browserToolbarIcons, context) ) { onItemTapped.invoke(Item.NewTab) }, @@ -129,7 +130,7 @@ class ToolbarMenu( context.getString(R.string.browser_menu_share), R.drawable.mozac_ic_share, context.getString(R.string.browser_menu_share), - R.color.icons + DefaultThemeManager.resolveAttribute(R.attr.browserToolbarIcons, context) ) { onItemTapped.invoke(Item.Share) }, @@ -138,7 +139,7 @@ class ToolbarMenu( context.getString(R.string.browser_menu_report_issue), R.drawable.ic_report_issues, context.getString(R.string.browser_menu_report_issue), - R.color.icons + DefaultThemeManager.resolveAttribute(R.attr.browserToolbarIcons, context) ) { onItemTapped.invoke(Item.ReportIssue) }, diff --git a/app/src/main/res/drawable-xxxhdpi/ic_logo_wordmark_white.png b/app/src/main/res/drawable-xxxhdpi/ic_logo_wordmark_white.png new file mode 100644 index 000000000..6b11e82ed Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_logo_wordmark_white.png differ diff --git a/app/src/main/res/drawable/home_background_gradient.xml b/app/src/main/res/drawable/home_background_gradient.xml new file mode 100644 index 000000000..41c81cc04 --- /dev/null +++ b/app/src/main/res/drawable/home_background_gradient.xml @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/home_search_background_private.xml b/app/src/main/res/drawable/home_search_background_private.xml new file mode 100644 index 000000000..3fe9a85fc --- /dev/null +++ b/app/src/main/res/drawable/home_search_background_private.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/home_search_background_private_dark.xml b/app/src/main/res/drawable/home_search_background_private_dark.xml new file mode 100644 index 000000000..54a0af3f1 --- /dev/null +++ b/app/src/main/res/drawable/home_search_background_private_dark.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/home_search_background_private_dark_no_border.xml b/app/src/main/res/drawable/home_search_background_private_dark_no_border.xml new file mode 100644 index 000000000..d4f54cb0a --- /dev/null +++ b/app/src/main/res/drawable/home_search_background_private_dark_no_border.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_home_white.xml b/app/src/main/res/drawable/ic_home_white.xml new file mode 100644 index 000000000..bec75dd7c --- /dev/null +++ b/app/src/main/res/drawable/ic_home_white.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_link.xml b/app/src/main/res/drawable/ic_link.xml index 354708ccc..d5ff00a3c 100644 --- a/app/src/main/res/drawable/ic_link.xml +++ b/app/src/main/res/drawable/ic_link.xml @@ -1,3 +1,7 @@ + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/private_browsing_button_white_background.xml b/app/src/main/res/drawable/private_browsing_button_white_background.xml new file mode 100644 index 000000000..86a28894f --- /dev/null +++ b/app/src/main/res/drawable/private_browsing_button_white_background.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/rounded_button.xml b/app/src/main/res/drawable/rounded_button.xml new file mode 100644 index 000000000..f37577ee9 --- /dev/null +++ b/app/src/main/res/drawable/rounded_button.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/component_awesomebar.xml b/app/src/main/res/layout/component_awesomebar.xml index 808bcc899..51433a8d8 100644 --- a/app/src/main/res/layout/component_awesomebar.xml +++ b/app/src/main/res/layout/component_awesomebar.xml @@ -15,7 +15,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toTopOf="@id/pill_wrapper" - mozac:awesomeBarTitleTextColor="#212121" - mozac:awesomeBarDescriptionTextColor="#6b6b6b" - mozac:awesomeBarChipTextColor="#ffffff" - mozac:awesomeBarChipBackgroundColor="#444444" /> \ No newline at end of file + mozac:awesomeBarTitleTextColor="?attr/awesomeBarTitleTextColor" + mozac:awesomeBarDescriptionTextColor="?attr/awesomeBarDescriptionTextColor" + mozac:awesomeBarChipTextColor="@color/offwhite" + mozac:awesomeBarChipBackgroundColor="@color/photonBlue40" /> \ No newline at end of file diff --git a/app/src/main/res/layout/component_search.xml b/app/src/main/res/layout/component_search.xml index 7b3a4185e..895cea060 100644 --- a/app/src/main/res/layout/component_search.xml +++ b/app/src/main/res/layout/component_search.xml @@ -10,6 +10,6 @@ android:clickable="true" android:focusable="true" android:focusableInTouchMode="true" - app:browserToolbarInsecureColor="@color/icons" - app:browserToolbarMenuColor="@color/icons" - app:browserToolbarSecureColor="@color/icons" /> \ No newline at end of file + app:browserToolbarInsecureColor="?attr/browserToolbarIcons" + app:browserToolbarMenuColor="?attr/browserToolbarIcons" + app:browserToolbarSecureColor="?attr/browserToolbarIcons" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_browser.xml b/app/src/main/res/layout/fragment_browser.xml index b440edf88..8b2765248 100644 --- a/app/src/main/res/layout/fragment_browser.xml +++ b/app/src/main/res/layout/fragment_browser.xml @@ -26,10 +26,11 @@ android:layout_height="wrap_content" android:padding="4dp" android:visibility="gone" + android:background="@color/private_browsing_top_gradient" mozac:awesomeBarChipBackgroundColor="#444444" mozac:awesomeBarChipTextColor="#ffffff" - mozac:awesomeBarDescriptionTextColor="#dddddd" - mozac:awesomeBarTitleTextColor="#ffffff" /> + mozac:awesomeBarDescriptionTextColor="?attr/awesomeBarDescriptionTextColor" + mozac:awesomeBarTitleTextColor="?attr/awesomeBarTitleTextColor" /> diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 2ba308cab..b1dab4b29 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -8,6 +8,7 @@ android:id="@+id/homeLayout" android:layout_width="match_parent" android:layout_height="match_parent" + android:background="?attr/homeBackgroundGradient" app:layoutDescription="@xml/home_scene" tools:context=".home.HomeFragment"> @@ -18,6 +19,7 @@ android:layout_marginTop="16dp" android:background="?android:attr/selectableItemBackgroundBorderless" android:src="@drawable/ic_menu" + android:tint="?attr/menuButtonTint" android:contentDescription="@string/content_description_menu" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -26,7 +28,7 @@ android:id="@+id/privateBrowsingButton" android:layout_width="@dimen/glyph_button_height" android:layout_height="@dimen/glyph_button_height" - android:background="?android:attr/selectableItemBackgroundBorderless" + android:background="?attr/privateBrowsingButtonBackground" android:src="@drawable/ic_private_browsing" android:contentDescription="@string/content_description_private_browsing_button" app:layout_constraintEnd_toStartOf="@id/menuButton" @@ -38,7 +40,7 @@ android:layout_height="wrap_content" android:layout_marginStart="16dp" android:layout_marginTop="42dp" - android:src="@drawable/ic_logo_wordmark" + android:src="?attr/fenixLogo" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/menuButton" /> @@ -50,7 +52,7 @@ android:layout_marginTop="64dp" android:layout_marginStart="16dp" android:elevation="@dimen/toolbar_elevation" - android:background="@drawable/home_search_background_light" + android:background="?attr/toolbarWrapperBackground" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/wordmark"> @@ -68,7 +70,7 @@ android:focusable="true" android:gravity="center_vertical" android:text="@string/search_hint" - android:textColor="@color/searchText" + android:textColor="?attr/toolbarTextColor" android:textSize="14sp" /> diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_search.xml index d52f651ec..fe85de3ea 100644 --- a/app/src/main/res/layout/fragment_search.xml +++ b/app/src/main/res/layout/fragment_search.xml @@ -5,11 +5,11 @@ + android:id="@+id/search_layout" + android:background="?attr/searchBackground"> + android:layout_marginEnd="8dp" + android:textColor="?attr/searchShortcutsTextColor" + android:background="?attr/pillWrapperBackground" + android:drawableTint="?attr/searchShortcutsTextColor"/>