@@ -201,24 +201,28 @@ class MainActivity : BaseActivity() {
201
201
DrawerItem .MANGA -> setFragment(MediaListFragment .newInstance(Category .MANGA ), R .string.section_manga)
202
202
DrawerItem .LOCAL_MANGA -> setFragment(LocalMangaFragment .newInstance(), R .string.section_local_manga)
203
203
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()
207
205
DrawerItem .SETTINGS -> setFragment(SettingsFragment .newInstance(), R .string.section_settings)
208
206
}
209
207
210
208
private fun handleAccountItemClick (item : AccountItem ) = when (item) {
211
209
AccountItem .GUEST , AccountItem .LOGIN -> LoginDialog .show(this )
212
210
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()
221
212
AccountItem .NOTIFICATIONS -> NotificationActivity .navigateTo(this )
222
213
AccountItem .UCP -> UcpActivity .navigateTo(this )
223
214
}
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
+ }
224
228
}
0 commit comments