add a menu button for opening a different note

This commit is contained in:
tibbi 2016-10-01 20:42:00 +02:00
parent 307e2a4eb1
commit 06e074ae6f
12 changed files with 22 additions and 5 deletions

View File

@ -67,6 +67,9 @@ public class MainActivity extends SimpleActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.open_note:
displayOpenNoteDialog();
return true;
case R.id.share:
shareText();
return true;
@ -111,6 +114,10 @@ public class MainActivity extends SimpleActivity {
});
}
private void displayOpenNoteDialog() {
}
private void saveText() {
final String newText = getCurrentNote();
final String oldText = mCurrentNote.getValue();

View File

@ -1,6 +1,11 @@
<?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/open_note"
android:icon="@mipmap/open_note"
android:title="@string/share"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/share"
android:icon="@mipmap/share"

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

View File

@ -13,6 +13,7 @@
<string name="cancel">Cancel</string>
<string name="no_title">Please name your note</string>
<string name="title_taken">A note with that title already exists</string>
<string name="open_note">Open note</string>
<!-- Settings -->
<string name="settings">Einstellungen</string>

View File

@ -13,6 +13,7 @@
<string name="cancel">Cancel</string>
<string name="no_title">Please name your note</string>
<string name="title_taken">A note with that title already exists</string>
<string name="open_note">Open note</string>
<!-- Settings -->
<string name="settings">Impostazioni</string>

View File

@ -13,6 +13,7 @@
<string name="cancel">Cancel</string>
<string name="no_title">Please name your note</string>
<string name="title_taken">A note with that title already exists</string>
<string name="open_note">Open note</string>
<!-- Settings -->
<string name="settings">設定</string>

View File

@ -13,6 +13,7 @@
<string name="cancel">Cancel</string>
<string name="no_title">Please name your note</string>
<string name="title_taken">A note with that title already exists</string>
<string name="open_note">Open note</string>
<!-- Settings -->
<string name="settings">Inställningar</string>

View File

@ -13,6 +13,7 @@
<string name="cancel">Cancel</string>
<string name="no_title">Please name your note</string>
<string name="title_taken">A note with that title already exists</string>
<string name="open_note">Open note</string>
<!-- Settings -->
<string name="settings">Settings</string>