Multiple Shared Elements

前端 未结 2 1231
陌清茗
陌清茗 2021-02-13 02:59

I have the following situation inside of a soccer application.
We want to implement the shared elements between all these activities.

In my viewholder on th

2条回答
  •  灰色年华
    2021-02-13 03:46

    I had this doubt myself, but I feel like the answer above is a little bit confusing. To put it simply if you have more than one shared elements to animate, you can create "Pair" of View & transitionName as much as you want. Here is a sample code for this:

        Pair statusAnim = Pair.create(holder.getOrderStatusView(), "track_job_status");
        Pair driverBundleAnim = Pair.create(holder.getDriverProfileBundle(), "driver_profile_bundle");
        ActivityOptions transitionActivityOptions = ActivityOptions.makeSceneTransitionAnimation((Activity) context, statusAnim, driverBundleAnim);
        context.startActivity(new Intent(context, TrackingActivity.class), transitionActivityOptions.toBundle());
    

提交回复
热议问题