I have an animation using ViewCompat.animate() on one of my Screen that uses FrameLayout and it looks fine on the test phone. But of course, once running on the test tablet (Nexus 7 2013), the animation isn't the same.
So I'm searching a way to get the same displayed translation Y, on different screen sizes without using different dimens resource files. Surely there is a way to calculate it at Run time and sort it out by itself.
I tried: float px = -182 * (getResources().getDisplayMetrics().densityDpi / 160f); But the distance traveled by the view on the 2 screens are not the same.
Saw this post but didn't provide the solution: android animation in different screen sizes
Anyone has an idea?
Cheers