Skip to content

Commit baabf64

Browse files
committed
Fix code style issue
1 parent 35f5e0e commit baabf64

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/main/kotlin/me/proxer/app/MainActivity.kt

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,24 +201,28 @@ class MainActivity : BaseActivity() {
201201
DrawerItem.MANGA -> setFragment(MediaListFragment.newInstance(Category.MANGA), R.string.section_manga)
202202
DrawerItem.LOCAL_MANGA -> setFragment(LocalMangaFragment.newInstance(), R.string.section_local_manga)
203203
DrawerItem.INFO -> setFragment(AboutFragment.newInstance(), R.string.section_info)
204-
DrawerItem.DONATE -> {
205-
startActivity(Intent(Intent.ACTION_VIEW, ProxerUrls.donateWeb(Device.DEFAULT).androidUri()))
206-
}
204+
DrawerItem.DONATE -> showDonationPage()
207205
DrawerItem.SETTINGS -> setFragment(SettingsFragment.newInstance(), R.string.section_settings)
208206
}
209207

210208
private fun handleAccountItemClick(item: AccountItem) = when (item) {
211209
AccountItem.GUEST, AccountItem.LOGIN -> LoginDialog.show(this)
212210
AccountItem.LOGOUT -> LogoutDialog.show(this)
213-
AccountItem.USER -> StorageHelper.user?.let {
214-
drawer.profileImageView.let { view ->
215-
ViewCompat.setTransitionName(view, "profile_image")
216-
217-
ProfileActivity.navigateTo(this, it.id, it.name, it.image,
218-
if (view.drawable != null) view else null)
219-
}
220-
}
211+
AccountItem.USER -> showProfilePage()
221212
AccountItem.NOTIFICATIONS -> NotificationActivity.navigateTo(this)
222213
AccountItem.UCP -> UcpActivity.navigateTo(this)
223214
}
215+
216+
private fun showDonationPage() {
217+
startActivity(Intent(Intent.ACTION_VIEW, ProxerUrls.donateWeb(Device.DEFAULT).androidUri()))
218+
}
219+
220+
private fun showProfilePage() = StorageHelper.user?.let {
221+
drawer.profileImageView.let { view ->
222+
ViewCompat.setTransitionName(view, "profile_image")
223+
224+
ProfileActivity.navigateTo(this, it.id, it.name, it.image,
225+
if (view.drawable != null) view else null)
226+
}
227+
}
224228
}

0 commit comments

Comments
 (0)