* Closes #505: Themes autocomplete highlight * Add Autocomplete highlight color * Re-add getView fun which is used elsewhere in master * Remove Test imports that aren't foundmaster
parent
9d3ef76929
commit
000a2236a2
|
@ -29,6 +29,8 @@ class ToolbarComponent(
|
||||||
bus.getSafeManagedObservable(SearchChange::class.java)
|
bus.getSafeManagedObservable(SearchChange::class.java)
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
fun getView(): BrowserToolbar = uiView.toolbar
|
||||||
|
|
||||||
override val reducer: Reducer<SearchState, SearchChange> = { state, change ->
|
override val reducer: Reducer<SearchState, SearchChange> = { state, change ->
|
||||||
when (change) {
|
when (change) {
|
||||||
is SearchChange.QueryChanged -> state.copy(query = change.query)
|
is SearchChange.QueryChanged -> state.copy(query = change.query)
|
||||||
|
@ -36,18 +38,25 @@ class ToolbarComponent(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initView() = ToolbarUIView(sessionId, isPrivate, container, actionEmitter, changesObservable)
|
override fun initView() = ToolbarUIView(sessionId, isPrivate, container, actionEmitter, changesObservable)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
render(reducer)
|
render(reducer)
|
||||||
applyTheme()
|
applyTheme()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getView(): BrowserToolbar = uiView.toolbar
|
|
||||||
|
|
||||||
private fun applyTheme() {
|
private fun applyTheme() {
|
||||||
getView().textColor = ContextCompat.getColor(container.context,
|
getView().suggestionBackgroundColor = ContextCompat.getColor(
|
||||||
DefaultThemeManager.resolveAttribute(R.attr.awesomeBarTitleTextColor, container.context))
|
container.context,
|
||||||
getView().hintColor = ContextCompat.getColor(container.context,
|
DefaultThemeManager.resolveAttribute(R.attr.suggestionBackground, container.context)
|
||||||
DefaultThemeManager.resolveAttribute(R.attr.awesomeBarDescriptionTextColor, container.context))
|
)
|
||||||
|
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)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<attr name="searchBackground" format="reference"/>
|
<attr name="searchBackground" format="reference"/>
|
||||||
<attr name="searchShortcutsTextColor" format="reference"/>
|
<attr name="searchShortcutsTextColor" format="reference"/>
|
||||||
<attr name="pillWrapperBackground" format="reference"/>
|
<attr name="pillWrapperBackground" format="reference"/>
|
||||||
|
<attr name="suggestionBackground" format="reference"/>
|
||||||
|
|
||||||
<!-- Browser fragment -->
|
<!-- Browser fragment -->
|
||||||
<attr name="browserUrlBarBackground" format="reference"/>
|
<attr name="browserUrlBarBackground" format="reference"/>
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
<item name="android:windowBackground">@color/off_white</item>
|
<item name="android:windowBackground">@color/off_white</item>
|
||||||
<item name="iconColor">@color/icons_light_mode</item>
|
<item name="iconColor">@color/icons_light_mode</item>
|
||||||
<item name="toolbarColor">@color/toolbar_light_mode</item>
|
<item name="toolbarColor">@color/toolbar_light_mode</item>
|
||||||
|
<item name="colorPrimary">@color/off_white</item>
|
||||||
|
<item name="colorAccent">@color/session_border_color</item>
|
||||||
|
|
||||||
<!-- Style the navigation bar -->
|
<!-- Style the navigation bar -->
|
||||||
<item name="navigationBarColorHome">@android:color/transparent</item>
|
<item name="navigationBarColorHome">@android:color/transparent</item>
|
||||||
|
@ -36,6 +38,7 @@
|
||||||
<item name="pillWrapperBackground">@color/off_white</item>
|
<item name="pillWrapperBackground">@color/off_white</item>
|
||||||
<item name="awesomeBarTitleTextColor">@color/awesome_bar_title_color</item>
|
<item name="awesomeBarTitleTextColor">@color/awesome_bar_title_color</item>
|
||||||
<item name="awesomeBarDescriptionTextColor">@color/awesome_bar_description_color</item>
|
<item name="awesomeBarDescriptionTextColor">@color/awesome_bar_description_color</item>
|
||||||
|
<item name="suggestionBackground">@color/photonBlue50</item>
|
||||||
|
|
||||||
<!-- Browser fragment colors -->
|
<!-- Browser fragment colors -->
|
||||||
<item name="browserUrlBarBackground">@drawable/home_search_background_dark</item>
|
<item name="browserUrlBarBackground">@drawable/home_search_background_dark</item>
|
||||||
|
@ -56,6 +59,8 @@
|
||||||
<item name="android:windowBackground">@color/private_browsing_top_gradient</item>
|
<item name="android:windowBackground">@color/private_browsing_top_gradient</item>
|
||||||
<item name="iconColor">@color/icons_dark_mode</item>
|
<item name="iconColor">@color/icons_dark_mode</item>
|
||||||
<item name="toolbarColor">@color/toolbar_dark_mode</item>
|
<item name="toolbarColor">@color/toolbar_dark_mode</item>
|
||||||
|
<item name="colorPrimary">@color/private_browsing_primary</item>
|
||||||
|
<item name="colorAccent">@color/private_browsing_primary</item>
|
||||||
|
|
||||||
<!-- Style the navigation bar -->
|
<!-- Style the navigation bar -->
|
||||||
<item name="navigationBarColorHome">@color/private_browsing_bottom_gradient</item>
|
<item name="navigationBarColorHome">@color/private_browsing_bottom_gradient</item>
|
||||||
|
@ -81,6 +86,7 @@
|
||||||
<item name="pillWrapperBackground">@color/private_browsing_top_gradient</item>
|
<item name="pillWrapperBackground">@color/private_browsing_top_gradient</item>
|
||||||
<item name="awesomeBarTitleTextColor">@color/off_white</item>
|
<item name="awesomeBarTitleTextColor">@color/off_white</item>
|
||||||
<item name="awesomeBarDescriptionTextColor">@color/photonGrey40</item>
|
<item name="awesomeBarDescriptionTextColor">@color/photonGrey40</item>
|
||||||
|
<item name="suggestionBackground">@color/private_browsing_primary</item>
|
||||||
|
|
||||||
<!-- Browser fragment colors -->
|
<!-- Browser fragment colors -->
|
||||||
<item name="browserUrlBarBackground">@drawable/home_search_background_private_dark</item>
|
<item name="browserUrlBarBackground">@drawable/home_search_background_private_dark</item>
|
||||||
|
|
Loading…
Reference in New Issue