From 26ff8e5bad20a0ad6eab534c1482a5929b0d1c72 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Tue, 19 Sep 2023 22:41:54 +0200 Subject: [PATCH] refactor: Remove unnecessary return type from `handleProfileClick` --- app/src/main/java/app/pachli/MainActivity.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/app/pachli/MainActivity.kt b/app/src/main/java/app/pachli/MainActivity.kt index 4e6af36e8..8414b218b 100644 --- a/app/src/main/java/app/pachli/MainActivity.kt +++ b/app/src/main/java/app/pachli/MainActivity.kt @@ -488,7 +488,10 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje header = AccountHeaderView(this).apply { headerBackgroundScaleType = ImageView.ScaleType.CENTER_CROP currentHiddenInList = true - onAccountHeaderListener = { _: View?, profile: IProfile, current: Boolean -> handleProfileClick(profile, current) } + onAccountHeaderListener = { _: View?, profile: IProfile, current: Boolean -> + handleProfileClick(profile, current) + false + } addProfile( ProfileSettingDrawerItem().apply { identifier = DRAWER_ITEM_ADD_ACCOUNT @@ -854,23 +857,23 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje } } - private fun handleProfileClick(profile: IProfile, current: Boolean): Boolean { + private fun handleProfileClick(profile: IProfile, current: Boolean) { val activeAccount = accountManager.activeAccount // open profile when active image was clicked if (current && activeAccount != null) { val intent = AccountActivity.getIntent(this, activeAccount.accountId) startActivityWithSlideInAnimation(intent) - return false + return } // open LoginActivity to add new account if (profile.identifier == DRAWER_ITEM_ADD_ACCOUNT) { startActivityWithSlideInAnimation(LoginActivity.getIntent(this, LoginActivity.MODE_ADDITIONAL_LOGIN)) - return false + return } // change Account changeAccount(profile.identifier, null) - return false + return } private fun changeAccount(newSelectedId: Long, forward: Intent?) {