1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-22 04:12:08 +01:00

Merge extended notifications menu into main menu

This commit is contained in:
Gregor Santner 2017-10-29 11:07:52 +01:00
parent cb811d8236
commit aaa2445bef
No known key found for this signature in database
GPG key ID: 7E83A7834AECB009
3 changed files with 50 additions and 60 deletions

View file

@ -679,6 +679,8 @@ public class MainActivity extends ThemedActivity
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
AppLog.v(this, "onCreateOptionsMenu()"); AppLog.v(this, "onCreateOptionsMenu()");
boolean cache;
//Clear the menus //Clear the menus
menu.clear(); menu.clear();
toolbarBottom.getMenu().clear(); toolbarBottom.getMenu().clear();
@ -691,10 +693,10 @@ public class MainActivity extends ThemedActivity
///Hide bottom _toolbar ///Hide bottom _toolbar
toolbarBottom.setVisibility(View.GONE); toolbarBottom.setVisibility(View.GONE);
} else { } else {
getMenuInflater().inflate(_appSettings.isExtendedNotificationsActivated() ? cache = _appSettings.isExtendedNotificationsActivated();
R.menu.main__menu_top__notifications_dropdown : R.menu.main__menu_top, menu); getMenuInflater().inflate(R.menu.main__menu_top, menu);
getMenuInflater().inflate(R.menu.main__menu_bottom, toolbarBottom.getMenu()); menu.findItem(R.id.action_notifications).setVisible(!cache);
top.onCreateBottomOptionsMenu(toolbarBottom.getMenu(), getMenuInflater()); menu.findItem(R.id.action_notifications_extended).setVisible(cache);
} }
} }
return true; return true;

View file

@ -10,6 +10,50 @@
android:orderInCategory="100" android:orderInCategory="100"
android:title="@string/notifications" android:title="@string/notifications"
app:showAsAction="always" /> app:showAsAction="always" />
<item
android:id="@+id/action_notifications_extended"
android:icon="@drawable/ic_notifications_white_48px__layer"
android:orderInCategory="100"
android:title="@string/notifications"
app:showAsAction="always">
<menu>
<item
android:id="@+id/action_notifications_all"
android:icon="@drawable/ic_dashboard_black_48px"
android:title="@string/notifications__all" />
<item
android:id="@+id/action_notifications_also_commented"
android:icon="@drawable/ic_question_answer_black_48px"
android:title="@string/notifications__also_commented" />
<item
android:id="@+id/action_notifications_comment_on_post"
android:icon="@drawable/ic_comment_black_48px"
android:title="@string/notifications__comment_on_post" />
<item
android:id="@+id/action_notifications_liked"
android:icon="@drawable/ic_thumb_up_black_48px"
android:title="@string/notifications__liked" />
<item
android:id="@+id/action_notifications_mentioned"
android:icon="@drawable/ic_person_pin_black_48px"
android:title="@string/notifications__mentioned" />
<item
android:id="@+id/action_notifications_reshared"
android:icon="@drawable/ic_repeat_black_48px"
android:title="@string/notifications__reshared" />
<item
android:id="@+id/action_notifications_started_sharing"
android:icon="@drawable/ic_person_add_black_48px"
android:title="@string/notifications__started_sharing" />
</menu>
</item>
<item <item
android:id="@+id/action_conversations" android:id="@+id/action_conversations"
android:icon="@drawable/ic_mail_white_48px__layer" android:icon="@drawable/ic_mail_white_48px__layer"

View file

@ -1,56 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.github.dfa.diaspora_android22.activity.MainActivity"
tools:ignore="AlwaysShowAction">
<item
android:id="@+id/action_notifications"
android:icon="@drawable/ic_notifications_white_48px__layer"
android:orderInCategory="100"
android:title="@string/notifications"
app:showAsAction="always">
<menu>
<item
android:id="@+id/action_notifications_all"
android:icon="@drawable/ic_dashboard_black_48px"
android:title="@string/notifications__all" />
<item
android:id="@+id/action_notifications_also_commented"
android:icon="@drawable/ic_question_answer_black_48px"
android:title="@string/notifications__also_commented" />
<item
android:id="@+id/action_notifications_comment_on_post"
android:icon="@drawable/ic_comment_black_48px"
android:title="@string/notifications__comment_on_post" />
<item
android:id="@+id/action_notifications_liked"
android:icon="@drawable/ic_thumb_up_black_48px"
android:title="@string/notifications__liked" />
<item
android:id="@+id/action_notifications_mentioned"
android:icon="@drawable/ic_person_pin_black_48px"
android:title="@string/notifications__mentioned" />
<item
android:id="@+id/action_notifications_reshared"
android:icon="@drawable/ic_repeat_black_48px"
android:title="@string/notifications__reshared" />
<item
android:id="@+id/action_notifications_started_sharing"
android:icon="@drawable/ic_person_add_black_48px"
android:title="@string/notifications__started_sharing" />
</menu>
</item>
<item
android:id="@+id/action_conversations"
android:icon="@drawable/ic_mail_white_48px__layer"
android:orderInCategory="200"
android:title="@string/conversations"
app:showAsAction="always" />
</menu>