2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-09 19:10:42 +00:00

For #1408 - Set Toolbar titles in code (vs in navgraph)

This commit is contained in:
Emily Kager 2019-04-09 15:36:21 -07:00 committed by Jeff Boek
parent 65235d5cf3
commit d7272d29de
8 changed files with 10 additions and 0 deletions

View File

@ -37,6 +37,7 @@ class LibraryFragment : Fragment() {
override fun onResume() {
super.onResume()
(activity as AppCompatActivity).title = getString(R.string.library_title)
(activity as AppCompatActivity).supportActionBar?.show()
}

View File

@ -66,6 +66,7 @@ class BookmarkFragment : Fragment(), CoroutineScope, BackHandler, AccountObserve
override fun onResume() {
super.onResume()
(activity as AppCompatActivity).title = getString(R.string.library_bookmarks)
(activity as AppCompatActivity).supportActionBar?.show()
checkIfSignedIn()
}

View File

@ -54,6 +54,8 @@ class AddBookmarkFolderFragment : Fragment(), CoroutineScope {
override fun onResume() {
super.onResume()
(activity as AppCompatActivity).title =
getString(R.string.bookmark_add_folder_fragment_label)
(activity as AppCompatActivity).supportActionBar?.show()
launch(IO) {

View File

@ -69,6 +69,7 @@ class EditBookmarkFragment : Fragment(), CoroutineScope {
override fun onResume() {
super.onResume()
(activity as? AppCompatActivity)?.title = getString(R.string.edit_bookmark_fragment_title)
(activity as? AppCompatActivity)?.supportActionBar?.show()
guidToEdit = EditBookmarkFragmentArgs.fromBundle(arguments!!).guidToEdit

View File

@ -89,6 +89,8 @@ class SelectBookmarkFolderFragment : Fragment(), CoroutineScope, AccountObserver
override fun onResume() {
super.onResume()
(activity as AppCompatActivity).title =
getString(R.string.bookmark_select_folder_fragment_label)
(activity as AppCompatActivity).supportActionBar?.show()
folderGuid = SelectBookmarkFolderFragmentArgs.fromBundle(arguments!!).folderGuid ?: BookmarkRoot.Root.id

View File

@ -63,6 +63,7 @@ class HistoryFragment : Fragment(), CoroutineScope, BackHandler {
override fun onResume() {
super.onResume()
(activity as AppCompatActivity).title = getString(R.string.library_history)
(activity as AppCompatActivity).supportActionBar?.show()
}

View File

@ -67,6 +67,7 @@ class SettingsFragment : PreferenceFragmentCompat(), CoroutineScope, AccountObse
override fun onResume() {
super.onResume()
(activity as AppCompatActivity).title = getString(R.string.settings_title)
(activity as AppCompatActivity).supportActionBar?.show()
val defaultBrowserPreference =
findPreference<DefaultBrowserPreference>(getString(R.string.pref_key_make_default_browser))

View File

@ -22,6 +22,7 @@ class SitePermissionsFragment : PreferenceFragmentCompat() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
(activity as AppCompatActivity).title = getString(R.string.preferences_site_permissions)
(activity as AppCompatActivity).supportActionBar?.show()
}