Skip to content

Commit

Permalink
fix: wrong title name in fragments (#1936)
Browse files Browse the repository at this point in the history
Details:
- This is just a dirty fix. The cause of the issue is due to methods (onCreate(), onCreateView(),...) of the fragment in backstack is somehow called.

Fixes: #1896
  • Loading branch information
anhanh11001 authored and iamareebjamal committed Jun 9, 2019
1 parent f8c59e3 commit 399c445
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class FavoriteFragment : Fragment() {
rootView.favoriteEventsRecycler.layoutManager = LinearLayoutManager(activity)
rootView.favoriteEventsRecycler.adapter = favoriteEventsRecyclerAdapter
rootView.favoriteEventsRecycler.isNestedScrollingEnabled = false
setToolbar(activity, getString(R.string.likes), false)
rootView.viewTreeObserver.addOnDrawListener {
setStartPostponedEnterTransition()
}
Expand Down Expand Up @@ -136,6 +135,11 @@ class FavoriteFragment : Fragment() {
}
}

override fun onResume() {
super.onResume()
setToolbar(activity, getString(R.string.likes), false)
}

private fun showEmptyMessage(itemCount: Int) {
noLikedLL.isVisible = (itemCount == 0)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ class SearchResultsFragment : Fragment(), CompoundButton.OnCheckedChangeListener
setPostponeSharedElementTransition()

setChips()
setToolbar(activity, getString(R.string.search_results))
setHasOptionsMenu(true)

rootView.eventsRecycler.layoutManager = LinearLayoutManager(context)

Expand Down Expand Up @@ -185,6 +183,12 @@ class SearchResultsFragment : Fragment(), CompoundButton.OnCheckedChangeListener
rootView.chipGroup.addView(chip)
}

override fun onResume() {
super.onResume()
setToolbar(activity, getString(R.string.search_results))
setHasOptionsMenu(true)
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val eventClickListener: EventClickListener = object : EventClickListener {
Expand Down

0 comments on commit 399c445

Please sign in to comment.