Skip to content

Commit

Permalink
mozilla-mobile#7700 fixed linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcLeclair committed Jan 29, 2020
1 parent 3f0463c commit 6ae274c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,15 @@ class HomeFragment : Fragment() {
)

if (::sessionControlView.isInitialized) {
if(offSet <= 0 || offSet == 1) {
if (offSet <= 0 || offSet == 1) {
(view.homeAppBar.layoutParams as CoordinatorLayout.LayoutParams)
.behavior = AppBarLayout.Behavior()
val behavior = ((view.homeAppBar.layoutParams as CoordinatorLayout.LayoutParams)
.behavior as AppBarLayout.Behavior)
behavior.topAndBottomOffset = offSet
behavior.onNestedPreScroll(view as CoordinatorLayout, view.homeAppBar,
sessionControlView.view,0 , 1, intArrayOf(2), ViewCompat.TYPE_NON_TOUCH)
sessionControlView.view ,0 , 1 , intArrayOf(2) ,
ViewCompat.TYPE_NON_TOUCH)
} else {
view.homeAppBar.setExpanded(false)
}
Expand All @@ -220,8 +221,6 @@ class HomeFragment : Fragment() {
sessionControlView = SessionControlView(homeFragmentStore,
view.sessionControlRecyclerView, sessionControlInteractor)
activity.themeManager.applyStatusBarTheme(activity)


return view
}

Expand Down Expand Up @@ -454,12 +453,11 @@ class HomeFragment : Fragment() {
hideToolbar()
}

override fun onPause(){
override fun onPause() {
super.onPause()
val rect = Rect()
view!!.findViewById<AppBarLayout>(R.id.homeAppBar).getGlobalVisibleRect(rect);
offSet = rect.height() - view!!.findViewById<AppBarLayout>(R.id.homeAppBar)
.totalScrollRange + 1
view!!.findViewById<AppBarLayout>(R.id.homeAppBar).getGlobalVisibleRect(rect)
offSet = rect.height() - view!!.findViewById<AppBarLayout>(R.id.homeAppBar).totalScrollRange + 1
}

private fun recommendPrivateBrowsingShortcut() {
Expand Down

0 comments on commit 6ae274c

Please sign in to comment.