mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] Fixes https://github.com/mozilla-mobile/fenix/issues/1886: Applies theme to toolbar onResume of library fragment (https://github.com/mozilla-mobile/fenix/pull/1888)
This commit is contained in:
parent
e1376c46f4
commit
82107be429
@ -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!!))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user