mirror of
https://github.com/ankidroid/Anki-Android.git
synced 2024-09-19 19:42:17 +02:00
Change in card type gets reflected in the previewer
This commit ensures that if we change card on leading side then the previewer fragment will load and shows same card on trailing side
This commit is contained in:
parent
502ce7f4eb
commit
a98bdd5f54
@ -602,6 +602,15 @@ open class CardTemplateEditor : AnkiActivity(), DeckSelectionListener {
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
initTabLayoutMediator()
|
||||
templateEditor.slidingTabLayout?.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
|
||||
override fun onTabSelected(p0: TabLayout.Tab?) {
|
||||
templateEditor.loadTemplatePreviewerFragmentIfFragmented()
|
||||
}
|
||||
override fun onTabUnselected(p0: TabLayout.Tab?) {
|
||||
}
|
||||
override fun onTabReselected(p0: TabLayout.Tab?) {
|
||||
}
|
||||
})
|
||||
parentFragmentManager.setFragmentResultListener(REQUEST_FIELD_INSERT, viewLifecycleOwner) { key, bundle ->
|
||||
if (key == REQUEST_FIELD_INSERT) {
|
||||
// this is guaranteed to be non null, as we put a non null value on the other side
|
||||
|
Loading…
Reference in New Issue
Block a user