Skip to content

Commit

Permalink
Merge pull request #1555 from moneymanagerex/v19
Browse files Browse the repository at this point in the history
animations will automatically adapt to the user's preferences
  • Loading branch information
guanlisheng authored Feb 4, 2024
2 parents adfec3f + ce1b089 commit 2484a7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/src/main/java/com/money/manager/ex/home/HomeFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,14 @@ public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
barExpenses.setMax((int) (Math.abs(income) + Math.abs(expenses)));

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
long longDuration = getResources().getInteger(android.R.integer.config_longAnimTime);
ObjectAnimator animationIncome = ObjectAnimator.ofInt(barIncome, "progress", (int) Math.abs(income));
animationIncome.setDuration(1000); // 0.5 second
animationIncome.setDuration(longDuration);
animationIncome.setInterpolator(new DecelerateInterpolator());
animationIncome.start();

ObjectAnimator animationExpenses = ObjectAnimator.ofInt(barExpenses, "progress", (int) Math.abs(expenses));
animationExpenses.setDuration(1000); // 0.5 second
animationExpenses.setDuration(longDuration);
animationExpenses.setInterpolator(new DecelerateInterpolator());
animationExpenses.start();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ private void startSyncIconRotation(MenuItem item) {
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
animation.setInterpolator(new LinearInterpolator());
animation.setDuration(1200);
animation.setDuration(getResources().getInteger(android.R.integer.config_longAnimTime));
// animRotate = AnimationUtils.loadAnimation(this, R.anim.rotation);
animation.setRepeatCount(Animation.INFINITE);

Expand Down

0 comments on commit 2484a7f

Please sign in to comment.