From a2671dfd2a7f4d7057a9de6ba393fdbb735b55af Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Mon, 1 Apr 2019 20:23:09 +0200 Subject: [PATCH] Fix shadow from AppBar (#566) - Create value elevation - Implement elevation in toolbars --- app/src/main/java/mozilla/lockbox/view/BackableFragment.kt | 1 + app/src/main/java/mozilla/lockbox/view/FxALoginFragment.kt | 1 + app/src/main/java/mozilla/lockbox/view/ItemListFragment.kt | 1 + app/src/main/res/values/dimens.xml | 1 + 4 files changed, 4 insertions(+) diff --git a/app/src/main/java/mozilla/lockbox/view/BackableFragment.kt b/app/src/main/java/mozilla/lockbox/view/BackableFragment.kt index a583920aa..8e7743cbe 100644 --- a/app/src/main/java/mozilla/lockbox/view/BackableFragment.kt +++ b/app/src/main/java/mozilla/lockbox/view/BackableFragment.kt @@ -20,6 +20,7 @@ open class BackableFragment : Fragment(), BackableView { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { navController = requireActivity().findNavController(R.id.fragment_nav_host) view.toolbar.setupWithNavController(navController) + view.toolbar.elevation = resources.getDimension(R.dimen.toolbar_elevation) view.toolbar.setNavigationIcon(R.drawable.ic_arrow_back) view.toolbar.setNavigationContentDescription(R.string.backable_description) diff --git a/app/src/main/java/mozilla/lockbox/view/FxALoginFragment.kt b/app/src/main/java/mozilla/lockbox/view/FxALoginFragment.kt index 0e799abfc..3f958abe7 100644 --- a/app/src/main/java/mozilla/lockbox/view/FxALoginFragment.kt +++ b/app/src/main/java/mozilla/lockbox/view/FxALoginFragment.kt @@ -54,6 +54,7 @@ class FxALoginFragment : BackableFragment(), FxALoginView { skipFxA.visibility = View.GONE } view.toolbar.setNavigationIcon(R.drawable.ic_close) + view.toolbar.elevation = resources.getDimension(R.dimen.toolbar_elevation) } override fun loadURL(url: String) { diff --git a/app/src/main/java/mozilla/lockbox/view/ItemListFragment.kt b/app/src/main/java/mozilla/lockbox/view/ItemListFragment.kt index f1cf44e5d..bd415201a 100644 --- a/app/src/main/java/mozilla/lockbox/view/ItemListFragment.kt +++ b/app/src/main/java/mozilla/lockbox/view/ItemListFragment.kt @@ -127,6 +127,7 @@ class ItemListFragment : Fragment(), ItemListView { private fun setupToolbar(toolbar: Toolbar, drawerLayout: DrawerLayout) { toolbar.navigationIcon = resources.getDrawable(R.drawable.ic_menu, null) toolbar.setNavigationContentDescription(R.string.menu_description) + toolbar.elevation = resources.getDimension(R.dimen.toolbar_elevation) toolbar.navigationClicks().subscribe { drawerLayout.openDrawer(GravityCompat.START) } .addTo(compositeDisposable) } diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 2f92f5641..a736a091e 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -15,4 +15,5 @@ 0px 96dp 40dp + 4dp