Provided unique no tabs message per mode
parent
c9722c65a2
commit
a70ba76cc9
|
@ -145,13 +145,24 @@ class TabTrayView(
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateState(state: BrowserState) {
|
fun updateState(state: BrowserState) {
|
||||||
val hasNoTabs = if (isPrivateModeSelected) {
|
view.let {
|
||||||
state.privateTabs.isEmpty()
|
val hasNoTabs = if (isPrivateModeSelected) {
|
||||||
} else {
|
state.privateTabs.isEmpty()
|
||||||
state.normalTabs.isEmpty()
|
} else {
|
||||||
|
state.normalTabs.isEmpty()
|
||||||
|
}
|
||||||
|
|
||||||
|
view.tab_tray_empty_view.isVisible = hasNoTabs
|
||||||
|
if (hasNoTabs) {
|
||||||
|
view.tab_tray_empty_view.text = if (isPrivateModeSelected) {
|
||||||
|
view.context.getString(R.string.no_private_tabs_description)
|
||||||
|
} else {
|
||||||
|
view.context?.getString(R.string.no_open_tabs_description)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
view.tab_tray_overflow.isVisible = !hasNoTabs
|
||||||
}
|
}
|
||||||
view?.tab_tray_empty_view?.isVisible = hasNoTabs
|
|
||||||
view?.tab_tray_overflow?.isVisible = !hasNoTabs
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onTabClosed(tab: Tab) {
|
override fun onTabClosed(tab: Tab) {
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
<string name="no_open_tabs_header_2">No open tabs</string>
|
<string name="no_open_tabs_header_2">No open tabs</string>
|
||||||
<!-- No Open Tabs Message Description -->
|
<!-- No Open Tabs Message Description -->
|
||||||
<string name="no_open_tabs_description">Your open tabs will be shown here.</string>
|
<string name="no_open_tabs_description">Your open tabs will be shown here.</string>
|
||||||
|
<!-- No Private Tabs Message Description -->
|
||||||
|
<string name="no_private_tabs_description">Your private tabs will be shown here.</string>
|
||||||
|
|
||||||
<!-- About content. The first parameter is the name of the application. (For example: Fenix) -->
|
<!-- About content. The first parameter is the name of the application. (For example: Fenix) -->
|
||||||
<string name="about_content">%1$s is produced by Mozilla.</string>
|
<string name="about_content">%1$s is produced by Mozilla.</string>
|
||||||
|
|
Loading…
Reference in New Issue