Skip to content

Commit

Permalink
Clear unneeded menu items (and menus)
Browse files Browse the repository at this point in the history
suggested in #74
  • Loading branch information
renyuneyun committed Mar 28, 2018
1 parent 20387fd commit e6721db
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 40 deletions.
6 changes: 0 additions & 6 deletions app/src/main/java/ryey/easer/core/ui/OutlineFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();

if (id == R.id.action_about) {
Intent intent = new Intent(getActivity(), AboutActivity.class);
startActivity(intent);
return true;
}

if (id == R.id.action_start) {
EHService.start(getActivity());
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import android.support.v4.app.ListFragment;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
Expand Down Expand Up @@ -43,7 +42,6 @@ public void onAttach(Context context) {
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setHasOptionsMenu(true);
registerForContextMenu(getListView());

// mStorage = ProfileDataStorage.getInstance(getActivity());
Expand Down Expand Up @@ -80,24 +78,6 @@ public void onListItemClick(ListView l, View v, int position, long id) {
beginEditData(name);
}

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu.clear();
inflater.inflate(R.menu.list_options, menu);
super.onCreateOptionsMenu(menu, inflater);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch (id) {
case R.id.action_add:
beginNewData();
return true;
}
return super.onOptionsItemSelected(item);
}

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/menu/list_options.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/menu/outline.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_about"
android:orderInCategory="100"
android:title="@string/title_about"
app:showAsAction="never" />
<item
android:id="@+id/action_start"
android:title="@string/menu_start" />
Expand Down

0 comments on commit e6721db

Please sign in to comment.