BottomSheetDialog片段共享元素过渡实现?

时间:2019-04-17 07:19:49

标签: android android-transitions bottom-sheet shared-element-transition

我在一个带有项目列表的片段中有一个RecyclerView。因此,当我单击一个项目时,将打开一个BottomSheetDialog。两种视图共有一些视图。所以我想为此添加共享的过渡。我搜索StackOverflow,但是在bottomsheetdialog中未找到有关共享转换的任何信息。

所以我的问题是,是否可以向BottomSheetDialog添加共享元素转换。由于这是一个片段,应该有正确的方法吗?有没有人有这方面的经验。 ?

我正在这样打开BottomSheetDialog

holder.cardAgenda.setOnClickListener(view -> {
                AgendaBottomSheet bottomSheetFragment = AgendaBottomSheet.newInstance();
                Bundle bundle = new Bundle();
                bundle.putString("documentId", getSnapshots().getSnapshot(position).getId());
                bundle.putString("name", model.getName());
                bundle.putString("description", model.getDescription());
                bundle.putString("date", dateFormat.format(timeStamp));
                bundle.putString("location", model.getLocation());
                bundle.putString("status", model.getStatus());
                bottomSheetFragment.setArguments(bundle);
                bottomSheetFragment.show(Objects.requireNonNull(getFragmentManager()), "Agenda Details");
            });

因此,有一种方法可以像片段中的addSharedElement()方法那样设置共享转换。

0 个答案:

没有答案