2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00
This commit is contained in:
Sawyer Blatz 2019-04-23 07:23:27 -07:00 committed by GitHub
parent e1376c46f4
commit 82107be429

View File

@ -12,11 +12,13 @@ import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import androidx.navigation.Navigation
import kotlinx.android.synthetic.main.fragment_library.*
import mozilla.appservices.places.BookmarkRoot
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.getColorFromAttr
import org.mozilla.fenix.library.bookmarks.BookmarkFragmentArgs
class LibraryFragment : Fragment() {
@ -36,6 +38,8 @@ class LibraryFragment : Fragment() {
override fun onResume() {
super.onResume()
setToolbarColor()
(activity as AppCompatActivity).title = getString(R.string.library_title)
(activity as AppCompatActivity).supportActionBar?.show()
}
@ -69,4 +73,10 @@ class LibraryFragment : Fragment() {
else -> super.onOptionsItemSelected(item)
}
}
private fun setToolbarColor() {
val toolbar = (activity as AppCompatActivity).findViewById<Toolbar>(R.id.navigationToolbar)
toolbar.setBackgroundColor(R.attr.foundation.getColorFromAttr(context!!))
toolbar.setTitleTextColor(R.attr.primaryText.getColorFromAttr(context!!))
}
}