transaction retrieval: move cancel button enabling to the onPreExecute chain
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 27 Feb 2019 17:21:04 +0000 (19:21 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 27 Feb 2019 17:21:04 +0000 (19:21 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java

index 958c0e9..558ca69 100644 (file)
@@ -389,7 +389,6 @@ public class MainActivity extends CrashReportingActivity {
         retrieveTransactionsTask = new RetrieveTransactionsTask(new WeakReference<>(this));
 
         retrieveTransactionsTask.execute();
-        bTransactionListCancelDownload.setEnabled(true);
     }
     public void onStopTransactionRefreshClick(View view) {
         Log.d("interactive", "Cancelling transactions refresh");
@@ -407,6 +406,7 @@ public class MainActivity extends CrashReportingActivity {
         else Toast.makeText(this, error, Toast.LENGTH_LONG).show();
     }
     public void onRetrieveStart() {
+        bTransactionListCancelDownload.setEnabled(true);
         progressBar.setIndeterminateTintList(ColorStateList.valueOf(Colors.primary));
         progressBar.setProgressTintList(ColorStateList.valueOf(Colors.primary));
         progressBar.setIndeterminate(true);