Skip to content

Commit

Permalink
Keep animations a consistent duration
Browse files Browse the repository at this point in the history
  • Loading branch information
scottschmitz committed Jan 8, 2018
1 parent d051ce7 commit 71caff2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ allprojects {
}
}

apply plugin: 'android-reporting'
apply plugin: 'android-reporting'
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.view.ContextThemeWrapper;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.Transformation;
import android.widget.LinearLayout;
Expand Down Expand Up @@ -434,8 +435,8 @@ public boolean willChangeBounds() {
}
};

// 1dp/ms
a.setDuration((int) (targetHeight / v.getContext().getResources().getDisplayMetrics().density));
a.setDuration((long) v.getContext().getResources().getInteger(android.R.integer.config_shortAnimTime));
a.setInterpolator(new AccelerateDecelerateInterpolator());
v.startAnimation(a);
}

Expand All @@ -459,8 +460,8 @@ public boolean willChangeBounds() {
}
};

// 1dp/ms
a.setDuration((int) (initialHeight / v.getContext().getResources().getDisplayMetrics().density));
a.setDuration((long) v.getContext().getResources().getInteger(android.R.integer.config_shortAnimTime));
a.setInterpolator(new AccelerateDecelerateInterpolator());
v.startAnimation(a);
}

Expand Down

0 comments on commit 71caff2

Please sign in to comment.