]> git.ktnx.net Git - mobile-ledger.git/commitdiff
new transaction: new menu item for resetting the activity
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 9 Dec 2018 12:56:51 +0000 (12:56 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 9 Dec 2018 12:56:51 +0000 (12:56 +0000)
app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java
app/src/main/res/menu/new_transaction.xml
app/src/main/res/values-bg/strings.xml
app/src/main/res/values/strings.xml

index 8ec820241caf42657295e189a385651f73a2ba77..c191e78a82ebbc99d5bca50013fc64d26066267a 100644 (file)
@@ -283,6 +283,11 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal
         do_add_account_row(true);
     }
 
+    public
+    void resetTransactionFromMenu(MenuItem item) {
+        reset_form();
+    }
+
     public void saveTransactionFromMenu(MenuItem item) {
         save_transaction();
     }
index 7785b0aa0a6ea9a85f7aee2fd311c69d671ceca3..698dbda2ba7780033227e2252071084df00cd0aa 100644 (file)
             android:title="@string/menu_add_account"
             android:visible="false"
             app:showAsAction="never|ifRoom" />
-    </menu>
\ No newline at end of file
+    <item
+        android:id="@+id/action_reset_new_transaction_activity"
+        android:icon="@drawable/ic_refresh_white_24dp"
+        android:onClick="resetTransactionFromMenu"
+        android:title="@string/action_reset_new_transaction_activity_title"
+        app:showAsAction="ifRoom|withText" />
+</menu>
\ No newline at end of file
index 1d88ef22188279e75d7a4ee7b1cebfda03e48134..8ee99e5f49c9261e37eeb76db510684097faa513 100644 (file)
@@ -30,4 +30,5 @@
     <string name="menu_acc_summary_refresh_title">Обновяване</string>
     <string name="err_net_error">Мрежова грешка</string>
     <string name="menu_acc_summary_show_hidden_accounts_title">Показване на скритите сметки</string>
+    <string name="action_reset_new_transaction_activity_title">Отначало</string>
 </resources>
\ No newline at end of file
index ad43d6a2bc43973cd0d1642e27036fdb91f58653..dc2be3618d03ea29e51f3b0fd39bdfe029b389ff 100644 (file)
@@ -74,4 +74,5 @@
     <string name="menu_hide_acc_condensed_title">Hide</string>
     <string name="menu_acc_summary_show_hidden_accounts_title">Show hidden accounts</string>
     <string name="err_bad_auth">Invalid username or password</string>
+    <string name="action_reset_new_transaction_activity_title">Reset</string>
 </resources>