1
0
Fork 0

Provided unique no tabs message per mode

master
David Walsh 2020-05-28 15:29:38 -05:00 committed by Jeff Boek
parent c9722c65a2
commit a70ba76cc9
2 changed files with 19 additions and 6 deletions

View File

@ -145,13 +145,24 @@ class TabTrayView(
}
fun updateState(state: BrowserState) {
val hasNoTabs = if (isPrivateModeSelected) {
state.privateTabs.isEmpty()
} else {
state.normalTabs.isEmpty()
view.let {
val hasNoTabs = if (isPrivateModeSelected) {
state.privateTabs.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) {

View File

@ -19,6 +19,8 @@
<string name="no_open_tabs_header_2">No open tabs</string>
<!-- No Open Tabs Message Description -->
<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) -->
<string name="about_content">%1$s is produced by Mozilla.</string>