I am trying to set up a simple Activity transition when I leave Activity A and start Activity B. I have the general idea of how to accomplish this and for the most part it is working. However, I have tableLayouts in Activity B which are created dynamically as the size of the tables changes based on the data passed in to activity B. When the transition occurs these tables just appear while the rest of the layouts transition as expected (slide). Here is the transition code leaving Activity A:
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this);
Intent standingsIntent = new Intent(MainActivity.this, StandingsActivity.class);
standingsIntent.putExtra(ORGANIZATION_EXTRA, organization);
startActivity(standingsIntent, options.toBundle());
I have tried postponing the transition in Activity B thinking that maybe the tables need to be created before the transition occurs, but that doesn't seem to make a difference, or maybe I have the resume placed in the wrong place.
Here is the intial code in onCreate :
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_standings);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
postponeEnterTransition();
}
// rest of onCreate
The data for the tables loads in the background so I am waiting until the background task completes to call setupWindowsAnimations() as shown here
private void setupWindowAnimations() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Transition transition = TransitionInflater.from(this).inflateTransition(R.transition.slide_up);
getWindow().setExitTransition(transition);
getWindow().setEnterTransition(transition);
startPostponedEnterTransition();
}
}
I'm not sure what to do at this point, but any help would be sincerely appreciated.