reset rotation angle before animating rotation
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 14 Mar 2019 20:52:44 +0000 (22:52 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 14 Mar 2019 20:54:58 +0000 (22:54 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java

index 8777407..f446e1a 100644 (file)
@@ -571,6 +571,7 @@ public class MainActivity extends ProfileThemedActivity {
 
             if (wasExpanded) {
                 Log.d("accounts", String.format("Collapsing account '%s'", acc.getName()));
+                view.setRotation(0);
                 animator.rotationBy(180);
 
                 // removing all child accounts from the view
@@ -604,6 +605,7 @@ public class MainActivity extends ProfileThemedActivity {
             }
             else {
                 Log.d("accounts", String.format("Expanding account '%s'", acc.getName()));
+                view.setRotation(180);
                 animator.rotationBy(-180);
                 ArrayList<LedgerAccount> accounts = Data.accounts.get();
                 List<LedgerAccount> children = Data.profile.get().loadVisibleChildAccountsOf(acc);