Fix click of nearby list menu item (#2399)

This commit is contained in:
Vivek Maskara 2019-02-03 02:13:35 +05:30 committed by GitHub
parent 1b62ac4d2d
commit fb5a40bba5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,7 +290,9 @@ public class MainActivity extends AuthenticatedActivity implements FragmentManag
notificationsMenuItem = menu.findItem(R.id.notifications); notificationsMenuItem = menu.findItem(R.id.notifications);
final View notification = notificationsMenuItem.getActionView(); final View notification = notificationsMenuItem.getActionView();
notificationCount = notification.findViewById(R.id.notification_count_badge); notificationCount = notification.findViewById(R.id.notification_count_badge);
notification.setOnClickListener(view -> NotificationActivity.startYourself(MainActivity.this)); notification.setOnClickListener(view -> {
NotificationActivity.startYourself(MainActivity.this);
});
this.menu = menu; this.menu = menu;
updateMenuItem(); updateMenuItem();
setNotificationCount(); setNotificationCount();
@ -343,7 +345,7 @@ public class MainActivity extends AuthenticatedActivity implements FragmentManag
// Starts notification activity on click to notification icon // Starts notification activity on click to notification icon
NotificationActivity.startYourself(this); NotificationActivity.startYourself(this);
return true; return true;
case R.id.list_sheet:NotificationActivity.startYourself(this); case R.id.list_sheet:
if (contributionsActivityPagerAdapter.getItem(1) != null) { if (contributionsActivityPagerAdapter.getItem(1) != null) {
((NearbyFragment)contributionsActivityPagerAdapter.getItem(1)).listOptionMenuIteClicked(); ((NearbyFragment)contributionsActivityPagerAdapter.getItem(1)).listOptionMenuIteClicked();
} }