Skip to content

Commit

Permalink
Twelve: MainFragment: Fix nav bar view item position
Browse files Browse the repository at this point in the history
Search item should be ignored with viewpager <-> nav bar

Change-Id: I037822fea64a7170d0fdce350ebc0c7acb649b93
  • Loading branch information
SebaUbuntu committed Nov 26, 2024
1 parent f62295a commit 16e8374
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@ class MainFragment : Fragment(R.layout.fragment_main) {
override fun onPageSelected(position: Int) {
super.onPageSelected(position)

navigationBarView.menu.getItem(position).isChecked = true
var offset = 0

// Search button
if (position >= 1) {
offset += 1
}

navigationBarView.menu.getItem(position + offset).isChecked = true
}
}
}
Expand Down

0 comments on commit 16e8374

Please sign in to comment.