diff --git a/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonListContainerFragment.java b/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonListContainerFragment.java index 8ec6850f8..bd5c9e252 100644 --- a/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonListContainerFragment.java +++ b/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonListContainerFragment.java @@ -89,18 +89,18 @@ protected TabsAdapter createTabsAdapter(AbstractInfoFragment.DataHolder dataHold } @Override - public void onAttach(@NonNull Context context) { - super.onAttach(context); + public void onResume() { + super.onResume(); try { - BaseMediaActivity listenerActivity = (BaseMediaActivity) context; + BaseMediaActivity listenerActivity = (BaseMediaActivity) requireContext(); listenerActivity.setBackPressedListener(this); } catch (ClassCastException e) { - throw new ClassCastException(context + " unable to register BackPressedListener"); + throw new ClassCastException(requireContext() + " unable to register BackPressedListener"); } } @Override - public void onDestroy() { + public void onPause() { try { BaseMediaActivity listenerActivity = (BaseMediaActivity) getContext(); assert listenerActivity != null; @@ -108,7 +108,7 @@ public void onDestroy() { } catch (ClassCastException e) { throw new ClassCastException(getContext() + " unable to unregister BackPressedListener"); } - super.onDestroy(); + super.onPause(); } @Override @@ -123,6 +123,6 @@ public boolean onBackPressed() { @Override protected boolean shouldRememberLastTab() { - return true; + return false; } } diff --git a/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonTabsFragment.java b/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonTabsFragment.java index 8f53a3c04..2fc1526ad 100644 --- a/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonTabsFragment.java +++ b/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonTabsFragment.java @@ -31,6 +31,7 @@ import org.xbmc.kore.ui.sections.file.MediaFileListFragment; import org.xbmc.kore.utils.LogUtils; import org.xbmc.kore.utils.TabsAdapter; +import org.xbmc.kore.utils.Utils; public class AddonTabsFragment extends AbstractTabsFragment @@ -65,18 +66,18 @@ protected TabsAdapter createTabsAdapter(AbstractInfoFragment.DataHolder dataHold } @Override - public void onAttach(@NonNull Context context) { - super.onAttach(context); + public void onResume() { + super.onResume(); try { - BaseMediaActivity listenerActivity = (BaseMediaActivity) context; + BaseMediaActivity listenerActivity = (BaseMediaActivity) requireContext(); listenerActivity.setBackPressedListener(this); } catch (ClassCastException e) { - throw new ClassCastException(context + " unable to register BackPressedListener"); + throw new ClassCastException(requireContext() + " unable to register BackPressedListener"); } } @Override - public void onDestroy() { + public void onPause() { try { BaseMediaActivity listenerActivity = (BaseMediaActivity) getContext(); assert listenerActivity != null; @@ -84,7 +85,7 @@ public void onDestroy() { } catch (ClassCastException e) { throw new ClassCastException(getContext() + " unable to unregister BackPressedListener"); } - super.onDestroy(); + super.onPause(); } @Override diff --git a/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonsActivity.java b/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonsActivity.java index 29e565169..2d4221110 100644 --- a/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonsActivity.java +++ b/app/src/main/java/org/xbmc/kore/ui/sections/addon/AddonsActivity.java @@ -131,11 +131,9 @@ public void onAddonSelected(AbstractFragment.DataHolder dataHolder, ImageView sh // Replace list fragment dataHolder.setSquarePoster(true); if (bundle.getBoolean(AddonInfoFragment.BUNDLE_KEY_BROWSABLE)) { - // No shared element transition to tabs fragment showFragment(AddonTabsFragment.class, dataHolder.getBundle()); } else { - // Use shared element transition to info fragment - showFragment(AddonInfoFragment.class, dataHolder.getBundle(), sharedImageView); + showFragment(AddonInfoFragment.class, dataHolder.getBundle()); } updateActionBar(getActionBarTitle(), true);