Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
Fix shadow from AppBar (#566)
Browse files Browse the repository at this point in the history
- Create value elevation
- Implement elevation in toolbars
  • Loading branch information
deandreamatias authored and sashei committed Apr 1, 2019
1 parent 4fbebf0 commit a2671df
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/mozilla/lockbox/view/BackableFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/mozilla/lockbox/view/FxALoginFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/mozilla/lockbox/view/ItemListFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
<dimen name="hidden_network_error">0px</dimen>
<dimen name="network_error_with_toolbar">96dp</dimen>
<dimen name="network_error">40dp</dimen>
<dimen name="toolbar_elevation">4dp</dimen>
</resources>

0 comments on commit a2671df

Please sign in to comment.