AppDetails: Update toolbar again once full app is fetched
This commit is contained in:
@@ -200,7 +200,7 @@ class AppDetailsFragment : BaseFragment<FragmentDetailsBinding>() {
|
|||||||
updateAppHeader(app, false)
|
updateAppHeader(app, false)
|
||||||
|
|
||||||
// Toolbar
|
// Toolbar
|
||||||
attachToolbar(app)
|
updateToolbar(app)
|
||||||
|
|
||||||
// App Details
|
// App Details
|
||||||
viewModel.fetchAppDetails(app.packageName)
|
viewModel.fetchAppDetails(app.packageName)
|
||||||
@@ -216,6 +216,7 @@ class AppDetailsFragment : BaseFragment<FragmentDetailsBinding>() {
|
|||||||
viewModel.fetchUserAppReview(app)
|
viewModel.fetchUserAppReview(app)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateToolbar(app)
|
||||||
updateAppHeader(app) // Re-inflate the app details, as web data may vary.
|
updateAppHeader(app) // Re-inflate the app details, as web data may vary.
|
||||||
updateExtraDetails(app)
|
updateExtraDetails(app)
|
||||||
|
|
||||||
@@ -389,7 +390,7 @@ class AppDetailsFragment : BaseFragment<FragmentDetailsBinding>() {
|
|||||||
super.onResume()
|
super.onResume()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun attachToolbar(app: App) {
|
private fun updateToolbar(app: App) {
|
||||||
binding.layoutDetailsToolbar.toolbar.apply {
|
binding.layoutDetailsToolbar.toolbar.apply {
|
||||||
elevation = 0f
|
elevation = 0f
|
||||||
navigationIcon = ContextCompat.getDrawable(requireContext(), R.drawable.ic_arrow_back)
|
navigationIcon = ContextCompat.getDrawable(requireContext(), R.drawable.ic_arrow_back)
|
||||||
@@ -402,6 +403,9 @@ class AppDetailsFragment : BaseFragment<FragmentDetailsBinding>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear Menu, so that it clears the previous menu items before inflating new ones
|
||||||
|
menu.clear()
|
||||||
|
|
||||||
// Inflate Menu
|
// Inflate Menu
|
||||||
inflateMenu(R.menu.menu_details)
|
inflateMenu(R.menu.menu_details)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user