]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java
progress bar around the save transaction floating action button
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / NewTransactionActivity.java
index 29d021f3cbf71c38db04c1ffa8c5dd9b0cf4405d..7648a65fa495facee6010cbcfef030a7d5624788 100644 (file)
@@ -23,6 +23,7 @@ import android.view.View;
 import android.widget.AutoCompleteTextView;
 import android.widget.EditText;
 import android.widget.FilterQueryProvider;
+import android.widget.ProgressBar;
 import android.widget.SimpleCursorAdapter;
 import android.widget.TableLayout;
 import android.widget.TableRow;
@@ -30,9 +31,27 @@ import android.widget.TextView;
 
 import java.util.Objects;
 
+/*
+ * TODO: auto-fill of transaction description
+ *       if Android O's implementation won't work, add a custom one
+ * TODO: nicer progress while transaction is submitted
+ * TODO: periodic and manual refresh of available accounts
+ *         (now done forcibly each time the main activity is started)
+ * TODO: latest transactions, maybe with browsing further in the past?
+ * TODO: reports
+ * TODO: get rid of the custom session/cookie and auth code?
+ *         (the last problem with the POST was the missing content-length header)
+ * TODO: app icon
+ * TODO: nicer swiping removal with visual feedback
+ * TODO: activity with current balance
+ * TODO: setup wizard
+ * TODO: update accounts/check settings upon change of backend settings
+ *  */
+
 public class NewTransactionActivity extends AppCompatActivity implements TaskCallback {
     private TableLayout table;
     private FloatingActionButton fab;
+    private ProgressBar progress;
     private TextView text_date;
     private TextView text_descr;
     private static SaveTransactionTask saver;
@@ -58,6 +77,8 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal
                 new_transaction_save_clicked(view);
             }
         });
+        progress = findViewById(R.id.save_transaction_progress);
+
         Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
         table = findViewById(R.id.new_transaction_accounts_table);
         for (int i = 0; i < table.getChildCount(); i++) {
@@ -69,6 +90,7 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal
 
     public void new_transaction_save_clicked(View view) {
         fab.setEnabled(false);
+        progress.setVisibility(View.VISIBLE);
 
         saver = new SaveTransactionTask(this);
 
@@ -201,6 +223,7 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal
     @Override
     public void done() {
         fab.setEnabled(true);
+        progress.setVisibility(View.INVISIBLE);
         reset_form();
     }