Skip to content

Commit

Permalink
Add create milestone button
Browse files Browse the repository at this point in the history
  • Loading branch information
UEvgeniy committed Dec 16, 2017
1 parent 2d6fe3f commit 2c8f445
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

import com.github.mobile.Intents;
import com.github.mobile.R;
Expand Down Expand Up @@ -68,8 +70,18 @@ public boolean onOptionsItemSelected(MenuItem item) {
intent.addFlags(FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
return true;
case R.id.add_ms_menu_item:
//todo change on opening of milestone_create_page
Toast.makeText(this, "open milestone", Toast.LENGTH_SHORT).show();
return true;
default:
return super.onOptionsItemSelected(item);
}
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.milestone, menu);
return true;
}
}
9 changes: 9 additions & 0 deletions app/src/main/res/menu/milestone.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/add_ms_menu_item"
android:icon="@drawable/ic_add_white_24dp"
app:showAsAction="always">
</item>
</menu>

0 comments on commit 2c8f445

Please sign in to comment.