I have a RecyclerView
in a fragment with an item list. So when I click an item, a BottomSheetDialog
opens. There are some views common for both of the views. So I thought to add shared transitions to this. I search StackOverflow, but I didn't find anything about shared transitions in bottomsheetdialog
.
So my question is that, Is it possible to add shared element transitions to a BottomSheetDialog
. As this is a Fragment, there should be a way right? Does anyone have experience in this. ?
I am opening the BottomSheetDialog
like this.
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");
});
So is there a way to set shared transitions like the addSharedElement()
method in fragments.