mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-20 18:27:26 +02:00
add a menu button for opening a different note
This commit is contained in:
parent
307e2a4eb1
commit
06e074ae6f
@ -67,6 +67,9 @@ public class MainActivity extends SimpleActivity {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
|
case R.id.open_note:
|
||||||
|
displayOpenNoteDialog();
|
||||||
|
return true;
|
||||||
case R.id.share:
|
case R.id.share:
|
||||||
shareText();
|
shareText();
|
||||||
return true;
|
return true;
|
||||||
@ -111,6 +114,10 @@ public class MainActivity extends SimpleActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void displayOpenNoteDialog() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void saveText() {
|
private void saveText() {
|
||||||
final String newText = getCurrentNote();
|
final String newText = getCurrentNote();
|
||||||
final String oldText = mCurrentNote.getValue();
|
final String oldText = mCurrentNote.getValue();
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
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
|
<item
|
||||||
android:id="@+id/share"
|
android:id="@+id/share"
|
||||||
android:icon="@mipmap/share"
|
android:icon="@mipmap/share"
|
||||||
|
BIN
app/src/main/res/mipmap-hdpi/open_note.png
Normal file
BIN
app/src/main/res/mipmap-hdpi/open_note.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 271 B |
BIN
app/src/main/res/mipmap-mdpi/open_note.png
Normal file
BIN
app/src/main/res/mipmap-mdpi/open_note.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 201 B |
BIN
app/src/main/res/mipmap-xhdpi/open_note.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/open_note.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 336 B |
BIN
app/src/main/res/mipmap-xxhdpi/open_note.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/open_note.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 550 B |
BIN
app/src/main/res/mipmap-xxxhdpi/open_note.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/open_note.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 334 B |
@ -13,6 +13,7 @@
|
|||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="no_title">Please name your note</string>
|
<string name="no_title">Please name your note</string>
|
||||||
<string name="title_taken">A note with that title already exists</string>
|
<string name="title_taken">A note with that title already exists</string>
|
||||||
|
<string name="open_note">Open note</string>
|
||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="settings">Einstellungen</string>
|
<string name="settings">Einstellungen</string>
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="no_title">Please name your note</string>
|
<string name="no_title">Please name your note</string>
|
||||||
<string name="title_taken">A note with that title already exists</string>
|
<string name="title_taken">A note with that title already exists</string>
|
||||||
|
<string name="open_note">Open note</string>
|
||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="settings">Impostazioni</string>
|
<string name="settings">Impostazioni</string>
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="no_title">Please name your note</string>
|
<string name="no_title">Please name your note</string>
|
||||||
<string name="title_taken">A note with that title already exists</string>
|
<string name="title_taken">A note with that title already exists</string>
|
||||||
|
<string name="open_note">Open note</string>
|
||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="settings">設定</string>
|
<string name="settings">設定</string>
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="no_title">Please name your note</string>
|
<string name="no_title">Please name your note</string>
|
||||||
<string name="title_taken">A note with that title already exists</string>
|
<string name="title_taken">A note with that title already exists</string>
|
||||||
|
<string name="open_note">Open note</string>
|
||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="settings">Inställningar</string>
|
<string name="settings">Inställningar</string>
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="no_title">Please name your note</string>
|
<string name="no_title">Please name your note</string>
|
||||||
<string name="title_taken">A note with that title already exists</string>
|
<string name="title_taken">A note with that title already exists</string>
|
||||||
|
<string name="open_note">Open note</string>
|
||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="settings">Settings</string>
|
<string name="settings">Settings</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user