1
0
Fork 0

Closes #2340. Set navigation icon color on library screen. (#2415)

Applying color filter to `toolbar.navigationIcon`.
master
Denys M 2019-05-11 04:24:56 +03:00 committed by Colin Lee
parent 744f1be0a9
commit fd56b1fef3
1 changed files with 10 additions and 2 deletions

View File

@ -4,6 +4,8 @@
package org.mozilla.fenix.library
import android.graphics.PorterDuff
import android.graphics.PorterDuffColorFilter
import android.os.Bundle
import android.view.LayoutInflater
import android.view.Menu
@ -78,7 +80,13 @@ class LibraryFragment : Fragment() {
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!!))
val backgroundColor = R.attr.foundation.getColorFromAttr(context!!)
val foregroundColor = R.attr.primaryText.getColorFromAttr(context!!)
toolbar.setBackgroundColor(backgroundColor)
toolbar.setTitleTextColor(foregroundColor)
toolbar.navigationIcon?.colorFilter =
PorterDuffColorFilter(foregroundColor, PorterDuff.Mode.SRC_IN)
}
}