]> git.ktnx.net Git - mobile-ledger.git/commitdiff
non-animation change of save transaction button
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 5 Dec 2018 21:02:27 +0000 (21:02 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 5 Dec 2018 21:02:27 +0000 (21:02 +0000)
upon success the image is changed to a check mark, and after
1,5 seconds - reverted back to the disk

app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java

index 7648a65fa495facee6010cbcfef030a7d5624788..148eacb1a46f56e4d056534fc538df531280c667 100644 (file)
@@ -6,6 +6,7 @@ import android.database.MatrixCursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.os.Build;
 import android.os.Bundle;
+import android.os.Handler;
 import android.preference.PreferenceManager;
 import android.provider.FontsContract;
 import android.support.design.widget.FloatingActionButton;
@@ -223,8 +224,17 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal
     @Override
     public void done() {
         fab.setEnabled(true);
+
+        fab.setImageResource(R.drawable.ic_thick_check_white);
         progress.setVisibility(View.INVISIBLE);
         reset_form();
+        final Handler handler = new Handler();
+        handler.postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                fab.setImageResource(R.drawable.ic_save_white_24dp);
+            }
+        }, 1500);
     }
 
     private void reset_form() {