Skip to content

Commit

Permalink
refactor in home fragment and activity
Browse files Browse the repository at this point in the history
  • Loading branch information
NiranjanNlc committed Jan 28, 2024
1 parent c4faf36 commit 4033eae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

<activity
android:name="org.mifos.mobile.ui.activities.HomeActivity"
android:configChanges="screenLayout|screenSize|orientation|uiMode"
android:configChanges="screenLayout|screenSize|orientation"
android:label="@string/home"
android:windowSoftInputMode="adjustResize" />
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class HomeActivity :

override fun onResume() {
super.onResume()
viewModel.userImage
if (!isReceiverRegistered) {
LocalBroadcastManager.getInstance(this).registerReceiver(
registerReceiver,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class HomeOldFragment : BaseFragment(), OnRefreshListener {
): View {
_binding = FragmentHomeOldBinding.inflate(inflater, container, false)
val rootView = binding.root
setUpUi(savedInstanceState)
return rootView
}

private fun HomeOldFragment.setUpUi(savedInstanceState: Bundle?) {
clientId = preferencesHelper?.clientId
setHasOptionsMenu(true)
binding.swipeHomeContainer.setColorSchemeResources(
Expand All @@ -79,7 +84,6 @@ class HomeOldFragment : BaseFragment(), OnRefreshListener {
}
setToolbarTitle(getString(R.string.home))
showUserInterface()
return rootView
}

private val notificationReceiver: BroadcastReceiver = object : BroadcastReceiver() {
Expand Down Expand Up @@ -108,6 +112,7 @@ class HomeOldFragment : BaseFragment(), OnRefreshListener {
override fun onResume() {
super.onResume()
registerReceiver()
viewModel.userImage
activity?.invalidateOptionsMenu()
}

Expand Down

0 comments on commit 4033eae

Please sign in to comment.