Commit 3a027266 authored by Eugene Shapovalov's avatar Eugene Shapovalov 💬

Fix crash Toolbar.setElevation in ProjectFragment.

parent 67f06a41
package ru.terrakok.gitlabclient.ui.project
import android.os.Bundle
import android.support.v4.view.ViewCompat
import android.util.TypedValue
import com.aurelhubert.ahbottomnavigation.AHBottomNavigationAdapter
import kotlinx.android.synthetic.main.fragment_project.*
......@@ -91,13 +92,12 @@ class ProjectFragment : BaseFragment(), ProjectInfoFragment.ProjectInfoToolbar {
private fun setToolbarElevation(tab: String) {
if (tab == Screens.PROJECT_INFO_SCREEN) {
toolbar.elevation = TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP,
8f,
resources.displayMetrics
ViewCompat.setElevation(
toolbar,
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8f, resources.displayMetrics)
)
} else {
toolbar.elevation = 0f
ViewCompat.setElevation(toolbar, 0f)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment