add a Save button to events
This commit is contained in:
parent
2cb67b128d
commit
6a014a99df
|
@ -5,6 +5,8 @@ import android.app.TimePickerDialog;
|
|||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.TextView;
|
||||
|
@ -52,6 +54,27 @@ public class EventActivity extends AppCompatActivity {
|
|||
updateEndTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.menu_event, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.save:
|
||||
saveEvent();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
private void saveEvent() {
|
||||
|
||||
}
|
||||
|
||||
private void updateStartDate() {
|
||||
mStartDate.setText(Formatter.getEventDate(mEventStartDateTime));
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<?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/save"
|
||||
android:icon="@mipmap/check"
|
||||
android:title="@string/save"
|
||||
app:showAsAction="ifRoom"/>
|
||||
</menu>
|
Binary file not shown.
After Width: | Height: | Size: 181 B |
Binary file not shown.
After Width: | Height: | Size: 137 B |
Binary file not shown.
After Width: | Height: | Size: 199 B |
Binary file not shown.
After Width: | Height: | Size: 276 B |
Binary file not shown.
After Width: | Height: | Size: 308 B |
|
@ -3,6 +3,7 @@
|
|||
|
||||
<!-- Event -->
|
||||
<string name="event">Event</string>
|
||||
<string name="save">Save</string>
|
||||
|
||||
<!-- Details -->
|
||||
<string name="details">Details</string>
|
||||
|
|
Loading…
Reference in New Issue