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>
@ -35,7 +36,7 @@
<string name="follow_us">Folge uns:</string>
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>
<!--License-->
<!-- License -->
<string name="notice">Diese App nutzt die folgenden Drittanbieterbibliotheken, die mein Leben einfacher machen. Danke.</string>
<string name="third_party_licences">Drittanbieterlizenzen</string>
<string name="butterknife_title"><u>Butter Knife (view injector)</u></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>
@ -35,7 +36,7 @@
<string name="follow_us">Seguici:</string>
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>
<!--License-->
<!-- License -->
<string name="notice">Questa app usa le seguenti librerie di terze parti per semplificarmi la vita. Grazie.</string>
<string name="third_party_licences">Licenze di terze parti</string>
<string name="butterknife_title"><u>Butter Knife (view injector)</u></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>
@ -35,7 +36,7 @@
<string name="follow_us">フォローしてください:</string>
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>
<!--License-->
<!-- License -->
<string name="notice">このアプリは、私の人生を容易にするために、次のサードパーティのライブラリーを使用しています。 ありがとうございます。</string>
<string name="third_party_licences">サードパーティー ライセンス</string>
<string name="butterknife_title"><u>Butter Knife (ビュー インジェクター)</u></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>
@ -35,7 +36,7 @@
<string name="follow_us">Följ oss:</string>
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>
<!--License-->
<!-- License -->
<string name="notice">Denna app använder följande tredjepartsbibliotek för att göra mitt liv enklare. Tack.</string>
<string name="third_party_licences">Tredjepartslicenser</string>
<string name="butterknife_title"><u>Butter Knife (view injector)</u></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>
@ -36,7 +37,7 @@
<string name="follow_us">Follow us:</string>
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>
<!--License-->
<!-- License -->
<string name="notice">This app uses the following third party libraries to make my life easier. Thank you.</string>
<string name="third_party_licences">Third party licences</string>
<string name="butterknife_title"><u>Butter Knife (view injector)</u></string>