I have an application that works on tablet devices with two panels, for the left - a simple animation when replacing a fragment:
private void loadLeftFragment(Fragment fragment, boolean isAnimated) { FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); if (isAnimated) { fragmentTransaction.setCustomAnimations(android.R.anim.slide_in_left, android.R.anim.slide_out_right); } fragmentTransaction.addToBackStack(null); fragmentTransaction.replace(R.id.left_frame, fragment).commit(); }
Pay attention to the animation of the code world. It works great on the Nexus 7, but on the Galaxy Tab 2 it is not. Therefore, I experimented with the android:hardwareAccelerated="true/false" tag android:hardwareAccelerated="true/false" in AndroidManifest.xml. And what I got is that when the value is set to false , the animation on the Galaxy Tab 2 is, for example, on the Nexus 7, that is, smooth and good looking. I did not expect this behavior, believing that it should be the other way around - setting hardwareAccelerated to true makes things smoother. But this will happen if I set it to true I see lags when false is just nice! What am I missing here? Thanks.
source share